Skip to content

Commit c2cd720

Browse files
helenKaryamsettyKA40094929KA40094929Karyamsetty Helen GraceCopilot
authored
Abdm v3 (#128)
* Abdm v3 (#112) * 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 --------- 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> * Update pom.xml * mongo query change fetch to linktoken (#113) * 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 --------- 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> * Abdm v3 (#114) * 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 --------- 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> * ABDM Abdm HiTypes addition in linktoken (#115) * 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: corrected spelling mistake Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: modified repo queries Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- 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> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Minor fixes (#116) * 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. --------- 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> * response correction (#117) * 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 --------- 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> * generate token logic change (#120) * 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 --------- 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> * hiType correction and modification in error message format (#121) * 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 * Fix display setting for patient care context --------- 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> * Modified error message display (#122) * 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 --------- 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> * M2 FHIR bundles creation (#123) * 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 --------- 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> * added missed variable change (#124) * 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 --------- 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> * Modified the constructor for better handling (#125) * 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 --------- 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> * medication statement correction (#126) * 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 --------- 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> * 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> * Update jboss-web.xml * Update common_docker.properties * Delete src/main/environment/common_test.properties * Delete src/main/environment/common_dev.properties * taken coderabbit comments (#129) * 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 * fix: taken coderabbitai comments --------- 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> * Update CareContextRepo.java --------- 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> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 998b5ab commit c2cd720

58 files changed

Lines changed: 3496 additions & 1061 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.factorypath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<factorypath>
2-
<factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.36/lombok-1.18.36.jar" enabled="true" runInBatchMode="false"/>
2+
<factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.30/lombok-1.18.30.jar" enabled="true" runInBatchMode="false"/>
33
<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"/>
44
</factorypath>

pom.xml

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</parent>
1212
<groupId>com.wipro.fhir.r4</groupId>
1313
<artifactId>fhir-api</artifactId>
14-
<version>3.6.0</version>
14+
<version>3.6.1</version>
1515
<packaging>war</packaging>
1616
<name>FHIR-API</name>
1717
<description>FHIR_NDHM standard integration in AMRIT</description>
@@ -186,39 +186,74 @@
186186
<dependency>
187187
<groupId>com.fasterxml.jackson.core</groupId>
188188
<artifactId>jackson-core</artifactId>
189-
<version>2.14.2</version>
189+
<version>2.15.2</version>
190190
</dependency>
191191
<dependency>
192192
<groupId>com.fasterxml.jackson.core</groupId>
193193
<artifactId>jackson-databind</artifactId>
194-
<version>2.14.2</version>
194+
<version>2.15.2</version>
195195
</dependency>
196196
<dependency>
197197
<groupId>com.fasterxml.jackson.core</groupId>
198198
<artifactId>jackson-annotations</artifactId>
199-
<version>2.14.2</version>
199+
<version>2.15.2</version>
200200
</dependency>
201201

202-
<!-- https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-structures-r4 -->
202+
<!--
203+
https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-structures-r4 -->
203204
<dependency>
204205
<groupId>ca.uhn.hapi.fhir</groupId>
205206
<artifactId>hapi-fhir-structures-r4</artifactId>
206-
<version>6.10.0</version>
207+
<version>8.4.0</version>
207208
</dependency>
208-
209+
210+
<!--
211+
https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-validation -->
212+
<dependency>
213+
<groupId>ca.uhn.hapi.fhir</groupId>
214+
<artifactId>hapi-fhir-validation</artifactId>
215+
<version>8.4.0</version>
216+
</dependency>
217+
218+
<!--
219+
https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-structures-r4 -->
220+
<dependency>
221+
<groupId>ca.uhn.hapi.fhir</groupId>
222+
<artifactId>hapi-fhir-structures-r4</artifactId>
223+
<version>8.4.0</version>
224+
</dependency>
225+
226+
227+
<!-- Choose a HAPI version that matches the rest of your modules -->
228+
<dependency>
229+
<groupId>ca.uhn.hapi.fhir</groupId>
230+
<artifactId>hapi-fhir-caching-caffeine</artifactId>
231+
<version>8.4.0</version> <!-- example; align with your HAPI version -->
232+
</dependency>
233+
234+
209235
<dependency>
210236
<groupId>ca.uhn.hapi</groupId>
211237
<artifactId>hapi-base</artifactId>
212238
<version>2.6.0</version>
213239
</dependency>
214240

215-
<!-- https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/org.hl7.fhir.utilities -->
241+
<!--
242+
https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/org.hl7.fhir.utilities -->
216243
<dependency>
217244
<groupId>ca.uhn.hapi.fhir</groupId>
218245
<artifactId>org.hl7.fhir.utilities</artifactId>
219246
<version>6.5.18</version>
220247
</dependency>
221248

249+
<!--
250+
https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-validation-resources-r4 -->
251+
<dependency>
252+
<groupId>ca.uhn.hapi.fhir</groupId>
253+
<artifactId>hapi-fhir-validation-resources-r4</artifactId>
254+
<version>8.4.0</version>
255+
</dependency>
256+
222257
<!-- lombok -->
223258
<dependency>
224259
<groupId>org.projectlombok</groupId>
@@ -363,7 +398,8 @@
363398
${target-properties} and
364399
${source-properties}
365400
</echo>
366-
<concat destfile="${target-properties}" append="yes"
401+
<concat destfile="${target-properties}"
402+
append="yes"
367403
force="yes">
368404
<fileset file="${source-properties}">
369405
</fileset>

src/main/environment/common_ci.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ webLoginAbhaRequestOtp = @env.ABDM_PHR_URL@/login/abha/request/otp
9898
webLoginAbhaVerify = @env.ABDM_PHR_URL@/login/abha/verify
9999
webLoginPhrCard = @env.ABDM_PHR_URL@/login/profile/abha/phr-card
100100

101+
## ABDM V3 M2 APIs
102+
generateTokenForLinkCareContext = @env.ABDM_HIECM_BASE_URL@/api/hiecm/v3/token/generate-token
103+
linkCareContext = @env.ABDM_HIECM_BASE_URL@/api/hiecm/hip/v3/link/carecontext
104+
101105
x-CM-ID=@env.X_CM_ID@
102106
abhaMode=@env.ABHA_MODE@
103107

@@ -120,3 +124,5 @@ springdoc.swagger-ui.enabled=@env.SWAGGER_DOC_ENABLED@
120124
spring.redis.host=@env.REDIS_HOST@
121125

122126
cors.allowed-origins=@env.CORS_ALLOWED_ORIGINS@
127+
128+
hipSystemUrl= @env.HIP_SYSTEM_URL@

src/main/environment/common_docker.properties

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ webLoginAbhaRequestOtp = ${ABDM_PHR_URL}/login/abha/request/otp
9898
webLoginAbhaVerify = ${ABDM_PHR_URL}/login/abha/verify
9999
webLoginPhrCard = ${ABDM_PHR_URL}/login/profile/abha/phr-card
100100

101+
## ABDM V3 M2 APIs
102+
generateTokenForLinkCareContext = @env.ABDM_HIECM_BASE_URL@/api/hiecm/v3/token/generate-token
103+
linkCareContext = @env.ABDM_HIECM_BASE_URL@/api/hiecm/hip/v3/link/carecontext
104+
101105
x-CM-ID=${X_CM_ID}
102106
abhaMode=${ABHA_MODE}
103107

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

119123
# Redis IP
120-
spring.redis.host=${REDIS_HOST}
124+
spring.redis.host=${REDIS_HOST}
125+
126+
127+
hipSystemUrl= ${HIP_SYSTEM_URL}

src/main/environment/common_example.properties

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ requestAuthByAbdm = https://abhasbx.abdm.gov.in/abha/api/v3/enrollment/auth/byAb
100100
webLoginAbhaVerify = https://abhasbx.abdm.gov.in/abha/api/v3/phr/web/login/abha/verify
101101
webLoginPhrCard = https://abhasbx.abdm.gov.in/abha/api/v3/phr/web/login/profile/abha/phr-card
102102

103+
## ABDM V3 M2 APIs
104+
generateTokenForLinkCareContext = https://dev.abdm.gov.in/api/hiecm/v3/token/generate-token
105+
linkCareContext = https://dev.abdm.gov.in/api/hiecm/hip/v3/link/carecontext
106+
103107
x-CM-ID= sbx
104108
abhaMode=sbx
105109

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

116-
cors.allowed-origins=http://localhost:*
120+
cors.allowed-origins=http://localhost:*
121+
122+
hipSystemUrl= <Enter HIP request URL>

src/main/java/com/wipro/fhir/controller/generateresource/ResourceRequestGateway.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
import org.springframework.web.bind.annotation.RestController;
3434

3535
import com.wipro.fhir.data.request_handler.ResourceRequestHandler;
36-
import com.wipro.fhir.service.resource_gateway.DiagnosticReportRecord;
37-
import com.wipro.fhir.service.resource_gateway.OPConsultRecordBundle;
38-
import com.wipro.fhir.service.resource_gateway.PrescriptionRecordBundle;
36+
import com.wipro.fhir.service.bundle_creation.DiagnosticRecordResourceBundle;
37+
import com.wipro.fhir.service.bundle_creation.OPConsultResourceBundle;
38+
import com.wipro.fhir.service.bundle_creation.PrescriptionResourceBundle;
3939
import com.wipro.fhir.utils.exception.FHIRException;
4040
import com.wipro.fhir.utils.response.OutputResponse;
4141

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

5757
@Autowired
58-
private OPConsultRecordBundle opConsultRecordBundle;
58+
private OPConsultResourceBundle opConsultRecordBundle;
5959
@Autowired
60-
private PrescriptionRecordBundle prescriptionRecordBundle;
60+
private PrescriptionResourceBundle prescriptionRecordBundle;
6161
@Autowired
62-
private DiagnosticReportRecord diagnosticReportRecord;
62+
private DiagnosticRecordResourceBundle diagnosticReportRecord;
6363

6464
/***
6565
*
@@ -78,7 +78,7 @@ public String getPatientResource(@RequestBody ResourceRequestHandler patientReso
7878

7979
OutputResponse response = new OutputResponse();
8080
try {
81-
String s = opConsultRecordBundle.getOPConsultRecordBundle(patientResourceRequest, null);
81+
String s = opConsultRecordBundle.populateOPConsultRecordResourceBundle(patientResourceRequest, null);
8282

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

105105
OutputResponse response = new OutputResponse();
106106
try {
107-
String s = diagnosticReportRecord.getDiagnosticReportRecordBundle(patientResourceRequest, null);
107+
String s = diagnosticReportRecord.populateDiagnosticReportResourceBundle(patientResourceRequest, null);
108108

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

130130
OutputResponse response = new OutputResponse();
131131
try {
132-
String s = prescriptionRecordBundle.getPrescriptionRecordBundle(patientResourceRequest, null);
132+
String s = prescriptionRecordBundle.populatePrescriptionResourceBundle(patientResourceRequest, null);
133133

134134
response.setResponse(s);
135135
} catch (FHIRException e) {

src/main/java/com/wipro/fhir/controller/test/Test.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@
3434

3535
import com.wipro.fhir.data.request_handler.ResourceRequestHandler;
3636
import com.wipro.fhir.service.atoms.feed.bahmni.ClinicalFeedWorker;
37-
import com.wipro.fhir.service.resource_gateway.OPConsultRecordBundle;
38-
import com.wipro.fhir.service.resource_gateway.OPConsultRecordBundleImpl;
39-
import com.wipro.fhir.service.resource_gateway.PrescriptionRecordBundleImpl;
37+
import com.wipro.fhir.service.bundle_creation.OPConsultResourceBundleImpl;
4038
import com.wipro.fhir.utils.http.HttpUtils;
4139
import com.wipro.fhir.utils.response.OutputResponse;
4240

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

5250
@Autowired
53-
private OPConsultRecordBundleImpl oPConsultRecordBundleImpl;
51+
private OPConsultResourceBundleImpl oPConsultRecordBundleImpl;
5452

5553
@Operation(summary = "Test parse ATOM Feeds")
5654
@PostMapping(value = { "/parse/feed/ATOM" })
@@ -59,7 +57,7 @@ public String parseFeeds(@RequestBody ResourceRequestHandler resourceRequestHand
5957
OutputResponse response = new OutputResponse();
6058
String s = null;
6159
try {
62-
s = oPConsultRecordBundleImpl.getOPConsultRecordBundle(resourceRequestHandler, null);
60+
s = oPConsultRecordBundleImpl.populateOPConsultRecordResourceBundle(resourceRequestHandler, null);
6361
response.setResponse(s);
6462
} catch (Exception e) {
6563
logger.error("Unexpected error:" , e);

src/main/java/com/wipro/fhir/controller/v3/abha/CreateAbhaV3Controller.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import org.slf4j.Logger;
44
import org.slf4j.LoggerFactory;
55
import org.springframework.beans.factory.annotation.Autowired;
6-
6+
import org.springframework.web.bind.annotation.CrossOrigin;
77
import org.springframework.web.bind.annotation.PostMapping;
88
import org.springframework.web.bind.annotation.RequestBody;
99
import org.springframework.web.bind.annotation.RequestMapping;
@@ -60,6 +60,8 @@ public String abhaEnrollmentByAadhaar(@RequestBody String request) {
6060
logger.info("NDHM_FHIR generate OTP for ABHA card API response " + response.toString());
6161
return response.toString();
6262
}
63+
64+
@CrossOrigin
6365
@Operation(summary = "Verify Auth By ABDM for ABHA enrollment")
6466
@PostMapping(value = { "/verifyAuthByAbdm" })
6567
public String verifyMobileForAuth(@RequestBody String request) {
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
package com.wipro.fhir.controller.v3.careContext;
2+
3+
import org.slf4j.Logger;
4+
import org.slf4j.LoggerFactory;
5+
import org.springframework.beans.factory.annotation.Autowired;
6+
import org.springframework.web.bind.annotation.PostMapping;
7+
import org.springframework.web.bind.annotation.RequestBody;
8+
import org.springframework.web.bind.annotation.RequestMapping;
9+
import org.springframework.web.bind.annotation.RestController;
10+
11+
import com.wipro.fhir.service.v3.careContext.CareContextLinkingService;
12+
import com.wipro.fhir.utils.exception.FHIRException;
13+
import com.wipro.fhir.utils.response.OutputResponse;
14+
15+
import io.swagger.v3.oas.annotations.Operation;
16+
17+
@RestController
18+
@RequestMapping(value = "/careContext", headers = "Authorization")
19+
public class CareContextLinkingController {
20+
21+
@Autowired
22+
private CareContextLinkingService careContextLinkingService;
23+
24+
private final Logger logger = LoggerFactory.getLogger(this.getClass().getName());
25+
26+
@Operation(summary = "Generate token for care context linking")
27+
@PostMapping(value = { "/generateCareContextToken" })
28+
public String requestOtpForEnrollment(@RequestBody String request) {
29+
logger.info("Generate token for care context API request " + request);
30+
OutputResponse response = new OutputResponse();
31+
try {
32+
if (request != null) {
33+
String s = careContextLinkingService.generateTokenForCareContext(request);
34+
response.setResponse(s);
35+
} else
36+
throw new FHIRException("NDHM_FHIR Empty request object");
37+
} catch (FHIRException e) {
38+
response.setError(5000, e.getMessage());
39+
logger.error(e.toString());
40+
}
41+
logger.info("NDHM_FHIR generate token for care context API response " + response.toString());
42+
return response.toString();
43+
}
44+
45+
@Operation(summary = "link care context")
46+
@PostMapping(value = { "/linkCareContext" })
47+
public String add(@RequestBody String request) {
48+
logger.info("link care context API request " + request);
49+
OutputResponse response = new OutputResponse();
50+
try {
51+
if (request != null) {
52+
String s = careContextLinkingService.linkCareContext(request);
53+
response.setResponse(s);
54+
} else
55+
throw new FHIRException("NDHM_FHIR Empty request object");
56+
} catch (FHIRException e) {
57+
response.setError(5000, e.getMessage());
58+
logger.error(e.toString());
59+
}
60+
logger.info("link care context API response " + response.toString());
61+
return response.toString();
62+
}
63+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.wipro.fhir.data.mongo.care_context;
2+
3+
import java.time.LocalDateTime;
4+
import java.util.Date;
5+
6+
import org.springframework.data.annotation.Id;
7+
import org.springframework.data.mongodb.core.mapping.Document;
8+
import org.springframework.data.mongodb.core.mapping.Field;
9+
10+
import com.google.gson.annotations.Expose;
11+
12+
import lombok.Data;
13+
14+
@Data
15+
@Document(collection = "GenerateTokenAbdmResponses")
16+
public class GenerateTokenAbdmResponses {
17+
18+
@Id
19+
@Expose
20+
@Field(value = "id")
21+
private String id;
22+
23+
@Expose
24+
@Field(value = "abhaAddress")
25+
private String abhaAddress;
26+
27+
@Expose
28+
@Field(value = "requestId")
29+
private String requestId;
30+
31+
@Expose
32+
@Field(value = "response")
33+
private String response;
34+
35+
@Expose
36+
@Field(value = "createdDate")
37+
private Date createdDate;
38+
39+
}

0 commit comments

Comments
 (0)