diff --git a/src/main/java/com/iemr/tm/data/benFlowStatus/BeneficiaryFlowStatus.java b/src/main/java/com/iemr/tm/data/benFlowStatus/BeneficiaryFlowStatus.java index f7f65b0e..884e1b48 100644 --- a/src/main/java/com/iemr/tm/data/benFlowStatus/BeneficiaryFlowStatus.java +++ b/src/main/java/com/iemr/tm/data/benFlowStatus/BeneficiaryFlowStatus.java @@ -295,7 +295,11 @@ public class BeneficiaryFlowStatus { @Expose @Column(name = "referred_visit_id") private Long referred_visit_id; - + + @Expose + @Column(name = "doctor_signature_flag") + private Boolean doctorSignatureFlag = false; + @Transient private I_bendemographics i_bendemographics; @Transient @@ -374,6 +378,9 @@ public static BeneficiaryFlowStatus getBeneficiaryFlowStatusForLeftPanel(ArrayLi (String) objArr[11], (String) objArr[12], (String) objArr[13], (Long) objArr[14], (Timestamp) objArr[15], (Timestamp) objArr[16], (Long) objArr[17], (Timestamp) objArr[18], (String) objArr[19], (String) objArr[20]); + if (objArr.length > 21) { + obj.setDoctorSignatureFlag((Boolean) objArr[21]); + } } } return obj; @@ -991,9 +998,12 @@ public Long getReferred_visit_id() { public void setReferred_visit_id(Long referred_visit_id) { this.referred_visit_id = referred_visit_id; } - - - - + public Boolean getDoctorSignatureFlag() { + return doctorSignatureFlag; + } + + public void setDoctorSignatureFlag(Boolean doctorSignatureFlag) { + this.doctorSignatureFlag = doctorSignatureFlag; + } } diff --git a/src/main/java/com/iemr/tm/repo/benFlowStatus/BeneficiaryFlowStatusRepo.java b/src/main/java/com/iemr/tm/repo/benFlowStatus/BeneficiaryFlowStatusRepo.java index 0db522e5..579f7631 100644 --- a/src/main/java/com/iemr/tm/repo/benFlowStatus/BeneficiaryFlowStatusRepo.java +++ b/src/main/java/com/iemr/tm/repo/benFlowStatus/BeneficiaryFlowStatusRepo.java @@ -118,7 +118,7 @@ public int updateBenFlowStatusAfterNurseActivityANC(@Param("benFlowID") Long ben @Query("SELECT t.benFlowID, t.beneficiaryRegID, t.visitDate, t.benName, t.age, t.ben_age_val, t.genderID, t.genderName, " + " t.villageName, t.districtName, t.beneficiaryID, t.servicePointName, t.VisitReason, t.VisitCategory, t.benVisitID, " - + " t.registrationDate, t.benVisitDate, t.visitCode, t.consultationDate, t.fatherName, t.preferredPhoneNum FROM BeneficiaryFlowStatus t " + + " t.registrationDate, t.benVisitDate, t.visitCode, t.consultationDate, t.fatherName, t.preferredPhoneNum, t.doctorSignatureFlag FROM BeneficiaryFlowStatus t " + " Where t.beneficiaryRegID = :benRegID AND t.benFlowID = :benFlowID ") public ArrayList getBenDetailsForLeftSidePanel(@Param("benRegID") Long benRegID, @Param("benFlowID") Long benFlowID); @@ -204,17 +204,18 @@ public ArrayList getLabWorklistNew( *updating lab technician flag as well after feto sense. */ @Transactional - @Modifying + @Modifying @Query("UPDATE BeneficiaryFlowStatus t set t.doctorFlag = :docFlag , t.pharmacist_flag = :pharmaFlag, " + " t.oncologist_flag = :oncologistFlag, t.consultationDate = now(), t.processed = 'U', " + " t.specialist_flag = :tcSpecialistFlag, t.tCSpecialistUserID = :tcSpecialistUserID, " - + "t.tCRequestDate = :tcDate, t.lab_technician_flag = :labTechnicianFlag " + + "t.tCRequestDate = :tcDate, t.lab_technician_flag = :labTechnicianFlag, t.doctorSignatureFlag = :signatureFlag " + " WHERE t.benFlowID = :benFlowID AND " + " t.beneficiaryRegID = :benRegID AND t.beneficiaryID = :benID ") public int updateBenFlowStatusAfterDoctorActivity(@Param("benFlowID") Long benFlowID, @Param("benRegID") Long benRegID, @Param("benID") Long benID, @Param("docFlag") Short docFlag, @Param("pharmaFlag") Short pharmaFlag, @Param("oncologistFlag") Short oncologistFlag, @Param("tcSpecialistFlag") Short tcSpecialistFlag, @Param("tcSpecialistUserID") int tcSpecialistUserID, - @Param("tcDate") Timestamp tcDate,@Param("labTechnicianFlag") Short labTechnicianFlag); + @Param("tcDate") Timestamp tcDate,@Param("labTechnicianFlag") Short labTechnicianFlag, + @Param("signatureFlag") Boolean signatureFlag); /*** * @author DU20091017 @@ -224,12 +225,12 @@ public int updateBenFlowStatusAfterDoctorActivity(@Param("benFlowID") Long benFl @Modifying @Query("UPDATE BeneficiaryFlowStatus t set t.doctorFlag = :docFlag , t.pharmacist_flag = :pharmaFlag, " + " t.oncologist_flag = :oncologistFlag, t.consultationDate = now(), t.processed = 'U', " - + " t.specialist_flag = :tcSpecialistFlag , t.lab_technician_flag = :labTechnicianFlag " + + " t.specialist_flag = :tcSpecialistFlag , t.lab_technician_flag = :labTechnicianFlag, t.doctorSignatureFlag = :signatureFlag " + " WHERE t.benFlowID = :benFlowID AND t.beneficiaryRegID = :benRegID AND t.beneficiaryID = :benID ") public int updateBenFlowStatusAfterDoctorActivitySpecialist(@Param("benFlowID") Long benFlowID, @Param("benRegID") Long benRegID, @Param("benID") Long benID, @Param("docFlag") Short docFlag, @Param("pharmaFlag") Short pharmaFlag, @Param("oncologistFlag") Short oncologistFlag, - @Param("tcSpecialistFlag") Short tcSpecialistFlag,@Param("labTechnicianFlag") Short labTechnicianFlag); + @Param("tcSpecialistFlag") Short tcSpecialistFlag,@Param("labTechnicianFlag") Short labTechnicianFlag, @Param("signatureFlag") Boolean signatureFlag); /*** * @author DU20091017 @@ -239,12 +240,12 @@ public int updateBenFlowStatusAfterDoctorActivitySpecialist(@Param("benFlowID") @Modifying @Query("UPDATE BeneficiaryFlowStatus t set t.doctorFlag = :docFlag , t.pharmacist_flag = :pharmaFlag, " + " t.oncologist_flag = :oncologistFlag, t.consultationDate = now(), t.processed = 'U', " - + " t.specialist_flag = :tcSpecialistFlag , t.lab_technician_flag = :labTechnicianFlag " + + " t.specialist_flag = :tcSpecialistFlag , t.lab_technician_flag = :labTechnicianFlag, t.doctorSignatureFlag = :signatureFlag" + " WHERE t.benFlowID = :benFlowID AND t.beneficiaryRegID = :benRegID AND t.beneficiaryID = :benID ") public int updateBenFlowStatusAfterDoctorActivitySpecialistANC(@Param("benFlowID") Long benFlowID, @Param("benRegID") Long benRegID, @Param("benID") Long benID, @Param("docFlag") Short docFlag, @Param("pharmaFlag") Short pharmaFlag, @Param("oncologistFlag") Short oncologistFlag, - @Param("tcSpecialistFlag") Short tcSpecialistFlag,@Param("labTechnicianFlag") Short labTechnicianFlag); + @Param("tcSpecialistFlag") Short tcSpecialistFlag,@Param("labTechnicianFlag") Short labTechnicianFlag, @Param("signatureFlag") Boolean signatureFlag); /*** * @author DU20091017 @@ -254,22 +255,24 @@ public int updateBenFlowStatusAfterDoctorActivitySpecialistANC(@Param("benFlowID @Modifying @Query("UPDATE BeneficiaryFlowStatus t set t.pharmacist_flag = :pharmaFlag, " + " t.oncologist_flag = :oncologistFlag, t.processed = 'U', t.specialist_flag = :tcSpecialistFlag, " - + "t.lab_technician_flag = :labTechnicianFlag" + + "t.lab_technician_flag = :labTechnicianFlag, t.doctorSignatureFlag = :signatureFlag" + " WHERE t.benFlowID = :benFlowID AND t.beneficiaryRegID = :benRegID AND t.beneficiaryID = :benID ") public int updateBenFlowStatusAfterDoctorActivityTCSpecialist(@Param("benFlowID") Long benFlowID, @Param("benRegID") Long benRegID, @Param("benID") Long benID, @Param("pharmaFlag") Short pharmaFlag, @Param("oncologistFlag") Short oncologistFlag, @Param("tcSpecialistFlag") Short tcSpecialistFlag, - @Param("labTechnicianFlag") Short labTechnicianFlag); + @Param("labTechnicianFlag") Short labTechnicianFlag, @Param("signatureFlag") Boolean signatureFlag); @Transactional - @Modifying - @Query("UPDATE BeneficiaryFlowStatus t set t.doctorFlag = :docFlag , t.pharmacist_flag = :pharmaFlag, " - + " t.oncologist_flag = :oncologistFlag , t.processed = 'U' " + " WHERE t.benFlowID = :benFlowID AND " - + " t.beneficiaryRegID = :benRegID AND t.beneficiaryID = :benID ") - public int updateBenFlowStatusAfterDoctorActivityUpdate(@Param("benFlowID") Long benFlowID, - @Param("benRegID") Long benRegID, @Param("benID") Long benID, @Param("docFlag") Short docFlag, - @Param("pharmaFlag") Short pharmaFlag, @Param("oncologistFlag") Short oncologistFlag); - + @Modifying + @Query("UPDATE BeneficiaryFlowStatus t set t.doctorFlag = :docFlag , t.pharmacist_flag = :pharmaFlag, " + + " t.oncologist_flag = :oncologistFlag , t.processed = 'U', t.doctorSignatureFlag = :signatureFlag" + + " WHERE t.benFlowID = :benFlowID AND " + + " t.beneficiaryRegID = :benRegID AND t.beneficiaryID = :benID ") + public int updateBenFlowStatusAfterDoctorActivityUpdate(@Param("benFlowID") Long benFlowID, + @Param("benRegID") Long benRegID, @Param("benID") Long benID, @Param("docFlag") Short docFlag, + @Param("pharmaFlag") Short pharmaFlag, @Param("oncologistFlag") Short oncologistFlag, + @Param("signatureFlag") Boolean signatureFlag); + @Query("SELECT t from BeneficiaryFlowStatus t " + " WHERE t.benVisitDate >= Date(:fromDate) AND t.vanID = :vanID AND t.radiologist_flag = 1 " + " AND t.providerServiceMapId= :providerServiceMapId ORDER BY t.benVisitDate DESC ") diff --git a/src/main/java/com/iemr/tm/service/anc/ANCServiceImpl.java b/src/main/java/com/iemr/tm/service/anc/ANCServiceImpl.java index fc1da82c..5f8d1156 100644 --- a/src/main/java/com/iemr/tm/service/anc/ANCServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/anc/ANCServiceImpl.java @@ -348,7 +348,12 @@ public Long saveANCDoctorData(JsonObject requestOBJ, String Authorization) throw Long diagnosisSuccessFlag = null; Integer prescriptionSuccessFlag = null; Long referSaveSuccessFlag = null; - Integer tcRequestStatusFlag = null; + boolean doctorSignature = requestOBJ.has("doctorSignatureFlag"); + + Boolean doctorSignatureFlag = false; + if (doctorSignature) { + doctorSignatureFlag = doctorSignature; + } if (requestOBJ != null) { TeleconsultationRequestOBJ tcRequestOBJ = null; @@ -466,7 +471,7 @@ public Long saveANCDoctorData(JsonObject requestOBJ, String Authorization) throw } int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataSave(commonUtilityClass, isTestPrescribed, - isMedicinePrescribed, tcRequestOBJ); + isMedicinePrescribed, tcRequestOBJ,doctorSignatureFlag); if (i > 0) saveSuccessFlag = diagnosisSuccessFlag; @@ -1488,6 +1493,11 @@ public Long updateANCDoctorData(JsonObject requestOBJ, String Authorization) thr Boolean isTestPrescribed = false; Boolean isMedicinePrescribed = false; + Boolean doctorSignatureFlag = false; + if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) { + doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean(); + } + // checking if test is prescribed if (requestOBJ.has("investigation") && !requestOBJ.get("investigation").isJsonNull() && requestOBJ.get("investigation") != null) { @@ -1596,7 +1606,7 @@ public Long updateANCDoctorData(JsonObject requestOBJ, String Authorization) thr } int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataUpdate(commonUtilityClass, - isTestPrescribed, isMedicinePrescribed, tcRequestOBJ); + isTestPrescribed, isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag); if (i > 0) updateSuccessFlag = investigationSuccessFlag; else diff --git a/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java b/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java index df561ae9..ec0f8514 100644 --- a/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java @@ -242,11 +242,11 @@ private BeneficiaryFlowStatus getBenFlowRecordObj(String requestOBJ, Long benefi } public int updateBenFlowAfterDocData(Long benFlowID, Long benRegID, Long benID, Long benVisitID, short docFlag, - short pharmaFlag, short oncologistFlag, short tcSpecialistFlag, int tcUserID, Timestamp tcDate,short labTechnicianFlag) { + short pharmaFlag, short oncologistFlag, short tcSpecialistFlag, int tcUserID, Timestamp tcDate,short labTechnicianFlag, Boolean signatureFlag) { int i = 0; try { i = beneficiaryFlowStatusRepo.updateBenFlowStatusAfterDoctorActivity(benFlowID, benRegID, benID, docFlag, - pharmaFlag, oncologistFlag, tcSpecialistFlag, tcUserID, tcDate,labTechnicianFlag); + pharmaFlag, oncologistFlag, tcSpecialistFlag, tcUserID, tcDate,labTechnicianFlag, signatureFlag); } catch (Exception e) { logger.error("Error in ben flow creation = " + e); } @@ -254,11 +254,11 @@ public int updateBenFlowAfterDocData(Long benFlowID, Long benRegID, Long benID, } public int updateBenFlowAfterDocDataFromSpecialist(Long benFlowID, Long benRegID, Long benID, Long benVisitID, - short docFlag, short pharmaFlag, short oncologistFlag, short tcSpecialistFlag,short labTechnicianFlag) { + short docFlag, short pharmaFlag, short oncologistFlag, short tcSpecialistFlag,short labTechnicianFlag, Boolean signatureFlag) { int i = 0; try { i = beneficiaryFlowStatusRepo.updateBenFlowStatusAfterDoctorActivitySpecialist(benFlowID, benRegID, benID, - docFlag, pharmaFlag, oncologistFlag, tcSpecialistFlag,labTechnicianFlag); + docFlag, pharmaFlag, oncologistFlag, tcSpecialistFlag, labTechnicianFlag, signatureFlag); } catch (Exception e) { logger.error("Error in ben flow creation = " + e); } @@ -266,11 +266,11 @@ public int updateBenFlowAfterDocDataFromSpecialist(Long benFlowID, Long benRegID } public int updateBenFlowAfterDocDataFromSpecialistANC(Long benFlowID, Long benRegID, Long benID, Long benVisitID, - short docFlag, short pharmaFlag, short oncologistFlag, short tcSpecialistFlag,short labTechnicianFlag) { + short docFlag, short pharmaFlag, short oncologistFlag, short tcSpecialistFlag,short labTechnicianFlag, Boolean signatureFlag) { int i = 0; try { i = beneficiaryFlowStatusRepo.updateBenFlowStatusAfterDoctorActivitySpecialistANC(benFlowID, benRegID, benID, - docFlag, pharmaFlag, oncologistFlag, tcSpecialistFlag,labTechnicianFlag); + docFlag, pharmaFlag, oncologistFlag, tcSpecialistFlag, labTechnicianFlag, signatureFlag); } catch (Exception e) { logger.error("Error in ben flow creation = " + e); } @@ -279,7 +279,7 @@ public int updateBenFlowAfterDocDataFromSpecialistANC(Long benFlowID, Long benRe public int updateBenFlowAfterDocDataUpdate(Long benFlowID, Long benRegID, Long benID, Long benVisitID, short docFlag, short pharmaFlag, short oncologistFlag, short tcSpecialistFlag, int tcUserID, - Timestamp tcDate,short labTechnicianFlag) throws Exception { + Timestamp tcDate,short labTechnicianFlag, Boolean signatureFlag) throws Exception { int i = 0; try { Short pharmaF = beneficiaryFlowStatusRepo.getPharmaFlag(benFlowID); @@ -291,7 +291,7 @@ public int updateBenFlowAfterDocDataUpdate(Long benFlowID, Long benRegID, Long b pharmaF1 = pharmaFlag; i = beneficiaryFlowStatusRepo.updateBenFlowStatusAfterDoctorActivity(benFlowID, benRegID, benID, docFlag, - pharmaF1, oncologistFlag, tcSpecialistFlag, tcUserID, tcDate,labTechnicianFlag); + pharmaF1, oncologistFlag, tcSpecialistFlag, tcUserID, tcDate, labTechnicianFlag, signatureFlag); } catch (Exception e) { logger.error("Error in ben flow creation = " + e); throw new Exception(e); @@ -301,7 +301,7 @@ public int updateBenFlowAfterDocDataUpdate(Long benFlowID, Long benRegID, Long b public int updateBenFlowAfterDocDataUpdateTCSpecialist(Long benFlowID, Long benRegID, Long benID, Long benVisitID, short docFlag, short pharmaFlag, short oncologistFlag, short tcSpecialistFlag, int tcUserID, - Timestamp tcDate, short labTechnicianFlag) throws Exception { + Timestamp tcDate, short labTechnicianFlag, Boolean signatureFlag) throws Exception { int i = 0; try { Short pharmaF = beneficiaryFlowStatusRepo.getPharmaFlag(benFlowID); @@ -313,7 +313,7 @@ public int updateBenFlowAfterDocDataUpdateTCSpecialist(Long benFlowID, Long benR pharmaF1 = pharmaFlag; i = beneficiaryFlowStatusRepo.updateBenFlowStatusAfterDoctorActivityTCSpecialist(benFlowID, benRegID, benID, - pharmaF1, oncologistFlag, tcSpecialistFlag,labTechnicianFlag); + pharmaF1, oncologistFlag, tcSpecialistFlag, labTechnicianFlag, signatureFlag); } catch (Exception e) { logger.error("Error in ben flow creation = " + e); throw new Exception(e); diff --git a/src/main/java/com/iemr/tm/service/cancerScreening/CSServiceImpl.java b/src/main/java/com/iemr/tm/service/cancerScreening/CSServiceImpl.java index 260a783b..a13f7499 100644 --- a/src/main/java/com/iemr/tm/service/cancerScreening/CSServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/cancerScreening/CSServiceImpl.java @@ -810,6 +810,14 @@ public String getBenDataFrmNurseToDocExaminationScreen(Long benRegID, Long visit public Long saveCancerScreeningDoctorData(JsonObject requestOBJ, String Authorization) throws Exception { Long docDataSuccessFlag = null; Long tcRequestStatusFlag = null; + boolean doctorSignature = requestOBJ.has("doctorSignatureFlag"); + + + Boolean doctorSignatureFlag = false; + if (doctorSignature) { + doctorSignatureFlag = doctorSignature; + } + if (requestOBJ != null && requestOBJ.has("diagnosis") && !requestOBJ.get("diagnosis").isJsonNull()) { @@ -907,7 +915,7 @@ public Long saveCancerScreeningDoctorData(JsonObject requestOBJ, String Authoriz && commonUtilityClass.getIsSpecialist() == true) { l1 = commonBenStatusFlowServiceImpl.updateBenFlowAfterDocDataFromSpecialist(tmpBenFlowID, tmpbeneficiaryRegID, tmpBeneficiaryID, tmpBenVisitID, docFlag, pharmaFalg, oncologistFlag, - tcSpecialistFlag, (short) 0); + tcSpecialistFlag, (short) 0, doctorSignatureFlag); if (tcSpecialistFlag == 9) { int l = tCRequestModelRepo.updateStatusIfConsultationCompleted( @@ -916,7 +924,7 @@ public Long saveCancerScreeningDoctorData(JsonObject requestOBJ, String Authoriz } else { l2 = commonBenStatusFlowServiceImpl.updateBenFlowAfterDocData(tmpBenFlowID, tmpbeneficiaryRegID, tmpBeneficiaryID, tmpBenVisitID, docFlag, pharmaFalg, oncologistFlag, tcSpecialistFlag, - tcUserID, tcDate, (short) 0); + tcUserID, tcDate, (short) 0, doctorSignatureFlag); } if (l1 > 0 || l2 > 0) diff --git a/src/main/java/com/iemr/tm/service/common/transaction/CommonDoctorServiceImpl.java b/src/main/java/com/iemr/tm/service/common/transaction/CommonDoctorServiceImpl.java index 51de27bb..32661569 100644 --- a/src/main/java/com/iemr/tm/service/common/transaction/CommonDoctorServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/common/transaction/CommonDoctorServiceImpl.java @@ -702,7 +702,7 @@ public Long updateBenReferDetails(JsonObject referObj) throws IEMRException { /// ------Start of beneficiary flow table after doctor data save------------- public int updateBenFlowtableAfterDocDataSave(CommonUtilityClass commonUtilityClass, Boolean isTestPrescribed, - Boolean isMedicinePrescribed, TeleconsultationRequestOBJ tcRequestOBJ) throws IEMRException { + Boolean isMedicinePrescribed, TeleconsultationRequestOBJ tcRequestOBJ, Boolean signatureFlag) throws IEMRException { short pharmaFalg; short docFlag = (short) 1; short tcSpecialistFlag = (short) 0; @@ -783,7 +783,7 @@ public int updateBenFlowtableAfterDocDataSave(CommonUtilityClass commonUtilityCl // updating lab technician flag as well after feto sense i = commonBenStatusFlowServiceImpl.updateBenFlowAfterDocDataFromSpecialist(tmpBenFlowID, tmpbeneficiaryRegID, tmpBeneficiaryID, tmpBenVisitID, docFlag, pharmaFalg, (short) 0, - tcSpecialistFlag, labTechnicianFlag); + tcSpecialistFlag, labTechnicianFlag,signatureFlag); if (tcSpecialistFlag == 9) { int l = tCRequestModelRepo.updateStatusIfConsultationCompleted(commonUtilityClass.getBeneficiaryRegID(), commonUtilityClass.getVisitCode(), "D"); @@ -808,7 +808,7 @@ public int updateBenFlowtableAfterDocDataSave(CommonUtilityClass commonUtilityCl } else i = commonBenStatusFlowServiceImpl.updateBenFlowAfterDocData(tmpBenFlowID, tmpbeneficiaryRegID, tmpBeneficiaryID, tmpBenVisitID, docFlag, pharmaFalg, (short) 0, tcSpecialistFlag, tcUserID, tcDate, - labTechnicianFlag); + labTechnicianFlag, signatureFlag); // TM Prescription SMS if (commonUtilityClass.getIsSpecialist() == true) { if (tcSpecialistFlag == 9) { @@ -846,7 +846,7 @@ public int updateBenFlowtableAfterDocDataSave(CommonUtilityClass commonUtilityCl * @return */ public int updateBenFlowtableAfterDocDataUpdate(CommonUtilityClass commonUtilityClass, Boolean isTestPrescribed, - Boolean isMedicinePrescribed, TeleconsultationRequestOBJ tcRequestOBJ) throws Exception { + Boolean isMedicinePrescribed, TeleconsultationRequestOBJ tcRequestOBJ, Boolean doctorSignatureFlag) throws Exception { int i = 0; short pharmaFalg; short docFlag = (short) 0; @@ -897,7 +897,7 @@ public int updateBenFlowtableAfterDocDataUpdate(CommonUtilityClass commonUtility i = commonBenStatusFlowServiceImpl.updateBenFlowAfterDocDataUpdateTCSpecialist(tmpBenFlowID, tmpbeneficiaryRegID, tmpBeneficiaryID, tmpBenVisitID, docFlag, pharmaFalg, (short) 0, - tcSpecialistFlag, tcUserID, tcDate, labTechnicianFlag); + tcSpecialistFlag, tcUserID, tcDate, labTechnicianFlag, doctorSignatureFlag); if (tcSpecialistFlag == 9) { int l = tCRequestModelRepo.updateStatusIfConsultationCompleted(commonUtilityClass.getBeneficiaryRegID(), @@ -945,7 +945,7 @@ public int updateBenFlowtableAfterDocDataUpdate(CommonUtilityClass commonUtility i = commonBenStatusFlowServiceImpl.updateBenFlowAfterDocDataUpdate(tmpBenFlowID, tmpbeneficiaryRegID, tmpBeneficiaryID, tmpBenVisitID, docFlag, pharmaFalg, (short) 0, tcSpecialistFlag, tcUserID, tcDate, - labTechnicianFlag); + labTechnicianFlag, doctorSignatureFlag); } diff --git a/src/main/java/com/iemr/tm/service/common/transaction/CommonNurseServiceImpl.java b/src/main/java/com/iemr/tm/service/common/transaction/CommonNurseServiceImpl.java index 8ebb3bb5..1826af3d 100644 --- a/src/main/java/com/iemr/tm/service/common/transaction/CommonNurseServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/common/transaction/CommonNurseServiceImpl.java @@ -2884,19 +2884,17 @@ private int calculateQtyPrescribed(String form, String dose, String frequency, S String durationUnit) { int qtyPrescribed = 0; + logger.info(frequency,"Frequency"); if (form != null && dose != null && frequency != null && duration != null && durationUnit != null) { double qtyInOneDay = getQtyForOneDay(form, dose, frequency); - if (frequency.equalsIgnoreCase("Single Dose") || frequency.equalsIgnoreCase("Stat Dose")) { - qtyPrescribed = (int) Math.ceil(qtyInOneDay); - } else { - if (durationUnit.equalsIgnoreCase("Day(s)")) - qtyPrescribed = (int) Math.ceil(Integer.parseInt(duration) * qtyInOneDay); - else if (durationUnit.equalsIgnoreCase("Week(s)")) - qtyPrescribed = (int) Math.ceil(Integer.parseInt(duration) * 7 * qtyInOneDay); - else if (durationUnit.equalsIgnoreCase("Month(s)")) - qtyPrescribed = (int) Math.ceil(Integer.parseInt(duration) * 30 * qtyInOneDay); - } + if (durationUnit.equalsIgnoreCase("Day(s)")) + qtyPrescribed = (int) Math.ceil(Integer.parseInt(duration) * qtyInOneDay); + else if (durationUnit.equalsIgnoreCase("Week(s)")) + qtyPrescribed = (int) Math.ceil(Integer.parseInt(duration) * 7 * qtyInOneDay); + else if (durationUnit.equalsIgnoreCase("Month(s)")) + qtyPrescribed = (int) Math.ceil(Integer.parseInt(duration) * 30 * qtyInOneDay); + } return qtyPrescribed; @@ -3007,7 +3005,7 @@ private double getQtyForOneDay(String form, String dose, String frequency) { } } else { if (frequency.equalsIgnoreCase("Single Dose") || frequency.equalsIgnoreCase("Stat Dose")|| - frequency.equalsIgnoreCase("Single Dose Before Food") || frequency.equalsIgnoreCase("Single Dose After Food")) { + frequency.equalsIgnoreCase("Single Dose Before Food") || frequency.equalsIgnoreCase("Single Dose After Food")) { if (form.equalsIgnoreCase("Tablet")) { if (dose.equalsIgnoreCase("Half Tab")) { qtyInOneDay = .5; diff --git a/src/main/java/com/iemr/tm/service/covid19/Covid19ServiceImpl.java b/src/main/java/com/iemr/tm/service/covid19/Covid19ServiceImpl.java index 0d0e424a..2d133113 100644 --- a/src/main/java/com/iemr/tm/service/covid19/Covid19ServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/covid19/Covid19ServiceImpl.java @@ -967,7 +967,9 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E Integer prescriptionSuccessFlag = null; // Long diagnosisSuccessFlag = null; Long referSaveSuccessFlag = null; - Integer tcRequestStatusFlag = null; + boolean doctorSignature = requestOBJ.has("doctorSignatureFlag"); + + if (requestOBJ != null) { TeleconsultationRequestOBJ tcRequestOBJ = null; @@ -981,6 +983,11 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E Boolean isTestPrescribed = false; Boolean isMedicinePrescribed = false; + Boolean doctorSignatureFlag = false; + if (doctorSignature) { + doctorSignatureFlag = doctorSignature; + } + // checking if test is prescribed if (requestOBJ.has("investigation") && !requestOBJ.get("investigation").isJsonNull() && requestOBJ.get("investigation") != null) { @@ -1085,7 +1092,7 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E } int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataSave(commonUtilityClass, isTestPrescribed, - isMedicinePrescribed, tcRequestOBJ); + isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag); if (i > 0) saveSuccessFlag = referSaveSuccessFlag; @@ -1187,6 +1194,12 @@ public Long updateCovid19DoctorData(JsonObject requestOBJ, String Authorization) Boolean isTestPrescribed = false; Boolean isMedicinePrescribed = false; + Boolean doctorSignatureFlag = false; + if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) { + doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean(); + } + + // checking if test is prescribed if (requestOBJ.has("investigation") && !requestOBJ.get("investigation").isJsonNull() && requestOBJ.get("investigation") != null) { @@ -1304,7 +1317,7 @@ public Long updateCovid19DoctorData(JsonObject requestOBJ, String Authorization) } int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataUpdate(commonUtilityClass, - isTestPrescribed, isMedicinePrescribed, tcRequestOBJ); + isTestPrescribed, isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag); if (i > 0) updateSuccessFlag = investigationSuccessFlag; diff --git a/src/main/java/com/iemr/tm/service/generalOPD/GeneralOPDServiceImpl.java b/src/main/java/com/iemr/tm/service/generalOPD/GeneralOPDServiceImpl.java index a74a874f..7039a632 100644 --- a/src/main/java/com/iemr/tm/service/generalOPD/GeneralOPDServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/generalOPD/GeneralOPDServiceImpl.java @@ -738,6 +738,8 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E Integer findingSuccessFlag = null; Integer prescriptionSuccessFlag = null; Long referSaveSuccessFlag = null; + boolean doctorSignature = requestOBJ.has("doctorSignatureFlag"); + //Integer tcRequestStatusFlag = null; @@ -754,6 +756,11 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E Boolean isTestPrescribed = false; Boolean isMedicinePrescribed = false; + Boolean doctorSignatureFlag = false; + if (doctorSignature) { + doctorSignatureFlag = doctorSignature; + } + // checking if test is prescribed if (requestOBJ.has("investigation") && !requestOBJ.get("investigation").isJsonNull() && requestOBJ.get("investigation") != null) { @@ -857,7 +864,7 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E } int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataSave(commonUtilityClass, isTestPrescribed, - isMedicinePrescribed, tcRequestOBJ); + isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag); if (i > 0) saveSuccessFlag = investigationSuccessFlag; @@ -1360,6 +1367,11 @@ public Long updateGeneralOPDDoctorData(JsonObject requestOBJ, String Authorizati Boolean isTestPrescribed = false; Boolean isMedicinePrescribed = false; + Boolean doctorSignatureFlag = false; + if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) { + doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean(); + } + // checking if test is prescribed if (requestOBJ.has("investigation") && !requestOBJ.get("investigation").isJsonNull() && requestOBJ.get("investigation") != null) { @@ -1474,7 +1486,7 @@ public Long updateGeneralOPDDoctorData(JsonObject requestOBJ, String Authorizati } int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataUpdate(commonUtilityClass, - isTestPrescribed, isMedicinePrescribed, tcRequestOBJ); + isTestPrescribed, isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag); if (i > 0) updateSuccessFlag = investigationSuccessFlag; diff --git a/src/main/java/com/iemr/tm/service/ncdCare/NCDCareServiceImpl.java b/src/main/java/com/iemr/tm/service/ncdCare/NCDCareServiceImpl.java index e5754bf6..b5e42548 100644 --- a/src/main/java/com/iemr/tm/service/ncdCare/NCDCareServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/ncdCare/NCDCareServiceImpl.java @@ -756,7 +756,7 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E Integer prescriptionSuccessFlag = null; Long diagnosisSuccessFlag = null; Long referSaveSuccessFlag = null; - Integer tcRequestStatusFlag = null; + boolean doctorSignature = requestOBJ.has("doctorSignatureFlag"); if (requestOBJ != null) { TeleconsultationRequestOBJ tcRequestOBJ = null; @@ -771,6 +771,14 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E Boolean isTestPrescribed = false; Boolean isMedicinePrescribed = false; + Boolean doctorSignatureFlag = false; + + + + if (doctorSignature) { + doctorSignatureFlag = doctorSignature; + } + // checking if test is prescribed if (requestOBJ.has("investigation") && !requestOBJ.get("investigation").isJsonNull() && requestOBJ.get("investigation") != null) { @@ -907,7 +915,7 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E } int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataSave(commonUtilityClass, isTestPrescribed, - isMedicinePrescribed, tcRequestOBJ); + isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag); if (i > 0) saveSuccessFlag = diagnosisSuccessFlag; @@ -1203,6 +1211,11 @@ public Long updateNCDCareDoctorData(JsonObject requestOBJ, String Authorization) Boolean isTestPrescribed = false; Boolean isMedicinePrescribed = false; + Boolean doctorSignatureFlag = false; + if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) { + doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean(); + } + // checking if test is prescribed if (requestOBJ.has("investigation") && !requestOBJ.get("investigation").isJsonNull() && requestOBJ.get("investigation") != null) { @@ -1312,7 +1325,7 @@ public Long updateNCDCareDoctorData(JsonObject requestOBJ, String Authorization) } int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataUpdate(commonUtilityClass, - isTestPrescribed, isMedicinePrescribed, tcRequestOBJ); + isTestPrescribed, isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag); if (i > 0) updateSuccessFlag = investigationSuccessFlag; diff --git a/src/main/java/com/iemr/tm/service/ncdscreening/NCDSCreeningDoctorServiceImpl.java b/src/main/java/com/iemr/tm/service/ncdscreening/NCDSCreeningDoctorServiceImpl.java index 2b6c8825..328fcbd6 100644 --- a/src/main/java/com/iemr/tm/service/ncdscreening/NCDSCreeningDoctorServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/ncdscreening/NCDSCreeningDoctorServiceImpl.java @@ -78,6 +78,8 @@ public int updateDoctorData(JsonObject requestOBJ, String Authorization) throws Integer findingSuccessFlag = null; Integer prescriptionSuccessFlag = null; Long referSaveSuccessFlag = null; + boolean doctorSignature = requestOBJ.has("doctorSignatureFlag"); + if (requestOBJ != null) { TeleconsultationRequestOBJ tcRequestOBJ = null; @@ -94,6 +96,11 @@ public int updateDoctorData(JsonObject requestOBJ, String Authorization) throws Boolean isTestPrescribed = false; Boolean isMedicinePrescribed = false; + Boolean doctorSignatureFlag = false; + if (doctorSignature) { + doctorSignatureFlag = doctorSignature; + } + // checking if test is prescribed if (requestOBJ.has("investigation") && !requestOBJ.get("investigation").isJsonNull() && requestOBJ.get("investigation") != null) { @@ -188,7 +195,7 @@ public int updateDoctorData(JsonObject requestOBJ, String Authorization) throws // call method to update beneficiary flow table int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataUpdate(commonUtilityClass, - isTestPrescribed, isMedicinePrescribed, tcRequestOBJ); + isTestPrescribed, isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag); if (i > 0) updateSuccessFlag = 1; diff --git a/src/main/java/com/iemr/tm/service/ncdscreening/NCDScreeningServiceImpl.java b/src/main/java/com/iemr/tm/service/ncdscreening/NCDScreeningServiceImpl.java index 0f750746..486361cb 100644 --- a/src/main/java/com/iemr/tm/service/ncdscreening/NCDScreeningServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/ncdscreening/NCDScreeningServiceImpl.java @@ -1008,7 +1008,8 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E Integer findingSuccessFlag = null; Integer prescriptionSuccessFlag = null; Long referSaveSuccessFlag = null; - Integer tcRequestStatusFlag = null; + boolean doctorSignature = requestOBJ.has("doctorSignatureFlag"); + if (requestOBJ != null) { TeleconsultationRequestOBJ tcRequestOBJ = null; @@ -1023,6 +1024,11 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E Boolean isTestPrescribed = false; Boolean isMedicinePrescribed = false; + Boolean doctorSignatureFlag = false; + if (doctorSignature) { + doctorSignatureFlag = doctorSignature; + } + // checking if test is prescribed if (requestOBJ.has("investigation") && !requestOBJ.get("investigation").isJsonNull() && requestOBJ.get("investigation") != null) { @@ -1119,7 +1125,7 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E } int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataSave(commonUtilityClass, isTestPrescribed, - isMedicinePrescribed, tcRequestOBJ); + isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag); if (i > 0) saveSuccessFlag = investigationSuccessFlag; diff --git a/src/main/java/com/iemr/tm/service/pnc/PNCServiceImpl.java b/src/main/java/com/iemr/tm/service/pnc/PNCServiceImpl.java index 6fe25634..e7dedec5 100644 --- a/src/main/java/com/iemr/tm/service/pnc/PNCServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/pnc/PNCServiceImpl.java @@ -300,7 +300,7 @@ public Long savePNCDoctorData(JsonObject requestOBJ, String Authorization) throw Long diagnosisSuccessFlag = null; Integer prescriptionSuccessFlag = null; Long referSaveSuccessFlag = null; - // Integer tcRequestStatusFlag = null; + boolean doctorSignature = requestOBJ.has("doctorSignatureFlag"); if (requestOBJ != null) { TeleconsultationRequestOBJ tcRequestOBJ = null; @@ -315,6 +315,11 @@ public Long savePNCDoctorData(JsonObject requestOBJ, String Authorization) throw Boolean isTestPrescribed = false; Boolean isMedicinePrescribed = false; + Boolean doctorSignatureFlag = false; + if (doctorSignature) { + doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean(); + } + // checking if test is prescribed if (requestOBJ.has("investigation") && !requestOBJ.get("investigation").isJsonNull() && requestOBJ.get("investigation") != null) { @@ -416,7 +421,7 @@ public Long savePNCDoctorData(JsonObject requestOBJ, String Authorization) throw } int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataSave(commonUtilityClass, isTestPrescribed, - isMedicinePrescribed, tcRequestOBJ); + isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag); if (i > 0) saveSuccessFlag = diagnosisSuccessFlag; @@ -1381,6 +1386,11 @@ public Long updatePNCDoctorData(JsonObject requestOBJ, String Authorization) thr Boolean isTestPrescribed = false; Boolean isMedicinePrescribed = false; + Boolean doctorSignatureFlag = false; + if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) { + doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean(); + } + // checking if test is prescribed if (requestOBJ.has("investigation") && !requestOBJ.get("investigation").isJsonNull() && requestOBJ.get("investigation") != null) { @@ -1489,7 +1499,7 @@ public Long updatePNCDoctorData(JsonObject requestOBJ, String Authorization) thr } int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataUpdate(commonUtilityClass, - isTestPrescribed, isMedicinePrescribed, tcRequestOBJ); + isTestPrescribed, isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag); if (i > 0) updateSuccessFlag = investigationSuccessFlag; diff --git a/src/main/java/com/iemr/tm/service/quickConsultation/QuickConsultationServiceImpl.java b/src/main/java/com/iemr/tm/service/quickConsultation/QuickConsultationServiceImpl.java index 8176b158..306e30a3 100644 --- a/src/main/java/com/iemr/tm/service/quickConsultation/QuickConsultationServiceImpl.java +++ b/src/main/java/com/iemr/tm/service/quickConsultation/QuickConsultationServiceImpl.java @@ -316,6 +316,8 @@ public Integer quickConsultDoctorDataInsert(JsonObject quickConsultDoctorOBJ, St Integer investigationSuccessFlag = null; Integer vitalsRBSTestFlag=null; Long referSaveSuccessFlag = null; + boolean doctorSignature = quickConsultDoctorOBJ.has("doctorSignatureFlag"); + TeleconsultationRequestOBJ tcRequestOBJ = null; CommonUtilityClass commonUtilityClass = InputMapper.gson().fromJson(quickConsultDoctorOBJ, @@ -339,6 +341,11 @@ public Integer quickConsultDoctorDataInsert(JsonObject quickConsultDoctorOBJ, St if (drugList != null && !drugList.isJsonNull() && drugList.size() > 0) isMedicinePrescribed = true; + Boolean doctorSignatureFlag = false; + if (doctorSignature) { + doctorSignatureFlag = doctorSignature; + } + // save prescribed medicine if (isMedicinePrescribed) { @@ -414,7 +421,7 @@ public Integer quickConsultDoctorDataInsert(JsonObject quickConsultDoctorOBJ, St } // call method to update beneficiary flow table int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataSave(commonUtilityClass, isTestPrescribed, - isMedicinePrescribed, tcRequestOBJ); + isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag); if (i > 0) returnOBJ = 1; @@ -521,6 +528,10 @@ public Long updateGeneralOPDQCDoctorData(JsonObject quickConsultDoctorOBJ, Strin Boolean isTestPrescribed = false; Boolean isMedicinePrescribed = false; + Boolean doctorSignatureFlag = false; + if (quickConsultDoctorOBJ.has("doctorSignatureFlag") && !quickConsultDoctorOBJ.get("doctorSignatureFlag").isJsonNull()) { + doctorSignatureFlag = quickConsultDoctorOBJ.get("doctorSignatureFlag").getAsBoolean(); + } // checking if test is prescribed if (quickConsultDoctorOBJ.has("labTestOrders")) { testList = quickConsultDoctorOBJ.getAsJsonArray("labTestOrders"); @@ -609,7 +620,7 @@ public Long updateGeneralOPDQCDoctorData(JsonObject quickConsultDoctorOBJ, Strin } int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataUpdate(commonUtilityClass, isTestPrescribed, - isMedicinePrescribed, tcRequestOBJ); + isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag); if (i > 0) updateSuccessFlag = benChiefComplaintID;