Skip to content

Commit

Permalink
Release EMR v1.11.0 - April 2023
Browse files Browse the repository at this point in the history
  • Loading branch information
tresorluz committed Apr 7, 2023
2 parents b757c80 + f92cda9 commit 624d2f8
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ ae6faa93-4a50-4036-b03c-5ac6fe4fbd82,,,Other testing at Inpatient,Autre Test en
59f82cad-f1c7-4272-9886-c7dc4ce2d4fe,,,Other testing at TB Unit,Autre Test a l’unité de TB,Other testing at TB Unit,Autre Test a l’unité de TB,Misc,N/A,,
703f2a8e-74ba-4e8c-93ef-64272c1e1733,,,PITC (Outpatient Department - casuality),CDIPS (Consultation Externe - accidenté),PITC (Outpatient Department - casuality),CDIPS (Consultation Externe - accidenté),Misc,N/A,,
a5843a33-f891-4e72-bb23-862b99ac0acb,,,Screening campaign,Campagne de dépistage,Screening campaign,Campagne de dépistage,Misc,N/A,,
915b293f-9d00-42a1-a2ba-6b5d00fe8629,,,Social Network Strategy,Stratégie des réseaux,Social Network Strategy,Stratégie des réseaux,Misc,N/A,,

bc43179d-00b4-4712-a5d6-4dabd4230888,,a5843a33-f891-4e72-bb23-862b99ac0acb;Emergency;Index;Inpatient;Labor and delivery;Malnutrition;OPD;Other PITC;Paediatric;PMTCT [ANC1-Only];PMTCT [Post ANC1];PNC;STI;TB;VCT;VMMC;Blood Bank;LOCATION_LABORATORY;Community Testing-Outreach;Community Testing-Satellite Site;Treatment Unit (UPEC);Partners of PW;Partners of BFW;Other testing at ANC;Other testing at Inpatient;Other testing at TB Unit;703f2a8e-74ba-4e8c-93ef-64272c1e1733,Testing Entry Point and Modality,Porte d’entrée du Test VIH,Testing Entry Point and Modality,Porte d’entrée du Test VIH,Misc,Coded,,
bc43179d-00b4-4712-a5d6-4dabd4230888,,a5843a33-f891-4e72-bb23-862b99ac0acb;Emergency;Index;Inpatient;Labor and delivery;Malnutrition;OPD;Other PITC;Paediatric;PMTCT [ANC1-Only];PMTCT [Post ANC1];PNC;STI;TB;VCT;VMMC;Blood Bank;LOCATION_LABORATORY;Community Testing-Outreach;Community Testing-Satellite Site;Treatment Unit (UPEC);Partners of PW;Partners of BFW;Other testing at ANC;Other testing at Inpatient;Other testing at TB Unit;703f2a8e-74ba-4e8c-93ef-64272c1e1733;Social Network Strategy,Testing Entry Point and Modality,Porte d’entrée du Test VIH,Testing Entry Point and Modality,Porte d’entrée du Test VIH,Misc,Coded,,
a45540e9-bf6f-4215-a0b7-3150d6d7115c,,,Determine,Determine,Determine,Determine,Misc,N/A,,
901d6f3d-4cd6-4353-bd4d-e1344c44fa29,,,Oraquick,Oraquick,Oraquick,Oraquick,Misc,N/A,,
4884e05f-bf21-4eed-bed4-613ffead8bed,,,ELISA,ELISA,ELISA,ELISA,Misc,N/A,,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ b1824734-c5d8-46d0-86c7-a4c8f73fce80,,,Hommes ayant des rapports sexuels avec de
425b6957-a360-4b5a-9a30-eb9705d9fc75,,,Prisoniers et Autres,Prisoners and Other enclose settings,Prisoniers et Autres,Prisoners and Other enclose settings,Misc,N/A,,

211f0857-61a3-4049-9777-374c4a592453,,b2031349-b60a-433d-880a-8668cc040d2f;9801e8cd-da10-4c52-adee-27cd6939adbb;c540d003-cdb5-434c-baa4-0b2b3e5e3205,Orientation sexuelle,Sexual orientation,Orientation sexuelle,Sexual orientation,Misc,Coded,,
248e21db-98f8-49fc-b596-fe9042b013ac,,b9c5c9c4-6290-4c79-b344-6928572ac57c;b1824734-c5d8-46d0-86c7-a4c8f73fce80;425b6957-a360-4b5a-9a30-eb9705d9fc75;762af91a-d2c1-4edc-9ec4-47a82c6f6485,Type Population Clé,KP Type,Type Population Clé,KP Type,Misc,Coded,,
248e21db-98f8-49fc-b596-fe9042b013ac,,b9c5c9c4-6290-4c79-b344-6928572ac57c;b1824734-c5d8-46d0-86c7-a4c8f73fce80;425b6957-a360-4b5a-9a30-eb9705d9fc75;762af91a-d2c1-4edc-9ec4-47a82c6f6485;7b706d4b-b6c7-4383-ae60-de81151dfc2e;4b2379ba-a180-4f69-8802-493ed0177654,Type Population Clé,KP Type,Type Population Clé,KP Type,Misc,Coded,,

a2065636-5326-40f5-aed6-0cc2cca81ccc,,,Oui full name,Yes full name,Oui,Yes,Misc,N/A,,
b497171e-0410-4d8d-bbd4-7e1a8f8b504e,,,Non full name,No full name,Non,No,Misc,N/A,,
Expand Down
2 changes: 1 addition & 1 deletion metadata/reportssql/drug_functions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ BEGIN
AND drugIsARV(d.concept_id)
AND o.order_action <> "DISCONTINUE"
AND o.date_stopped IS NULL
AND o.scheduled_date BETWEEN p_startDate AND p_endDate;
AND o.scheduled_date BETWEEN p_startDate AND DATE_ADD(p_endDate + INTERVAL 1 DAY, INTERVAL -1 SECOND);

RETURN result;
END$$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SELECT
getPatientMostRecentProgramTrackingStateValue(pat.patient_id,"en","HIV_PROGRAM_KEY") as "clinicalWhoStage",
getFirstARVPrescribed(pat.patient_id) as "regimentAtArtInitiation",
getARVTherapeuticLineAtInitiation(pat.patient_id) as "lineAtInitiation",
getActiveARVWithLowestDispensationPeriod(pat.patient_id, "2000-01-01", "2100-01-01") as "currentRegimen",
concatenateARTDrugs(pat.patient_id, getMostRecentArvPickupDateBeforeReportEndDate(pat.patient_id, "#endDate#"), getMostRecentArvPickupDateBeforeReportEndDate(pat.patient_id, "#endDate#"))as "currentRegimen",
getPatientMostRecentProgramAttributeCodedValue(pat.patient_id, "397b7bc7-13ca-4e4e-abc3-bf854904dce3", "en") as "currentLine",
IF(patientIsEligibleForVL(pat.patient_id), "Yes", "No") as "eligibilityForVl",
getARTAppointmentOnOrAfterDate(pat.patient_id, COALESCE(GREATEST("#startDate#", getLastArvPickupDate(pat.patient_id, "2000-01-01", "#endDate#")),"#startDate#")) as "lastAppointmentDate",
Expand All @@ -34,7 +34,7 @@ SELECT
getDurationMostRecentArvTreatmentInDays(pat.patient_id,"2000-01-01", "#endDate#") as "durationMostRecentArv",
getPatientMostRecentProgramAttributeCodedValue(pat.patient_id, "39202f47-a709-11e6-91e9-0800270d80ce", "en") as "reasonForInitiation",
IF(patientIsNotTransferredOut(pat.patient_id),"No","Yes") as "patientIsTransferedOut",
IF(getObsCodedValue(pat.patient_id, "211f0857-61a3-4049-9777-374c4a592453") IS NOT NULL, "True", "False") as "kp",
IF(getObsCodedValue(pat.patient_id, "248e21db-98f8-49fc-b596-fe9042b013ac") IS NOT NULL, "True", "False") as "kp",
getObsCodedValue(pat.patient_id, "248e21db-98f8-49fc-b596-fe9042b013ac") as "kpType",
getViralLoadTestDate(pat.patient_id) as "lastViralLoadResultDate",
getViralLoadTestResult(pat.patient_id) as "lastViralLoadResult",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ SELECT
getDateLatestARVRelatedVisit(p.patient_id) as "dateOfLastVisit",
getDateMostRecentARVAppointment(p.patient_id) as "lastAppointmentDate",
getPatientMostRecentProgramOutcome(p.patient_id, "en", "HIV_PROGRAM_KEY") as "hivOutcome",
getPatientMostRecentProgramAttributeCodedValue(p.patient_id, "39202f47-a709-11e6-91e9-0800270d80ce", "en") as "transferredIn",
getPatientMostRecentProgramAttributeCodedValue(p.patient_id, "39202f47-a709-11e6-91e9-0800270d80ce", "en") as "reasonsForConsultation",
IF(getPatientMostRecentProgramOutcome(p.patient_id, "en", "HIV_PROGRAM_KEY")="Transferred Out", "Yes", "No") as "transfertOut",
IF(getObsCodedValue(p.patient_id, "211f0857-61a3-4049-9777-374c4a592453") IS NOT NULL, "True", "False") as "kp",
getObsCodedValue(p.patient_id, "211f0857-61a3-4049-9777-374c4a592453") as "kpType",
IF(getObsCodedValue(p.patient_id, "248e21db-98f8-49fc-b596-fe9042b013ac") IS NOT NULL, "True", "False") as "kp",
getObsCodedValue(p.patient_id, "248e21db-98f8-49fc-b596-fe9042b013ac") as "kpType",
getPatientOccupation(p.patient_id) as "profession",
getPatientMostRecentProgramAttributeCodedValue(p.patient_id, "0a51d8d0-c775-48a2-9ca2-42c269d00bc2", "en") as "preTrackingOutcome",
getPatientMostRecentProgramAttributeCodedValue(p.patient_id, "caf6d807-861d-4393-9d6e-940b98fa712d", "en") as "trackingOutcome",
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion openmrs/apps/reports/reports.json
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@
}
},
"georgetownTbReport": {
"name": "TB Service Line Listing Report",
"name": "TB screening Line listing report",
"type": "concatenated",
"config": {
"macroTemplatePath": "/var/www/bahmni_config/openmrs/apps/reports/GEORGETOWN_TB_REPORT/template/georgetownTbReport.xls",
Expand Down
127 changes: 64 additions & 63 deletions report-testing-framework/data/backup-openmrs.sql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,16 @@ public void hivPatientShouldBeReported() throws Exception {
true
);

testDataGenerator.drug.orderDrug(
patientId,
encounterIdOpdVisit,
DrugNameEnum.TDF_FTC_300_300MG,
new LocalDateTime(2023, 1, 10, 8, 30, 0),
1,
DurationUnitEnum.MONTH,
true
);

/* record an ART Dispensation appointment */
testDataGenerator.appointment.recordAppointment(
patientId,
Expand Down Expand Up @@ -537,13 +547,12 @@ public void hivPatientShouldBeReported() throws Exception {
assertEquals(result.get(0).get("artStartDate"), "2023-01-10");
assertEquals(result.get(0).get("regimentAtArtInitiation"), "TDF/FTC 300/200mg");
assertEquals(result.get(0).get("currentLine"), "1st line");
assertEquals(result.get(0).get("currentRegimen"), "TDF/FTC 300/200mg");
assertEquals(result.get(0).get("currentRegimen"), "TDF/FTC 300/200mg;TDF/FTC 300/300mg");
assertEquals(result.get(0).get("currentLine"), "1st line");
assertEquals(result.get(0).get("eligibilityForVl"), "No");
assertEquals(result.get(0).get("lastAppointmentDate"), "2023-02-13");
assertEquals(result.get(0).get("getLastARVDispensed"), "TDF/FTC 300/200mg");
assertEquals(result.get(0).get("getLastARVDispensed"), "TDF/FTC 300/300mg");
assertEquals(result.get(0).get("lastARVDispenseDate"), "2023-01-10");
assertEquals(result.get(0).get("getLastARVDispensed"), "TDF/FTC 300/200mg");
assertEquals(result.get(0).get("durationMostRecentArv"), 31);
assertEquals(result.get(0).get("kp"), "False");
}
Expand Down Expand Up @@ -601,6 +610,16 @@ public void hivPatientWhoRegisteredBeforeShouldBeReported() throws Exception {
true
);

testDataGenerator.drug.orderDrug(
patientId,
encounterIdOpdVisit,
DrugNameEnum.TDF_FTC_300_300MG,
new LocalDateTime(2022, 12, 10, 8, 30, 0),
60,
DurationUnitEnum.DAY,
true
);

/* record an ART Dispensation appointment */
testDataGenerator.appointment.recordAppointment(
patientId,
Expand Down Expand Up @@ -631,13 +650,12 @@ public void hivPatientWhoRegisteredBeforeShouldBeReported() throws Exception {
assertEquals(result.get(0).get("artStartDate"), "2022-12-10");
assertEquals(result.get(0).get("regimentAtArtInitiation"), "TDF/FTC 300/200mg");
assertEquals(result.get(0).get("currentLine"), "1st line");
assertEquals(result.get(0).get("currentRegimen"), "TDF/FTC 300/200mg");
assertEquals(result.get(0).get("currentRegimen"), "TDF/FTC 300/200mg;TDF/FTC 300/300mg");
assertEquals(result.get(0).get("currentLine"), "1st line");
assertEquals(result.get(0).get("eligibilityForVl"), "No");
assertEquals(result.get(0).get("lastAppointmentDate"), "2023-02-09");
assertEquals(result.get(0).get("getLastARVDispensed"), "TDF/FTC 300/200mg");
assertEquals(result.get(0).get("getLastARVDispensed"), "TDF/FTC 300/300mg");
assertEquals(result.get(0).get("lastARVDispenseDate"), "2022-12-10");
assertEquals(result.get(0).get("getLastARVDispensed"), "TDF/FTC 300/200mg");
assertEquals(result.get(0).get("durationMostRecentArv"), 60);
assertEquals(result.get(0).get("kp"), "False");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void patientEnrolledToHiv_shouldBeReported() throws Exception {
patientId,
encounterIdOpdVisit,
DrugNameEnum.ABC_3TC_60_30MG,
new LocalDateTime(2020, 1, 5, 8, 0, 0),
new LocalDateTime(2020, 1, 5, 8, 30, 0),
1,
DurationUnitEnum.MONTH,
true);
Expand All @@ -127,10 +127,10 @@ public void patientEnrolledToHiv_shouldBeReported() throws Exception {
null);

/* record the sexual orientation */
testDataGenerator.hivAdultInitialForm.setSexualOrientation(
testDataGenerator.hivAdultInitialForm.setKpType(
patientId,
new LocalDateTime(2020, 1, 8, 8, 0, 0),
ConceptEnum.HETEROSEXUAL,
ConceptEnum.MIGRANT,
encounterIdAdultHivForm);

/* record an ART Dispensation appointment */
Expand Down Expand Up @@ -210,10 +210,10 @@ public void patientEnrolledToHiv_shouldBeReported() throws Exception {
assertEquals(result.get(0).get("eligibilityForVl"), "No");
assertEquals(result.get(0).get("dateOfLastVisit"), "2019-12-30");
assertEquals(result.get(0).get("lastAppointmentDate"), "2020-01-15");
assertEquals(result.get(0).get("transferredIn"), "Initiation of ART");
assertEquals(result.get(0).get("reasonsForConsultation"), "Initiation of ART");
assertEquals(result.get(0).get("transfertOut"), "No");
assertEquals(result.get(0).get("kp"), "True");
assertEquals(result.get(0).get("kpType"), "Heterosexual");
assertEquals(result.get(0).get("kpType"), "Migrant");
assertEquals(result.get(0).get("profession"), "Private sector employee");
assertEquals(result.get(0).get("preTrackingOutcome"), "7 to 30 days");
assertEquals(result.get(0).get("trackingOutcome"), "Calls not picked up");
Expand Down Expand Up @@ -334,10 +334,10 @@ public void childEnrolledToHiv_shouldBeReported() throws Exception {
null);

/* record the sexual orientation */
testDataGenerator.hivAdultInitialForm.setSexualOrientation(
testDataGenerator.hivAdultInitialForm.setKpType(
patientId,
new LocalDateTime(2020, 1, 8, 8, 0, 0),
ConceptEnum.HETEROSEXUAL,
ConceptEnum.MIGRANT,
encounterIdChildHivForm);

/* record an ART Dispensation appointment */
Expand Down Expand Up @@ -416,10 +416,10 @@ public void childEnrolledToHiv_shouldBeReported() throws Exception {
assertEquals(result.get(0).get("eligibilityForVl"), "No");
assertEquals(result.get(0).get("dateOfLastVisit"), "2019-12-30");
assertEquals(result.get(0).get("lastAppointmentDate"), "2020-01-15");
assertEquals(result.get(0).get("transferredIn"), "Initiation of ART");
assertEquals(result.get(0).get("reasonsForConsultation"), "Initiation of ART");
assertEquals(result.get(0).get("transfertOut"), "No");
assertEquals(result.get(0).get("kp"), "True");
assertEquals(result.get(0).get("kpType"), "Heterosexual");
assertEquals(result.get(0).get("kpType"), "Migrant");
assertEquals(result.get(0).get("profession"), "Private sector employee");
assertEquals(result.get(0).get("preTrackingOutcome"), "7 to 30 days");
assertEquals(result.get(0).get("trackingOutcome"), "Calls not picked up");
Expand Down Expand Up @@ -613,7 +613,7 @@ public void patientWithNoKPEnrolledToHiv_shouldBeReported() throws Exception {
assertEquals(result.get(0).get("eligibilityForVl"), "No");
assertEquals(result.get(0).get("dateOfLastVisit"), "2019-12-30");
assertEquals(result.get(0).get("lastAppointmentDate"), "2020-01-15");
assertEquals(result.get(0).get("transferredIn"), "Initiation of ART");
assertEquals(result.get(0).get("reasonsForConsultation"), "Initiation of ART");
assertEquals(result.get(0).get("transfertOut"), "No");
assertEquals(result.get(0).get("kp"), "False");
assertEquals(result.get(0).get("kpType"), null);
Expand Down Expand Up @@ -726,10 +726,10 @@ public void patientEligibleForVLAndEnrolledToHiv_shouldBeReported() throws Excep
null);

/* record the sexual orientation */
testDataGenerator.hivAdultInitialForm.setSexualOrientation(
testDataGenerator.hivAdultInitialForm.setKpType(
patientId,
new LocalDateTime(2020, 1, 8, 8, 0, 0),
ConceptEnum.HETEROSEXUAL,
ConceptEnum.MIGRANT,
encounterIdAdultHivForm);

/* record an ART Dispensation appointment */
Expand Down Expand Up @@ -806,10 +806,10 @@ public void patientEligibleForVLAndEnrolledToHiv_shouldBeReported() throws Excep
assertEquals(result.get(0).get("eligibilityForVl"), "Yes");
assertEquals(result.get(0).get("dateOfLastVisit"), "2019-12-30");
assertEquals(result.get(0).get("lastAppointmentDate"), "2020-01-15");
assertEquals(result.get(0).get("transferredIn"), "Initiation of ART");
assertEquals(result.get(0).get("reasonsForConsultation"), "Initiation of ART");
assertEquals(result.get(0).get("transfertOut"), "No");
assertEquals(result.get(0).get("kp"), "True");
assertEquals(result.get(0).get("kpType"), "Heterosexual");
assertEquals(result.get(0).get("kpType"), "Migrant");
assertEquals(result.get(0).get("profession"), "Private sector employee");
assertEquals(result.get(0).get("preTrackingOutcome"), "7 to 30 days");
assertEquals(result.get(0).get("trackingOutcome"), "Calls not picked up");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,13 @@ public int setSexualOrientation(int patientId, LocalDateTime obsDateTime, Concep
conceptTree.add(ConceptEnum.SEXUAL_ORIENTATION);
return TestDataGenerator.recordFormCodedValue(patientId, obsDateTime, conceptTree, value, encounterId, stmt);
}


public int setKpType(int patientId, LocalDateTime obsDateTime, ConceptEnum value, Integer encounterId) throws Exception {
List<ConceptEnum> conceptTree= new ArrayList<ConceptEnum>();
conceptTree.add(ConceptEnum.PATIENT_WITH_HIV_ADULT_INITIAL);
conceptTree.add(ConceptEnum.SOCIO_DEMOGRAPHIC_INFORMATION);
conceptTree.add(ConceptEnum.KP_TYPE);
return TestDataGenerator.recordFormCodedValue(patientId, obsDateTime, conceptTree, value, encounterId, stmt);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ public enum ConceptEnum {
PATIENT_WITH_HIV_CHILD_FOLLOW_UP("9e38f9c3-1f04-4221-b5c9-51d5adbe1931"),
CONSULTATION_FOLLOW_UP("cd0d1c27-f956-4a19-a09e-2989016c2ed5"),
WHAT_DOES_THE_CHILD_KNOW_ABOUT_THEIR_DISEASE("76a912af-702e-47a0-83c4-246900861296"),
MIGRANT("4b2379ba-a180-4f69-8802-493ed0177654"),
KP_TYPE("248e21db-98f8-49fc-b596-fe9042b013ac"),
NOTHING_DISCLOSURE_NOT_MADE("932a67d0-b302-41bd-b999-2cf62fe906b8");

private String value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public enum DrugNameEnum {
INH_100MG("INH 100mg"),
INH_300MG("INH 300mg"),
TDF_FTC_300_200MG("TDF/FTC 300/200mg"),
TDF_FTC_300_300MG("TDF/FTC 300/300mg"),
COTRIMOXAZOLE_400MG("Sulfamethoxazole+Trimethoprine (Cotrimoxazole) (400mg+180mg)/5ml");

private String value;
Expand Down

0 comments on commit 624d2f8

Please sign in to comment.