-
Notifications
You must be signed in to change notification settings - Fork 31
Update the branch from Release 3.5.1 to Release 3.4.1 #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
18e89ea
f2a546f
3f52227
f232c1c
3db94c9
d621130
f1efb4d
5e5e078
869c023
f1ebcf4
e8f40d7
b1e6a4a
0c5481d
12e1ddd
f83cd43
c9f6a59
606c45d
0fd1bb5
d81128f
95475bd
406331a
6f2922e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -274,7 +274,11 @@ public class BeneficiaryFlowStatus { | |
| @Expose | ||
| @Column(name = "isCaseSheetdownloaded") | ||
| private Boolean isCaseSheetdownloaded; | ||
|
|
||
|
|
||
| @Expose | ||
| @Column(name = "doctor_signature_flag") | ||
| private Boolean doctorSignatureFlag = false; | ||
|
|
||
| @Transient | ||
| private I_bendemographics i_bendemographics; | ||
| @Transient | ||
|
|
@@ -368,8 +372,11 @@ public static BeneficiaryFlowStatus getBeneficiaryFlowStatusForLeftPanel(ArrayLi | |
| (String) objArr[3], (String) objArr[4], (Integer) objArr[5], (Short) objArr[6], | ||
| (String) objArr[7], (String) objArr[8], (String) objArr[9], (Long) objArr[10], | ||
| (String) objArr[11], (String) objArr[12], (String) objArr[13], (Long) objArr[14], | ||
| (Timestamp) objArr[15], (Timestamp) objArr[16], (Long) objArr[17], (Timestamp) objArr[18], | ||
| (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]); | ||
| } | ||
|
Comment on lines
+377
to
+379
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Robust Boolean extraction from native result to avoid ClassCastException Direct cast to Boolean can blow up when JDBC returns 0/1 (Number). Parse defensively and avoid the magic index. Apply: - if (objArr.length > 21) {
- obj.setDoctorSignatureFlag((Boolean) objArr[21]);
- }
+ if (objArr.length > 21) {
+ Object v = objArr[21];
+ Boolean flag = (v instanceof Boolean) ? (Boolean) v
+ : (v instanceof Number) ? (((Number) v).intValue() != 0)
+ : (v != null ? Boolean.parseBoolean(v.toString()) : null);
+ obj.setDoctorSignatureFlag(flag);
+ }Optionally, replace 21 with a named constant tied to the SELECT list to prevent drift. |
||
| } | ||
| } | ||
| return obj; | ||
|
|
@@ -972,4 +979,14 @@ public void setAuth(String auth) { | |
| Auth = auth; | ||
| } | ||
|
|
||
| // Add getter | ||
| public Boolean getDoctorSignatureFlag() { | ||
| return doctorSignatureFlag; | ||
| } | ||
|
|
||
| // Add setter | ||
| public void setDoctorSignatureFlag(Boolean doctorSignatureFlag) { | ||
| this.doctorSignatureFlag = doctorSignatureFlag; | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,6 @@ | |
| import com.google.gson.annotations.Expose; | ||
| import lombok.Data; | ||
|
|
||
| import lombok.Data; | ||
|
|
||
| @Entity | ||
| @Data | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,13 +24,16 @@ | |
| import java.math.BigInteger; | ||
| import java.util.ArrayList; | ||
|
|
||
| import org.springframework.data.jpa.repository.Modifying; | ||
| import org.springframework.data.jpa.repository.Query; | ||
| import org.springframework.data.repository.CrudRepository; | ||
| import org.springframework.data.repository.query.Param; | ||
| import org.springframework.stereotype.Repository; | ||
|
|
||
| import com.iemr.mmu.data.labModule.LabResultEntry; | ||
|
|
||
| import jakarta.transaction.Transactional; | ||
|
|
||
| @Repository | ||
| public interface LabResultEntryRepo extends CrudRepository<LabResultEntry, BigInteger> { | ||
| @Query("SELECT procedureID FROM LabResultEntry WHERE beneficiaryRegID = :benRegID AND " | ||
|
|
@@ -46,4 +49,9 @@ | |
| ArrayList<Object[]> getLast_3_visitForLabTestDone(@Param("benRegID") Long benRegID, | ||
| @Param("visitCode") Long visitCode); | ||
|
|
||
| @Transactional | ||
| @Modifying | ||
| @Query(" UPDATE LabResultEntry set vanSerialNo = :ID WHERE ID = :ID") | ||
| int updateVanSerialNo(@Param("ID") BigInteger ID); | ||
|
Check warning on line 55 in src/main/java/com/iemr/mmu/repo/labModule/LabResultEntryRepo.java
|
||
|
Comment on lines
+52
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π§© Analysis chainLGTM! Verify return value handling in service layer. The However, ensure that calling code in the service layer checks the return value to confirm successful updates, especially since this operation occurs after the initial save. Run the following script to verify that callers handle the return value: π Script executed: #!/bin/bash
# Description: Check if callers of updateVanSerialNo verify the return value
# Search for calls to updateVanSerialNo
rg -nP -A 2 'updateVanSerialNo\s*\(' --type=javaLength of output: 4394 Handle updateVanSerialNo return value All service-layer calls to updateVanSerialNo ignore the returned row count; capture the int result and verify itβs >0, handling failures (e.g., throw or log) as appropriate. π€ Prompt for AI Agents |
||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π§© Analysis chain
Persisting doctorSignatureFlag: ensure schema + nullability are aligned
Looks fine. If nulls arenβt expected, mark the column non-nullable and confirm the migration adds it with a safe default.
Please verify:
π Script executed:
Length of output: 35304
Length of output: 749
π Script executed:
Length of output: 2554
Fix unsafe Boolean cast and add missing database migration
The mapper at line 378 uses an unsafe direct cast:
(Boolean) objArr[21]. JDBC drivers returnIntegerorShort(0/1) for boolean columns, notBooleantype. This will throw aClassCastExceptionat runtime.Additionally, no database migration file was found in the repository. The schema migration for
doctor_signature_flagmust be included in the PR.Required fixes:
Mapper (line 378): Replace direct Boolean cast with safe conversion:
Database migration: Add a Flyway/Liquibase migration file that adds the
doctor_signature_flagcolumn withTINYINT(1)type, default0, andNOT NULLconstraint to thei_ben_flow_outreachtable. Ensure it handles existing rows safely (e.g., via UPDATE statement).π€ Prompt for AI Agents