Skip to content

Commit 2559bf1

Browse files
authored
Merge pull request #4551 from hmislk/Issue#4550
Issue#4550
2 parents ad35503 + 2dc36f9 commit 2559bf1

File tree

6 files changed

+650
-34
lines changed

6 files changed

+650
-34
lines changed

src/main/java/com/divudi/bean/clinical/PatientEncounterController.java

+28-26
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ public void createNewResultReport(ClinicalFindingValue pf) {
733733

734734
patientReportController.setCurrentPtIx(currentPtIx);
735735
patientReportController.createNewReport(currentPtIx);
736+
pf.setPatientReport(patientReportController.getCurrentPatientReport());
736737
}
737738

738739

@@ -760,6 +761,7 @@ public void addEncounterInvestigationResults() {
760761
getEncounterFindingValues().add(encounterInvestigationResult);
761762
setEncounterInvestigationResults(fillEncounterInvestigationResults(current));
762763
createNewResultReport(encounterInvestigationResult);
764+
clinicalFindingValueFacade.edit(encounterInvestigationResult);
763765
encounterInvestigationResult = null;
764766
JsfUtil.addSuccessMessage("Investigation Report added");
765767

@@ -786,7 +788,7 @@ public PatientInvestigation createPatientInvestigation(ClinicalFindingValue pf)
786788
pi.setPrinted(Boolean.FALSE);
787789
pi.setReceived(Boolean.TRUE);
788790
pi.setRetired(false);
789-
createBillItemForPatientInvestigation(pi);
791+
// createBillItemForPatientInvestigation(pi);
790792
if (pi.getId() == null) {
791793
getPiFacade().create(pi);
792794
}
@@ -795,31 +797,31 @@ public PatientInvestigation createPatientInvestigation(ClinicalFindingValue pf)
795797
return pi;
796798
}
797799

798-
public void createBillItemForPatientInvestigation(PatientInvestigation pi){
799-
BillItem bi = new BillItem();
800-
bi.setQty(1.0);
801-
bi.setItem(pi.getInvestigation());
802-
if(bill==null){
803-
bill = new Bill();
804-
}
805-
bill.setPatient(pi.getPatient());
806-
bill.setCreatedAt(new Date());
807-
bill.setCreater(sessionController.getLoggedUser());
808-
bill.setPatient(pi.getPatient());
809-
bill.setBalance(0.0);
810-
bi.setCreatedAt(bill.getCreatedAt());
811-
bi.setCreater(sessionController.getLoggedUser());
812-
if (bill.getId()==null){
813-
billFacade.create(bill);
814-
}
815-
816-
bi.setBill(bill);
817-
818-
if (bi.getId() == null) {
819-
billItemFacade.create(bi);
820-
}
821-
pi.setBillItem(bi);
822-
}
800+
// public void createBillItemForPatientInvestigation(PatientInvestigation pi){
801+
// BillItem bi = new BillItem();
802+
// bi.setQty(1.0);
803+
// bi.setItem(pi.getInvestigation());
804+
// if(bill==null){
805+
// bill = new Bill();
806+
// }
807+
// bill.setPatient(pi.getPatient());
808+
// bill.setCreatedAt(new Date());
809+
// bill.setCreater(sessionController.getLoggedUser());
810+
// bill.setPatient(pi.getPatient());
811+
// bill.setBalance(0.0);
812+
// bi.setCreatedAt(bill.getCreatedAt());
813+
// bi.setCreater(sessionController.getLoggedUser());
814+
// if (bill.getId()==null){
815+
// billFacade.create(bill);
816+
// }
817+
//
818+
// bi.setBill(bill);
819+
//
820+
// if (bi.getId() == null) {
821+
// billItemFacade.create(bi);
822+
// }
823+
// pi.setBillItem(bi);
824+
// }
823825

824826
public void addDx() {
825827
if (diagnosis == null) {

src/main/java/com/divudi/bean/lab/PatientReportController.java

+39
Original file line numberDiff line numberDiff line change
@@ -1546,6 +1546,45 @@ public void approvePatientReport() {
15461546
getSmsFacade().create(e);
15471547
}
15481548
}
1549+
1550+
JsfUtil.addSuccessMessage("Approved");
1551+
commonController.printReportDetails(null, null, startTime, "Lab Report Aprove.");
1552+
}
1553+
1554+
public void approveEmrPatientReport() {
1555+
Date startTime = new Date();
1556+
if (currentPatientReport == null) {
1557+
JsfUtil.addErrorMessage("Nothing to approve");
1558+
return;
1559+
}
1560+
if (currentPatientReport.getDataEntered() == false) {
1561+
JsfUtil.addErrorMessage("First Save report");
1562+
return;
1563+
}
1564+
1565+
BooleanMessage tbm = canApproveThePatientReport(currentPatientReport);
1566+
if (!tbm.isFlag()) {
1567+
JsfUtil.addErrorMessage(tbm.getMessage());
1568+
return;
1569+
}
1570+
1571+
getCurrentPtIx().setApproved(true);
1572+
currentPtIx.setApproveAt(Calendar.getInstance().getTime());
1573+
currentPtIx.setApproveUser(getSessionController().getLoggedUser());
1574+
currentPtIx.setApproveDepartment(getSessionController().getDepartment());
1575+
getPiFacade().edit(currentPtIx);
1576+
currentPatientReport.setApproved(Boolean.FALSE);
1577+
currentPatientReport.setApproved(Boolean.TRUE);
1578+
currentPatientReport.setApproveAt(Calendar.getInstance().getTime());
1579+
currentPatientReport.setApproveDepartment(getSessionController().getLoggedUser().getDepartment());
1580+
currentPatientReport.setApproveInstitution(getSessionController().getLoggedUser().getInstitution());
1581+
currentPatientReport.setApproveUser(getSessionController().getLoggedUser());
1582+
currentPatientReport.setQrCodeContentsDetailed(generateQrCodeDetails(currentPatientReport));
1583+
currentPatientReport.setQrCodeContentsLink(generateQrCodeLink(currentPatientReport));
1584+
getFacade().edit(currentPatientReport);
1585+
getStaffController().setCurrent(getSessionController().getLoggedUser().getStaff());
1586+
getTransferController().setStaff(getSessionController().getLoggedUser().getStaff());
1587+
15491588
if(clinicalFindingValue!=null){
15501589
getClinicalFindingValue().setPatientInvestigation(currentPtIx);
15511590
if(clinicalFindingValue.getId()!=null){

src/main/java/com/divudi/entity/clinical/ClinicalFindingValue.java

+11
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.divudi.entity.PatientEncounter;
1212
import com.divudi.entity.Person;
1313
import com.divudi.entity.lab.PatientInvestigation;
14+
import com.divudi.entity.lab.PatientReport;
1415
import java.io.Serializable;
1516
import javax.persistence.CascadeType;
1617
import javax.persistence.Entity;
@@ -66,6 +67,8 @@ public class ClinicalFindingValue implements Serializable {
6667
private DocumentTemplate documentTemplate;
6768
@ManyToOne
6869
private PatientInvestigation patientInvestigation;
70+
@ManyToOne
71+
private PatientReport patientReport;
6972

7073
@Enumerated(EnumType.STRING)
7174
private ClinicalFindingValueType clinicalFindingValueType;
@@ -267,6 +270,14 @@ public PatientInvestigation getPatientInvestigation() {
267270
public void setPatientInvestigation(PatientInvestigation patientInvestigation) {
268271
this.patientInvestigation = patientInvestigation;
269272
}
273+
274+
public PatientReport getPatientReport() {
275+
return patientReport;
276+
}
277+
278+
public void setPatientReport(PatientReport patientReport) {
279+
this.patientReport = patientReport;
280+
}
270281

271282

272283

src/main/webapp/emr/opd_visit.xhtml

+3-2
Original file line numberDiff line numberDiff line change
@@ -643,18 +643,19 @@
643643
var="ix" class="w-100">
644644
<p:column headerText="Procedure" >
645645
<h:outputLabel value="#{ix.itemValue.name}"></h:outputLabel>
646-
647646
</p:column>
647+
648648
<p:column headerText="Details">
649649
<h:outputLabel value="#{ix.lobValue}"></h:outputLabel>
650650
</p:column>
651651
<p:column headerText="Action">
652652
<div class="d-flex">
653653
<p:commandLink id="btnNewReport" ajax="false"
654654
disabled="#{ix.patientInvestigation ne null}"
655-
action="/lab/patient_report">
655+
action="/emr/patient_report">
656656
<f:setPropertyActionListener value="#{ix}" target="#{patientEncounterController.currentEIResult}"></f:setPropertyActionListener>
657657
<f:setPropertyActionListener value="#{ix}" target="#{patientReportController.clinicalFindingValue}"/>
658+
<f:setPropertyActionListener value="#{ix.patientReport}" target="#{patientReportController.currentPatientReport}"></f:setPropertyActionListener>
658659
<p:graphicImage library="image" styleClass="standedicon" name="data_entry.png" ></p:graphicImage>
659660
</p:commandLink>
660661
<p:commandButton

0 commit comments

Comments
 (0)