-
Notifications
You must be signed in to change notification settings - Fork 6
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
COM-851 TX_PLVS: Column - Date of Regimen switch (limit only to the current reporting month) #323
base: dev
Are you sure you want to change the base?
Conversation
Adds the above column to the treatment report
Adds the above column to the treatment report
The previous code was comparing single drug orders, instead of regimens
JOIN drug d ON d.drug_id = do.drug_inventory_id AND d.retired = 0 | ||
WHERE o.voided = 0 | ||
AND o.encounter_id = previousEncounterId | ||
AND o.date_created BETWEEN p_startDate AND p_endDate |
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.
@tmvumbi2 Why checking date created for this regimen?
AND o.date_created BETWEEN p_startDate AND p_endDate | ||
AND drugIsARV(d.concept_id) | ||
AND drugOrderIsDispensed(o.patient_id, o.order_id) | ||
AND o.encounter_id <> currentEncounterId |
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.
@tmvumbi2 Isn't it better to use o.encounter_id < currentEncounterId and not check the date for this one?
@@ -18,8 +18,8 @@ SELECT getPatientDateOfEnrolmentInProgram(p.patient_id, "HIV_PROGRAM_KEY") AS "E | |||
"N/A" as "Regimen at ART Start/ Régime chez ART Start", | |||
getPatientMostRecentProgramAttributeCodedValue(p.patient_id, "397b7bc7-13ca-4e4e-abc3-bf854904dce3", "en") as "Current Regimen Line/ Ligne de régime actuelle", | |||
getListOfActiveARVDrugs(p.patient_id, '#startDate#', '#endDate#') as "Current ART Regimen/ Régime d'ART actuel", | |||
"N/A" as "Regimen Switch/ Commutateur de régime", | |||
"N/A" as "Date of Regimen switch (limit only to the current reporting month)", | |||
getRegimenSwitch(p.patient_id, "2010-01-01", "#endDate#") as "Regimen Switch/ Commutateur de régime", |
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.
@tmvumbi2 Remember to use 2000 instead of 2010 in case there's data entered for before 2010
Jira ticket: https://jembiprojects.jira.com/browse/COM-851