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

chore: add script to get AWE confirmation for patients #1023

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Goncharo
Copy link
Member

refs. metriport/metriport-internal#1040

Dependencies

n/a

Description

add script to get AWE confirmation for patients

Release Plan

asap

@Goncharo Goncharo requested a review from a team as a code owner October 20, 2023 04:35
Copy link
Contributor

@RamilGaripov RamilGaripov left a comment

Choose a reason for hiding this comment

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

:shipit: :shipit: :shipit:

Copy link
Member

@leite08 leite08 left a comment

Choose a reason for hiding this comment

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

Overall LGTM, just a suggestion on whether to make it more generic and the generic script improvement (patientIds, etc.).

Wondering if this would still be needed once we fix the issue with OpenSearch ingestion?

Comment on lines +17 to +19
const csvHeader = "id,firstName,lastName,dob,genderAtBirth,latestAWEDate,aweInPastYear\n";
const curDateTime = new Date();
const runName = `Z00s-${curDateTime.toISOString()}`;
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 expose the code Z00 to a const so we can more easily change it?

Also, does it make sense to turn this script into something more generic, to search codes instead of specifically AWEs?

Comment on lines +38 to +41
const facilities = await metriportAPI.listFacilities();
for (const facility of facilities) {
let patients = await metriportAPI.listPatients(facility.id);
patients = patients.filter(p => patientWhitelist.includes(p.id));
Copy link
Member

Choose a reason for hiding this comment

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

It'd be good to use an approach like this one, if this can be based off that branch an wait for it to be merged: https://github.com/metriport/metriport/pull/1019/files#diff-a7c4b68f53629031d1e1a1735020c853a99c9602b234c75b7559db1a1b9abdcfR140

So we have a list of patientIds in case we want to limit the search, and not worrying about facility.

try {
// list all of the patient's conditions
console.log(`>>> Getting Conditions for Patient ${patient.id}`);
const conditions = await metriportAPI.getPatientConsolidated(patient.id, ["Condition"]);
Copy link
Member

Choose a reason for hiding this comment

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

This is quote expensive to run in parallel... maybe we set the default value to 5 instead of 10?

@leite08 leite08 marked this pull request as draft November 14, 2023 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants