diff --git a/src/main/java/com/iemr/mmu/repo/benFlowStatus/BeneficiaryFlowStatusRepo.java b/src/main/java/com/iemr/mmu/repo/benFlowStatus/BeneficiaryFlowStatusRepo.java index da47c69a..b3d90026 100644 --- a/src/main/java/com/iemr/mmu/repo/benFlowStatus/BeneficiaryFlowStatusRepo.java +++ b/src/main/java/com/iemr/mmu/repo/benFlowStatus/BeneficiaryFlowStatusRepo.java @@ -170,24 +170,31 @@ public int updateBenFlowStatusAfterDoctorActivity(@Param("benFlowID") Long benFl @Transactional @Modifying - @Query("UPDATE BeneficiaryFlowStatus t set t.doctorFlag = :docFlag , t.pharmacist_flag = :pharmaFlag, " - + " t.oncologist_flag = :oncologistFlag, t.consultationDate = now(), t.processed = 'U', " - + " t.tCSpecialistUserID = :tcSpecialistUserID, t.tCRequestDate = :tcDate " - + " WHERE t.benFlowID = :benFlowID AND " + " t.beneficiaryRegID = :benRegID AND t.beneficiaryID = :benID ") + @Query("UPDATE BeneficiaryFlowStatus t set t.doctorFlag = :docFlag, " + + "t.pharmacist_flag = :pharmaFlag, t.doctorSignatureFlag = :signatureFlag, " + + "t.oncologist_flag = :oncologistFlag, t.consultationDate = now(), t.processed = 'U', " + + "t.tCSpecialistUserID = :tcSpecialistUserID, t.tCRequestDate = :tcDate " + + "WHERE t.benFlowID = :benFlowID AND t.beneficiaryRegID = :benRegID AND t.beneficiaryID = :benID") public int updateBenFlowStatusAfterDoctorActivityWDF(@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("tcSpecialistUserID") int tcSpecialistUserID, - @Param("tcDate") Timestamp tcDate); + @Param("benRegID") Long benRegID, @Param("benID") Long benID, + @Param("docFlag") Short docFlag, @Param("pharmaFlag") Short pharmaFlag, + @Param("oncologistFlag") Short oncologistFlag, + @Param("tcSpecialistUserID") int tcSpecialistUserID, + @Param("tcDate") Timestamp tcDate, + @Param("signatureFlag") Boolean signatureFlag); - @Transactional - @Modifying - @Query("UPDATE BeneficiaryFlowStatus t set t.pharmacist_flag = :pharmaFlag, " - + " t.oncologist_flag = :oncologistFlag, t.processed = 'U', t.specialist_flag = :tcSpecialistFlag " - + " 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); +@Transactional +@Modifying +@Query("UPDATE BeneficiaryFlowStatus t set t.pharmacist_flag = :pharmaFlag, " + + "t.doctorSignatureFlag = :signatureFlag, " + + "t.oncologist_flag = :oncologistFlag, t.processed = 'U', t.specialist_flag = :tcSpecialistFlag " + + "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("signatureFlag") Boolean signatureFlag); @Transactional @Modifying diff --git a/src/main/java/com/iemr/mmu/service/anc/ANCServiceImpl.java b/src/main/java/com/iemr/mmu/service/anc/ANCServiceImpl.java index a21c578d..01fcffc0 100644 --- a/src/main/java/com/iemr/mmu/service/anc/ANCServiceImpl.java +++ b/src/main/java/com/iemr/mmu/service/anc/ANCServiceImpl.java @@ -1475,6 +1475,10 @@ public Long updateANCDoctorData(JsonObject requestOBJ, String Authorization) thr Integer prescriptionSuccessFlag = null; Long referSaveSuccessFlag = null; Integer tcRequestStatusFlag = null; + Boolean doctorSignatureFlag = false; + if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) { + doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean(); + } if (requestOBJ != null) { TeleconsultationRequestOBJ tcRequestOBJ = null; @@ -1626,7 +1630,7 @@ public Long updateANCDoctorData(JsonObject requestOBJ, String Authorization) thr // call method to update beneficiary flow table 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/mmu/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java b/src/main/java/com/iemr/mmu/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java index 3296e47d..0fb6544f 100644 --- a/src/main/java/com/iemr/mmu/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java +++ b/src/main/java/com/iemr/mmu/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java @@ -279,8 +279,8 @@ public int updateBenFlowAfterDocData(Long benFlowID, Long benRegID, Long benID, } public int updateBenFlowAfterDocDataUpdate(Long benFlowID, Long benRegID, Long benID, Long benVisitID, - short docFlag, short pharmaFlag, short oncologistFlag, short tcSpecialistFlag, int tcUserID, - Timestamp tcDate) throws Exception { + short docFlag, short pharmaFlag, short oncologistFlag, short tcSpecialistFlag, + int tcUserID, Timestamp tcDate, Boolean signatureFlag) throws Exception { int i = 0; try { Short pharmaF = beneficiaryFlowStatusRepo.getPharmaFlag(benFlowID); @@ -291,8 +291,8 @@ public int updateBenFlowAfterDocDataUpdate(Long benFlowID, Long benRegID, Long b else pharmaF1 = pharmaFlag; - i = beneficiaryFlowStatusRepo.updateBenFlowStatusAfterDoctorActivity(benFlowID, benRegID, benID, docFlag, - pharmaF1, oncologistFlag, tcSpecialistFlag, tcUserID, tcDate, false); + i = beneficiaryFlowStatusRepo.updateBenFlowStatusAfterDoctorActivity(benFlowID, benRegID, benID, + docFlag, pharmaF1, oncologistFlag, tcSpecialistFlag, tcUserID, tcDate, signatureFlag); } catch (Exception e) { logger.error("Error in ben flow creation = " + e); throw new Exception(e); @@ -302,7 +302,7 @@ public int updateBenFlowAfterDocDataUpdate(Long benFlowID, Long benRegID, Long b public int updateBenFlowAfterDocDataUpdateWDF(Long benFlowID, Long benRegID, Long benID, Long benVisitID, short docFlag, short pharmaFlag, short oncologistFlag, int tcUserID, - Timestamp tcDate) throws Exception { + Timestamp tcDate, Boolean signatureFlag) throws Exception { int i = 0; try { Short pharmaF = beneficiaryFlowStatusRepo.getPharmaFlag(benFlowID); @@ -313,8 +313,8 @@ public int updateBenFlowAfterDocDataUpdateWDF(Long benFlowID, Long benRegID, Lon else pharmaF1 = pharmaFlag; - i = beneficiaryFlowStatusRepo.updateBenFlowStatusAfterDoctorActivityWDF(benFlowID, benRegID, benID, docFlag, - pharmaF1, oncologistFlag, tcUserID, tcDate); + i = beneficiaryFlowStatusRepo.updateBenFlowStatusAfterDoctorActivityWDF(benFlowID, benRegID, benID, + docFlag, pharmaF1, oncologistFlag, tcUserID, tcDate, signatureFlag); } catch (Exception e) { logger.error("Error in ben flow creation = " + e); throw new Exception(e); @@ -323,8 +323,8 @@ public int updateBenFlowAfterDocDataUpdateWDF(Long benFlowID, Long benRegID, Lon } public int updateBenFlowAfterDocDataUpdateTCSpecialist(Long benFlowID, Long benRegID, Long benID, Long benVisitID, - short docFlag, short pharmaFlag, short oncologistFlag, short tcSpecialistFlag, int tcUserID, - Timestamp tcDate) throws Exception { + short docFlag, short pharmaFlag, short oncologistFlag, short tcSpecialistFlag, + int tcUserID, Timestamp tcDate, Boolean signatureFlag) throws Exception { int i = 0; try { Short pharmaF = beneficiaryFlowStatusRepo.getPharmaFlag(benFlowID); @@ -336,7 +336,7 @@ public int updateBenFlowAfterDocDataUpdateTCSpecialist(Long benFlowID, Long benR pharmaF1 = pharmaFlag; i = beneficiaryFlowStatusRepo.updateBenFlowStatusAfterDoctorActivityTCSpecialist(benFlowID, benRegID, benID, - pharmaF1, oncologistFlag, tcSpecialistFlag); + pharmaF1, oncologistFlag, tcSpecialistFlag, signatureFlag); } catch (Exception e) { logger.error("Error in ben flow creation = " + e); throw new Exception(e); diff --git a/src/main/java/com/iemr/mmu/service/common/transaction/CommonDoctorServiceImpl.java b/src/main/java/com/iemr/mmu/service/common/transaction/CommonDoctorServiceImpl.java index f7e8839d..153b7fa0 100644 --- a/src/main/java/com/iemr/mmu/service/common/transaction/CommonDoctorServiceImpl.java +++ b/src/main/java/com/iemr/mmu/service/common/transaction/CommonDoctorServiceImpl.java @@ -825,8 +825,10 @@ public int updateBenFlowtableAfterDocDataSave(CommonUtilityClass commonUtilityCl * @param isMedicinePrescribed * @return */ - public int updateBenFlowtableAfterDocDataUpdate(CommonUtilityClass commonUtilityClass, Boolean isTestPrescribed, - Boolean isMedicinePrescribed, TeleconsultationRequestOBJ tcRequestOBJ) throws Exception { + public int updateBenFlowtableAfterDocDataUpdate(CommonUtilityClass commonUtilityClass, + Boolean isTestPrescribed, Boolean isMedicinePrescribed, + TeleconsultationRequestOBJ tcRequestOBJ, Boolean doctorSignatureFlag) throws Exception { + int i = 0; short pharmaFalg; short docFlag = (short) 0; @@ -852,7 +854,7 @@ public int updateBenFlowtableAfterDocDataUpdate(CommonUtilityClass commonUtility i = commonBenStatusFlowServiceImpl.updateBenFlowAfterDocDataUpdateTCSpecialist(tmpBenFlowID, tmpbeneficiaryRegID, tmpBeneficiaryID, tmpBenVisitID, docFlag, pharmaFalg, (short) 0, - tcSpecialistFlag, tcUserID, tcDate); + tcSpecialistFlag, tcUserID, tcDate, doctorSignatureFlag); } else { if (isTestPrescribed) @@ -880,13 +882,13 @@ public int updateBenFlowtableAfterDocDataUpdate(CommonUtilityClass commonUtility tcSpecialistFlag = (short) 100; i = commonBenStatusFlowServiceImpl.updateBenFlowAfterDocDataUpdate(tmpBenFlowID, tmpbeneficiaryRegID, tmpBeneficiaryID, tmpBenVisitID, docFlag, pharmaFalg, (short) 0, tcSpecialistFlag, tcUserID, - tcDate); + tcDate, doctorSignatureFlag); } else i = commonBenStatusFlowServiceImpl.updateBenFlowAfterDocDataUpdateWDF(tmpBenFlowID, tmpbeneficiaryRegID, tmpBeneficiaryID, tmpBenVisitID, docFlag, pharmaFalg, (short) 0, tcUserID, - tcDate); + tcDate, doctorSignatureFlag); } diff --git a/src/main/java/com/iemr/mmu/service/covid19/Covid19ServiceImpl.java b/src/main/java/com/iemr/mmu/service/covid19/Covid19ServiceImpl.java index d4ff81a0..c2868e44 100644 --- a/src/main/java/com/iemr/mmu/service/covid19/Covid19ServiceImpl.java +++ b/src/main/java/com/iemr/mmu/service/covid19/Covid19ServiceImpl.java @@ -839,6 +839,11 @@ public Long updateCovid19DoctorData(JsonObject requestOBJ, String Authorization) Integer prescriptionSuccessFlag = null; Long referSaveSuccessFlag = null; + Boolean doctorSignatureFlag = false; + if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) { + doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean(); + } + if (requestOBJ != null) { TeleconsultationRequestOBJ tcRequestOBJ = null; // TcSpecialistSlotBookingRequestOBJ tcSpecialistSlotBookingRequestOBJ = null; @@ -962,7 +967,7 @@ public Long updateCovid19DoctorData(JsonObject requestOBJ, String Authorization) // call method to update beneficiary flow table 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/mmu/service/generalOPD/GeneralOPDServiceImpl.java b/src/main/java/com/iemr/mmu/service/generalOPD/GeneralOPDServiceImpl.java index bac2f8ed..aa75eb58 100644 --- a/src/main/java/com/iemr/mmu/service/generalOPD/GeneralOPDServiceImpl.java +++ b/src/main/java/com/iemr/mmu/service/generalOPD/GeneralOPDServiceImpl.java @@ -1426,6 +1426,10 @@ public Long updateGeneralOPDDoctorData(JsonObject requestOBJ, String Authorizati Integer prescriptionSuccessFlag = null; Long referSaveSuccessFlag = null; Integer tcRequestStatusFlag = null; + Boolean doctorSignatureFlag = false; + if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) { + doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean(); + } if (requestOBJ != null) { TeleconsultationRequestOBJ tcRequestOBJ = null; @@ -1584,7 +1588,7 @@ public Long updateGeneralOPDDoctorData(JsonObject requestOBJ, String Authorizati // call method to update beneficiary flow table 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/mmu/service/ncdCare/NCDCareServiceImpl.java b/src/main/java/com/iemr/mmu/service/ncdCare/NCDCareServiceImpl.java index db55e967..aed7f4ea 100644 --- a/src/main/java/com/iemr/mmu/service/ncdCare/NCDCareServiceImpl.java +++ b/src/main/java/com/iemr/mmu/service/ncdCare/NCDCareServiceImpl.java @@ -1146,6 +1146,11 @@ public Long updateNCDCareDoctorData(JsonObject requestOBJ, String Authorization) Long referSaveSuccessFlag = null; Integer tcRequestStatusFlag = null; + Boolean doctorSignatureFlag = false; + if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) { + doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean(); + } + if (requestOBJ != null) { TeleconsultationRequestOBJ tcRequestOBJ = null; TcSpecialistSlotBookingRequestOBJ tcSpecialistSlotBookingRequestOBJ = null; @@ -1295,7 +1300,7 @@ public Long updateNCDCareDoctorData(JsonObject requestOBJ, String Authorization) // call method to update beneficiary flow table 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/mmu/service/ncdscreening/NCDSCreeningDoctorServiceImpl.java b/src/main/java/com/iemr/mmu/service/ncdscreening/NCDSCreeningDoctorServiceImpl.java index 6e470273..fad48bf5 100644 --- a/src/main/java/com/iemr/mmu/service/ncdscreening/NCDSCreeningDoctorServiceImpl.java +++ b/src/main/java/com/iemr/mmu/service/ncdscreening/NCDSCreeningDoctorServiceImpl.java @@ -76,6 +76,11 @@ public int updateDoctorData(JsonObject requestOBJ) throws Exception { Long referSaveSuccessFlag = null; // Integer tcRequestStatusFlag = null; + Boolean doctorSignatureFlag = false; + if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) { + doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean(); + } + if (requestOBJ != null) { TeleconsultationRequestOBJ tcRequestOBJ = null; // TcSpecialistSlotBookingRequestOBJ tcSpecialistSlotBookingRequestOBJ = null; @@ -240,7 +245,7 @@ public int updateDoctorData(JsonObject requestOBJ) throws Exception { // 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/mmu/service/pnc/PNCServiceImpl.java b/src/main/java/com/iemr/mmu/service/pnc/PNCServiceImpl.java index e1eee098..473151b5 100644 --- a/src/main/java/com/iemr/mmu/service/pnc/PNCServiceImpl.java +++ b/src/main/java/com/iemr/mmu/service/pnc/PNCServiceImpl.java @@ -1432,6 +1432,11 @@ public Long updatePNCDoctorData(JsonObject requestOBJ, String Authorization) thr Long referSaveSuccessFlag = null; Integer tcRequestStatusFlag = null; + Boolean doctorSignatureFlag = false; + if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) { + doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean(); + } + if (requestOBJ != null) { TeleconsultationRequestOBJ tcRequestOBJ = null; TcSpecialistSlotBookingRequestOBJ tcSpecialistSlotBookingRequestOBJ = null; @@ -1580,7 +1585,7 @@ public Long updatePNCDoctorData(JsonObject requestOBJ, String Authorization) thr // call method to update beneficiary flow table 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/mmu/service/quickConsultation/QuickConsultationServiceImpl.java b/src/main/java/com/iemr/mmu/service/quickConsultation/QuickConsultationServiceImpl.java index fc171805..7cf4801f 100644 --- a/src/main/java/com/iemr/mmu/service/quickConsultation/QuickConsultationServiceImpl.java +++ b/src/main/java/com/iemr/mmu/service/quickConsultation/QuickConsultationServiceImpl.java @@ -572,6 +572,12 @@ public Long updateGeneralOPDQCDoctorData(JsonObject quickConsultDoctorOBJ, Strin Long referupdateSuccessFlag = null; Integer tcRequestStatusFlag = null; + Boolean doctorSignatureFlag = false; + if (quickConsultDoctorOBJ.has("doctorSignatureFlag") + && !quickConsultDoctorOBJ.get("doctorSignatureFlag").isJsonNull()) { + doctorSignatureFlag = quickConsultDoctorOBJ.get("doctorSignatureFlag").getAsBoolean(); + } + TeleconsultationRequestOBJ tcRequestOBJ = null; TcSpecialistSlotBookingRequestOBJ tcSpecialistSlotBookingRequestOBJ = null; CommonUtilityClass commonUtilityClass = InputMapper.gson().fromJson(quickConsultDoctorOBJ, @@ -711,7 +717,7 @@ public Long updateGeneralOPDQCDoctorData(JsonObject quickConsultDoctorOBJ, Strin // call method to update beneficiary flow table int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataUpdate(commonUtilityClass, isTestPrescribed, - isMedicinePrescribed, tcRequestOBJ); + isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag); if (i > 0) { updateSuccessFlag = benChiefComplaintID;