Skip to content

Commit f83cd43

Browse files
authored
API changes in Signature enhancement for Casesheet (#133)
* fix:casesheet signature * fix: all visit code save data * fix: all visit code save data * fix: print data resposne doctor signature * fix:removed comments
1 parent 12e1ddd commit f83cd43

12 files changed

Lines changed: 100 additions & 32 deletions

File tree

src/main/java/com/iemr/mmu/data/benFlowStatus/BeneficiaryFlowStatus.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,11 @@ public class BeneficiaryFlowStatus {
274274
@Expose
275275
@Column(name = "isCaseSheetdownloaded")
276276
private Boolean isCaseSheetdownloaded;
277-
277+
278+
@Expose
279+
@Column(name = "doctor_signature_flag")
280+
private Boolean doctorSignatureFlag = false;
281+
278282
@Transient
279283
private I_bendemographics i_bendemographics;
280284
@Transient
@@ -368,8 +372,11 @@ public static BeneficiaryFlowStatus getBeneficiaryFlowStatusForLeftPanel(ArrayLi
368372
(String) objArr[3], (String) objArr[4], (Integer) objArr[5], (Short) objArr[6],
369373
(String) objArr[7], (String) objArr[8], (String) objArr[9], (Long) objArr[10],
370374
(String) objArr[11], (String) objArr[12], (String) objArr[13], (Long) objArr[14],
371-
(Timestamp) objArr[15], (Timestamp) objArr[16], (Long) objArr[17], (Timestamp) objArr[18],
375+
(Timestamp) objArr[15], (Timestamp) objArr[16], (Long) objArr[17], (Timestamp) objArr[18],
372376
(String) objArr[19], (String) objArr[20]);
377+
if (objArr.length > 21) {
378+
obj.setDoctorSignatureFlag((Boolean) objArr[21]);
379+
}
373380
}
374381
}
375382
return obj;
@@ -972,4 +979,14 @@ public void setAuth(String auth) {
972979
Auth = auth;
973980
}
974981

982+
// Add getter
983+
public Boolean getDoctorSignatureFlag() {
984+
return doctorSignatureFlag;
985+
}
986+
987+
// Add setter
988+
public void setDoctorSignatureFlag(Boolean doctorSignatureFlag) {
989+
this.doctorSignatureFlag = doctorSignatureFlag;
990+
}
991+
975992
}

src/main/java/com/iemr/mmu/repo/benFlowStatus/BeneficiaryFlowStatusRepo.java

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,12 @@ public int updateBenFlowStatusTMReferred(@Param("benFlowID") Long benFlowID, @Pa
7474
@Param("specialistFlag") Short specialistFlag, @Param("pharmacistflag") Short pharmacistflag);
7575

7676
@Query("SELECT t.benFlowID, t.beneficiaryRegID, t.visitDate, t.benName, t.age, t.ben_age_val, t.genderID, t.genderName, "
77-
+ " t.villageName, t.districtName, t.beneficiaryID, t.servicePointName, t.VisitReason, t.VisitCategory, t.benVisitID, "
78-
+ " t.registrationDate, t.benVisitDate, t.visitCode, t.consultationDate, t.fatherName, t.preferredPhoneNum FROM BeneficiaryFlowStatus t "
79-
+ " Where t.beneficiaryRegID = :benRegID AND t.benFlowID = :benFlowID ")
77+
+ " t.villageName, t.districtName, t.beneficiaryID, t.servicePointName, t.VisitReason, t.VisitCategory, "
78+
+ " t.benVisitID, t.registrationDate, t.benVisitDate, t.visitCode, t.consultationDate, "
79+
+ " t.fatherName, t.preferredPhoneNum, t.doctorSignatureFlag " // <-- added here
80+
+ " FROM BeneficiaryFlowStatus t "
81+
+ " WHERE t.beneficiaryRegID = :benRegID AND t.benFlowID = :benFlowID ")
82+
8083
public ArrayList<Object[]> getBenDetailsForLeftSidePanel(@Param("benRegID") Long benRegID,
8184
@Param("benFlowID") Long benFlowID);
8285

@@ -147,17 +150,24 @@ public ArrayList<BeneficiaryFlowStatus> getLabWorklistNew(
147150
@Param("providerServiceMapId") Integer providerServiceMapId, @Param("fromDate") Timestamp fromDate,
148151
@Param("vanID") Integer vanID);
149152

153+
150154
@Transactional
151155
@Modifying
152-
@Query("UPDATE BeneficiaryFlowStatus t set t.doctorFlag = :docFlag , t.pharmacist_flag = :pharmaFlag, "
153-
+ " t.oncologist_flag = :oncologistFlag, t.consultationDate = now(), t.processed = 'U', "
154-
+ " t.specialist_flag = :tcSpecialistFlag, t.tCSpecialistUserID = :tcSpecialistUserID, t.tCRequestDate = :tcDate "
155-
+ " WHERE t.benFlowID = :benFlowID AND " + " t.beneficiaryRegID = :benRegID AND t.beneficiaryID = :benID ")
156+
@Query("UPDATE BeneficiaryFlowStatus t set t.doctorFlag = :docFlag, "
157+
+ "t.pharmacist_flag = :pharmaFlag, t.doctorSignatureFlag = :signatureFlag, "
158+
+ "t.oncologist_flag = :oncologistFlag, t.consultationDate = now(), t.processed = 'U', "
159+
+ "t.specialist_flag = :tcSpecialistFlag, t.tCSpecialistUserID = :tcSpecialistUserID, "
160+
+ "t.tCRequestDate = :tcDate WHERE t.benFlowID = :benFlowID AND "
161+
+ "t.beneficiaryRegID = :benRegID AND t.beneficiaryID = :benID")
156162
public int updateBenFlowStatusAfterDoctorActivity(@Param("benFlowID") Long benFlowID,
157-
@Param("benRegID") Long benRegID, @Param("benID") Long benID, @Param("docFlag") Short docFlag,
158-
@Param("pharmaFlag") Short pharmaFlag, @Param("oncologistFlag") Short oncologistFlag,
159-
@Param("tcSpecialistFlag") Short tcSpecialistFlag, @Param("tcSpecialistUserID") int tcSpecialistUserID,
160-
@Param("tcDate") Timestamp tcDate);
163+
@Param("benRegID") Long benRegID, @Param("benID") Long benID,
164+
@Param("docFlag") Short docFlag, @Param("pharmaFlag") Short pharmaFlag,
165+
@Param("oncologistFlag") Short oncologistFlag,
166+
@Param("tcSpecialistFlag") Short tcSpecialistFlag,
167+
@Param("tcSpecialistUserID") int tcSpecialistUserID,
168+
@Param("tcDate") Timestamp tcDate,
169+
@Param("signatureFlag") Boolean signatureFlag);
170+
161171
@Transactional
162172
@Modifying
163173
@Query("UPDATE BeneficiaryFlowStatus t set t.doctorFlag = :docFlag , t.pharmacist_flag = :pharmaFlag, "

src/main/java/com/iemr/mmu/service/anc/ANCServiceImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ private int updateBenFlowNurseAfterNurseActivityANC(JsonObject investigationData
266266

267267
@Transactional(rollbackFor = Exception.class)
268268
public Long saveANCDoctorData(JsonObject requestOBJ, String Authorization) throws Exception {
269+
Boolean doctorSignatureFlag = false;
270+
if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) {
271+
doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean();
272+
}
269273
Long saveSuccessFlag = null;
270274
Long prescriptionID = null;
271275
Long investigationSuccessFlag = null;
@@ -415,7 +419,7 @@ public Long saveANCDoctorData(JsonObject requestOBJ, String Authorization) throw
415419

416420
// call method to update beneficiary flow table
417421
int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataSave(commonUtilityClass, isTestPrescribed,
418-
isMedicinePrescribed, tcRequestOBJ);
422+
isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag);
419423

420424
if (i > 0) {
421425
saveSuccessFlag = diagnosisSuccessFlag;

src/main/java/com/iemr/mmu/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,19 @@ private BeneficiaryFlowStatus getBenFlowRecordObj(String requestOBJ, Long benefi
261261
return obj;
262262
}
263263

264-
public int updateBenFlowAfterDocData(Long benFlowID, Long benRegID, Long benID, Long benVisitID, short docFlag,
265-
short pharmaFlag, short oncologistFlag, short tcSpecialistFlag, int tcUserID, Timestamp tcDate) {
264+
public int updateBenFlowAfterDocData(Long benFlowID, Long benRegID, Long benID, Long benVisitID,
265+
short docFlag, short pharmaFlag, short oncologistFlag, short tcSpecialistFlag,
266+
int tcUserID, Timestamp tcDate, Boolean signatureFlag) throws Exception {
266267
int i = 0;
267268
try {
268-
i = beneficiaryFlowStatusRepo.updateBenFlowStatusAfterDoctorActivity(benFlowID, benRegID, benID, docFlag,
269-
pharmaFlag, oncologistFlag, tcSpecialistFlag, tcUserID, tcDate);
269+
Short pharmaF = beneficiaryFlowStatusRepo.getPharmaFlag(benFlowID);
270+
Short pharmaF1 = (pharmaF != null && pharmaF == 1) ? pharmaF : pharmaFlag;
271+
272+
i = beneficiaryFlowStatusRepo.updateBenFlowStatusAfterDoctorActivity(benFlowID, benRegID, benID,
273+
docFlag, pharmaF1, oncologistFlag, tcSpecialistFlag, tcUserID, tcDate, signatureFlag);
270274
} catch (Exception e) {
271-
logger.error("Error in ben flow creation = " + e);
275+
logger.error("Error in ben flow update = " + e);
276+
throw new Exception(e);
272277
}
273278
return i;
274279
}
@@ -287,7 +292,7 @@ public int updateBenFlowAfterDocDataUpdate(Long benFlowID, Long benRegID, Long b
287292
pharmaF1 = pharmaFlag;
288293

289294
i = beneficiaryFlowStatusRepo.updateBenFlowStatusAfterDoctorActivity(benFlowID, benRegID, benID, docFlag,
290-
pharmaF1, oncologistFlag, tcSpecialistFlag, tcUserID, tcDate);
295+
pharmaF1, oncologistFlag, tcSpecialistFlag, tcUserID, tcDate, false);
291296
} catch (Exception e) {
292297
logger.error("Error in ben flow creation = " + e);
293298
throw new Exception(e);

src/main/java/com/iemr/mmu/service/cancerScreening/CSServiceImpl.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,10 @@ public String getBenDataFrmNurseToDocExaminationScreen(Long benRegID, Long visit
726726
// -------Create/save (Doctor)---------------------------
727727
@Transactional(rollbackFor = Exception.class)
728728
public Long saveCancerScreeningDoctorData(JsonObject requestOBJ, String Authorization) throws Exception {
729+
Boolean doctorSignatureFlag = false;
730+
if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) {
731+
doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean();
732+
}
729733
Long docDataSuccessFlag = null;
730734
Integer tcRequestStatusFlag = null;
731735

@@ -809,11 +813,11 @@ public Long saveCancerScreeningDoctorData(JsonObject requestOBJ, String Authoriz
809813
tcUserID = tcRequestOBJ.getUserID();
810814
tcDate = tcRequestOBJ.getAllocationDate();
811815

812-
}
813-
816+
}
817+
814818
int l = commonBenStatusFlowServiceImpl.updateBenFlowAfterDocData(tmpBenFlowID, tmpbeneficiaryRegID,
815819
tmpBeneficiaryID, tmpBenVisitID, docFlag, pharmaFalg, oncologistFlag, tcSpecialistFlag,
816-
tcUserID, tcDate);
820+
tcUserID, tcDate, doctorSignatureFlag);
817821

818822
docDataSuccessFlag = diagnosisSuccessFlag;
819823
}

src/main/java/com/iemr/mmu/service/common/transaction/CommonDoctorServiceImpl.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,10 @@ public Long updateBenReferDetails(JsonObject referObj) throws IEMRException {
764764
*/
765765
/// ------Start of beneficiary flow table after doctor data save-------------
766766

767-
public int updateBenFlowtableAfterDocDataSave(CommonUtilityClass commonUtilityClass, Boolean isTestPrescribed,
768-
Boolean isMedicinePrescribed, TeleconsultationRequestOBJ tcRequestOBJ) {
767+
public int updateBenFlowtableAfterDocDataSave(CommonUtilityClass commonUtilityClass,
768+
Boolean isTestPrescribed, Boolean isMedicinePrescribed,
769+
TeleconsultationRequestOBJ tcRequestOBJ, Boolean doctorSignatureFlag) throws Exception {
770+
769771
short pharmaFalg;
770772
short docFlag;
771773
short tcSpecialistFlag = (short) 0;
@@ -807,7 +809,8 @@ public int updateBenFlowtableAfterDocDataSave(CommonUtilityClass commonUtilityCl
807809
}
808810

809811
int i = commonBenStatusFlowServiceImpl.updateBenFlowAfterDocData(tmpBenFlowID, tmpbeneficiaryRegID,
810-
tmpBeneficiaryID, tmpBenVisitID, docFlag, pharmaFalg, (short) 0, tcSpecialistFlag, tcUserID, tcDate);
812+
tmpBeneficiaryID, tmpBenVisitID, docFlag, pharmaFalg, (short) 0, tcSpecialistFlag,
813+
tcUserID, tcDate, doctorSignatureFlag);
811814
return i;
812815
}
813816

src/main/java/com/iemr/mmu/service/covid19/Covid19ServiceImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,10 @@ private String getCovidDiagnosisData(Long benRegID, Long visitCode) {
11491149
/// --------------- start of saving doctor data ------------------------
11501150
@Transactional(rollbackFor = Exception.class)
11511151
public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws Exception {
1152+
Boolean doctorSignatureFlag = false;
1153+
if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) {
1154+
doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean();
1155+
}
11521156
Long saveSuccessFlag = null;
11531157
Long prescriptionID = null;
11541158
Long investigationSuccessFlag = null;
@@ -1258,7 +1262,7 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E
12581262

12591263
// call method to update beneficiary flow table
12601264
int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataSave(commonUtilityClass, isTestPrescribed,
1261-
isMedicinePrescribed, tcRequestOBJ);
1265+
isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag);
12621266

12631267
if (i > 0) {
12641268
saveSuccessFlag = referSaveSuccessFlag;

src/main/java/com/iemr/mmu/service/generalOPD/GeneralOPDServiceImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,10 @@ public Long saveBenExaminationDetails(JsonObject examinationDetailsOBJ, Long ben
784784
@Override
785785
@Transactional(rollbackFor = Exception.class)
786786
public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws Exception {
787+
Boolean doctorSignatureFlag = false;
788+
if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) {
789+
doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean();
790+
}
787791
Long saveSuccessFlag = null;
788792
Long prescriptionID = null;
789793
Long investigationSuccessFlag = null;
@@ -939,7 +943,7 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E
939943

940944
// call method to update beneficiary flow table
941945
int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataSave(commonUtilityClass, isTestPrescribed,
942-
isMedicinePrescribed, tcRequestOBJ);
946+
isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag);
943947

944948
if (i > 0) {
945949
saveSuccessFlag = investigationSuccessFlag;

src/main/java/com/iemr/mmu/service/ncdCare/NCDCareServiceImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,10 @@ public String getBeneficiaryVitalDetails(Long beneficiaryRegID, Long visitCode)
685685
/// --------------- start of saving doctor data ------------------------
686686
@Transactional(rollbackFor = Exception.class)
687687
public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws Exception {
688+
Boolean doctorSignatureFlag = false;
689+
if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) {
690+
doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean();
691+
}
688692
Long saveSuccessFlag = null;
689693
Long prescriptionID = null;
690694
Long investigationSuccessFlag = null;
@@ -868,7 +872,7 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E
868872

869873
// call method to update beneficiary flow table
870874
int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataSave(commonUtilityClass, isTestPrescribed,
871-
isMedicinePrescribed, tcRequestOBJ);
875+
isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag);
872876

873877
if (i > 0) {
874878
saveSuccessFlag = diagnosisSuccessFlag;

src/main/java/com/iemr/mmu/service/ncdscreening/NCDScreeningServiceImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,10 @@ public Long UpdateIDRSScreen(JsonObject idrsOBJ) throws Exception {
11691169

11701170
@Transactional(rollbackFor = Exception.class)
11711171
public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws Exception {
1172+
Boolean doctorSignatureFlag = false;
1173+
if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) {
1174+
doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean();
1175+
}
11721176
Long saveSuccessFlag = null;
11731177
Long prescriptionID = null;
11741178
Long investigationSuccessFlag = null;
@@ -1347,7 +1351,7 @@ public Long saveDoctorData(JsonObject requestOBJ, String Authorization) throws E
13471351

13481352
// call method to update beneficiary flow table
13491353
int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataSave(commonUtilityClass, isTestPrescribed,
1350-
isMedicinePrescribed, tcRequestOBJ);
1354+
isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag);
13511355

13521356
if (i > 0) {
13531357

0 commit comments

Comments
 (0)