Skip to content

Commit 5609036

Browse files
authored
Fix deployment of UgandaEMR module
* chnages not needed * Install common metadata and update location taggingentials * Optimize dataImporter initialization and streamline metadata imports
1 parent 3bc322d commit 5609036

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

api/src/main/java/org/openmrs/module/ugandaemr/UgandaEMRActivator.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,13 @@ public void started() {
6565
try {
6666
// enable disable apps of in coreapps
6767
ugandaEMRService.disableEnableAPPS();
68+
DataImporter dataImporter = Context.getRegisteredComponent("dataImporter", DataImporter.class);
69+
70+
// install common metadata
71+
ugandaEMRService.installCommonMetadata();
6872
GlobalProperty initialiseMetaDataOnStart = administrationService.getGlobalPropertyObject("ugandaemr.initialiseMetadataOnStart");
6973
if (initialiseMetaDataOnStart.getPropertyValue().equals("true")) {
70-
DataImporter dataImporter = Context.getRegisteredComponent("dataImporter", DataImporter.class);
74+
7175
// initialise forms and concepts and other metadata like privileges, personal attribute types
7276
importInternalMetaData(dataImporter);
7377
for (Initializer initializer : ugandaEMRService.initialiseForms()) {
@@ -78,8 +82,9 @@ public void started() {
7882
administrationService.saveGlobalProperty(initialiseMetaDataOnStart);
7983
}
8084

81-
// install common metadata
82-
ugandaEMRService.installCommonMetadata();
85+
dataImporter.importData("metadata/appointment.xml");
86+
87+
dataImporter.importData("metadata/Programs.xml");
8388

8489
// initialise primary Identifier
8590
ugandaEMRService.initializePrimaryIdentifierTypeMapping();
@@ -155,9 +160,7 @@ private void importInternalMetaData(DataImporter dataImporter) {
155160
dataImporter.importData(metaDataFilePath + "concepts_and_drugs/Concept_Modifications.xml");
156161
log.info("import to Concept Modifications Table Successful");
157162

158-
log.info("import of Drugs Starting");
159-
dataImporter.importData(metaDataFilePath + "appointment.xml");
160-
log.info("import of Drugs Successful");
163+
161164

162165
log.info("import of ICD 11 concepts Starting");
163166
dataImporter.importData(metaDataFilePath + "concepts_and_drugs/icd_11/icd_11_import_concept.xml");
@@ -235,9 +238,7 @@ private void importInternalMetaData(DataImporter dataImporter) {
235238
dataImporter.importData(metaDataFilePath + "RelationshipTypes.xml");
236239
log.info("UgandaEMR Relationship Types Imported");
237240

238-
log.info("Start import of Program related objects");
239-
dataImporter.importData(metaDataFilePath + "Programs.xml");
240-
log.info(" Program related objects Imported");
241+
241242

242243
log.info("Start import of orderFrequencies related objects");
243244
dataImporter.importData(metaDataFilePath + "order_frequency.xml");

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ public void install() throws Exception {
140140
install(LocationTags.SUPPORTIVE_SERVICE);
141141
install(LocationTags.ADMISSION);
142142
install(LocationTags.QUEUE_ROOM);
143+
install(LocationTags.LOGIN_LOCATION);
144+
install(LocationTags.VISIT_LOCATION);
145+
146+
log.info("Installing Organizations");
147+
installLocation(LocationOrganization.PARENT);
143148

144149
log.info("Installing Departments");
145150
installLocation(LocationDepartments.IPD);

api/src/main/java/org/openmrs/module/ugandaemr/metadata/core/location/LocationOrganization.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ public String description() {
2323

2424
@Override
2525
public String name() {
26-
return Context.getLocationService().getLocationByUuid("629d78e9-93e5-43b0-ad8a-48313fd99117").getName();
26+
String DEFAULT_HEALTH_CENTER_NAME = "Health Center Name";
27+
28+
org.openmrs.Location location = Context.getLocationService().getLocationByUuid("629d78e9-93e5-43b0-ad8a-48313fd99117");
29+
String name = (location != null) ? location.getName() : DEFAULT_HEALTH_CENTER_NAME;
30+
31+
return name;
2732
}
2833

2934
@Override

api/src/main/resources/liquibase.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -697,14 +697,6 @@ VALUES
697697
<comment> Updating family member's hiv unknown status concept id in obs table </comment>
698698
<sql> UPDATE obs SET value_coded = 90001 where value_coded = 165165 and concept_id = 165275; </sql>
699699
</changeSet>
700-
<changeSet id="ugandaemr-20230413-1122" author="semujju">
701-
<comment>
702-
Change htmlformentry_html_form table to UTF-8 encoding
703-
</comment>
704-
<sql>
705-
ALTER TABLE htmlformentry_html_form CONVERT TO CHARACTER SET UTF8;
706-
</sql>
707-
</changeSet>
708700
<changeSet id="ugandaemr-20230425-1730" author="dbaluku">
709701
<comment>
710702
next gen reports uuids for exchange

0 commit comments

Comments
 (0)