Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add drug dosage route to the prescription dialog #28

Draft
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class Drug {
private String comment;
private String dosage;
private Option drugUnit;
private Option route;

public Option getDrugUnit() {
return drugUnit;
Expand Down Expand Up @@ -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);
Expand All @@ -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()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,12 @@ public List<SimpleObject> getDrugUnit(UiUtils uiUtils){
}
return SimpleObject.fromCollection(drugUnitOptions,uiUtils,"id","label", "uuid") ;
}

public List<SimpleObject> getDosageRoutes(UiUtils uiUtils) {

Concept dosageRouteConcept = Context.getConceptService().getConceptByUuid("162394AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
List<Concept> dosageRouteConceptList = new ArrayList<Concept>();
dosageRouteConceptList.addAll(Context.getConceptService().getConceptsByConceptSet(dosageRouteConcept));
return SimpleObject.fromCollection(dosageRouteConceptList, uiUtils, "id", "name", "uuid");
}
}
4 changes: 4 additions & 0 deletions omod/src/main/webapp/fragments/clinicalNotes.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,10 @@ ${ ui.includeFragment("patientdashboardapp", "patientDashboardAppScripts", [note
<label>No. 0f Days<span>*</span></label>
<input type="text" class="drug-number-of-days" data-bind="value: prescription.drug().numberOfDays">
</li>
<li>
<label>Route</label>
<select class="drug-route" data-bind="options: prescription.drug().dosageRouteOpts, value: prescription.drug().dosageRoute, optionsText: 'label', optionsCaption: 'Select Route'"><option value=""></option></select>
</li>
<li>
<label>Comment</label>
<textarea class="drug-comment" data-bind="value: prescription.drug().comment"></textarea>
Expand Down
Loading