Skip to content

Commit

Permalink
Add the ability to show patient status information on the dashboard b…
Browse files Browse the repository at this point in the history
…ased 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
  • Loading branch information
ssmusoke authored and slubwama committed Jan 23, 2018
1 parent 0b3d118 commit d54b25c
Show file tree
Hide file tree
Showing 11 changed files with 816 additions and 56 deletions.
5 changes: 5 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@
<artifactId>providermanagement-api</artifactId>
</dependency>

<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>patientflags-api</artifactId>
</dependency>

<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>registrationcore-api</artifactId>
Expand Down
35 changes: 8 additions & 27 deletions api/src/main/java/org/openmrs/module/aijar/AijarActivator.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.openmrs.module.aijar.activator.Initializer;
import org.openmrs.module.aijar.api.deploy.bundle.CommonMetadataBundle;
import org.openmrs.module.aijar.api.deploy.bundle.UgandaAddressMetadataBundle;
import org.openmrs.module.aijar.api.deploy.bundle.UgandaEMRPatientFlagMetadataBundle;
import org.openmrs.module.aijar.metadata.core.PatientIdentifierTypes;
import org.openmrs.module.appframework.service.AppFrameworkService;
import org.openmrs.module.dataexchange.DataImporter;
Expand Down Expand Up @@ -102,7 +103,7 @@ public void started() {
appFrameworkService.disableApp("coreapps.latestObsForConceptList");
appFrameworkService.disableApp("coreapps.obsAcrossEncounters");
appFrameworkService.disableApp("coreapps.obsGraph");
appFrameworkService.disableApp("coreapps.visitByEncounterType");
appFrameworkService.enableApp("coreapps.visitByEncounterType");
appFrameworkService.disableApp("coreapps.dataIntegrityViolations");

// enable the relationships dashboard widget
Expand Down Expand Up @@ -149,15 +150,15 @@ public void started() {

// generate OpenMRS ID for patients without the identifier
generateOpenMRSIdentifierForPatientsWithout();

log.info("aijar Module started");

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

log.info("aijar Module started");

}

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

// retire concepts that are duplicated in the
// concept metadata package
/*ConceptService conceptService = Context.getConceptService();
List<String> conceptsToRetire = Arrays.asList("8b64f9e1-196a-4802-a287-fd160fb97002", // YES
"b1629d9a-91a5-4895-b6bc-647f3a944534" // NO
, "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // YES
, "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // NO
, "1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // UNKNOWN
, "1499AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // MODERATE
, "1500AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // SEVERE
, "1734AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // YEARS
, "111633AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // URINARY TRACT INFECTION
, "117543AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" // HERPES ZOSTER
);
for (String uuid : conceptsToRetire) {
Concept concept = conceptService.getConceptByUuid(uuid);
if (concept != null) {
// retire the concept
log.info("Retiring concept " + concept.toString());
conceptService.retireConcept(concept, "Duplicated in MDS import");
log.info("Retired concept " + concept.toString());
}
}*/

// install concepts
log.info("Installing standard metadata using the packages.xml file");
MetadataUtil.setupStandardMetadata(getClass().getClassLoader());
log.info("Standard metadata installed");

log.info("Installing patient flags");
deployService.installBundle(Context.getRegisteredComponents(UgandaEMRPatientFlagMetadataBundle.class).get(0));
log.info("Finished installing patient flags");

} catch (Exception e) {
Module mod = ModuleFactory.getModuleById("aijar");
ModuleFactory.stopModule(mod);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
import org.springframework.stereotype.Component;

/**
* Installs the most common metadata
* <p/>
* Created by ssmusoke on 06/01/2016.
* Installs the common metadata
*/
@Component
public class CommonMetadataBundle extends AbstractMetadataBundle {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package org.openmrs.module.aijar.api.deploy.bundle;

import org.openmrs.module.aijar.metadata.core.Flags;
import org.openmrs.module.aijar.metadata.core.Priorites;
import org.openmrs.module.aijar.metadata.core.Tags;
import org.openmrs.module.metadatadeploy.bundle.AbstractMetadataBundle;
import org.openmrs.module.patientflags.metadatadeploy.bundle.PatientFlagMetadataBundle;
import org.springframework.stereotype.Component;


/**
* Installs metadata for Patient Flags
*/
@Component
public class UgandaEMRPatientFlagMetadataBundle extends PatientFlagMetadataBundle {

/**
* @see AbstractMetadataBundle#install()
*/
public void install() throws Exception {
// Tags
log.info("Installing Patient flag tags");
install(Tags.PATIENT_STATUS);

// Priorites
log.info("Installing patient flag priorities");
install(Priorites.GREEN);
install(Priorites.RED);
install(Priorites.ORANGE);

// Flags
log.info("Installing flags");
install(Flags.DUE_FOR_FIRST_VIRAL_LOAD);
install(Flags.OVERDUE_FOR_FIRST_VIRAL_LOAD);
install(Flags.MISSED_APPOINTMENT);
install(Flags.UPCOMING_APPOINTMENT);
install(Flags.PATIENT_LOST);
install(Flags.PATIENT_LOST_TO_FOLLOWUP);
install(Flags.DUE_FOR_ROUTINE_VIRAL_LOAD);
install(Flags.OVERDUE_FOR_ROUTINE_VIRAL_LOAD);
install(Flags.DUE_FOR_FIRST_DNA_PCR);
install(Flags.OVERDUE_FOR_FIRST_DNA_PCR);
install(Flags.DUE_FOR_SECOND_DNA_PCR);
install(Flags.OVERDUE_FOR_SECOND_DNA_PCR);
install(Flags.DUE_FOR_RAPID_TEST);
install(Flags.OVERDUE_FOR_RAPID_TEST);
}
}
Loading

0 comments on commit d54b25c

Please sign in to comment.