FHIR Chat · Hapi Fhir Composite Search Questions · implementers

Stream: implementers

Topic: Hapi Fhir Composite Search Questions


view this post on Zulip Severin Kohler (Dec 07 2018 at 15:35):

Hi all - I'm currently playing around with the FHIR Search.
At the moment I'm trying some composite searches on our HAPI test server and recognised some things I don't understand.
First of all I deployed the example from the FHIR website for blood pressure on our Hapi (https://www.hl7.org/fhir/observation-example-bloodpressure.json.html) with all the necessary values and references (the jsons i deployed are listed below, I just copied them from the official test server or from the fhir website and modified some values a little bit)

1. When I'm doing a composite search like : Observation?component-code-value-quantity=8480-6$lt70, my Patient is also displayed even when the systolic blood pressure (99) isn't lower than 70.
I recongised that the diastolic blood pressure is 60 and if I enter a value below 60 no patient is displayed.
I guess its just searching for "some" valueQuantity.

So the search doesn't really connect the code with the value ?
Is this a bug within the Hapi Server, are the composite searches not fully implemented yet?
Or did I made some mistake/misunderstood something ?

2. If I'm trying to connect multiple Parameters for a patient like:
a) /Patient?_has:Observation:subject:component-code=8480-6&_has:Observation:subject:value-quantity=lt90 (works but same problem like in 1 )
or
b) /Patient?_has:Observation:subject:component-code-value-quantity=8480-6$lt90 (does display an error)
Why is b) not working (wrong syntax/not implemented) ?
Also i don't think a) is connecting the systolic code and the value at all, even if the search in 1. would work.

3. How would a search for female patients with blood pressure (sys) >90 and Body Temperature >37.0 look like?

Regards,
Severin Kohler

-----------------------------Here are the Resources, Observations etc. i deployed on my HAPI---------------------------------
---------------------Patient 1------------------------
{
"resourceType": "Patient",
"id": "5",
"active": true,
"gender": "female",
"birthDate": "1976-07-01",
"deceasedBoolean": false,
"name": [
{
"family": "of Alexandria",
"given": [
"Aedesia"
]
}
]
}

-----------PRACTITIONER----------------------
{
"resourceType": "Practitioner",
"id": "22291",
"meta": {
"versionId": "1",
"lastUpdated": "2018-10-01T06:18:35.977+00:00"
},
"identifier": [
{
"system": "http://clinfhir.com/fhir/NamingSystem/practitioner",
"value": "NM7uqTm65gZHKEzsqLQ9nT2y2662"
}
],
"name": [
{
"family": "DOCTOR",
"given": [
"REFERRING"
]
}
]
}

-----------Observation Blood Pressure --------------------
{
"resourceType": "Observation",
"id": "blood-pressure",
"meta": {
"profile": [
"http://hl7.org/fhir/StructureDefinition/vitalsigns"
]
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: blood-pressure</p><p><b>meta</b>: </p><p><b>identifier</b>: urn:uuid:187e0c12-8dd2-67e2-99b2-bf273c878281</p><p><b>basedOn</b>: </p><p><b>status</b>: final</p><p><b>category</b>: Vital Signs <span>(Details : {http://hl7.org/fhir/observation-category code 'vital-signs' = 'Vital Signs', given as 'Vital Signs'})</span></p><p><b>code</b>: Blood pressure systolic & diastolic <span>(Details : {LOINC code '85354-9' = 'lood pressure panel with all children optional', given as 'Bood pressure panel with all children optional'})</span></p><p><b>subject</b>: <a>Patient/example</a></p><p><b>effective</b>: 17/09/2012</p><p><b>performer</b>: <a>Practitioner/example</a></p><p><b>interpretation</b>: Below low normal <span>(Details : {http://hl7.org/fhir/v2/0078 code 'L' = 'Low', given as 'low'})</span></p><p><b>bodySite</b>: Right arm <span>(Details : {SNOMED CT code '368209003' = 'Right upper arm', given as 'Right arm'})</span></p><blockquote><p><b>component</b></p><p><b>code</b>: Systolic blood pressure <span>(Details : {LOINC code '8480-6' = 'Systolic blood pressure', given as 'Systolic blood pressure'}; {SNOMED CT code '271649006' = 'Systolic blood pressure', given as 'Systolic blood pressure'}; {http://acme.org/devices/clinical-codes code 'bp-s' = 'bp-s', given as 'Systolic Blood pressure'})</span></p><p><b>value</b>: 107 mmHg<span> (Details: UCUM code mm[Hg] = 'mmHg')</span></p><p><b>interpretation</b>: Normal <span>(Details : {http://hl7.org/fhir/v2/0078 code 'N' = 'Normal', given as 'normal'})</span></p></blockquote><blockquote><p><b>component</b></p><p><b>code</b>: Diastolic blood pressure <span>(Details : {LOINC code '8462-4' = 'Diastolic blood pressure', given as 'Diastolic blood pressure'})</span></p><p><b>value</b>: 60 mmHg<span> (Details: UCUM code mm[Hg] = 'mmHg')</span></p><p><b>interpretation</b>: Below low normal <span>(Details : {http://hl7.org/fhir/v2/0078 code 'L' = 'Low', given as 'low'})</span></p></blockquote></div>"
},
"identifier": [
{
"system": "urn:ietf:rfc:3986",
"value": "urn:uuid:187e0c12-8dd2-67e2-99b2-bf273c878281"
}
],
"basedOn": [
{
"identifier": {
"system": "https://acme.org/identifiers",
"value": "1234"
}
}
],
"status": "final",
"category": [
{
"coding": [
{
"system": "http://hl7.org/fhir/observation-category",
"code": "vital-signs",
"display": "Vital Signs"
}
]
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "85354-9",
"display": "Bood pressure panel with all children optional"
}
],
"text": "Blood pressure systolic & diastolic"
},
"subject": {
"reference": "Patient/5"
},
"effectiveDateTime": "2012-09-17",
"performer": [
{
"reference": "Practitioner/3"
}
],
"interpretation": {
"coding": [
{
"system": "http://hl7.org/fhir/v2/0078",
"code": "L",
"display": "low"
}
],
"text": "Below low normal"
},
"bodySite": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "368209003",
"display": "Right arm"
}
]
},
"component": [
{
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "8480-6",
"display": "Systolic blood pressure"
},
{
"system": "http://snomed.info/sct",
"code": "271649006",
"display": "Systolic blood pressure"
},
{
"system": "http://acme.org/devices/clinical-codes",
"code": "bp-s",
"display": "Systolic Blood pressure"
}
]
},
"valueQuantity": {
"value": 99,
"unit": "mmHg",
"system": "http://unitsofmeasure.org",
"code": "mm[Hg]"
},
"interpretation": {
"coding": [
{
"system": "http://hl7.org/fhir/v2/0078",
"code": "N",
"display": "normal"
}
],
"text": "Normal"
}
},
{
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "8462-4",
"display": "Diastolic blood pressure"
}
]
},
"valueQuantity": {
"value": 60,
"unit": "mmHg",
"system": "http://unitsofmeasure.org",
"code": "mm[Hg]"
},
"interpretation": {
"coding": [
{
"system": "http://hl7.org/fhir/v2/0078",
"code": "L",
"display": "low"
}
],
"text": "Below low normal"
}
}
]
}

---------------------Observation Body Temperature------------------------------

{
"resourceType": "Observation",
"id": "body-temperature",
"meta": {
"profile": [
"http://hl7.org/fhir/StructureDefinition/vitalsigns"
]
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: body-temperature</p><p><b>meta</b>: </p><p><b>status</b>: final</p><p><b>category</b>: Vital Signs <span>(Details : {http://hl7.org/fhir/observation-category code 'vital-signs' = 'Vital Signs', given as 'Vital Signs'})</span></p><p><b>code</b>: Body temperature <span>(Details : {LOINC code '8310-5' = 'Body temperature', given as 'Body temperature'})</span></p><p><b>subject</b>: <a>Patient/example</a></p><p><b>effective</b>: 02/07/1999</p><p><b>value</b>: 36.5 C<span> (Details: UCUM code Cel = 'Cel')</span></p></div>"
},
"status": "final",
"category": [
{
"coding": [
{
"system": "http://hl7.org/fhir/observation-category",
"code": "vital-signs",
"display": "Vital Signs"
}
],
"text": "Vital Signs"
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "8310-5",
"display": "Body temperature"
}
],
"text": "Body temperature"
},
"subject": {
"reference": "Patient/5"
},
"effectiveDateTime": "1999-07-02",
"valueQuantity": {
"value": 37.2,
"unit": "C",
"system": "http://unitsofmeasure.org",
"code": "Cel"
}
}

view this post on Zulip Lloyd McKenzie (Dec 10 2018 at 23:59):

@James Agnew ?

view this post on Zulip James Agnew (Dec 11 2018 at 10:31):

This composite search issue is a known issue in HAPI FHIR. Unfortunately it's a hard one to fix..

view this post on Zulip Paul Church (Dec 11 2018 at 20:24):

Just to make sure I understand the composite parameter examples in the spec at 2.21.1.4.15 - is example #1 in this thread valid without specifying the system, or should it be "Observation?component-code-value-quantity=http://loinc.org|8480-6$lt70"? Based on the token definition I guess both should work.

view this post on Zulip Severin Kohler (Dec 14 2018 at 10:14):

@Julian Sass

view this post on Zulip Severin Kohler (Dec 14 2018 at 10:25):

This composite search issue is a known issue in HAPI FHIR. Unfortunately it's a hard one to fix..

okay so i just try it on a vonk then

view this post on Zulip Severin Kohler (Dec 14 2018 at 10:54):

@Andrea Essenwanger

view this post on Zulip Alexander Zautke (Dec 14 2018 at 20:31):

Hi Severin!

Unfortunately, there is currently also a known bug in Vonk related to composite parameters.
Instead of searching on "component-code-value-quantity" it will try to search on "component-value-quantity".
So search request 1) does not work.

2a) This search query is not working because "lt90" is not a valid value for "value-quantity". In a quantity, only the prefix is optional.
You have to supply the system and unit. {{BASE_URL}}/Observation?value-quantity=lt70|http://unitsofmeasure.org|mm[Hg] should work fine.
A combination with _has is valid, however, it needs to be noted that both _has parts are applied independently. So, the server forms a union of both result sets not an intersection. If you need to have a logical AND, have a look at _filter, though, this is not widely implemented.

2b) Should work if you provide all mandatory parts, provided 1) get's fixed.

3) A combination of _filter and _type should work. However, I guess at the moment there is not a single server capable of handling this.


Last updated: Apr 12 2022 at 19:14 UTC