Skip to content

Commit 7bf1e45

Browse files
helenKaryamsettyKA40094929KA40094929Karyamsetty Helen Grace
authored
Bundle model fixes (#127)
* Abdm Facility fetch services changes * facility save after carecontext and patientcarecontextx update * FacilityId save in mongo db and Variable declaration correction * Mongo carecontext save query logic changes * ABHA Creation M1 V3 API changes * Abha V3 changes * removed unused code * v3- verify auth by abdm API changes * feat: Abdm M2 V3 changes * feat: mongo query change fetch for linktoken * fix: link carecontext authorization error * feat: hiTypes addition * feat: version change for testing * fix: minor change for empty response * Simplify queries in CareContextRepo interface Removed unnecessary 'order by 1 desc' clause from queries. * fix: corrected response format * fix: minor logic change for care context linking * small correction in hiType and error message modification * modified error message * feat: new standard FHIR bundles creation * Fix environment variable for systemUrl * Fix formatting of systemUrl property * fix: taken coderabbitai comments and minor changes * fix: changed missed variable * fix: modified the constructor * Change exception message for Organization resource * Fix typo in exception message for PractitionerDataModel * fix: corrected type error * fix: correct medication histoory model class --------- Co-authored-by: KA40094929 <KA40094929@10.152.32.202> Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <ka40094929@wipro.com>
1 parent 1128ffa commit 7bf1e45

2 files changed

Lines changed: 12 additions & 31 deletions

File tree

src/main/java/com/wipro/fhir/data/resource_model/MedicalHistoryDataModel.java

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,49 +19,31 @@ public class MedicalHistoryDataModel implements Serializable {
1919

2020

2121
private BigInteger id;
22-
private BigInteger beneficiaryRegID;
23-
private String visitCode;
22+
private BigInteger providerServiceMapID;
2423
private String currentMedication;
25-
private Integer currentMedYear;
26-
private String yearOfIllness;
27-
private String finalIllnessType;
28-
private String yearOfSurgery;
29-
private String finalSurgeryType;
30-
private Timestamp createdDate;
24+
private Timestamp currentMedYear;
3125
private String createdBy;
26+
private Timestamp createdDate;
3227
public MedicalHistoryDataModel() {
3328
}
3429

3530
public MedicalHistoryDataModel(Object[] objArr) throws Exception {
3631
try {
3732

38-
this.id = objArr[0] != null
39-
? BigInteger.valueOf(Long.parseLong(objArr[0].toString()))
40-
: null;
41-
42-
this.beneficiaryRegID = objArr[1] != null
43-
? BigInteger.valueOf(Long.parseLong(objArr[1].toString()))
44-
: null;
45-
46-
// visitCode is STRING only
47-
this.visitCode = objArr[2] != null ? objArr[2].toString() : null;
33+
this.id = objArr[0] != null ? BigInteger.valueOf(Long.parseLong(objArr[0].toString())) : null;
34+
35+
this.providerServiceMapID = objArr[1] != null ? BigInteger.valueOf(Long.parseLong(objArr[1].toString())) : null;
4836

49-
this.currentMedication = objArr[3] != null ? objArr[3].toString() : null;
37+
this.currentMedication = objArr[2] != null ? objArr[2].toString() : null;
5038

51-
this.currentMedYear = objArr[4] != null
52-
? Integer.parseInt(objArr[4].toString())
53-
: null;
39+
this.currentMedYear = objArr[3] instanceof Timestamp ? (Timestamp) objArr[3] : null;
5440

55-
this.yearOfIllness = objArr[5] != null ? objArr[5].toString() : null;
56-
this.finalIllnessType = objArr[6] != null ? objArr[6].toString() : null;
57-
this.yearOfSurgery = objArr[7] != null ? objArr[7].toString() : null;
58-
this.finalSurgeryType = objArr[8] != null ? objArr[8].toString() : null;
41+
this.createdBy = objArr[4] != null ? objArr[4].toString() : null;
5942

60-
this.createdDate = objArr[9] instanceof Timestamp ? (Timestamp) objArr[9] : null;
61-
this.createdBy = objArr[10] != null ? objArr[10].toString() : null;
43+
this.createdDate = objArr[5] instanceof Timestamp ? (Timestamp) objArr[5] : null;
6244

6345
} catch (Exception e) {
64-
throw new Exception("Medical statement resource model failed with error - " + e.getMessage());
46+
throw new Exception("Medical History resource model failed with error - " + e.getMessage());
6547
}
6648

6749
}

src/main/java/com/wipro/fhir/repo/common/PatientEligibleForResourceCreationRepo.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ List<Object[]> callMedicationRequestSP(@Param("beneficiaryRegID_IN") BigInteger
121121
List<Object[]> callMedicalHistorySp(@Param("visitCode_IN") BigInteger visitCode_IN);
122122

123123
//Immunization record
124-
@Query(nativeQuery = true, value = "CALL db_iemr.FHIR_R_Immunization(:beneficiaryRegID_IN, :visitCode_IN, @0, "
125-
+ "@1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11, @12)")
124+
@Query(nativeQuery = true, value = "CALL db_iemr.FHIR_R_Immunization(:beneficiaryRegID_IN, :visitCode_IN)")
126125
List<Object[]> callImmunizationSP(@Param("beneficiaryRegID_IN") BigInteger beneficiaryRegID_IN, @Param("visitCode_IN") BigInteger visitCode_IN);
127126

128127
@Query(nativeQuery = true, value = "CALL db_iemr.FHIR_R_OrganizationDetails(:visitCode_IN)")

0 commit comments

Comments
 (0)