Skip to content
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

1413 cq doc retrieval #1437

Merged
merged 89 commits into from
Feb 23, 2024
Merged

1413 cq doc retrieval #1437

merged 89 commits into from
Feb 23, 2024

Conversation

Orta21
Copy link
Member

@Orta21 Orta21 commented Jan 19, 2024

Ticket: #1413

Description

Add doc retrieval for CQ flow

Testing

Wont be able to test until we have infra setup in staging. This code can be merged though as it should not be triggered in staging or prod.

Release Plan

Once the infra gets merged ill will edit the trigger to be called in the cloud so we can test

  • Update npm packages
  • Merge this

Orta21 and others added 29 commits January 11, 2024 21:06
- add AsyncLocalStorage and update logs to include the request ID

Ref: metriport/metriport-internal#1040
- remove deprecated updateDocQuery
- move jobId create/decompose to single place

Ref: metriport/metriport-internal#1040
Merge branch 'develop' into 1455-fix-dq-status
@Orta21 Orta21 changed the base branch from develop to 1455-fix-dq-status January 30, 2024 23:59
@Orta21
Copy link
Member Author

Orta21 commented Feb 22, 2024

  • issing link to upstream dependency on the PR description

@leite08 it was merged into develop so there is no more upstream branch as this is pointing there now

packages/api/src/external/carequality/document/shared.ts Outdated Show resolved Hide resolved
Comment on lines 78 to 92
if (content) {
const metriportFHIRContent = createDocReferenceContent({
...baseAttachment,
location: location,
extension: [metriportDataSourceExtension],
});

return [...content, metriportFHIRContent];
}

const cqFHIRContent = createDocReferenceContent({
...baseAttachment,
location: location,
extension: [cqExtension],
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't understand this. AFAIK:

  • doc refs downloaded from HIE have the respective HIE extension;
  • doc refs contributed by cxs have the Metriport extension.

I don't see how having content or not indicates that. If that's because we don't have content when in a certain flow, this is error prone, as if we change the flow to have the content at that point, its not obvious from there that this function works like this.


const docId = docRef.metriportId ?? "";

const fhirDocRef = cqToFHIR(docId, docRef, patientId, true, currentFHIRDocRef[0]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make currentFHIRDocRef be a single object, please? Its confusing to read the code and see both currentFHIRDocRefs and currentFHIRDocRef be an array.


export const cqToFHIR = (
docId: string,
doc: IHEGWDocumentReference,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: doc > docRef

@Orta21 Orta21 merged commit cc0bb03 into develop Feb 23, 2024
15 checks passed
@Orta21 Orta21 deleted the 1413-cq-doc-retrieval branch February 23, 2024 20:43
Copy link

🎉 This PR is included in version 5.63.0-develop.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 5.64.0-develop.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 5.64.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants