Endpoints for the SHR consent lifecycle: requesting patient consent, verifying it with an OTP, polling its status, resending the OTP, and refreshing or closing the visit it opened.
Request patient consent for an SHR visit
Initiates a consent request against the DHA Consent Management Platform. On success DHA dispatches an OTP to the patient and returns a consent_id used by the verify, status and resend-otp calls.
Related documentation: Introduction to the Shared Health Record
Request patient consent for an SHR visit › Request Body
cr_idClient Registry (CR) identifier of the patient whose records the consent covers.
facility_idFacility Registry (FR) code of the facility requesting consent.
requested_byName or role of the person requesting consent. Recorded on the consent audit trail.
visit_typeType of visit the consent is being requested for. OP for outpatient, IP for inpatient.
Request patient consent for an SHR visit › Responses
Consent request created
consent_idIdentifier of the consent request. Supply it on the verify, status and resend-otp calls.
consent_statusCurrent state of the consent request as reported by DHA, for example Pending while the patient has not yet entered the OTP.
messageHuman readable outcome message from DHA.
otp_recordOTP record reference. Send it back with the OTP when verifying the consent.
statusOutcome status reported by DHA.
visit_typeType of visit the consent was requested for.
Verify patient consent with an OTP
Verifies a pending consent request using the OTP the patient received. A successful verification opens a visit and returns the per-visit consent token used to read patient records.
Related documentation: Introduction to the Shared Health Record
path Parameters
consent_idConsent id returned by the consent request.
Verify patient consent with an OTP › Request Body
otpOne-time password the patient received from DHA.
otp_recordOTP record reference returned by the consent request. It ties the OTP back to the consent it was issued for.
Verify patient consent with an OTP › Responses
Consent verified
consent_tokenPer-visit consent token. Send it in the X-Consent-Token header when fetching patient records.
messageHuman readable outcome message from DHA.
statusOutcome status reported by DHA.
visit_idIdentifier of the visit opened by the verified consent. Use it to refresh consent or to close the visit.
Poll the status of a consent request
Returns the current status of a consent request identified by its consent id. Poll this endpoint while the patient completes the OTP step. Once consent is approved the response also carries the visit_id.
Related documentation: Introduction to the Shared Health Record
path Parameters
consent_idConsent id returned by the consent request.
Poll the status of a consent request › Responses
Consent status
consent_idIdentifier of the consent request being polled.
consent_statusCurrent state of the consent request as reported by DHA, for example Pending or Approved.
messageHuman readable outcome message from DHA.
statusOutcome status reported by DHA.
visit_idIdentifier of the visit opened against the approved consent. Use it to refresh consent or to close the visit.
Resend the consent OTP
Asks DHA to resend the OTP for a pending consent request. The response carries a fresh otp_record - verify the consent with that value, not the one from the original consent request.
Related documentation: Introduction to the Shared Health Record
path Parameters
consent_idConsent id returned by the consent request.
Resend the consent OTP › Responses
OTP resent
consent_idIdentifier of the consent request the OTP was resent for.
consent_statusCurrent state of the consent request as reported by DHA.
messageHuman readable outcome message from DHA.
otp_recordOTP record reference for the newly issued OTP. Use this value, not the earlier one, when verifying the consent.
statusOutcome status reported by DHA.
visit_typeType of visit the consent was requested for.
Refresh patient consent for an open visit
Refreshes patient consent for an open visit and returns a fresh consent token. Use it when the token issued at verification has expired but the visit is still open.
Related documentation: Introduction to the Shared Health Record
path Parameters
visit_idVisit id of the open visit.
Refresh patient consent for an open visit › Responses
Consent refreshed
consent_tokenRefreshed per-visit consent token. Replace the token you were using and send this one in the X-Consent-Token header.
messageHuman readable outcome message from DHA.
statusOutcome status reported by DHA.
Close an SHR visit
Closes the visit identified by its visit id. Close the visit once the encounter is complete - the consent token can no longer be refreshed afterwards.
Related documentation: Introduction to the Shared Health Record
path Parameters
visit_idVisit id to close.
Close an SHR visit › Responses
Visit closed
consent_idIdentifier of the consent request the closed visit belonged to.
end_dateTimestamp at which the visit was closed.
messageHuman readable outcome message from DHA.
statusOutcome status reported by DHA.
visit_idIdentifier of the visit that was closed.

