diff --git a/api/src/main/java/org/openmrs/module/ugandaemr/activator/JsonFormsInitializer.java b/api/src/main/java/org/openmrs/module/ugandaemr/activator/JsonFormsInitializer.java index b779bd256..1473cfa6b 100644 --- a/api/src/main/java/org/openmrs/module/ugandaemr/activator/JsonFormsInitializer.java +++ b/api/src/main/java/org/openmrs/module/ugandaemr/activator/JsonFormsInitializer.java @@ -120,7 +120,7 @@ protected void load(File file) throws Exception { throw new Exception("Form Version is required"); } - String uuid = generateUuidFromObjects(AMPATH_FORMS_UUID, formName, formVersion); + String uuid = (String) jsonFile.get("uuid"); // Process Form // ISSUE-150 If form with uuid present then update it Form form = formService.getFormByUuid(uuid); @@ -181,13 +181,7 @@ protected void load(File file) throws Exception { if (needToSaveForm) { formService.saveForm(form); } - } else if (formService.getForm(formName) != null) { // ISSUE-150 If form with name present then retire it and - // create a new one - form = formService.getForm(formName); - formService.retireForm(form, "Replaced with new version by Iniz"); - createNewForm(uuid, formName, formDescription, formPublished, formRetired, encounterType, formVersion, - jsonString); - } else {// ISSUE-150 Create new form + }else { createNewForm(uuid, formName, formDescription, formPublished, formRetired, encounterType, formVersion, jsonString); } @@ -195,7 +189,6 @@ protected void load(File file) throws Exception { private void createNewForm(String uuid, String formName, String formDescription, Boolean formPublished, Boolean formRetired, EncounterType encounterType, String formVersion, String jsonString) { - DatatypeService datatypeService = Context.getDatatypeService(); FormService formService = Context.getFormService(); String clobUuid = UUID.randomUUID().toString(); Form newForm = new Form(); @@ -206,7 +199,6 @@ private void createNewForm(String uuid, String formName, String formDescription, newForm.setRetired(formRetired); newForm.setPublished(formPublished); newForm.setEncounterType(encounterType); - newForm = formService.saveForm(newForm); createFormResource(newForm, clobUuid, jsonString); } @@ -222,19 +214,12 @@ private void createFormResource(Form form, String clobUuid, String jsonString) { formResource.setValueReferenceInternal(clobUuid); formResource.setDatatypeClassname("AmpathJsonSchema"); formService.saveFormResource(formResource); - ClobDatatypeStorage clobData = new ClobDatatypeStorage(); clobData.setUuid(clobUuid); clobData.setValue(jsonString); datatypeService.saveClobDatatypeStorage(clobData); } - private static String generateUuidFromObjects(Object... args) { - String seed = Arrays.stream(args).map(arg -> arg == null ? "null" : arg.toString()).collect(Collectors.joining("_")); - String uuid = UUID.nameUUIDFromBytes(seed.getBytes()).toString(); - return uuid; - } - public String getProviderName() { return this.providerName; } diff --git a/api/src/main/resources/liquibase.xml b/api/src/main/resources/liquibase.xml index 72d757891..0ef996629 100644 --- a/api/src/main/resources/liquibase.xml +++ b/api/src/main/resources/liquibase.xml @@ -913,6 +913,18 @@ VALUES UPDATE drug SET name = 'Abacavir 300 mg', dosage_form = 1513,concept_id = 814 WHERE drug_id = 3 and concept_id=165507; + + + + + select count(*) from concept where concept_id=175384; + + + Migrate data from other patient decision concept to rightful TB refferrall concept + + UPDATE obs SET concept_id = 175384 where concept_id=164435; + + diff --git a/api/src/main/resources/metadata/concepts_and_drugs/Concept.xml b/api/src/main/resources/metadata/concepts_and_drugs/Concept.xml index e49d70220..210d6fae9 100644 --- a/api/src/main/resources/metadata/concepts_and_drugs/Concept.xml +++ b/api/src/main/resources/metadata/concepts_and_drugs/Concept.xml @@ -1140,7 +1140,7 @@ - + diff --git a/api/src/main/resources/metadata/concepts_and_drugs/Concept_Answer.xml b/api/src/main/resources/metadata/concepts_and_drugs/Concept_Answer.xml index e912a2508..2b1f7b1d9 100644 --- a/api/src/main/resources/metadata/concepts_and_drugs/Concept_Answer.xml +++ b/api/src/main/resources/metadata/concepts_and_drugs/Concept_Answer.xml @@ -604,7 +604,7 @@ - + diff --git a/api/src/main/resources/metadata/concepts_and_drugs/Concept_Description.xml b/api/src/main/resources/metadata/concepts_and_drugs/Concept_Description.xml index 66d35a648..ac33207df 100644 --- a/api/src/main/resources/metadata/concepts_and_drugs/Concept_Description.xml +++ b/api/src/main/resources/metadata/concepts_and_drugs/Concept_Description.xml @@ -336,7 +336,7 @@ - + diff --git a/api/src/main/resources/metadata/concepts_and_drugs/Concept_Name.xml b/api/src/main/resources/metadata/concepts_and_drugs/Concept_Name.xml index a9dbaf33d..0d0174221 100644 --- a/api/src/main/resources/metadata/concepts_and_drugs/Concept_Name.xml +++ b/api/src/main/resources/metadata/concepts_and_drugs/Concept_Name.xml @@ -1199,11 +1199,11 @@ - - - - - + + + + + @@ -5491,7 +5491,6 @@ - diff --git a/api/src/main/resources/metadata/concepts_and_drugs/Concept_Reference.xml b/api/src/main/resources/metadata/concepts_and_drugs/Concept_Reference.xml index b1962aa43..65e34797f 100644 --- a/api/src/main/resources/metadata/concepts_and_drugs/Concept_Reference.xml +++ b/api/src/main/resources/metadata/concepts_and_drugs/Concept_Reference.xml @@ -150,8 +150,6 @@ - - @@ -614,8 +612,6 @@ - - diff --git a/api/src/main/resources/metadata/concepts_and_drugs/Drug.xml b/api/src/main/resources/metadata/concepts_and_drugs/Drug.xml index 72ede0b52..30e9dfed3 100644 --- a/api/src/main/resources/metadata/concepts_and_drugs/Drug.xml +++ b/api/src/main/resources/metadata/concepts_and_drugs/Drug.xml @@ -3,8 +3,6 @@ - - diff --git a/omod/src/main/webapp/resources/htmlforms/003-HMIS_ACP_ARTCard-FamilyTracking .xml b/omod/src/main/webapp/resources/htmlforms/003-HMIS_ACP_ARTCard-FamilyTracking .xml index 9af4b0041..dc9f65922 100644 --- a/omod/src/main/webapp/resources/htmlforms/003-HMIS_ACP_ARTCard-FamilyTracking .xml +++ b/omod/src/main/webapp/resources/htmlforms/003-HMIS_ACP_ARTCard-FamilyTracking .xml @@ -2,7 +2,7 @@ formDescription="Summary entry form for patients enrolled for ART" formEncounterType="591cba6a-5c5f-11ee-8c99-0242ac120002" formUuid="f2722150-5c5f-11ee-8c99-0242ac120002" - formVersion="3.4.2" + formVersion="4.0.0" formAddMetadata="yes" formUILocation="patientDashboard.visitActions" formOrder="1" diff --git a/omod/src/main/webapp/resources/htmlforms/003-HMIS_ACP_ARTCard-SummaryPage .xml b/omod/src/main/webapp/resources/htmlforms/003-HMIS_ACP_ARTCard-SummaryPage .xml index 2ba789e11..f31b4b463 100644 --- a/omod/src/main/webapp/resources/htmlforms/003-HMIS_ACP_ARTCard-SummaryPage .xml +++ b/omod/src/main/webapp/resources/htmlforms/003-HMIS_ACP_ARTCard-SummaryPage .xml @@ -2,7 +2,7 @@ formDescription="Summary entry form for patients enrolled for ART" formEncounterType="8d5b27bc-c2cc-11de-8d13-0010c6dffd0f" formUuid="52653a60-8300-4c13-be4d-4b746da06fee" - formVersion="3.0" + formVersion="4.0.0" formAddMetadata="yes" formUILocation="patientDashboard.visitActions" formOrder="1" diff --git a/omod/src/main/webapp/resources/htmlforms/031-OutPatientRegister.xml b/omod/src/main/webapp/resources/htmlforms/031-OutPatientRegister.xml index 2d5f48c0d..5247b9b0f 100644 --- a/omod/src/main/webapp/resources/htmlforms/031-OutPatientRegister.xml +++ b/omod/src/main/webapp/resources/htmlforms/031-OutPatientRegister.xml @@ -2,7 +2,7 @@ formDescription="HMIS 031 Outpatient (OPD) Form" formEncounterType="ee4780f5-b5eb-423b-932f-00b5879df5ab" formUuid="8c2f8378-51c7-4407-85a0-cb2832accfcf" - formVersion="1.0" + formVersion="4.0.0" formAddMetadata="yes" formUILocation="patientDashboard.visitActions" formOrder="7" @@ -170,11 +170,24 @@ $allRows.hide(); jq('#1-removeEntry').remove(); jq('#10-addEntry').remove(); + jq('#1-toggleDiagnosisContainer').show(); + + jq('#11-removeEntry').remove(); + jq('#20-addEntry').remove(); + jq('#11-toggleDiagnosisContainer').show(); + }); + + jq(document).ready(function () { + $allRows = jq(this).find('.multi-drug'); + $allRows.hide(); + jq('#1-removeEntry').remove(); + jq('#10-addEntry').remove(); jq('#1-toggleContainer').show(); jq('#11-removeEntry').remove(); jq('#20-addEntry').remove(); jq('#11-toggleContainer').show(); + }); jQuery(document).ready(function (jq) { @@ -244,6 +257,7 @@ } }); + jq(document).ready(function () { $allRows = jq(this).find('.multi-drug'); $allRows.hide(); @@ -254,13 +268,13 @@ jq('#20-addEntry').remove(); jq('#11-toggleContainer').show(); for (let x = 0; x<= 10; x++) { - if (jq(this).find('#other-meds-trigger-' + x).find("input[type$='text']").val()!='') { - jq(this).find('#' + x + '-toggleContainer').show(); - jq(this).find('#' + x + '-addEntry').hide(); + if (jq(this).find('#' +x+ '-drug').find("input[type$='text']").val()!='') { + jq(this).find('#' +x+ '-toggleContainer').show(); + jq(this).find('#' +x+ '-addEntry').hide(); } else { x-=1; - jq(this).find('#' + x + '-addEntry').show(); + jq(this).find('#' +x+ '-addEntry').show(); break; } } @@ -272,13 +286,13 @@ $allRows.hide(); jq('#1-removeEntry').remove(); jq('#10-addEntry').remove(); - jq('#1-toggleContainer').show(); + jq('#1-toggleDiagnosisContainer').show(); jq('#11-removeEntry').remove(); jq('#20-addEntry').remove(); - jq('#11-toggleContainer').show(); + jq('#11-toggleDiagnosisContainer').show(); for (let x = 0; x<= 10; x++) { if (jq(this).find('#' +x+ '-problem-trigger').find("input[type$='text']").val()!='') { - jq(this).find('#' +x+ '-toggleContainer').show(); + jq(this).find('#' +x+ '-toggleDiagnosisContainer').show(); jq(this).find('#' +x+ '-addEntry').hide(); } else { @@ -362,8 +376,6 @@ var enableStockManagement = ; - - jq(document).ready(function () { currentLocationUUID = getLocationByName(jq("#location_id").find("select").find(":selected").text()) @@ -474,7 +486,6 @@ } }); - function getDrugByConcept(concept, drug_strength_id) { if (enableStockManagement) { jq("#" + drug_strength_id + "").find("select").empty(); @@ -497,7 +508,6 @@ } } } - function getLocationByName(locationName) { var locationUUID jq.ajax({ @@ -511,8 +521,6 @@ }); return locationUUID } - - function getEncountersByEncounterTypeUUID(patientUUID, encounterTypeUUID) { var serverResponse = []; jq.ajax({ @@ -686,7 +694,7 @@