Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f501ca7
Abdm v3 (#112)
helenKaryamsetty Oct 7, 2025
efa413b
Update pom.xml
helenKaryamsetty Oct 7, 2025
2275422
mongo query change fetch to linktoken (#113)
helenKaryamsetty Oct 13, 2025
4809e07
Abdm v3 (#114)
helenKaryamsetty Oct 14, 2025
f55c90e
ABDM Abdm HiTypes addition in linktoken (#115)
helenKaryamsetty Oct 31, 2025
d417c96
Minor fixes (#116)
helenKaryamsetty Nov 4, 2025
84427db
response correction (#117)
helenKaryamsetty Nov 6, 2025
c0312c4
generate token logic change (#120)
helenKaryamsetty Nov 19, 2025
b5b9995
hiType correction and modification in error message format (#121)
helenKaryamsetty Dec 15, 2025
6dadda6
Modified error message display (#122)
helenKaryamsetty Dec 15, 2025
955ec3f
M2 FHIR bundles creation (#123)
helenKaryamsetty Dec 23, 2025
32ba209
added missed variable change (#124)
helenKaryamsetty Dec 23, 2025
81dda6d
Modified the constructor for better handling (#125)
helenKaryamsetty Dec 23, 2025
1128ffa
medication statement correction (#126)
helenKaryamsetty Dec 23, 2025
7bf1e45
Bundle model fixes (#127)
helenKaryamsetty Dec 30, 2025
ba2c133
Merge branch 'release-3.6.1' into abdmV3
helenKaryamsetty Dec 30, 2025
1578ade
Update jboss-web.xml
helenKaryamsetty Dec 30, 2025
b3a6b11
Update common_docker.properties
helenKaryamsetty Dec 30, 2025
179b34d
Delete src/main/environment/common_test.properties
helenKaryamsetty Dec 30, 2025
cd22115
Delete src/main/environment/common_dev.properties
helenKaryamsetty Dec 30, 2025
534d757
taken coderabbit comments (#129)
helenKaryamsetty Dec 30, 2025
8b16580
Update CareContextRepo.java
helenKaryamsetty Dec 30, 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
2 changes: 1 addition & 1 deletion .factorypath
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<factorypath>
<factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.36/lombok-1.18.36.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.30/lombok-1.18.30.jar" enabled="true" runInBatchMode="false"/>
<factorypathentry kind="VARJAR" id="M2_REPO/org/mapstruct/mapstruct-processor/1.2.0.Final/mapstruct-processor-1.2.0.Final.jar" enabled="true" runInBatchMode="false"/>
</factorypath>
54 changes: 45 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>
<groupId>com.wipro.fhir.r4</groupId>
<artifactId>fhir-api</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
<packaging>war</packaging>
<name>FHIR-API</name>
<description>FHIR_NDHM standard integration in AMRIT</description>
Expand Down Expand Up @@ -186,39 +186,74 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.14.2</version>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.2</version>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.14.2</version>
<version>2.15.2</version>
</dependency>

<!-- https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-structures-r4 -->
<!--
https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-structures-r4 -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-r4</artifactId>
<version>6.10.0</version>
<version>8.4.0</version>
</dependency>


<!--
https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-validation -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation</artifactId>
<version>8.4.0</version>
</dependency>

<!--
https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-structures-r4 -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-r4</artifactId>
<version>8.4.0</version>
</dependency>


<!-- Choose a HAPI version that matches the rest of your modules -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-caching-caffeine</artifactId>
<version>8.4.0</version> <!-- example; align with your HAPI version -->
</dependency>


<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-base</artifactId>
<version>2.6.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/org.hl7.fhir.utilities -->
<!--
https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/org.hl7.fhir.utilities -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.utilities</artifactId>
<version>6.5.18</version>
</dependency>

<!--
https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-validation-resources-r4 -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation-resources-r4</artifactId>
<version>8.4.0</version>
</dependency>

<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
Expand Down Expand Up @@ -363,7 +398,8 @@
${target-properties} and
${source-properties}
</echo>
<concat destfile="${target-properties}" append="yes"
<concat destfile="${target-properties}"
append="yes"
force="yes">
<fileset file="${source-properties}">
</fileset>
Expand Down
6 changes: 6 additions & 0 deletions src/main/environment/common_ci.properties
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ webLoginAbhaRequestOtp = @env.ABDM_PHR_URL@/login/abha/request/otp
webLoginAbhaVerify = @env.ABDM_PHR_URL@/login/abha/verify
webLoginPhrCard = @env.ABDM_PHR_URL@/login/profile/abha/phr-card

## ABDM V3 M2 APIs
generateTokenForLinkCareContext = @env.ABDM_HIECM_BASE_URL@/api/hiecm/v3/token/generate-token
linkCareContext = @env.ABDM_HIECM_BASE_URL@/api/hiecm/hip/v3/link/carecontext

[email protected]_CM_ID@
[email protected]_MODE@

Expand All @@ -120,3 +124,5 @@ [email protected]_DOC_ENABLED@
[email protected]_HOST@

[email protected]_ALLOWED_ORIGINS@

hipSystemUrl= @env.HIP_SYSTEM_URL@
9 changes: 8 additions & 1 deletion src/main/environment/common_docker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ webLoginAbhaRequestOtp = ${ABDM_PHR_URL}/login/abha/request/otp
webLoginAbhaVerify = ${ABDM_PHR_URL}/login/abha/verify
webLoginPhrCard = ${ABDM_PHR_URL}/login/profile/abha/phr-card

## ABDM V3 M2 APIs
generateTokenForLinkCareContext = @env.ABDM_HIECM_BASE_URL@/api/hiecm/v3/token/generate-token
linkCareContext = @env.ABDM_HIECM_BASE_URL@/api/hiecm/hip/v3/link/carecontext

x-CM-ID=${X_CM_ID}
abhaMode=${ABHA_MODE}

Expand All @@ -117,4 +121,7 @@ springdoc.api-docs.enabled=${SWAGGER_DOC_ENABLED}
springdoc.swagger-ui.enabled=${SWAGGER_DOC_ENABLED}

# Redis IP
spring.redis.host=${REDIS_HOST}
spring.redis.host=${REDIS_HOST}


hipSystemUrl= ${HIP_SYSTEM_URL}
8 changes: 7 additions & 1 deletion src/main/environment/common_example.properties
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ requestAuthByAbdm = https://abhasbx.abdm.gov.in/abha/api/v3/enrollment/auth/byAb
webLoginAbhaVerify = https://abhasbx.abdm.gov.in/abha/api/v3/phr/web/login/abha/verify
webLoginPhrCard = https://abhasbx.abdm.gov.in/abha/api/v3/phr/web/login/profile/abha/phr-card

## ABDM V3 M2 APIs
generateTokenForLinkCareContext = https://dev.abdm.gov.in/api/hiecm/v3/token/generate-token
linkCareContext = https://dev.abdm.gov.in/api/hiecm/hip/v3/link/carecontext

x-CM-ID= sbx
abhaMode=sbx

Expand All @@ -113,4 +117,6 @@ jwt.secret=my-32-character-ultra-secure-and-ultra-long-secret
logging.path=logs/
logging.file.name=logs/fhir-api.log

cors.allowed-origins=http://localhost:*
cors.allowed-origins=http://localhost:*

hipSystemUrl= <Enter HIP request URL>
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
import org.springframework.web.bind.annotation.RestController;

import com.wipro.fhir.data.request_handler.ResourceRequestHandler;
import com.wipro.fhir.service.resource_gateway.DiagnosticReportRecord;
import com.wipro.fhir.service.resource_gateway.OPConsultRecordBundle;
import com.wipro.fhir.service.resource_gateway.PrescriptionRecordBundle;
import com.wipro.fhir.service.bundle_creation.DiagnosticRecordResourceBundle;
import com.wipro.fhir.service.bundle_creation.OPConsultResourceBundle;
import com.wipro.fhir.service.bundle_creation.PrescriptionResourceBundle;
import com.wipro.fhir.utils.exception.FHIRException;
import com.wipro.fhir.utils.response.OutputResponse;

Expand All @@ -55,11 +55,11 @@ public class ResourceRequestGateway {
private final Logger logger = LoggerFactory.getLogger(this.getClass().getName());

@Autowired
private OPConsultRecordBundle opConsultRecordBundle;
private OPConsultResourceBundle opConsultRecordBundle;
@Autowired
private PrescriptionRecordBundle prescriptionRecordBundle;
private PrescriptionResourceBundle prescriptionRecordBundle;
@Autowired
private DiagnosticReportRecord diagnosticReportRecord;
private DiagnosticRecordResourceBundle diagnosticReportRecord;

/***
*
Expand All @@ -78,7 +78,7 @@ public String getPatientResource(@RequestBody ResourceRequestHandler patientReso

OutputResponse response = new OutputResponse();
try {
String s = opConsultRecordBundle.getOPConsultRecordBundle(patientResourceRequest, null);
String s = opConsultRecordBundle.populateOPConsultRecordResourceBundle(patientResourceRequest, null);

response.setResponse(s);
} catch (FHIRException e) {
Expand All @@ -104,7 +104,7 @@ public String getDiagnosticReportRecord(@RequestBody ResourceRequestHandler pati

OutputResponse response = new OutputResponse();
try {
String s = diagnosticReportRecord.getDiagnosticReportRecordBundle(patientResourceRequest, null);
String s = diagnosticReportRecord.populateDiagnosticReportResourceBundle(patientResourceRequest, null);

response.setResponse(s);
} catch (FHIRException e) {
Expand All @@ -129,7 +129,7 @@ public String getPrescriptionRecord(@RequestBody ResourceRequestHandler patientR

OutputResponse response = new OutputResponse();
try {
String s = prescriptionRecordBundle.getPrescriptionRecordBundle(patientResourceRequest, null);
String s = prescriptionRecordBundle.populatePrescriptionResourceBundle(patientResourceRequest, null);

response.setResponse(s);
} catch (FHIRException e) {
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/com/wipro/fhir/controller/test/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@

import com.wipro.fhir.data.request_handler.ResourceRequestHandler;
import com.wipro.fhir.service.atoms.feed.bahmni.ClinicalFeedWorker;
import com.wipro.fhir.service.resource_gateway.OPConsultRecordBundle;
import com.wipro.fhir.service.resource_gateway.OPConsultRecordBundleImpl;
import com.wipro.fhir.service.resource_gateway.PrescriptionRecordBundleImpl;
import com.wipro.fhir.service.bundle_creation.OPConsultResourceBundleImpl;
import com.wipro.fhir.utils.http.HttpUtils;
import com.wipro.fhir.utils.response.OutputResponse;

Expand All @@ -50,7 +48,7 @@ public class Test {
private final Logger logger = LoggerFactory.getLogger(this.getClass().getName());

@Autowired
private OPConsultRecordBundleImpl oPConsultRecordBundleImpl;
private OPConsultResourceBundleImpl oPConsultRecordBundleImpl;

@Operation(summary = "Test parse ATOM Feeds")
@PostMapping(value = { "/parse/feed/ATOM" })
Expand All @@ -59,7 +57,7 @@ public String parseFeeds(@RequestBody ResourceRequestHandler resourceRequestHand
OutputResponse response = new OutputResponse();
String s = null;
try {
s = oPConsultRecordBundleImpl.getOPConsultRecordBundle(resourceRequestHandler, null);
s = oPConsultRecordBundleImpl.populateOPConsultRecordResourceBundle(resourceRequestHandler, null);
response.setResponse(s);
} catch (Exception e) {
logger.error("Unexpected error:" , e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
Expand Down Expand Up @@ -60,6 +60,8 @@ public String abhaEnrollmentByAadhaar(@RequestBody String request) {
logger.info("NDHM_FHIR generate OTP for ABHA card API response " + response.toString());
return response.toString();
}

@CrossOrigin
@Operation(summary = "Verify Auth By ABDM for ABHA enrollment")
@PostMapping(value = { "/verifyAuthByAbdm" })
public String verifyMobileForAuth(@RequestBody String request) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package com.wipro.fhir.controller.v3.careContext;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.wipro.fhir.service.v3.careContext.CareContextLinkingService;
import com.wipro.fhir.utils.exception.FHIRException;
import com.wipro.fhir.utils.response.OutputResponse;

import io.swagger.v3.oas.annotations.Operation;

@RestController
@RequestMapping(value = "/careContext", headers = "Authorization")
public class CareContextLinkingController {

@Autowired
private CareContextLinkingService careContextLinkingService;

private final Logger logger = LoggerFactory.getLogger(this.getClass().getName());

@Operation(summary = "Generate token for care context linking")
@PostMapping(value = { "/generateCareContextToken" })
public String requestOtpForEnrollment(@RequestBody String request) {
logger.info("Generate token for care context API request " + request);
OutputResponse response = new OutputResponse();
try {
if (request != null) {
String s = careContextLinkingService.generateTokenForCareContext(request);
response.setResponse(s);
} else
throw new FHIRException("NDHM_FHIR Empty request object");
} catch (FHIRException e) {
response.setError(5000, e.getMessage());
logger.error(e.toString());
}
logger.info("NDHM_FHIR generate token for care context API response " + response.toString());
return response.toString();
}

@Operation(summary = "link care context")
@PostMapping(value = { "/linkCareContext" })
public String add(@RequestBody String request) {
logger.info("link care context API request " + request);
OutputResponse response = new OutputResponse();
try {
if (request != null) {
String s = careContextLinkingService.linkCareContext(request);
response.setResponse(s);
} else
throw new FHIRException("NDHM_FHIR Empty request object");
} catch (FHIRException e) {
response.setError(5000, e.getMessage());
logger.error(e.toString());
}
logger.info("link care context API response " + response.toString());
return response.toString();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.wipro.fhir.data.mongo.care_context;

import java.time.LocalDateTime;
import java.util.Date;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import com.google.gson.annotations.Expose;

import lombok.Data;

@Data
@Document(collection = "GenerateTokenAbdmResponses")
public class GenerateTokenAbdmResponses {

@Id
@Expose
@Field(value = "id")
private String id;

@Expose
@Field(value = "abhaAddress")
private String abhaAddress;

@Expose
@Field(value = "requestId")
private String requestId;

@Expose
@Field(value = "response")
private String response;

@Expose
@Field(value = "createdDate")
private Date createdDate;

}
Loading
Loading