P2 Linking and records
P2 is the mirror of M2 Health Information Provider. 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
Profile management, 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: 1 to 250 characters, letters, digits and
spaces, with ., - and _ allowed between them. 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 the HIP ID and unverified identifiers of type MR, MOBILE,
ABHA_NUMBER or ABHA_ADDRESS.
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 generate link token call, 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.
Profile, card and QR code
The signed in user manages their own profile from your app. Every call takes
the user token from login as X-token.
| Element | What it holds |
|---|---|
| Profile screen | Editable demographics, marked KYC Verified or Self-Declared |
| ABHA number | Visible only on a KYC Verified profile |
| ABHA address card, a PDF | Photo, full name, ABHA number, ABHA address, QR code, date of birth, gender, mobile number |
| Editable, KYC Verified | Mobile number, with an OTP to the new number, and address |
| Editable, Self-Declared | The same, plus photo, full name, gender and date of birth |
| Also on the profile | Update the password, link an ABHA number by mobile OTP or Aadhaar OTP, switch between the profiles on one login, refresh the token, and log out |
Next
- The calls and base URLs: P2 API reference.
- The next milestone: P3 Consent and notifications.