-
Notifications
You must be signed in to change notification settings - Fork 67
RELEASE: Conversion type mandatory + misc #3895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Part of cs-39 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Part of eng-322 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Part of eng-39 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Part of eng-39 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Part of eng-231 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Part of eng-231 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Part of eng-231 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Part of eng-331 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Part of eng-231 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Ref: #000 - api@1.27.4-alpha.0 - @metriport/api-sdk@14.14.4-alpha.0 - @metriport/carequality-cert-runner@1.18.4-alpha.0 - @metriport/carequality-sdk@1.6.4-alpha.0 - @metriport/commonwell-cert-runner@1.26.4-alpha.0 - @metriport/commonwell-jwt-maker@1.24.4-alpha.0 - @metriport/commonwell-sdk@5.9.2-alpha.0 - @metriport/core@1.24.4-alpha.0 - @metriport/ihe-gateway-sdk@0.19.4-alpha.0 - infrastructure@1.22.4-alpha.0 - mllp-server@0.3.4-alpha.0 - @metriport/shared@0.23.4-alpha.0 - utils@1.25.4-alpha.0 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Ref: #000 - api@1.27.5-alpha.0 - @metriport/api-sdk@14.14.5-alpha.0 - @metriport/carequality-cert-runner@1.18.5-alpha.0 - @metriport/carequality-sdk@1.6.5-alpha.0 - @metriport/commonwell-cert-runner@1.26.5-alpha.0 - @metriport/commonwell-jwt-maker@1.24.5-alpha.0 - @metriport/commonwell-sdk@5.9.3-alpha.0 - @metriport/core@1.24.5-alpha.0 - @metriport/ihe-gateway-sdk@0.19.5-alpha.0 - infrastructure@1.22.5-alpha.0 - mllp-server@0.3.5-alpha.0 - @metriport/shared@0.23.5-alpha.0 - utils@1.25.5-alpha.0 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Part of eng-231 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Ref: #000 - @metriport/api-sdk@15.0.0-alpha.0 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
build: add valid html attribute
build: remove dup code
Part of eng-231 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Part of eng-231 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
build: conversiontype required
WalkthroughThis change enforces that the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API
participant Core
participant DB
Client->>API: POST /patient/:id/consolidated/query?conversionType={type}
API->>API: Validate required conversionType ("json", "html", "pdf")
API->>Core: getConsolidatedPatientDataAsync(..., conversionType)
Core->>DB: Fetch patient/resource data
Core-->>API: Consolidated data (format depends on conversionType)
API-->>Client: Response (includes conversionType in schema)
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (13)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (12)
⏰ Context from checks skipped due to timeout of 90000ms (36)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Ref: #000 - @metriport/api-sdk@15.0.0 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Ref: #000 - api@1.27.5 - @metriport/api-sdk@15.0.0 - @metriport/carequality-cert-runner@1.18.5 - @metriport/carequality-sdk@1.6.5 - @metriport/commonwell-cert-runner@1.26.5 - @metriport/commonwell-jwt-maker@1.24.5 - @metriport/commonwell-sdk@5.9.3 - @metriport/core@1.24.5 - @metriport/ihe-gateway-sdk@0.19.5 - infrastructure@1.22.5 - mllp-server@0.3.5 - @metriport/shared@0.23.5 - utils@1.25.5 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
Ref: #000 - api@1.27.6 - @metriport/api-sdk@15.0.1 - @metriport/carequality-cert-runner@1.18.6 - @metriport/carequality-sdk@1.6.6 - @metriport/commonwell-cert-runner@1.26.6 - @metriport/commonwell-jwt-maker@1.24.6 - @metriport/commonwell-sdk@5.9.4 - @metriport/core@1.24.6 - @metriport/ihe-gateway-sdk@0.19.6 - infrastructure@1.22.6 - mllp-server@0.3.6 - @metriport/shared@0.23.6 - utils@1.25.6 Signed-off-by: Jorge Orta <36802074+Orta21@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Nitpick comments (1)
packages/api-sdk/src/medical/client/metriport.ts (1)
487-488
: Update JSDoc to reflect the required nature of the parameter.While the JSDoc describes
conversionType
as "Optional", the broader PR context indicates this parameter is becoming required across the API. Consider updating the JSDoc to reflect this change more accurately, perhaps as "The conversion type for the medical record rendering" rather than "Optional to indicate...".- * @param conversionType Optional to indicate how the medical record should be rendered - one of: + * @param conversionType The conversion type for how the medical record should be rendered - one of:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (34)
docs/_snippets/consolidated-query.mdx
(1 hunks)fern/definition/medical/fhir.yml
(3 hunks)packages/api-sdk/package.json
(2 hunks)packages/api-sdk/src/medical/client/metriport.ts
(2 hunks)packages/api-sdk/src/medical/models/fhir.ts
(1 hunks)packages/api/package.json
(1 hunks)packages/api/src/command/medical/patient/__tests__/consolidated-get.test.ts
(2 hunks)packages/api/src/command/medical/patient/__tests__/get-consolidated-webhook.test.ts
(0 hunks)packages/api/src/command/medical/patient/__tests__/store-query-cmd.ts
(2 hunks)packages/api/src/command/medical/patient/consolidated-get.ts
(2 hunks)packages/api/src/routes/internal/medical/patient.ts
(2 hunks)packages/api/src/routes/medical/document.ts
(0 hunks)packages/api/src/routes/medical/patient.ts
(2 hunks)packages/carequality-cert-runner/package.json
(2 hunks)packages/carequality-sdk/package.json
(1 hunks)packages/commonwell-cert-runner/package.json
(2 hunks)packages/commonwell-jwt-maker/package.json
(2 hunks)packages/commonwell-sdk/package.json
(2 hunks)packages/core/package.json
(1 hunks)packages/core/src/command/consolidated/consolidated-get.ts
(1 hunks)packages/core/src/command/consolidated/get-snapshot.ts
(1 hunks)packages/core/src/command/search-summary/brief.ts
(0 hunks)packages/core/src/command/search-summary/create.ts
(5 hunks)packages/core/src/command/search-summary/filter.ts
(0 hunks)packages/core/src/command/search-summary/shared.ts
(0 hunks)packages/core/src/external/aws/lambda-logic/bundle-to-html-adhd.ts
(1 hunks)packages/core/src/external/aws/lambda-logic/bundle-to-html-derm.ts
(1 hunks)packages/core/src/external/aws/lambda-logic/bundle-to-html.ts
(1 hunks)packages/ihe-gateway-sdk/package.json
(2 hunks)packages/infra/package.json
(1 hunks)packages/mllp-server/package.json
(1 hunks)packages/shared/package.json
(1 hunks)packages/shared/src/interface/internal/consolidated.ts
(1 hunks)packages/utils/package.json
(1 hunks)
💤 Files with no reviewable changes (5)
- packages/api/src/command/medical/patient/tests/get-consolidated-webhook.test.ts
- packages/api/src/routes/medical/document.ts
- packages/core/src/command/search-summary/brief.ts
- packages/core/src/command/search-summary/shared.ts
- packages/core/src/command/search-summary/filter.ts
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.ts`: - Use the Onion Pattern to organize a package's code in layers - Try to use immutable code and avoid sharing state across different functions, objects, and systems - Try...
**/*.ts
: - Use the Onion Pattern to organize a package's code in layers
- Try to use immutable code and avoid sharing state across different functions, objects, and systems
- Try to build code that's idempotent whenever possible
- Prefer functional programming style functions: small, deterministic, 1 input, 1 output
- Minimize coupling / dependencies
- Avoid modifying objects received as parameter
- Only add comments to code to explain why something was done, not how it works
- Naming
- classes, enums:
PascalCase
- constants, variables, functions:
camelCase
- file names:
kebab-case
- table and column names:
snake_case
- Use meaningful names, so whoever is reading the code understands what it means
- Don’t use negative names, like
notEnabled
, preferisDisabled
- For numeric values, if the type doesn’t convey the unit, add the unit to the name
- Typescript
- Use types
- Prefer
const
instead oflet
- Avoid
any
and casting fromany
to other types- Type predicates: only applicable to narrow down the type, not to force a complete type conversion
- Prefer deconstructing parameters for functions instead of multiple parameters that might be of
the same type- Don’t use
null
inside the app, only on code interacting with external interfaces/services,
like DB and HTTP; convert toundefined
before sending inwards into the code- Use
async/await
instead of.then()
- Use the strict equality operator
===
, don’t use abstract equality operator==
- When calling a Promise-returning function asynchronously (i.e., not awaiting), use
.catch()
to
handle errors (seeprocessAsyncError
andemptyFunction
depending on the case)- Date and Time
- Always use
buildDayjs()
to createdayjs
instances- Prefer
dayjs.duration(...)
to create duration consts and keep them asduration
- Prefer Nullish Coalesce (??) than the OR operator (||) to provide a default value
- Avoid creating arrow functions
- Use truthy syntax instead of
in
- i.e.,if (data.link)
notif ('link' in data)
- Error handling
- Pass the original error as the new one’s
cause
so the stack trace is persisted- Error messages should have a static message - add dynamic data to MetriportError's
additionalInfo
prop- Avoid sending multiple events to Sentry for a single error
- Global constants and variables
- Move literals to constants declared after imports when possible (avoid magic numbers)
- Avoid shared, global objects
- Avoid using
console.log
andconsole.error
in packages other than utils, infra and shared,
and try to useout().log
instead- Avoid multi-line logs
- don't send objects as a second parameter to
console.log()
orout().log()
- don't create multi-line strings when using
JSON.stringify()
- Use
eslint
to enforce code style- Use
prettier
to format code- max column length is 100 chars
- multi-line comments use
/** */
- scripts: top-level comments go after the import
packages/shared/src/interface/internal/consolidated.ts
packages/api-sdk/src/medical/models/fhir.ts
packages/api/src/command/medical/patient/__tests__/consolidated-get.test.ts
packages/core/src/command/consolidated/get-snapshot.ts
packages/core/src/command/consolidated/consolidated-get.ts
packages/api/src/routes/medical/patient.ts
packages/core/src/external/aws/lambda-logic/bundle-to-html-derm.ts
packages/api/src/command/medical/patient/__tests__/store-query-cmd.ts
packages/core/src/external/aws/lambda-logic/bundle-to-html.ts
packages/core/src/external/aws/lambda-logic/bundle-to-html-adhd.ts
packages/api/src/routes/internal/medical/patient.ts
packages/api/src/command/medical/patient/consolidated-get.ts
packages/core/src/command/search-summary/create.ts
packages/api-sdk/src/medical/client/metriport.ts
🧠 Learnings (6)
packages/ihe-gateway-sdk/package.json (1)
Learnt from: leite08
PR: metriport/metriport#3463
File: packages/api-sdk/src/medical/models/patient.ts:1-1
Timestamp: 2025-03-19T13:58:17.253Z
Learning: When changes are made to SDK packages (`api-sdk`, `commonwell-sdk`, `carequality-sdk`) or `packages/shared` in the Metriport codebase, alpha versions need to be published to NPM before merging the PR.
packages/commonwell-sdk/package.json (1)
Learnt from: leite08
PR: metriport/metriport#3463
File: packages/api-sdk/src/medical/models/patient.ts:1-1
Timestamp: 2025-03-19T13:58:17.253Z
Learning: When changes are made to SDK packages (`api-sdk`, `commonwell-sdk`, `carequality-sdk`) or `packages/shared` in the Metriport codebase, alpha versions need to be published to NPM before merging the PR.
packages/api/src/routes/medical/patient.ts (1)
Learnt from: leite08
PR: metriport/metriport#3814
File: packages/api/src/routes/internal/medical/patient-consolidated.ts:141-174
Timestamp: 2025-05-20T21:26:26.804Z
Learning: The functionality introduced in packages/api/src/routes/internal/medical/patient-consolidated.ts is planned to be refactored in downstream PR #3857, including improvements to error handling and validation.
packages/api-sdk/package.json (1)
Learnt from: leite08
PR: metriport/metriport#3463
File: packages/api-sdk/src/medical/models/patient.ts:1-1
Timestamp: 2025-03-19T13:58:17.253Z
Learning: When changes are made to SDK packages (`api-sdk`, `commonwell-sdk`, `carequality-sdk`) or `packages/shared` in the Metriport codebase, alpha versions need to be published to NPM before merging the PR.
packages/api/src/routes/internal/medical/patient.ts (1)
Learnt from: leite08
PR: metriport/metriport#3814
File: packages/api/src/routes/internal/medical/patient-consolidated.ts:141-174
Timestamp: 2025-05-20T21:26:26.804Z
Learning: The functionality introduced in packages/api/src/routes/internal/medical/patient-consolidated.ts is planned to be refactored in downstream PR #3857, including improvements to error handling and validation.
packages/api/src/command/medical/patient/consolidated-get.ts (2)
Learnt from: leite08
PR: metriport/metriport#3814
File: packages/api/src/routes/internal/medical/patient-consolidated.ts:141-174
Timestamp: 2025-05-20T21:26:26.804Z
Learning: The functionality introduced in packages/api/src/routes/internal/medical/patient-consolidated.ts is planned to be refactored in downstream PR #3857, including improvements to error handling and validation.
Learnt from: leite08
PR: metriport/metriport#3814
File: packages/core/src/command/consolidated/search/fhir-resource/search-semantic.ts:36-36
Timestamp: 2025-05-19T13:53:09.828Z
Learning: In the `getConsolidatedPatientData` function from `@metriport/core/command/consolidated/consolidated-get`, only the `patient` parameter is required. Other parameters like `requestId`, `resources`, `dateFrom`, `dateTo`, `fromDashboard`, and `forceDataFromFhir` are all optional.
🧬 Code Graph Analysis (4)
packages/shared/src/interface/internal/consolidated.ts (1)
packages/api-sdk/src/medical/models/fhir.ts (1)
consolidationConversionType
(20-20)
packages/api/src/command/medical/patient/__tests__/consolidated-get.test.ts (1)
packages/api/src/command/medical/patient/consolidated-get.ts (1)
getCurrentConsolidatedProgress
(154-174)
packages/core/src/command/consolidated/get-snapshot.ts (1)
packages/api-sdk/src/medical/models/fhir.ts (1)
ConsolidationConversionType
(21-21)
packages/core/src/command/consolidated/consolidated-get.ts (1)
packages/api-sdk/src/medical/models/fhir.ts (1)
ConsolidationConversionType
(21-21)
🔇 Additional comments (42)
packages/carequality-sdk/package.json (1)
3-3
:✅ Verification successful
Pre-release version bump
The version has been updated to1.6.5-alpha.0
to align with the coordinated alpha release across packages. Confirm this aligns with your semver policy for pre-releases and update any dependent docs or workflows still referencing1.6.3
.Run this to detect any stale references to the old version:
🏁 Script executed:
#!/bin/bash # Search entire repo for occurrences of the previous version rg "1\\.6\\.3" -n .Length of output: 716
Pre-release bump approved
The move to1.6.5-alpha.0
follows semver pre-release conventions. I didn’t find any stale references to the prior carequality-sdk version outside of auto-generated lockfiles.• Lockfiles still show
1.6.3
for unrelated deps (express-http-proxy
, etc.) – simply re-runnpm install
to refresh them.
• No docs or CI/workflows reference the old SDK version.All set to merge.
packages/core/src/command/search-summary/create.ts (7)
5-5
: LGTM: Proper error handling import added.The addition of
MetriportError
import from@metriport/shared
aligns with the coding guidelines for consistent error handling across the codebase.
30-38
: Excellent documentation with helpful context.The JSDoc comment provides comprehensive documentation including the TODO note about production usage, which helps future maintainers understand the current state of this function.
89-89
: Good practice: Dependency injection for logging.Passing the
log
function as a parameter toparseSummaryWithCitations
follows good dependency injection practices and improves testability.
92-92
: LGTM: Error message correctly updated.The error message has been appropriately updated from "AI brief generation failure" to "Search summary generation failure" to match the function's actual purpose.
102-105
: Good refactor: Optional logging parameter with sensible default.The function signature change to accept an optional
log
parameter withconsole.log
as default follows good practices:
- Maintains backward compatibility
- Allows dependency injection for testing
- Provides sensible default behavior
121-122
: Excellent error handling improvement.The enhanced error handling follows the coding guidelines correctly:
- Uses the injected logger for consistent logging
- Wraps the original error in
MetriportError
with the original error as cause- Provides a meaningful static error message
11-11
:✅ Verification successful
Verify the import path change is correct.
The import path has been changed from a local
./filter
to../ai-brief/filter
. This suggests code reorganization where filtering functionality has been moved or consolidated.Please verify that the
prepareBundleForAiSummarization
function is correctly exported from the new location:
🏁 Script executed:
#!/bin/bash # Description: Verify the prepareBundleForAiSummarization function exists in the new location # Expected: Function should be exported from ../ai-brief/filter ast-grep --pattern 'export $_ prepareBundleForAiSummarization'Length of output: 64
🏁 Script executed:
#!/bin/bash # Search for all occurrences of prepareBundleForAiSummarization to verify it’s defined and exported rg --color=never -n "prepareBundleForAiSummarization"Length of output: 698
Import Path Verified
The
prepareBundleForAiSummarization
function is indeed exported frompackages/core/src/command/ai-brief/filter.ts
, and the import inpackages/core/src/command/search-summary/create.ts
correctly resolves via../ai-brief/filter
. No changes needed.packages/shared/package.json (1)
3-3
: Approve version bump to alpha pre-release
The version is correctly updated to0.23.5-alpha.0
, matching the coordinated alpha release across the monorepo.packages/api/package.json (1)
3-3
: Approve API package version bump
The API package version is correctly incremented to1.27.5-alpha.0
, aligning with the release plan for alpha pre-releases.packages/ihe-gateway-sdk/package.json (3)
3-3
: Approve SDK version bump
Version updated from0.19.3
to0.19.5-alpha.0
, consistent with the pre-release cycle.
56-56
: Approve shared dependency update
The@metriport/shared
dependency is correctly advanced to^0.23.5-alpha.0
to match the shared package’s new pre-release version.
3-56
:✅ Verification successful
Reminder: publish pre-release to NPM
As learned from prior SDK releases, ensure that0.19.5-alpha.0
(and its updated dependencies) is published to the public registry before merging to avoid downstream build issues.Run:
🏁 Script executed:
npm view @metriport/ihe-gateway-sdk versionsLength of output: 2744
🏁 Script executed:
npm view @metriport/shared versionsLength of output: 2555
Pre-release versions are already published
- @metriport/ihe-gateway-sdk 0.19.5-alpha.0 is listed on npm
- @metriport/shared 0.23.5-alpha.0 is listed on npm
No further action required before merging.
packages/carequality-cert-runner/package.json (3)
3-3
: Approve version bump to alpha pre-release
The package version is correctly updated to1.18.5-alpha.0
, matching the coordinated pre-release flow.
44-44
: Approve ihe-gateway-sdk dependency bump
Dependency on@metriport/ihe-gateway-sdk
updated to^0.19.5-alpha.0
, aligning with the new SDK release.
45-45
: Approve shared dependency bump
Dependency on@metriport/shared
updated to^0.23.5-alpha.0
to keep in sync with the shared package.packages/mllp-server/package.json (1)
3-3
: Approve version bump to alpha pre-release
Themllp-server
version is correctly bumped to0.3.5-alpha.0
, consistent with the monorepo’s pre-release process.packages/commonwell-sdk/package.json (1)
3-3
: LGTM! Coordinated alpha version updates.The version bumps are consistent with the alpha release process. Both the package version and the
@metriport/shared
dependency have been appropriately updated to alpha versions.Also applies to: 63-63
packages/commonwell-cert-runner/package.json (1)
3-3
: LGTM! Version updates align with ecosystem changes.The alpha version bump and dependency update to
@metriport/commonwell-sdk
are consistent with the coordinated release process.Also applies to: 45-45
packages/commonwell-jwt-maker/package.json (1)
3-3
: LGTM! Consistent alpha versioning maintained.The version increments and dependency updates follow the established pattern across the commonwell package ecosystem.
Also applies to: 44-44
docs/_snippets/consolidated-query.mdx (1)
7-9
: LGTM! Documentation correctly reflects API changes.The update from
optional
torequired
for theconversionType
field aligns with the PR objective to make this parameter mandatory. The description and allowed values remain appropriately unchanged.packages/core/src/external/aws/lambda-logic/bundle-to-html-derm.ts (1)
1322-1322
: LGTM! HTML syntax error fixed.The missing equals sign in the
data-id
attribute has been properly corrected, ensuring valid HTML syntax for the medication statement table row.packages/api-sdk/src/medical/models/fhir.ts (1)
27-27
: LGTM! Correct implementation of mandatory conversionType.The schema change correctly enforces
conversionType
as a required field, removing the previous optional behavior. This aligns perfectly with the PR objective to make conversion type mandatory.packages/api-sdk/package.json (2)
3-3
: Correct major version bump for breaking changes.The version increment from
14.14.3
to15.0.0-alpha.0
appropriately reflects the breaking API changes whereconversionType
becomes mandatory.Please ensure the alpha versions are published to NPM before merging this PR, as indicated in the previous learning from this codebase.
61-62
: Dependency versions correctly updated to maintain consistency.The alpha version updates for
@metriport/commonwell-sdk
and@metriport/shared
maintain consistency across the monorepo dependencies.packages/core/src/command/consolidated/get-snapshot.ts (1)
17-17
: Correct type definition update for mandatory conversionType.The change from optional to required
conversionType
inConsolidatedSnapshotRequestAsync
properly aligns with the schema changes in other files and enforces the new mandatory requirement.packages/shared/src/interface/internal/consolidated.ts (1)
8-8
: Schema correctly updated to enforce mandatory conversionType.The change from optional to required
conversionType
ininternalSendConsolidatedSchema
is consistent with the corresponding changes in other schema files and properly enforces the new mandatory requirement.packages/api/src/command/medical/patient/__tests__/consolidated-get.test.ts (1)
33-35
: LGTM! Test updates align with mandatory conversionType requirement.The test cases have been correctly updated to include the now-required
conversionType: "json"
parameter, ensuring compatibility with the updated function signature ofgetCurrentConsolidatedProgress
.Also applies to: 72-74
packages/core/src/command/consolidated/consolidated-get.ts (1)
124-124
: LGTM! Correctly enforces conversionType as required parameter.Making
conversionType
required ensures that all callers must explicitly specify the conversion type, preventing potential issues with undefined values and aligning with the broader API contract changes.packages/core/src/external/aws/lambda-logic/bundle-to-html.ts (1)
1014-1014
: LGTM! Fixes HTML attribute syntax error.The missing
=
character in thedata-id
attribute has been correctly added, ensuring valid HTML syntax for medication statement rows.packages/api/src/command/medical/patient/__tests__/store-query-cmd.ts (1)
38-38
: LGTM! Test infrastructure properly supports mandatory conversionType.The addition of
conversionType: "json"
to test data and the default value logic in the factory function ensure compatibility with the new required parameter while maintaining test functionality.Also applies to: 61-61
packages/core/src/external/aws/lambda-logic/bundle-to-html-adhd.ts (1)
1242-1242
: Correct HTML attribute syntax fordata-id
.The
data-id
attribute on the<tr>
element now includes the missing equals sign and proper quoting (data-id="${medicationStatement.id}"
), fixing the malformed HTML that would have broken attribute parsing in the rendered output.packages/api/src/routes/internal/medical/patient.ts (2)
669-670
: Documentation accurately reflects the new requirement.The updated documentation correctly specifies that
conversionType
is now required and includes the new"json"
option alongside existing"pdf"
and"html"
values.
683-684
: Properly enforces required conversionType parameter.The change from
optional()
toorFail()
correctly makesconversionType
mandatory, and thetoLowerCase()
transformation ensures case-insensitive handling for better user experience. The schema validation will catch invalid values appropriately.packages/api/src/command/medical/patient/consolidated-get.ts (2)
11-14
: Import statement reordering is acceptable.The reordering of import statements doesn't affect functionality and maintains readability.
262-262
: Logic correctly simplified after making conversionType required.Removing the truthiness check for
conversionType
is appropriate since it's now a required parameter and will never be undefined. The simplified conditionconve 8000 rsionType != "json" && hasResources
is cleaner and more direct.packages/api/src/routes/medical/patient.ts (2)
276-278
: Documentation improvement clarifies webhook behavior.The updated documentation correctly specifies that
conversionType
is required and importantly clarifies that the webhook payload will always contain a signed URL valid for 3 minutes, regardless of conversion type. This removes ambiguity about the response format.
295-298
: Consistent enforcement of required conversionType parameter.The changes mirror the internal route implementation:
- Using
orFail()
to enforce the required parameter- Direct parsing with
consolidationConversionTypeSchema.parse()
This ensures consistent behavior across both internal and external API endpoints.
fern/definition/medical/fhir.yml (3)
12-26
: Documentation formatting and content improvements.The reformatted documentation improves readability and maintains accuracy about the endpoint's asynchronous behavior and webhook responses.
36-39
: Correctly defines conversionType as required query parameter.Moving
conversionType
from the request body to query parameters and making it required aligns with the implementation changes in the route handlers. The documentation clearly specifies the accepted values:"json"
,"html"
, or"pdf"
.
71-72
: Example demonstrates new JSON conversion type.The example appropriately showcases the new
"json"
conversion type, helping developers understand how to use the updated API.packages/api-sdk/src/medical/client/metriport.ts (1)
498-498
: LGTM: Default value provides backward compatibility.The assignment of
"json"
as the default value is well-aligned with the broader changes to standardize the conversionType parameter while maintaining backward compatibility for existing SDK users.
@coderabbitai review |
✅ Actions performedReview triggered.
|
Issues:
Dependencies
Description
Testing
Check each PR.
Release Plan
master
Summary by CodeRabbit
New Features
conversionType
parameter is now required for consolidated patient queries and supports"json"
,"html"
, and"pdf"
formats.Bug Fixes
Removals
/search-summary
API endpoint and related AI brief and summarization utilities have been removed.Chores