-
Notifications
You must be signed in to change notification settings - Fork 72
fix(core): Fix deduplication to properly handle references for MedicationDispense #4076
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
fix(core): Fix deduplication to properly handle references for MedicationDispense #4076
Conversation
…cationDispense metriport/metriport-internal#1040 Signed-off-by: Keshav Saharia <keshav@metriport.com>
WalkthroughThe changes update the handling of the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant BundleExtractor
participant Deduplicator
Client->>BundleExtractor: extractFhirTypesFromBundle(bundle)
BundleExtractor->>BundleExtractor: Collect MedicationDispense and other resources
BundleExtractor-->>Client: ExtractedFhirTypes (includes medicationDispenses)
Client->>Deduplicator: deduplicateFhir(ExtractedFhirTypes)
Deduplicator->>Deduplicator: Deduplicate medications
Deduplicator->>Deduplicator: Replace medication references in MedicationDispense and others
Deduplicator-->>Client: Deduplicated FHIR resources
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error code ERR_SSL_WRONG_VERSION_NUMBER 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 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...
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (6)
|
metriport/metriport-internal#1040
Issues:
Dependencies
Description
I received a report that Surescripts conversion bundles had broken references for MedicationDispense, but I couldn't figure out anywhere that the logic would allow that to happen. I wrote an analysis script to test this, which showed that bundles with MedicationDispense were having their references broken by
dangerouslyDeduplicateFhir
. This is an issue that likely affects any FHIR bundle with MedicationDispense resources.After implementing the fix, all patient bundles were deduplicating correctly with correct references.
Testing
Will test by deduplicating some large bundles.
Release Plan
Summary by CodeRabbit