-
Type:
Story
-
Resolution: Unresolved
-
Priority:
Low
-
Affects Version/s: None
-
None
-
STOP TB Sprint 6
-
STOP TB
-
UAT
Description
Implement the backend flow for ABDM M2 (Care Context creation).
The following APIs are required to complete the ABDM M2 flow.
1. Get ABDM Facility mapped with Work Location
Method: GET
API:
/commonapi/facility/getWorklocationMappedAbdmFacility/{workLocationId}
Example:
/common-api/facility/getWorklocationMappedAbdmFacility/33
The API should return the ABDM Facility details mapped with the selected work location.
Required values from response:
- providerServiceMapID
- abdmFacilityID
- abdmFacilityName
2. Save ABDM Facility ID against Visit
Method: POST
API:
/fhir-api/facility/saveAbdmFacilityId
Request:
{{
{ "visitCode": 30027502720720, "abdmFacilityId": "Test_HIP_Amrit" }}}
Expected Response:
ABDM Facility ID updated successfully
3. Get Beneficiary ABHA/Health ID Details
Method: POST
API:
/fhir-api/healthID/getBenhealthID
Request:
{{
{ "beneficiaryRegID": 10493096, "beneficiaryID": 925143363723 }}}
The API should return beneficiary ABHA details including:
- healthIdNumber
- healthId
- beneficiaryRegID
- name
- gender
- yearOfBirth
4. Generate OTP for Care Context
Method: POST
API:
/fhir-api/careContext/generateOTPForCareContext
Request:
{{
{ "healthID": "91746352268302@sbx", "healthIdNumber": "91-7463-5226-8302", "abdmFacilityId": "Test_HIP_Amrit", "abdmFacilityName": "Test HIP Amrit" }}}
The API should generate OTP and return txnId.
Expected Response:
{{
{ "txnId": "<transaction-id>" }}}
5. Validate OTP and Create Care Context
Method: POST
API:
/fhir-api/careContext/validateOTPAndCreateCareContext
Request:
{{
{ "otp": "<OTP>", "txnId": "<transaction-id>", "beneficiaryID": 925143363723, "healthID": "91746352268302@sbx", "healthIdNumber": "91-7463-5226-8302", "visitCode": 30027502720720, "visitCategory": "General OPD", "abdmFacilityId": "Test_HIP_Amrit", "abdmFacilityName": "Test HIP Amrit" }}}
Expected Response:
Care Context added successfully
Expected Flow
Work Location → Get ABDM Facility → Save Facility ID against Visit → Get Beneficiary ABHA Details → Generate OTP → Validate OTP → Create Care Context
Acceptance Criteria
- ABDM Facility details should be fetched based on Work Location.
- ABDM Facility ID should be mapped/saved against the beneficiary visit.
- Beneficiary ABHA details should be fetched successfully.
- OTP should be generated for Care Context creation.
- Generated txnId should be used during OTP validation.
- On successful OTP validation, Care Context should be created for the respective beneficiary visit.
- Proper error responses should be returned if Facility ID, ABHA details, OTP, transaction ID, or visit details are invalid/missing.
- is blocked by
-
STOP-136 ABDM M2 - Phase 1 - General OPD Flow
-
- In Development
-