-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API Changes for FLW created ABHA IDs data sync (#63)
* Modified tnxId keyword to txnId * Abha-address search API changes * added validation for multiple phraddress * Abha-address search response changes * Save facility id variable change chnages * Added check to avoid multiple save of single care-context * removed unused variables * Updated public key certificate API * Integrated Abha session v3 APIs and Profile login user verify APIs * committed coderabitai suggested * Revert "jwt implementation changes (#53)" This reverts commit 5e16b7d. * data Sync for FLW API changes * Reapply "jwt implementation changes (#53)" This reverts commit c38d099. * changed variable type default value as false --------- Co-authored-by: KA40094929 <KA40094929@APL-5CD1394ZJT> Co-authored-by: Karyamsetty Helen Grace <[email protected]> Co-authored-by: KA40094929 <[email protected]> Co-authored-by: KA40094929 <[email protected]>
- Loading branch information
1 parent
b47be0f
commit f55149d
Showing
5 changed files
with
174 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
src/main/java/com/wipro/fhir/controller/healthID/CreateHealthIdRecord.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package com.wipro.fhir.controller.healthID; | ||
|
||
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.RequestHeader; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.wipro.fhir.service.healthID.HealthIDService; | ||
import com.wipro.fhir.utils.exception.FHIRException; | ||
import com.wipro.fhir.utils.response.OutputResponse; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
|
||
@CrossOrigin | ||
@RestController | ||
@RequestMapping(value = "/healthIDRecord", headers = "Authorization", consumes = "application/json", produces = "application/json") | ||
public class CreateHealthIdRecord { | ||
|
||
private final Logger logger = LoggerFactory.getLogger(this.getClass().getName()); | ||
|
||
@Autowired | ||
private HealthIDService healthIDService; | ||
|
||
/*** | ||
* | ||
* @param request | ||
* @param Authorization | ||
* @return BenRegID of beneficiary after mapping | ||
*/ | ||
@CrossOrigin | ||
@Operation(summary = "Map ABHA to beneficiary") | ||
@PostMapping(value = { "/mapHealthIDToBeneficiary" }) | ||
public String mapHealthIDToBeneficiary( | ||
@RequestBody String request, @RequestHeader(value = "Authorization") String Authorization) { | ||
logger.info("NDHM_FHIR Map ABHA to beneficiary API request " + request); | ||
OutputResponse response = new OutputResponse(); | ||
try { | ||
if (request != null) { | ||
String s = healthIDService.mapHealthIDToBeneficiary(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 Map ABHA to beneficiary API response " + response.toString()); | ||
return response.toString(); | ||
} | ||
|
||
|
||
@CrossOrigin | ||
@Operation(summary = "Add New health ID record to healthId table") | ||
@PostMapping(value = { "/addHealthIdRecord" }) | ||
public String addRecordToHealthIdTable( | ||
@RequestBody String request, @RequestHeader(value = "Authorization") String Authorization) { | ||
logger.info("NDHM_FHIR API to add the new health record coming from FLW request " + request); | ||
OutputResponse response = new OutputResponse(); | ||
try { | ||
if (request != null) { | ||
String s = healthIDService.addRecordToHealthIdTable(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 API to add the new health record coming from FLW response " + response.toString()); | ||
return response.toString(); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters