Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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<Object[]> getBenDetailsForLeftSidePanel(@Param("benRegID") Long benRegID,
@Param("benFlowID") Long benFlowID);
Expand Down Expand Up @@ -204,17 +204,18 @@ public ArrayList<BeneficiaryFlowStatus> 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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 ")
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/com/iemr/tm/service/anc/ANCServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,11 @@
Long referSaveSuccessFlag = null;
Integer tcRequestStatusFlag = null;

Boolean doctorSignatureFlag = false;
if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) {

Check failure on line 354 in src/main/java/com/iemr/tm/service/anc/ANCServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "doctorSignatureFlag" 6 times.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-API&issues=AZrKn0yWNF6ICcNMq--z&open=AZrKn0yWNF6ICcNMq--z&pullRequest=105
doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean();
}

if (requestOBJ != null) {
TeleconsultationRequestOBJ tcRequestOBJ = null;
// TcSpecialistSlotBookingRequestOBJ tcSpecialistSlotBookingRequestOBJ = null;
Expand Down Expand Up @@ -466,7 +471,7 @@

}
int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataSave(commonUtilityClass, isTestPrescribed,
isMedicinePrescribed, tcRequestOBJ);
isMedicinePrescribed, tcRequestOBJ,doctorSignatureFlag);

if (i > 0)
saveSuccessFlag = diagnosisSuccessFlag;
Expand Down Expand Up @@ -1488,6 +1493,11 @@
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) {
Expand Down Expand Up @@ -1596,7 +1606,7 @@

}
int i = commonDoctorServiceImpl.updateBenFlowtableAfterDocDataUpdate(commonUtilityClass,
isTestPrescribed, isMedicinePrescribed, tcRequestOBJ);
isTestPrescribed, isMedicinePrescribed, tcRequestOBJ, doctorSignatureFlag);
if (i > 0)
updateSuccessFlag = investigationSuccessFlag;
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.ArrayList;
import java.util.Calendar;

import org.checkerframework.checker.units.qual.s;

Check warning on line 30 in src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unused import 'org.checkerframework.checker.units.qual.s'.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-API&issues=AZrKn0xbNF6ICcNMq--y&open=AZrKn0xbNF6ICcNMq--y&pullRequest=105
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -242,35 +243,35 @@
}

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);
}
return i;
}

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);
}
return i;
}

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);
}
Expand All @@ -279,7 +280,7 @@

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 {

Check warning on line 283 in src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-API&issues=AZrKn0xbNF6ICcNMq--w&open=AZrKn0xbNF6ICcNMq--w&pullRequest=105
int i = 0;
try {
Short pharmaF = beneficiaryFlowStatusRepo.getPharmaFlag(benFlowID);
Expand All @@ -291,7 +292,7 @@
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);
Expand All @@ -301,7 +302,7 @@

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 {

Check warning on line 305 in src/main/java/com/iemr/tm/service/benFlowStatus/CommonBenStatusFlowServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-API&issues=AZrKn0xbNF6ICcNMq--x&open=AZrKn0xbNF6ICcNMq--x&pullRequest=105
int i = 0;
try {
Short pharmaF = beneficiaryFlowStatusRepo.getPharmaFlag(benFlowID);
Expand All @@ -313,7 +314,7 @@
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,12 @@
Long docDataSuccessFlag = null;
Long tcRequestStatusFlag = null;

Boolean doctorSignatureFlag = false;
if (requestOBJ.has("doctorSignatureFlag") && !requestOBJ.get("doctorSignatureFlag").isJsonNull()) {

Check failure on line 815 in src/main/java/com/iemr/tm/service/cancerScreening/CSServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "doctorSignatureFlag" 3 times.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-API&issues=AZrKn0uJNF6ICcNMq--r&open=AZrKn0uJNF6ICcNMq--r&pullRequest=105
doctorSignatureFlag = requestOBJ.get("doctorSignatureFlag").getAsBoolean();
}


if (requestOBJ != null && requestOBJ.has("diagnosis") && !requestOBJ.get("diagnosis").isJsonNull()) {

TeleconsultationRequestOBJ tcRequestOBJ = null;
Expand Down Expand Up @@ -907,7 +913,7 @@
&& 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(
Expand All @@ -916,7 +922,7 @@
} 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)
Expand Down
Loading