Skip to content

Commit

Permalink
U3X-980: Ensure that the other meds are displaying in all modes (edit…
Browse files Browse the repository at this point in the history
… and add) (#375)

* U3X-980: Ensure that the other meds are displaying in all modes (edit and add)

* ensure that drungs can add and edit as well as visit-diagnosis

* Ensure results and clinical notes are displaying on art card

* Ensure that the approval process toast works fine

* make sure the vl date is set when encounter date is set

* remove unnecessory vl-=dae changes
  • Loading branch information
slubwama authored Jan 16, 2024
1 parent 001130c commit f29169a
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 55 deletions.
87 changes: 45 additions & 42 deletions omod/src/main/webapp/fragments/displayResultListOnEncounter.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
encounterId: ${encounterId}
}, function (response) {
if (response.trim() !== "{}") {
var responseData = JSON.parse(response.replace("ordersList=", "\"ordersList\":").trim());
var responseData = JSON.parse(response.replace("ordersList=", "\"ordersList\":").replace("order=", "\"order\":").trim());
displayLabResult(responseData)
}
});
Expand All @@ -28,6 +28,11 @@
});
function organize(data) {
data.filter(function (d) {
if(["Numeric", "Coded", "Text","N/A"].includes(d["set"])){
return d["set"]=d["test"];
}
})
var final = [];
var investigations = data.map(function (d) {
return d['investigation'];
Expand Down Expand Up @@ -71,57 +76,55 @@
testId: testId
}, function (response) {
if (response) {
var responseData = JSON.parse(response.replace("data=", "\"data\":").trim());
var responseData = JSON.parse(response.replace("data=", "\"data\":").replace("order=", "\"order\":").trim());
organize(responseData.data);
} else if (!response) {
}
});
}
</script>
<section sectionTag="section" id="lab-results-tab" headerTag="h1">
<div id="printSection" class="print-only">
<center>
<table class="table table-striped">
<thead>
<tr>
<th width="50%" style="text-align: left">Test</th>
<th width="15%" style="text-align: left">Result</th>
<th width="15%" style="text-align: left">Units</th>
<th width="15%" style="text-align: left">Reference Range</th>
</tr>
</thead>
<tbody data-bind="foreach: _items">
<tr>
<td data-bind="foreach: sets">
<table style="table-layout:fixed;">
<thead>
<th data-bind="text: name" style="text-align: left"></th>
</thead>
<tbody data-bind="foreach: data">
<td width="50%"
data-bind="text: '' + test" style="text-align: left"></td>
<td width="15%" data-bind="text: value" style="text-align: left"></td>
<td width="15%" data-bind="text: unit" style="text-align: left"></td>
<td width="15%" style="text-align: left">
<div data-bind="if: (lowNormal || hiNormal)">
<span data-bind="text: 'Adult/Male:' + lowNormal + '/' + hiNormal"></span>
</div>
<div class="card" id="patient-report" style="margin-top: 5px; table-layout: fixed;">
<table style="width: 100%">
<thead style="width: 100%">
<th style="width: 25%">Test</th>
<th style="width: 25%">Result</th>
<th style="width: 25%">Reference Range</th>
<th style="width: 20%">Units</th>
</thead>
</table>

<div class="card-body" data-bind="foreach: _items">
<div class="row">
<div class="col-md-12" data-bind="foreach: sets">
<div class="card" style="table-layout:fixed;">
<div class="card-header">
<label class="form-check-label" style="font-weight: bold" data-bind="attr : { 'for' : data[0].testId}"><span data-bind="text: name"></span></label>
</div>
<table data-bind="foreach: data" style="width: 100%">
<tr style="width: 100%">
<td data-bind="text: '' + test" style="width: 25%"></td>
<td data-bind="text: value" style="width: 25%"></td>
<td style="width: 25%">
<div data-bind="if: (lowNormal || hiNormal)">
<span data-bind="text: 'Normal:&nbsp;&nbsp;' + lowNormal + ' - ' + hiNormal"></span>
</div>

<div data-bind="if: (lowCritical || lowCritical)">
<span data-bind="text: 'Female:' + lowCritical + '/' + hiCritical"></span>
</div>
<div data-bind="if: (lowCritical || lowCritical)">
<span data-bind="text: 'Critical:&nbsp;&nbsp;' + lowCritical + ' - ' + hiCritical"></span>
</div>

<div data-bind="if: (lowAbsolute || hiAbsolute)">
<span data-bind="text: 'Child:' + lowAbsolute + '/' + hiAbsolute"></span>
</div>
</td>
</tbody>
<div data-bind="if: (lowAbsolute || hiAbsolute)">
<span data-bind="text: 'Absolute:&nbsp;&nbsp;' + lowAbsolute + ' - ' + hiAbsolute"></span>
</div>
</td>
<td data-bind="text: unit" style="width: 25%"></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</center>
</div>
</div>
</div>
</div>
</div>
</section>

5 changes: 5 additions & 0 deletions omod/src/main/webapp/fragments/printResults.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
});
function organize(data) {
data.filter(function (d) {
if(["Numeric", "Coded", "Text","N/A"].includes(d["set"])){
return d["set"]=d["test"];
}
})
var final = [];
var investigations = data.map(function (d) {
return d['investigation'];
Expand Down
16 changes: 15 additions & 1 deletion omod/src/main/webapp/fragments/reviewResults.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@
async: false,
success: function (response) {
serverResponse = response.results;
jq().toastmessage('showSuccessToast', "Successfuly approved "+response.results.length+" Orders");
if(response.orders && response.orders.length>0){
response.orders.forEach(function (order){
jq().toastmessage('showSuccessToast', "Successfuly approved "+order.concept.display);
})
}
jq('#review-lab-test-dialog').modal('hide').data('bs.modal', null);
jq('#review-lab-test-dialog').modal("dispose");
setTimeout(function(){
window.location.reload();
}, 6000);
},
error: function (response) {
console.log(response.responseJSON.error.message);
Expand All @@ -34,6 +43,11 @@
});
function organiseLabTest(data) {
data.filter(function (d) {
if(["Numeric", "Coded", "Text","N/A"].includes(d["set"])){
return d["set"]=d["test"];
}
})
var final = [];
var investigations = data.map(function (d) {
return d['investigation'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,17 @@

jq('#11-removeEntry').remove();
jq('#20-addEntry').remove();
jq('#11-toggleContainer').show();
jq('#11-toggleDiagnosisContainer').show();
});


jq(document).ready(function () {
jq('.addEntry').on("click", function () {
var correctedAddButtonId = parseFloat(this.id) + 1;
var contentAddId = "#" + correctedAddButtonId + "-toggleContainer";
var contentAddId = "#" + correctedAddButtonId + "-toggleContainer"
if (this.parentNode.parentNode.parentNode.classList.contains("visit-diagnosis")) {
contentAddId= "#" + correctedAddButtonId + "-toggleDiagnosisContainer";
}
jq(contentAddId).toggle(true);
jq('#' + this.id).toggle(false);
jq('#' + parseFloat(this.id) + '-removeEntry').toggle(true);
Expand All @@ -504,6 +507,10 @@
jq('.removeEntry').on("click", function () {
var correctedRemoveButtonId = parseFloat(this.id) - 1;
var contentAddId = "#" + parseFloat(this.id) + "-toggleContainer";

if (this.parentNode.parentNode.parentNode.classList.contains("visit-diagnosis")) {
contentAddId= "#" + correctedAddButtonId + "-toggleDiagnosisContainer";
}
jq(contentAddId).toggle(false);
jq(':input:not(:button)', contentAddId).val([]);
jq('#' + correctedRemoveButtonId + '-addEntry').toggle(true);
Expand Down Expand Up @@ -616,10 +623,10 @@
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&lt;= 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 {
Expand Down Expand Up @@ -761,8 +768,8 @@

jq('#indication-for-viral-load').hide();

jq(".investigations").find('#165412').change(function () {
if ( jq(".investigations").find('#165412').find(':checkbox').prop('checked')) {
jq(".molecular-investigation").find('#165412').change(function () {
if ( jq(".molecular-investigation").find('#165412').find(':checkbox').prop('checked')) {
jq('#indication-for-viral-load').show();
} else {
jq('#indication-for-viral-load').hide();
Expand Down Expand Up @@ -3887,9 +3894,18 @@
<div class="col-4 lablex2">
<label style="width: 100%; background-color: #e5e2e2">Molecular</label>
<br/>
<repeat with="['165413','GeneXpert'],['165412','VL'],['1320','HEP B VL'],['844','DNA/PCR'],['161494','ANA'],['159859','HPV']">
<obs id="{0}" conceptId="1078" answerConceptId="{0}" answerLabel="{1}" style="checkbox"/>
</repeat>
<div class="row molecular-investigation">
<repeat with="['165413','GeneXpert'],['165412','VL'],['1320','HEP B VL'],['844','DNA/PCR'],['161494','ANA'],['159859','HPV']">
<obs id="{0}" conceptId="1078" answerConceptId="{0}" answerLabel="{1}" style="checkbox"/>
</repeat>
</div>

<div class="row" id="indication-for-viral-load">
<div class="col-md-12">
<label>Indication for viral load testing</label>
<obs conceptId="168689" id="168689" style="checkbox"/>
</div>
</div>
</div>
</div>
<div class="row">
Expand Down Expand Up @@ -4080,7 +4096,7 @@
<repeat>
<template>
<obsgroup groupingConceptId="159947">
<div class="row visit-diagnosis" id="{id}-toggleContainer">
<div class="row visit-diagnosis" id="{id}-toggleDiagnosisContainer">
<div class="col-md-3">
<obs id="{id}-problem-trigger" labelText="Diagnosis" conceptId="1284" answerClasses="Diagnosis" style="autocomplete" class="fullwidth diagnosis-problem"/>
<obs class="hidden" id="{id}-problem-other" conceptId="161602" labelText="Specify Diagnosis"/>
Expand Down Expand Up @@ -4552,7 +4568,7 @@
<obsgroup groupingConceptId="160741">
<div class="row multi-drug" id="{id}-toggleContainer">
<div class="col-md-3">
<obs id="other-meds-trigger-{id}"
<obs id="{id}-drug"
labelText="Drug" conceptId="1282"
answerClasses="Drug" style="autocomplete"
class="fullwidth drug-other"/>
Expand Down
2 changes: 1 addition & 1 deletion omod/src/main/webapp/resources/htmlforms/triage-form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@
</div>

<div class="col-4">
<div class="card" id="clinical-notes-poc">
<div class="card" id="clinical-notes-triage">
<div class="card-header">Clinical Notes</div>
<div class="card-body">
<obs conceptId="159395" rows="6" cols="60"/>
Expand Down

0 comments on commit f29169a

Please sign in to comment.