Page Status: updated 2022-11-03
Patient - Fetch
Page index
Introduction
Sv. Hämta patientinformation.
This page describes the process of fetching the resource Patient by a few examples.
Fetching patients can be done in different ways. See Patient query operations for information about all options.
In short, a query request is either a read, that is, a retrieval via the resource ID, or a search via a search condition. The result differs between a read and a search. A search results in a Bundle being returned containing all matching resources. If there are no hits, an empty Bundle is returned. A read results in the requested resource being returned or an error if no resource with the requested ID exists. If a system error occurs both searches and reads result in an error (i.e. an OperationOutcome).
Fetching a Patient is done by one of the following operations.
GET [base]/Patient/[id]
GET [base]/Patient?[search parameters]
A set of HTTP headers must be provided in order to fetch a patient. See HTTP Header and Authorization for more information about the various headers used by the National Medication List.
See Patient for more information about the Patient resource.
Before a Patient can be retrieved and presented to the user other information is needed from the National Medication List. For more information on different scenarios and what information is required for each scenario, see Handbok för vård- och apotekstjänster: Verksamhetsområden.
Examples
HTTP Header
See HTTP Header and Authorization for generic information about all HTTP headers used by the National Medication List including information about authorization, purpose and access type. The authorization token is translated to an authority role. The authority role together with the purpose and type of access is used by the National Medication List to determine what actions a user may perform and what information the user may access.
Header | Comment |
---|---|
authorization | The users's security token |
prefer | Type of returned content |
x-access | The cause for the call |
x-context-id | An ID to group a sequence of requests |
x-org-info | Information about the users's organisation |
x-patientref | The logical ID of the patient |
x-provenance | A provenance resource with information about the user interacting with NLL |
x-purpose | The purpose of the call |
x-request-id | A random and unique ID |
x-user-agent | Information about the calling system |
Example 1 - Fetch a patient
This example shows a patient having a personal identity number, i.e. the person exists in the Swedish Population Register (sv. folkbokföringsregistret). The identity is marked as active and alive.
The request is made as a search by the patient's personal identity number (sv. personnr),
, GET [base]/Patient?identifier=http://electronichealth.se/identifier/personnummer%7C198710152391
.
HTTP headers
Header | Value | Comment |
---|---|---|
authorization | {...,"FORSKRIVARKOD":"9000027","VARDGIVARE":"0123456789","YRKESKOD":["LK"],"loa":3} |
Selected information from the OAuth2-ticket in decoded form |
prefer | ||
x-access | UTAN_KRAV_SAMTYCKE |
|
x-org-info | {"orgenhetsOrt":"Sala"} |
Decoded value |
x-patientref | ||
x-provenance | ||
x-purpose | VARD |
|
x-request-id | 92b5982a-f4cf-4231-b0c7-9ac3c41ef6f8 |
|
x-user-agent | {"name":"Test system testaren","version":"0.01010101010.1 beta"} |
Decoded value |
HTTP body: Fetch Patient
Example 2 - Fetch a patient with a protected identity
This example shows a patient with a protected identity in the Swedish Population Registry (sv. folkbokföringsregistret).
The request is made as a read by the logical id, GET [base]/Patient/a5e62b33-943c-44f6-ad11-f7d068b623d6
.
HTTP headers
Header | Value | Comment |
---|---|---|
authorization | {...,"FORSKRIVARKOD":"9000027","VARDGIVARE":"0123456789","YRKESKOD":["LK"],"loa":3} |
Selected information from the OAuth2-ticket in decoded form |
prefer | ||
x-access | UTAN_KRAV_SAMTYCKE |
|
x-org-info | {"orgenhetsOrt":"Sala"} |
Decoded value |
x-patientref | ||
x-provenance | ||
x-purpose | VARD |
|
x-request-id | eeafc7a1-875a-482d-8df2-11554a9aafec |
|
x-user-agent | {"name":"Test system testaren","version":"0.01010101010.1 beta"} |
Decoded value |
HTTP body: Fetch Patient with protected identity
Example 3 - Fetch a patient that is deceased
This example shows a patient that is marked as deceased in the Swedish Population Registry (sv. folkbokföringsregistret).
The request is made as a read by the logical id, GET [base]/Patient/e5c691f6-aa3d-4b1f-9d20-f585594a379e
.
HTTP headers
Header | Value | Comment |
---|---|---|
authorization | {...,"FORSKRIVARKOD":"9000027","VARDGIVARE":"0123456789","YRKESKOD":["LK"],"loa":3} |
Selected information from the OAuth2-ticket in decoded form |
prefer | ||
x-access | UTAN_KRAV_SAMTYCKE |
|
x-org-info | {"orgenhetsOrt":"Sala"} |
Decoded value |
x-patientref | ||
x-provenance | ||
x-purpose | VARD |
|
x-request-id | 642b183e-70d1-439d-a4af-7a6ce4b02b24 |
|
x-user-agent | {"name":"Test system testaren","version":"0.01010101010.1 beta"} |
Decoded value |
HTTP body: Fetch Patient deceased
Example 4 - Fetch a patient with unknown status
This example shows a patient were nllPopulationRegistered is set to UNKNOWN. This situation occur when a person is missing in the National Medication List and the connection to the Swedish Population Registry (sv. folkbokföringsregistret) is down.
The request is made as a search by the patient's personal identity number (sv. personnr),
, GET [base]/Patient?identifier=http://electronichealth.se/identifier/personnummer%7C198602062393
.
HTTP headers
Header | Value | Comment |
---|---|---|
authorization | {...,"FORSKRIVARKOD":"9000027","VARDGIVARE":"0123456789","YRKESKOD":["LK"],"loa":3} |
Selected information from the OAuth2-ticket in decoded form |
prefer | ||
x-access | UTAN_KRAV_SAMTYCKE |
|
x-org-info | {"orgenhetsOrt":"Sala"} |
Decoded value |
x-patientref | ||
x-provenance | ||
x-purpose | VARD |
|
x-request-id | 1c5c63e2-e142-40f5-8c71-765dfe87e19d |
|
x-user-agent | {"name":"Test system testaren","version":"0.01010101010.1 beta"} |
Decoded value |
HTTP body: Fetch Patient unknown status
Example 5 - Fetch a patient with unknown status
This example shows a patient were nllPopulationRegistered is set to UNKNOWN. This situation occur when a person is missing in the National Medication List and the connection to the Swedish Population Registry (sv. folkbokföringsregistret) is down.
The request is made as a read by the logical id, GET [base]/Patient/1c679140-36be-4a62-b3ab-1e9e37c373fc
.
HTTP headers
Header | Value | Comment |
---|---|---|
authorization | {...,"FORSKRIVARKOD":"9000027","VARDGIVARE":"0123456789","YRKESKOD":["LK"],"loa":3} |
Selected information from the OAuth2-ticket in decoded form |
prefer | ||
x-access | UTAN_KRAV_SAMTYCKE |
|
x-org-info | {"orgenhetsOrt":"Sala"} |
Decoded value |
x-patientref | ||
x-provenance | ||
x-purpose | VARD |
|
x-request-id | 1406c02e-89ee-4ee0-9097-6536d7c4a007 |
|
x-user-agent | {"name":"Test system testaren","version":"0.01010101010.1 beta"} |
Decoded value |
HTTP body: Fetch Patient unknown status