From 2950f0291b0697902faf062e9db5e045b4c619fa Mon Sep 17 00:00:00 2001 From: injiri Date: Mon, 21 Mar 2022 20:06:46 +0300 Subject: [PATCH] add drug dosage route to the prescription dialog --- .../patientdashboardapp/model/Drug.java | 11 +- .../ClinicalNotesFragmentController.java | 8 + .../main/webapp/fragments/clinicalNotes.gsp | 4 + .../fragments/patientDashboardAppScripts.gsp | 1350 ++++++++--------- .../src/main/webapp/resources/scripts/note.js | 8 + 5 files changed, 700 insertions(+), 681 deletions(-) diff --git a/api/src/main/java/org/openmrs/module/patientdashboardapp/model/Drug.java b/api/src/main/java/org/openmrs/module/patientdashboardapp/model/Drug.java index c55cbf8..3965af4 100644 --- a/api/src/main/java/org/openmrs/module/patientdashboardapp/model/Drug.java +++ b/api/src/main/java/org/openmrs/module/patientdashboardapp/model/Drug.java @@ -19,6 +19,7 @@ public class Drug { private String comment; private String dosage; private Option drugUnit; + private Option route; public Option getDrugUnit() { return drugUnit; @@ -59,10 +60,10 @@ public String getComment() { public void setComment(String comment) { this.comment = comment; } - public void setDosage(String dosage){ - this.dosage = dosage; - } - + public void setDosage(String dosage){ this.dosage = dosage; } + public Option getRoute() { return route; } + public void setRoute(Option route) { this.route = route; } + public void save(Encounter encounter, String referralWardName) { InventoryCommonService inventoryCommonService = Context.getService(InventoryCommonService.class); InventoryDrug inventoryDrug = inventoryCommonService.getDrugByName(this.drugName); @@ -78,6 +79,8 @@ public void save(Encounter encounter, String referralWardName) { opdDrugOrder.setNoOfDays(this.numberOfDays); opdDrugOrder.setComments(this.comment); opdDrugOrder.setDosage(this.dosage); + /* TODO immplement opdDrugOrder.route property in hospitalcore.opdDrugOrder + opdDrugOrder.setRoute(this.route);*/ if (drugUnit !=null){ opdDrugOrder.setDosageUnit(Context.getConceptService().getConcept(this.drugUnit.getId())); } diff --git a/omod/src/main/java/org/openmrs/module/patientdashboardapp/fragment/controller/ClinicalNotesFragmentController.java b/omod/src/main/java/org/openmrs/module/patientdashboardapp/fragment/controller/ClinicalNotesFragmentController.java index b35eebf..e9643e2 100644 --- a/omod/src/main/java/org/openmrs/module/patientdashboardapp/fragment/controller/ClinicalNotesFragmentController.java +++ b/omod/src/main/java/org/openmrs/module/patientdashboardapp/fragment/controller/ClinicalNotesFragmentController.java @@ -151,4 +151,12 @@ public List getDrugUnit(UiUtils uiUtils){ } return SimpleObject.fromCollection(drugUnitOptions,uiUtils,"id","label", "uuid") ; } + + public List getDosageRoutes(UiUtils uiUtils) { + + Concept dosageRouteConcept = Context.getConceptService().getConceptByUuid("162394AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); + List dosageRouteConceptList = new ArrayList(); + dosageRouteConceptList.addAll(Context.getConceptService().getConceptsByConceptSet(dosageRouteConcept)); + return SimpleObject.fromCollection(dosageRouteConceptList, uiUtils, "id", "name", "uuid"); + } } diff --git a/omod/src/main/webapp/fragments/clinicalNotes.gsp b/omod/src/main/webapp/fragments/clinicalNotes.gsp index f8b0aca..1408212 100644 --- a/omod/src/main/webapp/fragments/clinicalNotes.gsp +++ b/omod/src/main/webapp/fragments/clinicalNotes.gsp @@ -555,6 +555,10 @@ ${ ui.includeFragment("patientdashboardapp", "patientDashboardAppScripts", [note +
  • + + +
  • diff --git a/omod/src/main/webapp/fragments/patientDashboardAppScripts.gsp b/omod/src/main/webapp/fragments/patientDashboardAppScripts.gsp index f7bf48f..4498e8c 100644 --- a/omod/src/main/webapp/fragments/patientDashboardAppScripts.gsp +++ b/omod/src/main/webapp/fragments/patientDashboardAppScripts.gsp @@ -1,677 +1,673 @@ <% - def successUrl = ui.pageLink("patientqueueapp", "opdQueue", [app: 'patientdashboardapp.opdqueue']) + def successUrl = ui.pageLink("patientqueueapp", "opdQueue", [app: 'patientdashboardapp.opdqueue']) %> diff --git a/omod/src/main/webapp/resources/scripts/note.js b/omod/src/main/webapp/resources/scripts/note.js index 977886e..3d270c1 100644 --- a/omod/src/main/webapp/resources/scripts/note.js +++ b/omod/src/main/webapp/resources/scripts/note.js @@ -191,6 +191,8 @@ function Drug() { self.dosageAndUnit = ko.computed(function(){ return self.dosage() + " " + (self.drugUnit() && self.drugUnit().label); }); + self.dosageRouteOpts = ko.observableArray([]); + self.dosageRoute = ko.observable(); } function Frequency(freqObj) { @@ -208,6 +210,12 @@ function DrugUnit(unitObj) { this.label = unitObj.label; } +function DosageRoute(dosageRoutObj){ + this.id = dosageRoutObj.id; + this.label = dosageRoutObj.label; + +} + function Outcome(outcomeObj) { this.option = new Option(outcomeObj.id,outcomeObj.label); this.followUpDate = outcomeObj.followUpDate;