Skip to content

Commit

Permalink
C2C-319: MSPP Vaccinations report to capture data on 'Fully vaccinate…
Browse files Browse the repository at this point in the history
…d children' (#70)
  • Loading branch information
Ruhanga authored Jul 18, 2024
1 parent 28f566f commit d6d8286
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.Map;

import org.apache.commons.lang3.math.NumberUtils;
import org.openmrs.Location;
import org.openmrs.api.ConceptService;
import org.openmrs.api.context.Context;
import org.openmrs.module.commonreports.ActivatedReportManager;
Expand Down Expand Up @@ -137,6 +138,22 @@ public ReportDefinition constructReportDefinition() {
String[] vaccinationConceptsListWithSequence = inizService
.getValueFromKey("report.MSPP.vaccination.vaccinationConceptsListWithSequence").split(",");

if (inizService.getConceptFromKey("report.MSPP.vaccination.isChildFullyVaccinatedQuestion.concept") != null &&
inizService.getConceptFromKey("report.MSPP.vaccination.yesAnswer.concept") != null) {
CodedObsCohortDefinition isChildFullyVaccinated = new CodedObsCohortDefinition();
isChildFullyVaccinated.setQuestion(
inizService.getConceptFromKey("report.MSPP.vaccination.isChildFullyVaccinatedQuestion.concept"));
isChildFullyVaccinated.addParameter(new Parameter("onOrAfter", "On Or After", Date.class));
isChildFullyVaccinated.addParameter(new Parameter("onOrBefore", "On Or Before", Date.class));
isChildFullyVaccinated.setOperator(SetComparator.IN);
isChildFullyVaccinated
.setValueList(Arrays.asList(inizService.getConceptFromKey("report.MSPP.vaccination.yesAnswer.concept")));

vaccination.addRow(inizService
.getConceptFromKey("report.MSPP.vaccination.isChildFullyVaccinatedQuestion.concept").getDisplayString(),
isChildFullyVaccinated, parameterMappings);
}

for (String member : vaccinationConceptsListWithSequence) {

String[] bits = member.split(":");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,21 @@ public void testReport() throws Exception {
.getColumnValue("Diphtheria Tetanus Vaccination 11." + MSPPVaccinationReportManager.col5);
assertNotNull(_prenatalFemalesReceivedDT);
assertEquals(1, _prenatalFemalesReceivedDT.getSize());

Cohort _0mTo1yFemalesFullyVaccinated= (Cohort) row
.getColumnValue("Is the child fully vaccinated?." + MSPPVaccinationReportManager.col1);
assertNotNull(_0mTo1yFemalesFullyVaccinated);
assertEquals(1, _0mTo1yFemalesFullyVaccinated.getSize());

Cohort _0mTo1yMalesFullyVaccinated = (Cohort) row
.getColumnValue("Is the child fully vaccinated?." + MSPPVaccinationReportManager.col3);
assertNotNull(_0mTo1yMalesFullyVaccinated);
assertEquals(1, _0mTo1yMalesFullyVaccinated.getSize());

Cohort _prenatalFemalesFullyVaccinated = (Cohort) row
.getColumnValue("Is the child fully vaccinated?." + MSPPVaccinationReportManager.col5);
assertNotNull(_prenatalFemalesFullyVaccinated);
assertEquals(1, _prenatalFemalesFullyVaccinated.getSize());
}

for (Iterator<DataSetRow> itr = data.getDataSets().get("MSPP ECV").iterator(); itr.hasNext();) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<concept concept_id="847" retired="false" datatype_id="2" class_id="7" is_set="false" creator="1" date_created="2021-01-02 15:27:51.0" version="" uuid="5bc84919-86f1-4d9a-8b08-73cbb853b574" />
<concept concept_id="848" retired="false" datatype_id="2" class_id="7" is_set="false" creator="1" date_created="2021-01-02 15:27:51.0" version="" uuid="3afaa3ce-0dbe-4ac8-964a-1913ee930d34" />
<concept concept_id="855" retired="false" datatype_id="6" class_id="5" is_set="false" creator="1" date_created="2021-01-02 15:27:51.0" version="" uuid="5e7c3216-7f3b-4f5f-ab46-390f309e350d" />
<concept concept_id="888" retired="false" datatype_id="6" class_id="5" is_set="false" creator="1" date_created="2021-01-02 15:27:51.0" version="" uuid="25f7d0de-378a-477b-ac19-0bc9e9138064" />

<concept_name concept_id="862" name="Vaccinations" locale="en" creator="1" date_created="2004-08-12 00:00:00.0" concept_name_id="9036" concept_name_type="FULLY_SPECIFIED" locale_preferred="1" voided="false" uuid="666947cb-18da-4287-b579-15023917b6b3" />
<concept_name concept_id="855" name="Vaccination date" locale="en" creator="1" date_created="2004-08-12 00:00:00.0" concept_name_id="9070" concept_name_type="FULLY_SPECIFIED" locale_preferred="1" voided="false" uuid="562afa50-85c6-4508-a182-27066952b219" />
Expand All @@ -38,6 +39,7 @@
<concept_name concept_id="846" name="Rotavirus Vaccination" locale="en" creator="1" date_created="2004-08-12 00:00:00.0" concept_name_id="2561" concept_name_type="FULLY_SPECIFIED" locale_preferred="1" voided="false" uuid="8bc87903-c0db-4293-aee4-916f3a166e6a" />
<concept_name concept_id="847" name="Measles Rubella Vaccination" locale="en" creator="1" date_created="2004-08-12 00:00:00.0" concept_name_id="2562" concept_name_type="FULLY_SPECIFIED" locale_preferred="1" voided="false" uuid="ff581ee7-7f11-4c0d-902b-f77353676bd8" />
<concept_name concept_id="848" name="Diphtheria Tetanus Vaccination" locale="en" creator="1" date_created="2004-08-12 00:00:00.0" concept_name_id="2563" concept_name_type="FULLY_SPECIFIED" locale_preferred="1" voided="false" uuid="c35c76ed-c41c-425e-8ec5-fb8c3ff60b4f" />
<concept_name concept_id="888" name="Is the child fully vaccinated?" locale="en" creator="1" date_created="2004-08-12 00:00:00.0" concept_name_id="2564" concept_name_type="FULLY_SPECIFIED" locale_preferred="1" voided="false" uuid="3c76e5dc-c41c-8ec5-425e-f0bb8ff64fc3" />
<!-- BCG -->
<obs obs_id="80" person_id="15" concept_id="2317" encounter_id="3" obs_group_id="[NULL]" obs_datetime="2021-06-01 00:00:00.0" location_id="1" value_coded="[NULL]" comments="" creator="1" date_created="2021-06-01 00:00:00.0" voided="false" value_coded_name_id="[NULL]" value_complex="[NULL]" value_text="[NULL]" value_numeric="[NULL]" value_datetime="[NULL]" value_drug="[NULL]" uuid="a2c84a9b-6181-445f-a106-267cc8641976" />
<obs obs_id="4003" person_id="15" concept_id="862" encounter_id="3" obs_group_id="80" obs_datetime="2021-06-01 00:00:00.0" location_id="1" value_coded="839" comments="" creator="1" date_created="2021-06-01 00:00:00.0" voided="false" value_coded_name_id="[NULL]" value_complex="[NULL]" value_text="[NULL]" value_numeric="[NULL]" value_datetime="[NULL]" value_drug="[NULL]" uuid="90b6abe2-eef9-4d03-aba7-5363a591cb1a" />
Expand All @@ -49,6 +51,7 @@
<obs obs_id="4006" person_id="15" concept_id="862" encounter_id="3" obs_group_id="81" obs_datetime="2021-06-01 00:00:00.0" location_id="1" value_coded="843" comments="" creator="1" date_created="2021-06-01 00:00:00.0" voided="false" value_coded_name_id="[NULL]" value_complex="[NULL]" value_text="[NULL]" value_numeric="[NULL]" value_datetime="[NULL]" value_drug="[NULL]" uuid="cf613b43-0e89-4c8d-9821-92bff858b087" />
<obs obs_id="4005" person_id="15" concept_id="865" encounter_id="3" obs_group_id="81" obs_datetime="2021-06-01 00:00:00.0" location_id="1" value_coded="[NULL]" comments="" creator="1" date_created="2021-06-01 00:00:00.0" voided="false" value_coded_name_id="[NULL]" value_complex="[NULL]" value_text="[NULL]" value_numeric="3" value_datetime="[NULL]" value_drug="[NULL]" uuid="91fc8bff-0c2a-4b4f-b8fe-13abecdee795" />
<obs obs_id="5005" person_id="15" concept_id="855" encounter_id="3" obs_group_id="81" obs_datetime="2021-06-01 00:00:00.0" location_id="1" value_coded="[NULL]" comments="" creator="1" date_created="2021-06-01 00:00:00.0" voided="false" value_coded_name_id="[NULL]" value_complex="[NULL]" value_text="[NULL]" value_numeric="[NULL]" value_datetime="2021-06-01 00:00:00.0" value_drug="[NULL]" uuid="255dc1d3-064b-4ab5-acc9-4de61a81d7f0" />
<obs obs_id="6005" person_id="15" concept_id="888" encounter_id="3" obs_group_id="81" obs_datetime="2021-06-01 00:00:00.0" location_id="1" value_coded="7" comments="" creator="1" date_created="2021-06-01 00:00:00.0" voided="false" value_coded_name_id="[NULL]" value_complex="[NULL]" value_text="[NULL]" value_numeric="[NULL]" value_datetime="2021-06-01 00:00:00.0" value_drug="[NULL]" uuid="a3c0eedd-cc10-4e6a-a9f0-5e32b7f2e70f" />

<!-- BCG -->
<obs obs_id="89" person_id="16" concept_id="2317" encounter_id="15" obs_group_id="[NULL]" obs_datetime="2021-06-01 00:00:00.0" location_id="1" value_coded="[NULL]" comments="" creator="1" date_created="2021-06-01 00:00:00.0" voided="false" value_coded_name_id="[NULL]" value_complex="[NULL]" value_text="[NULL]" value_numeric="[NULL]" value_datetime="[NULL]" value_drug="[NULL]" uuid="a868c277-3e96-4abf-9529-8a0232bb6764" />
Expand All @@ -61,6 +64,7 @@
<obs obs_id="4007" person_id="16" concept_id="865" encounter_id="15" obs_group_id="82" obs_datetime="2021-06-01 00:00:00.0" location_id="1" value_coded="[NULL]" comments="" creator="1" date_created="2021-06-01 00:00:00.0" voided="false" value_coded_name_id="[NULL]" value_complex="[NULL]" value_text="[NULL]" value_numeric="3" value_datetime="[NULL]" value_drug="[NULL]" uuid="e034612c-53a7-4b90-98fb-e32570952813" />
<obs obs_id="4008" person_id="16" concept_id="862" encounter_id="15" obs_group_id="82" obs_datetime="2021-06-01 00:00:00.0" location_id="1" value_coded="843" comments="" creator="1" date_created="2021-06-01 00:00:00.0" voided="false" value_coded_name_id="[NULL]" value_complex="[NULL]" value_text="[NULL]" value_numeric="[NULL]" value_datetime="[NULL]" value_drug="[NULL]" uuid="22a5b9c9-9e71-4038-a805-b97e8f46d6a3" />
<obs obs_id="5007" person_id="16" concept_id="855" encounter_id="15" obs_group_id="82" obs_datetime="2021-06-01 00:00:00.0" location_id="1" value_coded="[NULL]" comments="" creator="1" date_created="2021-06-01 00:00:00.0" voided="false" value_coded_name_id="[NULL]" value_complex="[NULL]" value_text="[NULL]" value_numeric="[NULL]" value_datetime="2021-06-01 00:00:00.0" value_drug="[NULL]" uuid="a746db3f-1e8e-42c3-ab60-ce6c5b9d6a7d" />
<obs obs_id="6006" person_id="16" concept_id="888" encounter_id="15" obs_group_id="82" obs_datetime="2021-06-01 00:00:00.0" location_id="1" value_coded="7" comments="" creator="1" date_created="2021-06-01 00:00:00.0" voided="false" value_coded_name_id="[NULL]" value_complex="[NULL]" value_text="[NULL]" value_numeric="[NULL]" value_datetime="2021-06-01 00:00:00.0" value_drug="[NULL]" uuid="7b9eeb9e-1e5c-4d6e-abe2-d9e4a4b2e3fc" />

<!-- Oral Polio 2 -->
<obs obs_id="84" person_id="16" concept_id="2317" encounter_id="15" obs_group_id="[NULL]" obs_datetime="2021-06-01 00:00:00.0" location_id="1" value_coded="[NULL]" comments="" creator="1" date_created="2021-06-01 00:00:00.0" voided="false" value_coded_name_id="[NULL]" value_complex="[NULL]" value_text="[NULL]" value_numeric="[NULL]" value_datetime="[NULL]" value_drug="[NULL]" uuid="719e1957-a98a-48ff-9705-954892268e16" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@
"report.MSPP.vaccination.vaccinations" : "3c25e650-ccfa-48da-b276-a7872796b113",
"report.MSPP.vaccination.vaccinationSequenceNumberConcept" : "39741bfe-36a0-4a5b-9c64-fd4caaadca01",
"report.MSPP.vaccination.vaccinationConceptsListWithSequence" : "9199a4c6-b15f-482c-aa0e-c839bd0cf535,0661812a-6ff7-42f9-bbe7-f79c5bdd0f58:1,0661812a-6ff7-42f9-bbe7-f79c5bdd0f58:2,0661812a-6ff7-42f9-bbe7-f79c5bdd0f58:3,30fd2e76-bfcb-49b4-8668-64fd3d3ec0ea,613c8c54-a1f5-435c-a1f0-ec9beaa42d06:1,613c8c54-a1f5-435c-a1f0-ec9beaa42d06:2,613c8c54-a1f5-435c-a1f0-ec9beaa42d06:3,9a9b3ca9-4ef9-4cb6-8a6d-ed9a7c32c46e:1,9a9b3ca9-4ef9-4cb6-8a6d-ed9a7c32c46e:2,5bc84919-86f1-4d9a-8b08-73cbb853b574:1,5bc84919-86f1-4d9a-8b08-73cbb853b574:2,3afaa3ce-0dbe-4ac8-964a-1913ee930d34:11,3afaa3ce-0dbe-4ac8-964a-1913ee930d34:12",
"report.MSPP.vaccination.isChildFullyVaccinatedQuestion.concept" : "25f7d0de-378a-477b-ac19-0bc9e9138064",
"report.MSPP.vaccination.yesAnswer.concept" : "b055abd8-a420-4a11-8b98-02ee170a7b54",
"report.MSPP.vaccination.ecvList" : "9199a4c6-b15f-482c-aa0e-c839bd0cf535,0661812a-6ff7-42f9-bbe7-f79c5bdd0f58:2,30fd2e76-bfcb-49b4-8668-64fd3d3ec0ea,613c8c54-a1f5-435c-a1f0-ec9beaa42d06:3,9a9b3ca9-4ef9-4cb6-8a6d-ed9a7c32c46e:2,5bc84919-86f1-4d9a-8b08-73cbb853b574:1",
"report.MSPP.vaccination.vaccinationDateConcept" : "5e7c3216-7f3b-4f5f-ab46-390f309e350d",
"report.MSPP.childCare.active" : "true",
Expand Down

0 comments on commit d6d8286

Please sign in to comment.