-
Notifications
You must be signed in to change notification settings - Fork 52
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
base: develop
Are you sure you want to change the base?
Conversation
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.
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.
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?
const csvHeader = "id,firstName,lastName,dob,genderAtBirth,latestAWEDate,aweInPastYear\n"; | ||
const curDateTime = new Date(); | ||
const runName = `Z00s-${curDateTime.toISOString()}`; |
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.
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?
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)); |
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.
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"]); |
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.
This is quote expensive to run in parallel... maybe we set the default value to 5 instead of 10?
refs. metriport/metriport-internal#1040
Dependencies
n/a
Description
add script to get AWE confirmation for patients
Release Plan
asap