Skip to content

Commit

Permalink
Merge pull request #4664 from hmislk/Issue#4663
Browse files Browse the repository at this point in the history
Closes #4663
  • Loading branch information
Senula88 authored Apr 19, 2024
2 parents 5e12568 + 83bde45 commit 7b37d6d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ public void fillMedicines(Patient patient) {

List<ClinicalFindingValue> tmpCli = fillCurrentPatientClinicalFindingValues(patient, temp);
if (tmpCli == null || tmpCli.isEmpty()) {
JsfUtil.addErrorMessage("No medications found on Patient Details");
JsfUtil.addErrorMessage("No medications found on Patient Profile");
return;
}

Expand All @@ -1156,6 +1156,38 @@ public void fillMedicines(Patient patient) {
}
updateOrGeneratePrescription();
}

public void fillProcedures(Patient patient) {
if (encounterProcedures == null) {
encounterProcedures = new ArrayList<>();
}
List<ClinicalFindingValueType> temp = new ArrayList<>();
temp.add(ClinicalFindingValueType.PatientProcedure);

List<ClinicalFindingValue> tmpCli = fillCurrentPatientClinicalFindingValues(patient, temp);
if (tmpCli == null || tmpCli.isEmpty()) {
JsfUtil.addErrorMessage("No Procedures found on Patient Profile");
return;
}

for (ClinicalFindingValue cli : tmpCli) {
if (cli == null) {
continue;
}

cli.setEncounter(current);
cli.setClinicalFindingValueType(ClinicalFindingValueType.VisitProcedure);
if (cli.getId() == null) {
clinicalFindingValueFacade.create(cli);
} else {
clinicalFindingValueFacade.edit(cli);
}
getEncounterFindingValues().add(cli);
encounterProcedures.add(cli);

}
updateOrGeneratePrescription();
}

public List<ClinicalFindingValue> fillCurrentPatientClinicalFindingValues(Patient patient) {
return fillCurrentPatientClinicalFindingValues(patient, null);
Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/emr/opd_visit.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -687,10 +687,11 @@

</p:panel>

<p:panel class="w-100 m-1" >
<p:panel class="w-100 m-1" id="procedures">
<f:facet name="header">
<h:outputText styleClass="fas fa-medkit"/>
<h:outputText class="mx-4" value="Procedures"/>
<p:commandButton value="Refill" process="@this" class='ui-button-warning' icon='fas fa-fill' style="float: right;" update="#{p:resolveFirstComponentWithId('procedures',view).clientId} #{p:resolveFirstComponentWithId('msg',view).clientId}" action="#{patientEncounterController.fillProcedures(patientController.current)}"/>
</f:facet>
<div class="row" >
<div class="col-md-9" >
Expand Down

0 comments on commit 7b37d6d

Please sign in to comment.