Skip to content

Commit d54b25c

Browse files
ssmusokeslubwama
authored andcommitted
Add the ability to show patient status information on the dashboard based on information entered (#317)
* Add ability to deploy patient flags via metadata deploy * Changed patient flags to use the api module instead of the omod * Changed role reference from a uuid to the name of the role * Removed the tag evaluator since the default is an SQL Flag Evaluator * Added patient flags as a required module * Added the info message for module startup only when there are no exceptions * Updated the module versions to the latest releases from Reference App 2.7 release train * Added the first round of patient flags * Updated to install available flags * Enable the recent visits dashboard widget * Update of DUE_FOR_FIRST_VIRAL_LOAD to enable additional queries for ANC * Updated uicommons and core versions to fix issue with breaking dashboard widgets * Added Exposed Infant and Viral Load patient flags
1 parent 0b3d118 commit d54b25c

File tree

11 files changed

+816
-56
lines changed

11 files changed

+816
-56
lines changed

api/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@
152152
<artifactId>providermanagement-api</artifactId>
153153
</dependency>
154154

155+
<dependency>
156+
<groupId>org.openmrs.module</groupId>
157+
<artifactId>patientflags-api</artifactId>
158+
</dependency>
159+
155160
<dependency>
156161
<groupId>org.openmrs.module</groupId>
157162
<artifactId>registrationcore-api</artifactId>

api/src/main/java/org/openmrs/module/aijar/AijarActivator.java

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.openmrs.module.aijar.activator.Initializer;
3131
import org.openmrs.module.aijar.api.deploy.bundle.CommonMetadataBundle;
3232
import org.openmrs.module.aijar.api.deploy.bundle.UgandaAddressMetadataBundle;
33+
import org.openmrs.module.aijar.api.deploy.bundle.UgandaEMRPatientFlagMetadataBundle;
3334
import org.openmrs.module.aijar.metadata.core.PatientIdentifierTypes;
3435
import org.openmrs.module.appframework.service.AppFrameworkService;
3536
import org.openmrs.module.dataexchange.DataImporter;
@@ -102,7 +103,7 @@ public void started() {
102103
appFrameworkService.disableApp("coreapps.latestObsForConceptList");
103104
appFrameworkService.disableApp("coreapps.obsAcrossEncounters");
104105
appFrameworkService.disableApp("coreapps.obsGraph");
105-
appFrameworkService.disableApp("coreapps.visitByEncounterType");
106+
appFrameworkService.enableApp("coreapps.visitByEncounterType");
106107
appFrameworkService.disableApp("coreapps.dataIntegrityViolations");
107108

108109
// enable the relationships dashboard widget
@@ -149,15 +150,15 @@ public void started() {
149150

150151
// generate OpenMRS ID for patients without the identifier
151152
generateOpenMRSIdentifierForPatientsWithout();
152-
153+
log.info("aijar Module started");
153154

154155
} catch (Exception e) {
155156
Module mod = ModuleFactory.getModuleById("aijar");
156157
ModuleFactory.stopModule(mod);
157158
throw new RuntimeException("failed to setup the module ", e);
158159
}
159160

160-
log.info("aijar Module started");
161+
161162
}
162163

163164
/**
@@ -331,35 +332,15 @@ private void installCommonMetadata(MetadataDeployService deployService) {
331332
deployService.installBundle(Context.getRegisteredComponents(UgandaAddressMetadataBundle.class).get(0));
332333
log.info("Finished installing addresshierarchy");
333334

334-
// retire concepts that are duplicated in the
335-
// concept metadata package
336-
/*ConceptService conceptService = Context.getConceptService();
337-
List<String> conceptsToRetire = Arrays.asList("8b64f9e1-196a-4802-a287-fd160fb97002", // YES
338-
"b1629d9a-91a5-4895-b6bc-647f3a944534" // NO
339-
, "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // YES
340-
, "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // NO
341-
, "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // UNKNOWN
342-
, "1499AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // MODERATE
343-
, "1500AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // SEVERE
344-
, "1734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // YEARS
345-
, "111633AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // URINARY TRACT INFECTION
346-
, "117543AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // HERPES ZOSTER
347-
);
348-
for (String uuid : conceptsToRetire) {
349-
Concept concept = conceptService.getConceptByUuid(uuid);
350-
if (concept != null) {
351-
// retire the concept
352-
log.info("Retiring concept " + concept.toString());
353-
conceptService.retireConcept(concept, "Duplicated in MDS import");
354-
log.info("Retired concept " + concept.toString());
355-
}
356-
}*/
357-
358335
// install concepts
359336
log.info("Installing standard metadata using the packages.xml file");
360337
MetadataUtil.setupStandardMetadata(getClass().getClassLoader());
361338
log.info("Standard metadata installed");
362339

340+
log.info("Installing patient flags");
341+
deployService.installBundle(Context.getRegisteredComponents(UgandaEMRPatientFlagMetadataBundle.class).get(0));
342+
log.info("Finished installing patient flags");
343+
363344
} catch (Exception e) {
364345
Module mod = ModuleFactory.getModuleById("aijar");
365346
ModuleFactory.stopModule(mod);

api/src/main/java/org/openmrs/module/aijar/api/deploy/bundle/CommonMetadataBundle.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
import org.springframework.stereotype.Component;
77

88
/**
9-
* Installs the most common metadata
10-
* <p/>
11-
* Created by ssmusoke on 06/01/2016.
9+
* Installs the common metadata
1210
*/
1311
@Component
1412
public class CommonMetadataBundle extends AbstractMetadataBundle {
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package org.openmrs.module.aijar.api.deploy.bundle;
2+
3+
import org.openmrs.module.aijar.metadata.core.Flags;
4+
import org.openmrs.module.aijar.metadata.core.Priorites;
5+
import org.openmrs.module.aijar.metadata.core.Tags;
6+
import org.openmrs.module.metadatadeploy.bundle.AbstractMetadataBundle;
7+
import org.openmrs.module.patientflags.metadatadeploy.bundle.PatientFlagMetadataBundle;
8+
import org.springframework.stereotype.Component;
9+
10+
11+
/**
12+
* Installs metadata for Patient Flags
13+
*/
14+
@Component
15+
public class UgandaEMRPatientFlagMetadataBundle extends PatientFlagMetadataBundle {
16+
17+
/**
18+
* @see AbstractMetadataBundle#install()
19+
*/
20+
public void install() throws Exception {
21+
// Tags
22+
log.info("Installing Patient flag tags");
23+
install(Tags.PATIENT_STATUS);
24+
25+
// Priorites
26+
log.info("Installing patient flag priorities");
27+
install(Priorites.GREEN);
28+
install(Priorites.RED);
29+
install(Priorites.ORANGE);
30+
31+
// Flags
32+
log.info("Installing flags");
33+
install(Flags.DUE_FOR_FIRST_VIRAL_LOAD);
34+
install(Flags.OVERDUE_FOR_FIRST_VIRAL_LOAD);
35+
install(Flags.MISSED_APPOINTMENT);
36+
install(Flags.UPCOMING_APPOINTMENT);
37+
install(Flags.PATIENT_LOST);
38+
install(Flags.PATIENT_LOST_TO_FOLLOWUP);
39+
install(Flags.DUE_FOR_ROUTINE_VIRAL_LOAD);
40+
install(Flags.OVERDUE_FOR_ROUTINE_VIRAL_LOAD);
41+
install(Flags.DUE_FOR_FIRST_DNA_PCR);
42+
install(Flags.OVERDUE_FOR_FIRST_DNA_PCR);
43+
install(Flags.DUE_FOR_SECOND_DNA_PCR);
44+
install(Flags.OVERDUE_FOR_SECOND_DNA_PCR);
45+
install(Flags.DUE_FOR_RAPID_TEST);
46+
install(Flags.OVERDUE_FOR_RAPID_TEST);
47+
}
48+
}

0 commit comments

Comments
 (0)