Extract Observations
What
Enables you to pull out all observations sent from any FHIR source. See the Validation and Business rules section for further details on what is included in the Aggregated endpoint.
Prerequisites
How to
With a valid token, call the base URL with the Observation resource, using the patient’s identifier (with the corresponding system) in the actor search parameter to pull back all of a patient’s observations you have access to in PKB.
National ID Example: https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/Observation?subject:Patient.identifier=https://fhir.nhs.uk/Id/nhs-number%7C9571270652
PKB Public ID Example: https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/Observation?subject:Patient.identifier=http://fhir.patientsknowbest.com/id/public-id%7C1d4a8b2d-f885-499f-ba51-50600312f316
You can add other supported search parameters onto that request to meet your specific use case. See the FHIR R4 Search page for further information.
Example pulling back all of a patient’s observations that that contain the coded text of ‘blood pressure’: https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/Observation?subject:Patient.identifier=https://fhir.nhs.uk/Id/nhs-number%7C9106771734&code:text=blood pressure
A FHIR bundle is returned to you in json format with all of the patient’s observations that are in their PKB record.
Useful links
Further information on connectivity and endpoints.
PKB uses the Observation FHIR resource. You can read the full capability statement here.
Example
Here’s an example response for pulling all of this patient’s observations that have a date of the 10th of January 2023 or more recent:
{
"resourceType": "Bundle",
"meta": {
"lastUpdated": "2025-02-20T16:26:22.615+00:00"
},
"type": "searchset",
"total": 5,
"link": [
{
"relation": "self",
"url": "/fhir/Observation?subject%3APatient.identifier=https%3A%2F%2Ffhir.nhs.uk%2FId%2Fnhs-number%7C9106771734"
}
],
"entry": [
{
"link": [
{
"relation": "self",
"url": "https://sandboxaggregated.fhir-api.sandbox.patientsknowbest.com/Observation/e6ba1953-c4b7-34f0-a59f-a8f493716a0c"
}
],
"fullUrl": "https://sandboxaggregated.fhir-api.sandbox.patientsknowbest.com/Observation/e6ba1953-c4b7-34f0-a59f-a8f493716a0c",
"resource": {
"resourceType": "Observation",
"id": "e6ba1953-c4b7-34f0-a59f-a8f493716a0c",
"meta": {
"extension": [
{
"url": "http://fhir.patientsknowbest.com/structuredefinition/access-route",
"valueCoding": {
"system": "http://fhir.patientsknowbest.com/codesystem/access-route",
"code": "FHIR_API",
"display": "Integration (FHIR)"
}
},
{
"url": "http://fhir.patientsknowbest.com/structuredefinition/version-persisted",
"valueDateTime": "2024-10-28T10:51:19.399+00:00"
},
{
"url": "ex:createdAt",
"valueInstant": "2024-10-28T10:51:19.629061Z"
}
],
"versionId": "7414571",
"lastUpdated": "2024-10-28T10:51:19.629061Z",
"security": [
{
"system": "http://fhir.patientsknowbest.com/codesystem/source-organization",
"code": "0c6478d8-ab0f-3337-84f6-4c94464e0222",
"display": "Denormalized source information"
},
{
"system": "http://fhir.patientsknowbest.com/codesystem/privacy-label",
"code": "GENERAL_HEALTH"
}
]
},
"extension": [
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream",
"extension": [
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream-source-id",
"valueString": "testr4"
},
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream-resource-id",
"valueString": "Observation/18a60e1f-8f54-490c-baa2-a300e30aaf28"
}
]
}
],
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "vital-signs",
"display": "Vital Signs"
}
]
}
],
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "75367002",
"display": "Blood pressure"
}
],
"text": "Blood pressure"
},
"subject": {
"reference": "Patient/2a43a24f-3b1d-3475-9511-bf3ca994afc9"
},
"component": [
{
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "163030003",
"display": "Systolic blood pressure"
}
],
"text": "Systolic blood pressure"
},
"valueQuantity": {
"value": 120,
"unit": "mmHg",
"system": "http://unitsofmeasure.org",
"code": "mm[Hg]"
}
},
{
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "163031004",
"display": "Diastolic blood pressure"
}
],
"text": "Diastolic blood pressure"
},
"valueQuantity": {
"value": 80,
"unit": "mmHg",
"system": "http://unitsofmeasure.org",
"code": "mm[Hg]"
}
}
]
},
"search": {
"mode": "match"
}
},
{
"link": [
{
"relation": "self",
"url": "https://sandboxaggregated.fhir-api.sandbox.patientsknowbest.com/Observation/b589589b-47ae-33ab-ba67-698135f22dc5"
}
],
"fullUrl": "https://sandboxaggregated.fhir-api.sandbox.patientsknowbest.com/Observation/b589589b-47ae-33ab-ba67-698135f22dc5",
"resource": {
"resourceType": "Observation",
"id": "b589589b-47ae-33ab-ba67-698135f22dc5",
"meta": {
"extension": [
{
"url": "http://fhir.patientsknowbest.com/structuredefinition/version-persisted",
"valueDateTime": "2025-02-20T15:53:42.413+00:00"
},
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/last-updated-source",
"valueString": "testr4"
},
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream-last-updated",
"valueDateTime": "2025-02-20T15:53:42.413+00:00"
},
{
"url": "http://fhir.patientsknowbest.com/structuredefinition/access-route",
"valueCoding": {
"system": "http://fhir.patientsknowbest.com/codesystem/access-route",
"code": "FHIR_API",
"display": "Integration (FHIR)"
}
},
{
"url": "ex:createdAt",
"valueInstant": "2025-02-20T15:53:44.469073Z"
}
],
"versionId": "7720651",
"lastUpdated": "2025-02-20T15:53:44.469073Z",
"security": [
{
"system": "http://fhir.patientsknowbest.com/codesystem/source-organization",
"code": "0c6478d8-ab0f-3337-84f6-4c94464e0222",
"display": "Denormalized source information"
},
{
"system": "http://fhir.patientsknowbest.com/codesystem/privacy-label",
"code": "GENERAL_HEALTH"
}
]
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"> - Serum TSH (thyroid stimulating hormone) level</div>"
},
"extension": [
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream",
"extension": [
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream-source-id",
"valueString": "testr4"
},
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream-resource-id",
"valueString": "Observation/0B6147FF-E9F5-0AC5-FCA5-7DA237564414"
}
]
}
],
"identifier": [
{
"system": "http://fhir.patientsknowbest.com/id/emis-observation-event-guid",
"value": "05d77808-f6bd-4023-8ea1-d5c81c1c17a7"
}
],
"status": "final",
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "1022791000000101",
"display": "Serum TSH (thyroid stimulating hormone) level"
}
]
},
"subject": {
"reference": "Patient/2a43a24f-3b1d-3475-9511-bf3ca994afc9"
},
"performer": [
{
"reference": "Practitioner/ffc5ebc8-efa6-3f9a-9dfa-9a92a063ec2c",
"display": "Mr PKB Test"
}
],
"valueQuantity": {
"value": 4.6,
"unit": "mU/L"
},
"interpretation": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",
"code": "A",
"display": "Abnormal"
}
]
}
]
},
"search": {
"mode": "match"
}
},
{
"link": [
{
"relation": "self",
"url": "https://sandboxaggregated.fhir-api.sandbox.patientsknowbest.com/Observation/924805a1-93cf-3193-b422-5038da13edc7"
}
],
"fullUrl": "https://sandboxaggregated.fhir-api.sandbox.patientsknowbest.com/Observation/924805a1-93cf-3193-b422-5038da13edc7",
"resource": {
"resourceType": "Observation",
"id": "924805a1-93cf-3193-b422-5038da13edc7",
"meta": {
"extension": [
{
"url": "http://fhir.patientsknowbest.com/structuredefinition/version-persisted",
"valueDateTime": "2025-02-20T16:06:55.886+00:00"
},
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/last-updated-source",
"valueString": "testr4"
},
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream-last-updated",
"valueDateTime": "2025-02-20T16:06:55.886+00:00"
},
{
"url": "http://fhir.patientsknowbest.com/structuredefinition/access-route",
"valueCoding": {
"system": "http://fhir.patientsknowbest.com/codesystem/access-route",
"code": "FHIR_API",
"display": "Integration (FHIR)"
}
},
{
"url": "ex:createdAt",
"valueInstant": "2025-02-20T16:06:56.977211Z"
}
],
"versionId": "7720658",
"lastUpdated": "2025-02-20T16:06:56.977211Z",
"security": [
{
"system": "http://fhir.patientsknowbest.com/codesystem/privacy-label",
"code": "SEXUAL_HEALTH"
},
{
"system": "http://fhir.patientsknowbest.com/codesystem/source-organization",
"code": "0c6478d8-ab0f-3337-84f6-4c94464e0222",
"display": "Denormalized source information"
}
]
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"> - Chlamydia test positive</div>"
},
"extension": [
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream",
"extension": [
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream-source-id",
"valueString": "testr4"
},
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream-resource-id",
"valueString": "Observation/D983A6A8-8479-102E-AAD9-E81A82B55FAC1"
}
]
}
],
"identifier": [
{
"system": "http://fhir.patientsknowbest.com/id/emis-observation-event-guid",
"value": "cf29c6ed-9a98-469a-b4aa-9a3d0e25b4ad"
}
],
"status": "final",
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "201441000000107",
"display": "Chlamydia test positive"
}
]
},
"subject": {
"reference": "Patient/2a43a24f-3b1d-3475-9511-bf3ca994afc9"
},
"performer": [
{
"reference": "Practitioner/ffc5ebc8-efa6-3f9a-9dfa-9a92a063ec2c",
"display": "Mr PKB Test"
}
]
},
"search": {
"mode": "match"
}
},
{
"link": [
{
"relation": "self",
"url": "https://sandboxaggregated.fhir-api.sandbox.patientsknowbest.com/Observation/476631a7-9fb7-3682-a114-010e630674f0"
}
],
"fullUrl": "https://sandboxaggregated.fhir-api.sandbox.patientsknowbest.com/Observation/476631a7-9fb7-3682-a114-010e630674f0",
"resource": {
"resourceType": "Observation",
"id": "476631a7-9fb7-3682-a114-010e630674f0",
"meta": {
"extension": [
{
"url": "http://fhir.patientsknowbest.com/structuredefinition/access-route",
"valueCoding": {
"system": "http://fhir.patientsknowbest.com/codesystem/access-route",
"code": "FHIR_API",
"display": "Integration (FHIR)"
}
},
{
"url": "http://fhir.patientsknowbest.com/structuredefinition/version-persisted",
"valueDateTime": "2024-10-18T10:42:34.535+00:00"
},
{
"url": "ex:createdAt",
"valueInstant": "2024-10-18T10:42:34.645579Z"
}
],
"versionId": "7413163",
"lastUpdated": "2024-10-18T10:42:34.645579Z",
"security": [
{
"system": "http://fhir.patientsknowbest.com/codesystem/source-organization",
"code": "0c6478d8-ab0f-3337-84f6-4c94464e0222",
"display": "Denormalized source information"
},
{
"system": "http://fhir.patientsknowbest.com/codesystem/privacy-label",
"code": "GENERAL_HEALTH"
}
]
},
"extension": [
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream",
"extension": [
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream-source-id",
"valueString": "testr4"
},
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream-resource-id",
"valueString": "Observation/2ff490ec-c89f-4a8d-a652-173c9376691f"
}
]
}
],
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "laboratory",
"display": "Laboratory"
}
]
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "62374-4",
"display": "17p13.1 deletion analysis"
}
]
},
"subject": {
"reference": "Patient/2a43a24f-3b1d-3475-9511-bf3ca994afc9"
},
"effectiveDateTime": "2023-04-09",
"issued": "2024-10-09T13:28:17.239+01:00",
"valueCodeableConcept": {
"text": "Positive"
}
},
"search": {
"mode": "match"
}
},
{
"link": [
{
"relation": "self",
"url": "https://sandboxaggregated.fhir-api.sandbox.patientsknowbest.com/Observation/3daf7bc6-ea13-322e-bd45-e70ddb2acbc6"
}
],
"fullUrl": "https://sandboxaggregated.fhir-api.sandbox.patientsknowbest.com/Observation/3daf7bc6-ea13-322e-bd45-e70ddb2acbc6",
"resource": {
"resourceType": "Observation",
"id": "3daf7bc6-ea13-322e-bd45-e70ddb2acbc6",
"meta": {
"extension": [
{
"url": "http://fhir.patientsknowbest.com/structuredefinition/access-route",
"valueCoding": {
"system": "http://fhir.patientsknowbest.com/codesystem/access-route",
"code": "FHIR_API",
"display": "Integration (FHIR)"
}
},
{
"url": "http://fhir.patientsknowbest.com/structuredefinition/version-persisted",
"valueDateTime": "2024-10-18T10:48:30.592+00:00"
},
{
"url": "ex:createdAt",
"valueInstant": "2024-10-18T10:48:30.655891Z"
}
],
"versionId": "7413167",
"lastUpdated": "2024-10-18T10:48:30.655891Z",
"security": [
{
"system": "http://fhir.patientsknowbest.com/codesystem/source-organization",
"code": "0c6478d8-ab0f-3337-84f6-4c94464e0222",
"display": "Denormalized source information"
},
{
"system": "http://fhir.patientsknowbest.com/codesystem/privacy-label",
"code": "GENERAL_HEALTH"
}
]
},
"extension": [
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream",
"extension": [
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream-source-id",
"valueString": "testr4"
},
{
"url": "https://fhir.patientsknowbest.com/structuredefinition/upstream-resource-id",
"valueString": "Observation/d38061a6-1eb2-4001-9458-e1acd3c692bd"
}
]
}
],
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "laboratory",
"display": "Laboratory"
}
]
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "81247-9",
"display": "TP53 gene mutation analysis"
}
]
},
"subject": {
"reference": "Patient/2a43a24f-3b1d-3475-9511-bf3ca994afc9"
},
"effectiveDateTime": "2022-10-09",
"issued": "2024-10-09T13:28:17.239+01:00",
"valueCodeableConcept": {
"text": "Positive"
}
},
"search": {
"mode": "match"
}
}
]
}Aggregated Observation supported search parameters
{
"name": "focus",
"definition": "/SearchParameter/Observation.focus",
"type": "reference"
},
{
"name": "encounter",
"definition": "/SearchParameter/Observation.encounter",
"type": "reference"
},
{
"name": "combo-data-absent-reason",
"definition": "/SearchParameter/Observation.combo-data-absent-reason",
"type": "token"
},
{
"name": "method",
"definition": "/SearchParameter/Observation.method",
"type": "token"
},
{
"name": "combo-value-quantity",
"definition": "/SearchParameter/Observation.combo-value-quantity",
"type": "quantity"
},
{
"name": "combo-code",
"definition": "/SearchParameter/Observation.combo-code",
"type": "token"
},
{
"name": "component-value-quantity",
"definition": "/SearchParameter/Observation.component-value-quantity",
"type": "quantity"
},
{
"name": "component-code",
"definition": "/SearchParameter/Observation.component-code",
"type": "token"
},
{
"name": "subject",
"definition": "/SearchParameter/Observation.subject",
"type": "reference"
},
{
"name": "code",
"definition": "/SearchParameter/Observation.code",
"type": "token"
},
{
"name": "based-on",
"definition": "/SearchParameter/Observation.based-on",
"type": "reference"
},
{
"name": "specimen",
"definition": "/SearchParameter/Observation.specimen",
"type": "reference"
},
{
"name": "value-string",
"definition": "/SearchParameter/Observation.value-string",
"type": "string"
},
{
"name": "value-concept",
"definition": "/SearchParameter/Observation.value-concept",
"type": "token"
},
{
"name": "patient",
"definition": "/SearchParameter/Observation.patient",
"type": "reference"
},
{
"name": "value-date",
"definition": "/SearchParameter/Observation.value-date",
"type": "date"
},
{
"name": "identifier",
"definition": "/SearchParameter/Observation.identifier",
"type": "token"
},
{
"name": "data-absent-reason",
"definition": "/SearchParameter/Observation.data-absent-reason",
"type": "token"
},
{
"name": "performer",
"definition": "/SearchParameter/Observation.performer",
"type": "reference"
},
{
"name": "combo-value-concept",
"definition": "/SearchParameter/Observation.combo-value-concept",
"type": "token"
},
{
"name": "status",
"definition": "/SearchParameter/Observation.status",
"type": "token"
},
{
"name": "component-data-absent-reason",
"definition": "/SearchParameter/Observation.component-data-absent-reason",
"type": "token"
},
{
"name": "derived-from",
"definition": "/SearchParameter/Observation.derived-from",
"type": "reference"
},
{
"name": "device",
"definition": "/SearchParameter/Observation.device",
"type": "reference"
},
{
"name": "value-quantity",
"definition": "/SearchParameter/Observation.value-quantity",
"type": "quantity"
},
{
"name": "part-of",
"definition": "/SearchParameter/Observation.part-of",
"type": "reference"
},
{
"name": "has-member",
"definition": "/SearchParameter/Observation.has-member",
"type": "reference"
},
{
"name": "component-value-concept",
"definition": "/SearchParameter/Observation.component-value-concept",
"type": "token"
},
{
"name": "category",
"definition": "/SearchParameter/Observation.category",
"type": "token"
},
{
"name": "date",
"definition": "/SearchParameter/Observation.date",
"type": "date"
}