P2 Linking and records
P2 is the mirror of M2 Attach. M2 is a provider publishing a record. P2 is the patient discovering it and linking it to their own ABHA address.
In short
- Discovery is for facilities the user visited without giving an ABHA address, and for old records.
- A HIP is expected to answer a discovery request within 10 seconds.
- Never show a care context that is already linked.
- Send the data transfer request within 5 minutes of the user tapping Pull Records.
What you build
Care context linking, user initiated linking, scan and share at a facility, and health locker subscriptions.
Scan and share at a facility
The facility displays a QR code holding a URL with two parameters: the HIP ID and a facility defined context such as a counter code. Your app scans it, then:
- Shows the user what will be shared.
- Takes consent in the specified wording. It covers sharing the ABHA address and profile with that facility for registration, and the facility linking any records it generates.
- Calls the HIE-CM to share the details.
- Waits for the facility, currently expected to respond within 30 seconds.
- Displays the token number if the facility returned one.
Counter names arrive in the QR code: up to 20 alphanumeric characters, no special characters. A counter name cannot be the facility ID, the HPID, the HIP ID or the HIP name.
Discovery and user initiated linking
The user searches for the facility by name. Only participating facilities appear, and the facility must be a HIP linked to an HRP. Your app sends a discovery request carrying name, year or date of birth, gender, verified mobile number and ABHA address. A provider issued registration number is optional.
The user selects care contexts and confirms. The HIP sends an OTP to the registered mobile number, and on successful verification the care contexts link to the ABHA address.
The same flow works for government health programmes such as CoWIN, AB-PMJAY, e-Sanjeevani OPD, e-Sanjeevani HWC and RCH, each with a programme specific optional field.
Three failures have specified copy.
| Situation | Message |
|---|---|
| The HIP is unreachable | "Couldn't Connect: We are sorry. Unable to contact your hospital. Please try again later" |
| The user never visited the facility | "No health records found" |
| Everything is already linked | "No new health record to link: Records of all visits are already linked and there is nothing new to link" |
Records should arrive within 2 hours.
Where the citizen is the HIP
A citizen pushing a record into your app is the HIP. A health locker, where users upload their own records, puts you on that publishing side.
An uploaded record is shareable once you hold three things: a link token from the M1 APIs, a care context added by HIP initiated linking from M2 Attach, and the M2 health information transfer APIs.
Set the health information type from the contents or from user input. Use
HealthDocumentRecord when it cannot be determined.
Next
- The calls and base URLs: P2 API reference.
- The next milestone: P3 Consent and notifications.