Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
3814860
Abdm Facility fetch services changes
Sep 19, 2024
a2224b4
facility save after carecontext and patientcarecontextx update
Sep 26, 2024
1a28c2b
FacilityId save in mongo db and Variable declaration correction
Oct 8, 2024
fea418b
Mongo carecontext save query logic changes
Oct 8, 2024
9d30d46
ABHA Creation M1 V3 API changes
Oct 18, 2024
583594a
Abha V3 changes
Dec 9, 2024
8d206ef
resolved merge conflicts
Dec 9, 2024
4c76193
removed unused code
helenKaryamsetty Dec 9, 2024
c07d839
v3- verify auth by abdm API changes
Dec 12, 2024
d26eeda
Merge branch 'PSMRI:develop' into abdmV3
helenKaryamsetty Dec 12, 2024
5e93901
resolved merge conflicts
Dec 12, 2024
e669df1
fix pulled latest develop
helenKaryamsetty Oct 6, 2025
7a5c0d4
feat: Abdm M2 V3 changes
helenKaryamsetty Oct 6, 2025
43683a2
feat: mongo query change fetch for linktoken
helenKaryamsetty Oct 13, 2025
8ead599
Merge branch 'abdmV3' into abdmV3
helenKaryamsetty Oct 13, 2025
c1c5d38
fix: link carecontext authorization error
helenKaryamsetty Oct 14, 2025
497b3ff
Merge branch 'PSMRI:abdmV3' into abdmV3
helenKaryamsetty Oct 14, 2025
d748156
Merge branch 'abdmV3' of https://github.com/helenKaryamsetty/FHIR-API…
helenKaryamsetty Oct 14, 2025
811aef7
Merge branch 'PSMRI:abdmV3' into abdmV3
helenKaryamsetty Oct 31, 2025
945d874
feat: hiTypes addition
helenKaryamsetty Oct 31, 2025
c1c96f4
feat: version change for testing
helenKaryamsetty Oct 31, 2025
d267c17
fix: minor change for empty response
helenKaryamsetty Nov 4, 2025
49c97fa
fix: resolved merge conflicts
helenKaryamsetty Nov 4, 2025
6d5298f
Simplify queries in CareContextRepo interface
helenKaryamsetty Nov 4, 2025
23b4a20
fix: corrected response format
helenKaryamsetty Nov 6, 2025
db670fc
Merge branch 'abdmV3' of https://github.com/helenKaryamsetty/FHIR-API…
helenKaryamsetty Nov 6, 2025
5d6dd44
fix: minor logic change for care context linking
helenKaryamsetty Nov 19, 2025
1d9835a
Merge branch 'abdmV3' of https://github.com/helenKaryamsetty/FHIR-API…
helenKaryamsetty Nov 19, 2025
765d260
small correction in hiType and error message modification
helenKaryamsetty Dec 15, 2025
71c995d
Merge branch 'abdmV3' of https://github.com/helenKaryamsetty/FHIR-API…
helenKaryamsetty Dec 15, 2025
fec6064
modified error message
helenKaryamsetty Dec 15, 2025
fa7cf00
resolved merge conflicts
helenKaryamsetty Dec 15, 2025
7a21582
feat: new standard FHIR bundles creation
helenKaryamsetty Dec 22, 2025
09913fc
Merge branch 'abdmV3' of https://github.com/helenKaryamsetty/FHIR-API…
helenKaryamsetty Dec 22, 2025
8269c75
Fix environment variable for systemUrl
helenKaryamsetty Dec 22, 2025
055525e
Fix formatting of systemUrl property
helenKaryamsetty Dec 22, 2025
61506e6
fix: taken coderabbitai comments and minor changes
helenKaryamsetty Dec 23, 2025
a1df7fa
fix: resolved merge conflicts
helenKaryamsetty Dec 23, 2025
e2bec9a
fix: changed missed variable
helenKaryamsetty Dec 23, 2025
88654c5
fix: resolved merge conflicts
helenKaryamsetty Dec 23, 2025
e44be6f
Merge branch 'PSMRI:abdmV3' into abdmV3
helenKaryamsetty Dec 23, 2025
881bcbf
fix: modified the constructor
helenKaryamsetty Dec 23, 2025
d116010
Change exception message for Organization resource
helenKaryamsetty Dec 23, 2025
6237bad
Fix typo in exception message for PractitionerDataModel
helenKaryamsetty Dec 23, 2025
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 @@ -5,6 +5,8 @@

import org.springframework.stereotype.Component;

import com.wipro.fhir.utils.exception.FHIRException;

import lombok.Data;

@Component
Expand Down Expand Up @@ -38,35 +40,44 @@ public class OrganizationDataModel {
public OrganizationDataModel() {
}

public OrganizationDataModel(Object[] objArr) {
public OrganizationDataModel(Object[] objArr) throws FHIRException {

try {

this.benVisitID = objArr[0] != null ? Long.parseLong(objArr[0].toString()) : null;
this.serviceProviderID = objArr[1] != null ? Short.parseShort(objArr[1].toString()) : null;
this.serviceProviderName = objArr[2] != null ? objArr[2].toString() : null;

this.benVisitID = objArr[0] != null ? (Long) objArr[0] : null;
this.serviceProviderID = objArr[1] != null ? (Short) objArr[1] : null;
this.serviceProviderName = objArr[2] != null ? (String) objArr[2] : null;
this.stateID = objArr[3] != null ? Integer.parseInt(objArr[3].toString()) : null;
this.stateName = objArr[4] != null ? objArr[4].toString() : null;

this.stateID = objArr[3] != null ? (Integer) objArr[3] : null;
this.stateName = objArr[4] != null ? (String) objArr[4] : null;
this.districtID = objArr[5] != null ? Integer.parseInt(objArr[5].toString()) : null;
this.districtName = objArr[6] != null ? objArr[6].toString() : null;

this.districtID = objArr[5] != null ? (Integer) objArr[5] : null;
this.districtName = objArr[6] != null ? (String) objArr[6] : null;
this.locationName = objArr[7] != null ? objArr[7].toString() : null;
this.address = objArr[8] != null ? objArr[8].toString() : null;

this.locationName = objArr[7] != null ? (String) objArr[7] : null;
this.address = objArr[8] != null ? (String) objArr[8] : null;
this.serviceID = objArr[9] != null ? Short.parseShort(objArr[9].toString()) : null;
this.serviceName = objArr[10] != null ? objArr[10].toString() : null;

this.serviceID = objArr[9] != null ? (Short) objArr[9] : null;
this.serviceName = objArr[10] != null ? (String) objArr[10] : null;
this.isNational = objArr[11] != null
? objArr[11].toString().equalsIgnoreCase("true") || objArr[11].toString().equals("1")
: null;

this.isNational = objArr[11] != null ? (Boolean) objArr[11] : null;
this.abdmFacilityId = objArr[12] != null ? objArr[12].toString() : null;
this.abdmFacilityName = objArr[13] != null ? objArr[13].toString() : null;

this.abdmFacilityId = objArr[12] != null ? (String) objArr[12] : null;
this.abdmFacilityName = objArr[13] != null ? (String) objArr[13] : null;
this.psAddMapID = objArr[14] != null ? Integer.parseInt(objArr[14].toString()) : null;
this.providerServiceMapID = objArr[15] != null ? Integer.parseInt(objArr[15].toString()) : null;

Comment on lines +45 to +72
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Missing array bounds validation before element access.

The constructor accesses objArr[0] through objArr[15] (16 elements) without verifying that the array has sufficient length. An ArrayIndexOutOfBoundsException will be thrown for shorter arrays, which gets wrapped in a less informative FHIRException.

πŸ”Ž Proposed fix: Add bounds check at the start of try block
 	try {
+		if (objArr.length < 16) {
+			throw new FHIRException("Organization resource requires at least 16 elements, but got " + objArr.length);
+		}

 		this.benVisitID = objArr[0] != null ? Long.parseLong(objArr[0].toString()) : null;
πŸ€– Prompt for AI Agents
In src/main/java/com/wipro/fhir/data/resource_model/OrganizationDataModel.java
around lines 45 to 72, the constructor directly accesses objArr[0]..objArr[15]
without validating the array length; add a guard at the start of the try block
to verify objArr is not null and objArr.length >= 16 and if not, throw a
FHIRException (or return/handle) with a clear message indicating the missing
elements; keep the rest of the parsing logic the same so downstream parsing only
runs when the array has the expected 16 elements.

} catch (Exception e) {
throw new FHIRException("Organization resource failed with error - " + e.getMessage());
}

this.psAddMapID = objArr[14] != null ? (Integer) objArr[14] : null;
this.providerServiceMapID = objArr[15] != null ? (Integer) objArr[15] : null;
}


public OrganizationDataModel getOrganization(Object[] resultSet) {
public OrganizationDataModel getOrganization(Object[] resultSet) throws FHIRException {

if (resultSet == null || resultSet.length == 0) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

import org.springframework.stereotype.Component;

import com.wipro.fhir.utils.exception.FHIRException;

import lombok.Data;

@Data
Expand Down Expand Up @@ -37,27 +39,41 @@ public class PractitionerDataModel {
public PractitionerDataModel() {
}

public PractitionerDataModel(Object[] objArr) {

this.benVisitID = objArr[0] != null ? ((Number) objArr[0]).intValue() : null;
this.userID = objArr[1] != null ? ((Number) objArr[1]).intValue() : null;
this.fullName = (String) objArr[2];
this.dob = (Date) objArr[3];
this.employeeID = (String) objArr[4];
this.contactNo = (String) objArr[5];
this.emailID = (String) objArr[6];
this.qualificationName = (String) objArr[7];
this.designationName = (String) objArr[8];
this.genderName = (String) objArr[9];
this.genderID = objArr[10] != null ? ((Number) objArr[10]).intValue() : null;
this.serviceProviderID = objArr[11] != null ? ((Number) objArr[11]).intValue() : null;
this.visitCode = objArr[12] != null ? ((Number) objArr[12]).longValue() : null;
this.createdBy = (String) objArr[13];
this.createdDate = (Timestamp) objArr[14];
public PractitionerDataModel(Object[] objArr) throws FHIRException {

try {

this.benVisitID = objArr[0] != null ? Integer.parseInt(objArr[0].toString()) : null;
this.userID = objArr[1] != null ? Integer.parseInt(objArr[1].toString()) : null;

this.fullName = objArr[2] != null ? objArr[2].toString() : null;

this.dob = objArr[3] != null ? (objArr[3] instanceof Date ? (Date) objArr[3] : null) : null;

this.employeeID = objArr[4] != null ? objArr[4].toString() : null;
this.contactNo = objArr[5] != null ? objArr[5].toString() : null;
this.emailID = objArr[6] != null ? objArr[6].toString() : null;
this.qualificationName = objArr[7] != null ? objArr[7].toString() : null;
this.designationName = objArr[8] != null ? objArr[8].toString() : null;
this.genderName = objArr[9] != null ? objArr[9].toString() : null;

this.genderID = objArr[10] != null ? Integer.parseInt(objArr[10].toString()) : null;
this.serviceProviderID = objArr[11] != null ? Integer.parseInt(objArr[11].toString()) : null;

this.visitCode = objArr[12] != null ? Long.parseLong(objArr[12].toString()) : null;

this.createdBy = objArr[13] != null ? objArr[13].toString() : null;

this.createdDate = objArr[14] != null ? (objArr[14] instanceof Timestamp ? (Timestamp) objArr[14] : null)
: null;
} catch (Exception e) {
throw new FHIRException("Practitioner resource failed with error - " + e.getMessage());
}

}


public PractitionerDataModel getPractitioner(Object[] resultSet) {
public PractitionerDataModel getPractitioner(Object[] resultSet) throws FHIRException {
if (resultSet == null || resultSet.length == 0) {
return null;
}
Expand Down
Loading