diff --git a/api/src/main/java/org/openmrs/module/eptsreports/reporting/library/cohorts/QualityImprovement2020CohortQueries.java b/api/src/main/java/org/openmrs/module/eptsreports/reporting/library/cohorts/QualityImprovement2020CohortQueries.java index 99bd29bfdb..c90623655b 100644 --- a/api/src/main/java/org/openmrs/module/eptsreports/reporting/library/cohorts/QualityImprovement2020CohortQueries.java +++ b/api/src/main/java/org/openmrs/module/eptsreports/reporting/library/cohorts/QualityImprovement2020CohortQueries.java @@ -7674,7 +7674,7 @@ public CohortDefinition getMQ15DEN(Integer den) { hivMetadata.getSemiannualDispensation(), hivMetadata.getAnnualArvDispensationConcept())); - CohortDefinition transferOut = getTranferredOutPatients(); + CohortDefinition transferOut = getTranferredOutPatientDuringRevisionPeriod(); CohortDefinition dead = getDeadPatientsComposition(); @@ -7756,7 +7756,7 @@ public CohortDefinition getMQ15DEN(Integer den) { resumoMensalCohortQueries.getPatientsWhoWereActiveByEndOfMonthB13(), "endDate=${revisionEndDate},location=${location}")); - comp.addSearch("F", EptsReportUtils.map(transferOut, MAPPING1)); + comp.addSearch("F", EptsReportUtils.map(transferOut, MAPPING3)); comp.addSearch( "dead", EptsReportUtils.map(dead, "endDate=${revisionEndDate},location=${location}")); @@ -7895,7 +7895,7 @@ public CohortDefinition getMQ15NUM(Integer num) { break; case 9: comp.setName( - "% de Crianças (2-9 anos) inscritas há 12 meses em algum MDS (DT) que receberam pelo menos um resultado de CV"); + "% de Crianças (2-9 anos) activas em TARV e inscritos há 24 meses em algum MDS (DT) que receberam o segundo resultado de CV"); break; case 10: comp.setName( @@ -8223,6 +8223,9 @@ public CohortDefinition getPatientsWhoHadMdsOnMostRecentClinicalAndPickupOnFilaF CohortDefinition nextPickupBetween173And187 = QualityImprovement2020Queries.getPatientsWithPickupOnFilaBetween(173, 187); + CohortDefinition nextPickupBetween335And395 = + QualityImprovement2020Queries.getPatientsWithPickupOnFilaBetween(335, 395); + compositionCohortDefinition.addSearch( "MDS", EptsReportUtils.map( @@ -8245,7 +8248,13 @@ public CohortDefinition getPatientsWhoHadMdsOnMostRecentClinicalAndPickupOnFilaF nextPickupBetween173And187, "startDate=${startDate},endDate=${endDate},location=${location}")); - compositionCohortDefinition.setCompositionString("MDS OR DSDT OR FILA83 OR FILA173"); + compositionCohortDefinition.addSearch( + "FILA335", + EptsReportUtils.map( + nextPickupBetween335And395, + "startDate=${startDate},endDate=${endDate},location=${location}")); + + compositionCohortDefinition.setCompositionString("MDS OR DSDT OR FILA83 OR FILA173 OR FILA335"); return compositionCohortDefinition; } @@ -9456,6 +9465,7 @@ public CohortDefinition getMQ15NumeratorMDS() { ageCohortQueries.createXtoYAgeCohort("Ages", 2, 200), "effectiveDate=${endDate}")); cd.setCompositionString("MQ15DenMDS AND MDS AND AGE"); + return cd; } @@ -11962,7 +11972,7 @@ public CohortDefinition getPatientsWhoHadVLResultLessThen1000nLaboratoryFormAfte + " AND e.voided = 0 " + " AND o.voided = 0) vl_result " + " ON two_dispensations.patient_id = vl_result.patient_id " - + "WHERE vl_result.vl_date > two_dispensations.second_date AND vl_result.vl_date <= :revisionEndDate"; + + "WHERE vl_result.vl_date >= two_dispensations.second_date AND vl_result.vl_date <= :revisionEndDate"; StringSubstitutor sb = new StringSubstitutor(map); @@ -12116,7 +12126,7 @@ public CohortDefinition getPatientsWhoHadVLResultOnLaboratoryFormAfterSecondVLRe + " AND p.voided = 0 " + " AND e.voided = 0 " + " AND o.voided = 0) vl_result ON two_dispensations.patient_id = vl_result.patient_id " - + "WHERE vl_result.vl_date > two_dispensations.second_date " + + "WHERE vl_result.vl_date >= two_dispensations.second_date " + " AND vl_result.vl_date <= :revisionEndDate"; StringSubstitutor sb = new StringSubstitutor(map); @@ -13700,6 +13710,7 @@ public CohortDefinition getPatientsWhoEndedTbTreatmentWithin30DaysOfLastClinical + " AND o.voided = 0 " + " AND e.encounter_type = ${6} " + " AND e.location_id = :location " + + " AND e.encounter_datetime <= :revisionEndDate " + " AND o.concept_id = ${1268} " + " AND o.value_coded = ${1267} " + " GROUP BY p.patient_id) tb_end " @@ -15753,4 +15764,123 @@ public CohortDefinition getMQ19B(Integer num, MIMQ reportSource) { return compositionCohortDefinition; } + + /** + * Utentes Transferidos Para Outra US + * + *
O sistema irá identificar utentes “Transferido Para” outras US em TARV durante o período de + * revisão seleccionando os utentes registados como: + *