Use different Patient ID types in requests to Leyr
You can now specify the type of patient identity you'd like to base your requests on with Leyr. Initially supported types:
- EHR ID - internal identifier, used by EHR vendors internally
- Swedish Personal Number - national identity number in Sweden
Following endpoints at Leyr are supported:
How to select Patient ID type
Patient ID typing applies to parameters, where patient ID is used. Those are:
patientId
query parameter inGET /appointments
endpointpatientId
field in JSON body ofPOST /appointments
endpointpatientId
in path parameter ofGET /patients/{patientId}
endpoint
Previously you would pass patient id as a plain string, containing Swedish Personal Number, e.g.
GET https://api.leyr.io/api/emrs/takecare/appointments?patientId=191212121212
You can now construct patientId
parameter in all the places mentioned above, following the structure:
{patient_id_type}:{patient_id_value}
, where currently supported patient_id_type
are:
emr_id
se_personal_number
Examples
Examples for fully constructed patientId
would be:
emr_id:abc_12345
se_personal_number:191212121212
abc_12345
as patientId
. In this case Leyr will treat it as emr_id
.
This means
emr_id:abc_12345
and abc_12345
are equivalent.emr_id
GET https://api.leyr.io/api/emrs/takecare/appointments?patientId=emr_id:abc_12345
In this case Leyr will look for appointments for a patient, which internal EHR ID is abc_12345
se_personal_number
GET https://api.leyr.io/api/emrs/takecare/appointments?patientId=se_personal_number:191212121212
In this case Leyr will look for appointments for a patient, which Swedish Personal Number is 191212121212
Nothing provided
GET https://api.leyr.io/api/emrs/takecare/appointments?patientId=abc_12345
The value passed there is treated as emr_id
.
In this case Leyr will look for appointments for a patient, which internal EHR ID is abc_12345
.
https://api.leyr.io/api/emrs/takecare/appointments?patientId=191212121212
, 191212121212
would still be treated as internal EHR ID, and not Swedish Personal Number.
Make sure to provide
se_personal_number
as a prefix explicitly, when looking to use patient's personal number in requests.Other prefixes, semicolons in patientId
GET https://api.leyr.io/api/emrs/takecare/appointments?patientId=urn:oid:1.2.752.129.2.1.3.1|191212121212
The value passed there is treated as emr_id
.
In this case Leyr will look for appointments for a patient, which internal EHR ID is urn:oid:1.2.752.129.2.1.3.1|191212121212
.
This is actually done to support URLs like the example above, which is used by some EHR vendors to identify patients.