Searching for Measurements
- Erik Nielsen
- Andreas Harfeld Jakobsen
- Tom Pilgård
Patient
Patients can search for measurements by:
$search-measurements
Searching measurements with $search-measurements
POST $search-measurement request body:
Parameters available:
Amount | Parameter Name | Type |
---|
Amount | Parameter Name | Type |
---|---|---|
0..1 |
| Reference (Patient) |
0..1 |
| Reference (EpisodeOfCare) |
0..1 |
| Reference (Device) |
1..1 |
| Period |
0..* |
| Reference (ServiceRequests) |
Combinations allow for:
broad searches (Patient and Period only)
very specific searches (Period and ServiceRequest) and other combinations
Response:
The response is a bundle of nested bundles that each contain a full set of related resources (Observation, Media, QuestionnaireResponse and Provenance) for a found measurement. If a QuestionnaireResponse is part of a bundle the Questionnaire it answers is also included in the bundle. Related resources are the set of resources created by a single invocation of the submit-measurement operation.
Bundle of:
Bundle for each submitted together:
0..* Observation
0..* Media
0..* QuestionnaireResponse
1..* Questionnaire
0..* Provenance indicating reuse of measurement
Examples:
Below example is from here: http://ehealth-documentation.s3-website-eu-west-1.amazonaws.com/latest/ig/POST_search-measurements.html#post-search-measurements
Unlike a regular search operation which would be a GET request, the $search-measurement is a POST request to the URL:
POST [base]/$search-measurements
The search parameters are sent by including them in the request body (below is a JSON example of a body):
{
"resourceType": "Parameters",
"parameter": [
{
"name": "patient",
"valueReference": {
"reference": "https://patient.cit-measurement-1414.local/fhir/Patient/47556"
}
},
{
"name": "period",
"valuePeriod": {
"start": "2020-12-21T00:00:00+00:00"
}
}
]
}
The response will then contain a bundle of bundles with the found resources (Below is a JSON example of a return bundle):
{
"resourceType": "Bundle",
"type": "collection",
"entry": [
{
"fullUrl": "f1e15387-6e84-4a5f-ab0d-076b4c6ea906",
"resource": {
"resourceType": "Bundle",
"id": "f1e15387-6e84-4a5f-ab0d-076b4c6ea906",
"type": "collection",
"entry": [
{
"fullUrl": "https://measurement.cit-measurement-1414.local/fhir/Observation/350",
"resource": {
"resourceType": "Observation",
"id": "350",
"meta": {
"versionId": "1",
"lastUpdated": "2021-12-21T14:10:01.692+00:00",
"source": "#b2ec62fc-7f07-44",
"profile": [
"http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-observation"
]
},
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/workflow-episodeOfCare",
"valueReference": {
"reference": "https://careplan.cit-measurement-1414.local/fhir/EpisodeOfCare/73880"
}
},
{
"url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-resolved-timing",
"extension": [
{
"url": "serviceRequestVersionId",
"valueId": "42"
},
{
"url": "type",
"valueCodeableConcept": {
"coding": [
{
"system": "http://ehealth.sundhed.dk/cs/resolved-timing-type",
"code": "Adhoc"
}
]
}
}
]
}
],
"basedOn": [
{
"reference": "https://careplan.cit-measurement-1414.local/fhir/ServiceRequest/48367"
}
],
"status": "final",
"code": {
"coding": [
{
"system": "urn:oid:1.2.208.176.2.1",
"code": "NPU03011"
}
]
},
"subject": {
"reference": "https://patient.cit-measurement-1414.local/fhir/Patient/47556"
},
"effectivePeriod": {
"start": "2021-12-21T14:10:01+00:00",
"end": "2021-12-21T14:10:01+00:00"
},
"performer": [
{
"reference": "https://patient.cit-measurement-1414.local/fhir/Patient/47556"
}
],
"device": {
"reference": "https://device.cit-measurement-1414.local/fhir/Device/38078"
}
}
},
{
"fullUrl": "https://measurement.cit-measurement-1414.local/fhir/Media/351",
"resource": {
"resourceType": "Media",
"id": "351",
"meta": {
"versionId": "1",
"lastUpdated": "2021-12-21T14:10:01.982+00:00",
"source": "#38603316-dade-48",
"profile": [
"http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-media"
]
},
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/workflow-episodeOfCare",
"valueReference": {
"reference": "https://careplan.cit-measurement-1414.local/fhir/EpisodeOfCare/23583"
}
},
{
"url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-quality",
"extension": [
{
"url": "qualityType",
"valueCodeableConcept": {
"coding": [
{
"system": "http://ehealth.sundhed.dk/cs/quality-types",
"code": "TBD"
}
]
}
},
{
"url": "qualityCode",
"valueCodeableConcept": {
"coding": [
{
"system": "http://ehealth.sundhed.dk/cs/usage-quality",
"code": "TBD"
}
]
}
}
]
},
{
"url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-resolved-timing",
"extension": [
{
"url": "serviceRequestVersionId",
"valueId": "42"
},
{
"url": "type",
"valueCodeableConcept": {
"coding": [
{
"system": "http://ehealth.sundhed.dk/cs/resolved-timing-type",
"code": "Adhoc"
}
]
}
}
]
}
],
"basedOn": [
{
"reference": "https://careplan.cit-measurement-1414.local/fhir/ServiceRequest/13775"
}
],
"status": "completed",
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/media-type",
"code": "audio"
}
]
},
"subject": {
"reference": "https://patient.cit-measurement-1414.local/fhir/Patient/47556"
},
"createdDateTime": "2021-12-21T14:10:01+00:00",
"content": {
"language": "en"
}
}
}
]
}
}
]
}
$search-measurements-bundle-limit
Introduced in 2024.3
Searching measurements with $search-measurements-bundle-limit
POST $search-measurement request body:
Parameters available:
Amount | Parameter Name | Type |
---|
Amount | Parameter Name | Type |
---|---|---|
0..1 |
| Reference (Patient) |
0..1 |
| Reference (EpisodeOfCare) |
0..1 |
| Positive Integer |
0..1 |
| DateTimeType |
0..1 |
| DateTimeType |
0..* |
| Reference (ServiceRequests) |
Combinations allow for:
Only one of the parameters Start or End can be used at a time.
If
start
is used, the firstcount
number of bundles after thestart
time is returned.If
end
is used, the latestcount
number of bundles up to theend
time is returned.
broad searches (Patient and Start or End only)
precise searches (Start or End and ServiceRequest) and other combinations
Response:
The response is a bundle of nested bundles that each contain a full set of related resources (Observation, Media, QuestionnaireResponse and Provenance) for a found measurement. If a QuestionnaireResponse is part of a bundle the Questionnaire it answers is also included in the bundle. Related resources are the set of resources created by a single invocation of the submit-measurement operation. The amount of nested bundles is limited by the given count parameter.
Bundle of:
Bundle for each submitted together:
0..* Observation
0..* Media
0..* QuestionnaireResponse
0..* Provenance indicating reuse of measurement
Examples:
Below example is from here: http://ehealth-documentation.s3-website-eu-west-1.amazonaws.com/latest/ig/POST_search-measurements.html#post-search-measurements
Like the $search-measurements operation, the $search-measurements-bundle-limit operation is also a POST request to the URL:
POST [base]/$search-measurements-bundle-limit
The search parameters are sent by including them in the request body (below is a JSON example of a body):
{
"resourceType": "Parameters",
"parameter": [
{
"name": "patient",
"valueReference": {
"reference": "https://patient.local.ehealth.sundhed.dk/fhir/Patient/8100"
}
},
{
"name": "count",
"valueInteger": 10
},
{
"name": "end",
"valueDateTime": "2024-06-06T04:41:38+02:00"
}
]
}
The response will then contain a bundle of bundles with the found resources (Below is a JSON example of a return bundle):
Search on Observation
Searching for Observation
Below is a list of some of the common search parameters. An exhaustive list can be found in implementation guide at http://ehealth-documentation.s3-website-eu-west-1.amazonaws.com/latest/ig/measurement.openapi.json.
Name | Description |
---|
Name | Description |
---|---|
| the tag of a resource |
| The ID of the resource |
| The patient that the observation is about |
| The subject that the observation is about |
| The EpisodeOfCare that the Observation is associated with |
| The ServiceRequest that the observation is based on |
| Resolved Timing start |
| Resolved Timing end |
Response:
Bundle of
Observation(s)
Examples:
Searching on Observations are done by use of a traditional GET request:
GET [base]/fhir/Observation?paramName1=param1¶mName2=param2
As an example one could perform searches like the following examples:
Searching by two resource Ids and and a Subject:
GET [base]/fhir/Observation?_id=1,3&subject=https://patient.local.ehealth.sundhed.dk/fhir/Patient/34032
Searching by occurrence date:
GET [base]/fhir/Observation?date=lt2023-01-22&date=gt2022-10-22
(lt=less than, gt=greater than)Searching by resolvedTiming start and end:
GET [base]/fhir/Observation?resolvedTimingEnd=gt2023-05-22T08:37:42+02:00&resolvedTimingStart=gt2023-05-22T08:37:42+02:00
Search by resource tag:
GET [base]/fhir/Observation?_tag=http://ehealth.sundhed.dk/cs/ehealth-system|xa
An example of a response on for a search could be:
Search on Media
Searching on Media
Below is a list of some of the common search parameters. An exhaustive list can be found in implementation guide at http://ehealth-documentation.s3-website-eu-west-1.amazonaws.com/latest/ig/measurement.openapi.json.
Name | Description |
---|
Name | Description |
---|---|
| the tag of a resource |
| The ID of the resource |
| Episode associated with observation |
| The subject that the observation is about |
| The type of the Media ("photo | video | audio") |
| When Media was collected |
| ServiceRequest that caused this media to be created |
Response:
Bundle of
Media(s)
Examples:
Searching on Medias are done by use of a traditional GET request:
GET [base]/fhir/Media?paramName1=param1¶mName2=param2
As an example one could perform searches like the following examples:
Searching based on Media’s type:
GET [base]/fhir/Media?type=audio
Searching based on when the media was created:
GET [base]/fhir/Media?created=lt2023-03-22&created=gt2023-01-22
An example of a response on for a search could be:
Search on QuestionnaireResponse
Searching for QuestionnaireResponse
Below is a list of some of the common search parameters. An exhaustive list can be found in implementation guide at http://ehealth-documentation.s3-website-eu-west-1.amazonaws.com/latest/ig/measurement.openapi.json.
Name | Description |
---|
Name | Description |
---|---|
| the tag of a resource |
| The ID of the resource |
| The unique id for a particular observation |
| The status of the QuestionnaireResponse |
| Episode associated with observation |
| The questionnaire the answers are provided for |
| The subject that the observation is about |
| When the questionnaire response was last changed |
Response:
Bundle of
QuestionnaireResponse(s)
Examples:
Searching on QuestionnaireResponses are done by use of a traditional GET request:
GET [base]/fhir/QuestionnaireResponse?paramName1=param1¶mName2=param2
As an example one could perform searches like the following examples:
Searching based on QuestionnaireResponse authored date:
GET [base]/fhir/QuestionnaireResponse?authored=lt2023-03-22&authored=gt2023-01-22
Searching based on the Questionnaire which the QuestionnaireResponse answers:
GET [base]/fhir/QuestionnaireResponse?questionnaire=https://questionnaire.local.ehealth.sundhed.dk/fhir/Questionnaire/16023
Searching on the status of a QuestionnaireResponse:
GET [base]/fhir/QuestionnaireResponse?status=completed
An example of a response on for a search could be:
Practitioner
Practitioners can search for measurements by the same methods as Patients, but restrictions apply:
The practitioner must be logged in using a CareTeam that, in generic terms, ”plays a role in the corresponding EpisodeOfCare or CarePlan”