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

Dmhtn #25

Open
wants to merge 10 commits into
base: 2.x
Choose a base branch
from
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>patientdashboardapp</artifactId>
<version>2.0.1-SNAPSHOT</version>
<version>1.0.8-SNAPSHOT</version>
</parent>

<artifactId>patientdashboardapp-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public static List<Option> getAvailableOutcomes() {
options.add(new Option(CURED_OPTION, null, "Discharged"));
options.add(new Option(FOLLOW_UP_OPTION, null, "Next Appointment Date"));
options.add(new Option(ADMIT_OPTION, null, "Admit"));
options.add(new Option(REFERRAL_OPTION,null,"Referral"));
options.add(new Option(DIED_OPTION, null, "Died"));
options.add(new Option(REFERRAL_OPTION, null, "Referral"));
return options;
Expand Down
2 changes: 1 addition & 1 deletion omod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>patientdashboardapp</artifactId>
<version>2.0.1-SNAPSHOT</version>
<version>1.0.8-SNAPSHOT</version>
</parent>

<artifactId>patientdashboardapp-omod</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@


import org.apache.commons.lang.StringEscapeUtils;
import org.openmrs.Concept;
import org.openmrs.ConceptAnswer;
import org.openmrs.ConceptSet;
import org.openmrs.*;
import org.openmrs.api.context.Context;
import org.openmrs.module.hospitalcore.BillingService;
import org.openmrs.module.hospitalcore.InventoryCommonService;
Expand All @@ -25,9 +23,7 @@
import org.openmrs.ui.framework.fragment.FragmentModel;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.*;

/**
*
Expand Down Expand Up @@ -151,4 +147,47 @@ public List<SimpleObject> getDrugUnit(UiUtils uiUtils){
}
return SimpleObject.fromCollection(drugUnitOptions,uiUtils,"id","label", "uuid") ;
}

public List<SimpleObject> examination(@RequestParam("findingQuery") String findingQuery) {
List<ConceptClass> requiredConceptClasses = Arrays.asList(Context.getConceptService().getConceptClassByName(
"Diagnosis"), Context.getConceptService().getConceptClassByName("Anatomy"));
List<ConceptDatatype> requiredConceptDataTypes = Arrays.asList(
Context.getConceptService().getConceptDatatypeByName("Coded"), Context.getConceptService()
.getConceptDatatypeByName("Text"));
List<Locale> locales = new ArrayList<Locale>();
locales.add(Context.getLocale());
List<ConceptSearchResult> possibleMatches = Context.getConceptService().getConcepts(findingQuery, locales, false,
requiredConceptClasses, null, requiredConceptDataTypes, null, null, null, null);
List<SimpleObject> searchResults = new ArrayList<SimpleObject>();

for (ConceptSearchResult conceptSearchResult : possibleMatches) {
Concept concept = conceptSearchResult.getConcept();
SimpleObject finding = new SimpleObject();

String text_name = "";
String text_type = "hidden";

finding.put("value", concept.getUuid());
finding.put("label", concept.getName().getName());

if (concept.getDatatype().getName().equals("Text")) {
text_type = "text";
text_name = "concept." + concept.getUuid();
}

finding.put("text_name", text_name);
finding.put("text_type", text_type);

List<SimpleObject> findingAnswers = new ArrayList<SimpleObject>();
for (ConceptAnswer answer : concept.getAnswers()) {
SimpleObject findingAnswer = new SimpleObject();
findingAnswer.put("uuid", answer.getAnswerConcept().getUuid());
findingAnswer.put("display", answer.getAnswerConcept().getName().getName());
findingAnswers.add(findingAnswer);
}
finding.put("answers", findingAnswers);
searchResults.add(finding);
}
return searchResults;
}
}
26 changes: 25 additions & 1 deletion omod/src/main/webapp/fragments/clinicalNotes.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,30 @@ ${ ui.includeFragment("patientdashboardapp", "patientDashboardAppScripts", [note
</p>
</fieldset>

<fieldset class="no-confirmation">
<legend>Systemic Examinations</legend>
<div style="padding: 0 4px">

<div>
<label for="searchExaminations" class="label title-label">Systematic Examinations <span class="important"></span></label>
<input type="text" id="searchExaminations" name="" value="" placeholder="Add Examination"/>
<field>
<input type="hidden" id="exams-set" class=""/>
<span id="exams-lbl" class="field-error" style="display: none"></span>
</field>

<div class="tasks" id="task-exams" style="display:none;">
<header class="tasks-header">
<span id="title-symptom" class="tasks-title">PATIENT'S EXAMINATIONS</span>
<a class="tasks-lists"></a>
</header>

<div id="exams-holder"></div>
</div>
</div>
</div>
</fieldset>

<fieldset class="no-confirmation">
<legend>Diagnosis</legend>
<div>
Expand Down Expand Up @@ -569,4 +593,4 @@ ${ ui.includeFragment("patientdashboardapp", "patientDashboardAppScripts", [note
<script>
var prescription = {drug: ko.observable(new Drug())};
ko.applyBindings(prescription, jq("#prescription-dialog")[0]);
</script>
</script>
34 changes: 19 additions & 15 deletions omod/src/main/webapp/fragments/triageInfo.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -161,64 +161,68 @@ jq(function(){

<div class="info-body" >
<label><span class="status active"></span>Temperature:</label>
<span>${triage?.temperature?:"Not Captured"}</span>
<% if (triage?.temperature > 38) {%>
<span style="background-color: red;" >${triage?.temperature?:"-"}</span>
<%} else {%>
<span>${triage?.temperature?:"-"}</span>
<%}%>
<br>

<label><span class="status active"></span>Blood Pressure:</label>
<span>${ triage?.systolic && triage?.daistolic ? triage?.systolic + "/" + triage?.daistolic : "Not Captured" }</span>
<span>${ triage?.systolic && triage?.daistolic ? triage?.systolic + "/" + triage?.daistolic : "-" }</span>
<br>

<label><span class="status active"></span>Respiratory Rate:</label>
<span>${triage?.respiratoryRate?:"Not Captured"}</span>
<span>${triage?.respiratoryRate?:"-"}</span>
<br>

<label><span class="status active"></span>Pulse Rate:</label>
<span>${triage?.pulsRate?:"Not Captured"}</span>
<span>${triage?.pulsRate?:"-"}</span>
<br>

<% if (patient.gender == "F" && patient.age > 10) {%>
<label><span class="status active"></span>Last Periods:</label>
<span id="lastPeriods">${triage?.lastMenstrualDate ? ui.formatDatePretty(triage?.lastMenstrualDate): "Not Captured"}</span>
<span id="lastPeriods">${triage?.lastMenstrualDate ? ui.formatDatePretty(triage?.lastMenstrualDate): "-"}</span>
<br>
<% } %>

<label><span class="status active"></span>Oxygen Saturation:</label>
<span>${triage?.oxygenSaturation? triage.oxygenSaturation.toString() + "%": "Not Captured"}</span>
<span>${triage?.oxygenSaturation? triage.oxygenSaturation.toString() + "%": "-"}</span>
<br>

<label><span class="status active"></span>Height:</label>
<span>${triage?.height?:"Not Captured"}</span>
<label><span class="status active"></span>Height(cm):</label>
<span>${triage?.height?:"-"}</span>
<br>

<label><span class="status active"></span>Weight:</label>
<span>${triage?.weight?:"Not Captured"}</span>
<span>${triage?.weight?:"-"}</span>
<br>

<% if (patient.age >= 2) {%>
<label><span class="status active"></span>BMI:</label>
<span>${(triage && triage.weight && triage.height) ? formatter.format(triage?.weight/((triage?.height/100) * (triage?.height/100))) : "Not Captured"}</span>
<span>${(triage && triage.weight && triage.height) ? formatter.format(triage?.weight/((triage?.height/100) * (triage?.height/100))) : "-"}</span>
<br>
<% } %>

<label><span class="status active"></span>M.U.A Circum:</label>
<span>${triage?.mua?:"Not Captured"}</span>
<span>${triage?.mua?:"-"}</span>
<br>

<label><span class="status active"></span>Chest Circum:</label>
<span>${triage?.chest?:"Not Captured"}</span>
<span>${triage?.chest?:"-"}</span>
<br>

<label><span class="status active"></span>Abdominal Circum:</label>
<span>${triage?.abdominal?:"Not Captured"}</span>
<span>${triage?.abdominal?:"-"}</span>
<br>


<label><span class="status active"></span>Blood Group:</label>
<span>${triage?.bloodGroup && triage?.rhesusFactor ? triage?.bloodGroup + "/" + triage?.rhesusFactor : "Not Captured"}</span>
<span>${triage?.bloodGroup && triage?.rhesusFactor ? triage?.bloodGroup + "/" + triage?.rhesusFactor : "-"}</span>
<br>

<label><span class="status active"></span>HIV Status:</label>
<span>${triage?.pitct ?: "Not Captured"}</span>
<span>${triage?.pitct ?: "-"}</span>
<br>
</div>
</div>
Expand Down
22 changes: 11 additions & 11 deletions omod/src/main/webapp/pages/main.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -286,22 +286,22 @@

<div class="dashboard-tabs">
<ul>
<li id="cn"><a href="#notes">Clinical Notes</a></li>
<li id="ti"><a href="#triage-info">Triage Information</a></li>
<li id="ch"><a href="#summary">Clinical History</a></li>
<li id="ti"><a href="#triage-info">Triage Information</a></li>
<li id="ch"><a href="#summary">Clinical History</a></li>
<li id="cn"><a href="#notes">Clinical Notes</a></li>
<li id="lr"><a href="#investigations">Lab Reports</a></li>
<li id="rr"><a href="#radiology">Radiology Reports</a></li>
</ul>
<div id="notes">
${ ui.includeFragment("patientdashboardapp", "clinicalNotes", [patientId: patientId, opdId: opdId, queueId: queueId, opdLogId: opdLogId]) }
</div>
<div id="triage-info">
${ ui.includeFragment("patientdashboardapp", "triageInfo", [patientId: patientId, opdId: opdId, queueId: queueId]) }
</div>

<div id="triage-info">
${ ui.includeFragment("patientdashboardapp", "triageInfo", [patientId: patientId, opdId: opdId, queueId: queueId]) }
</div>
<div id="summary">
${ ui.includeFragment("patientdashboardapp", "visitSummary", [patientId: patientId]) }
</div>

<div id="summary">
${ ui.includeFragment("patientdashboardapp", "visitSummary", [patientId: patientId]) }
<div id="notes">
${ ui.includeFragment("patientdashboardapp", "clinicalNotes", [patientId: patientId, opdId: opdId, queueId: queueId, opdLogId: opdLogId]) }
</div>

<div id="investigations">
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.openmrs.module</groupId>
<artifactId>patientdashboardapp</artifactId>
<version>2.0.1-SNAPSHOT</version>
<version>1.0.8-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Patient Dashboard App Module</name>
<description>Useful functionality and summary for the patient</description>
Expand Down Expand Up @@ -42,7 +42,7 @@
<appuiVersion>1.8.0</appuiVersion>
<kenyaemrVersion>17.0.3</kenyaemrVersion>
<jodaTimeVersion>2.9.1</jodaTimeVersion>
<ehrconfigisVersion>2.0.0</ehrconfigisVersion>
<ehrconfigisVersion>1.1.1</ehrconfigisVersion>
<metadatadeployVersion>1.3</metadatadeployVersion>
<ehrlaboratoryVersion>2.0.0</ehrlaboratoryVersion>

Expand Down