FHIR: Not finding DiagnosticReport for patient id on SmartHealthIt server - hl7-fhir

I'm trying to find DiagnosticReport resources for a given patient using the SmartHealthIt R4 server for testing (https://r4.smarthealthit.org).
I've loaded the Patient and DiagnosticReport resources shown below.
The patient has the following for id:
"resourceType": "Patient",
"id": "1435573",
The DiagnosticReport has the following for subject:
"subject": {
"reference": "Patient/1435573"
}
None of the following searches return this DiagnosticReport. How do I get all of the DiagnosticReport resources for Patient/1435573 including the one used in this example (I can modify the Patient, the DiagnosticReport, and/or the urls to get the result). The queries below are based on Hapi FHIR: searching for patient identifier using Postman. All of the queries give basically an empty bundle (contains only the self url) except for the last that gives an invalid query error.
Queries:
https://r4.smarthealthit.org/DiagnosticReport?subject=1435573
https://r4.smarthealthit.org/DiagnosticReport?patient.identifier=1435573
https://r4.smarthealthit.org/DiagnosticReport?subject=Patient/1435573
https://r4.smarthealthit.org/DiagnosticReport?subject=https://r4.smarthealthit.org/Patient/1435573
https://r4.smarthealthit.org/DiagnosticReport?subject=http://r4.smarthealthit.org/Patient/1435573
https://r4.smarthealthit.org/DiagnosticReport?subject.reference=1435573
(invalid parameter chain error)
Full Patient Resource (response from the url shown below):
https://r4.smarthealthit.org/Patient/1435573
{
"resourceType": "Patient",
"id": "1435573",
"meta": {
"versionId": "1",
"lastUpdated": "2022-11-20T12:31:20.724-05:00",
"profile": [
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
]
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Generated by Synthea.Version identifier: master-branch-latest\n . Person seed: -3481236467670898486 Population seed: 1663786624475</div>"
},
"extension": [
{
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race",
"extension": [
{
"url": "ombCategory",
"valueCoding": {
"system": "urn:oid:2.16.840.1.113883.6.238",
"code": "2106-3",
"display": "White"
}
},
{
"url": "text",
"valueString": "White"
}
]
},
{
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity",
"extension": [
{
"url": "ombCategory",
"valueCoding": {
"system": "urn:oid:2.16.840.1.113883.6.238",
"code": "2186-5",
"display": "Not Hispanic or Latino"
}
},
{
"url": "text",
"valueString": "Not Hispanic or Latino"
}
]
},
{
"url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName",
"valueString": "Natosha194 Rolfson709"
},
{
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
"valueCode": "M"
},
{
"url": "http://hl7.org/fhir/StructureDefinition/patient-birthPlace",
"valueAddress": {
"city": "Westfield",
"state": "Massachusetts",
"country": "US"
}
},
{
"url": "http://synthetichealth.github.io/synthea/disability-adjusted-life-years",
"valueDecimal": 0.011850126818590398
},
{
"url": "http://synthetichealth.github.io/synthea/quality-adjusted-life-years",
"valueDecimal": 30.98814987318141
}
],
"identifier": [
{
"system": "https://github.com/synthetichealth/synthea",
"value": "d7e5852a-974c-6d45-f81d-5a87bbd05d2a"
},
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "MR",
"display": "Medical Record Number"
}
],
"text": "Medical Record Number"
},
"system": "http://hospital.smarthealthit.org",
"value": "d7e5852a-974c-6d45-f81d-5a87bbd05d2a"
},
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "SS",
"display": "Social Security Number"
}
],
"text": "Social Security Number"
},
"system": "http://hl7.org/fhir/sid/us-ssn",
"value": "999-55-2948"
},
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "DL",
"display": "Driver's License"
}
],
"text": "Driver's License"
},
"system": "urn:oid:2.16.840.1.113883.4.3.25",
"value": "S99934182"
},
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "PPN",
"display": "Passport Number"
}
],
"text": "Passport Number"
},
"system": "http://standardhealthrecord.org/fhir/StructureDefinition/passportNumber",
"value": "X1908681X"
}
],
"name": [
{
"use": "official",
"family": "Hermiston71",
"given": [
"Glenn0",
"Adalberto916"
],
"prefix": [
"Mr."
]
}
],
"telecom": [
{
"system": "phone",
"value": "555-370-8941",
"use": "home"
}
],
"gender": "male",
"birthDate": "1960-07-09",
"deceasedDateTime": "1992-06-21T18:48:35-04:00",
"address": [
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/geolocation",
"extension": [
{
"url": "latitude",
"valueDecimal": 42.1419070399434
},
{
"url": "longitude",
"valueDecimal": -71.28041093915812
}
]
}
],
"line": [
"236 Halvorson Mews Suite 21"
],
"city": "Walpole",
"state": "MA",
"country": "US"
}
],
"maritalStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus",
"code": "M",
"display": "M"
}
],
"text": "M"
},
"multipleBirthBoolean": false,
"communication": [
{
"language": {
"coding": [
{
"system": "urn:ietf:bcp:47",
"code": "en-US",
"display": "English"
}
],
"text": "English"
}
}
]
}
Full DiagnosticReport Resource (response from the url shown below):
https://r4.smarthealthit.org/DiagnosticReport/1435574
{
"resourceType": "DiagnosticReport",
"id": "1435574",
"meta": {
"versionId": "1",
"lastUpdated": "2022-11-20T12:36:53.205-05:00",
"profile": [
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note"
]
},
"status": "final",
"category": [
{
"coding": [
{
"system": "http://loinc.org",
"code": "34117-2",
"display": "History and physical note"
},
{
"system": "http://loinc.org",
"code": "51847-2",
"display": "Evaluation + Plan note"
}
]
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "34117-2",
"display": "History and physical note"
},
{
"system": "http://loinc.org",
"code": "51847-2",
"display": "Evaluation + Plan note"
}
]
},
"subject": {
"reference": "Patient/1435573"
},
"effectiveDateTime": "1978-09-02T17:57:46-04:00",
"issued": "1978-09-02T17:57:46.296-04:00",
"performer": [
{
"display": "Dr. Debbie941 Macejkovic424"
}
],
"presentedForm": [
{
"contentType": "text/plain; charset=utf-8",
"data": "DQoxOTc4LTA5LTAyDQoNCiMgQ2hpZWYgQ29tcGxhaW50DQpObyBjb21wbGFpbnRzLg0KDQojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzDQpHbGVubjANCiBpcyBhIDE4IHllYXItb2xkIG5vbi1oaXNwYW5pYyB3aGl0ZSBtYWxlLg0KDQojIFNvY2lhbCBIaXN0b3J5DQogUGF0aWVudCBoYXMgbmV2ZXIgc21va2VkLg0KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuDQoNClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuDQogUGF0aWVudCBkaWQgbm90IGZpbmlzaCBoaWdoIHNjaG9vbC4NClBhdGllbnQgY3VycmVudGx5IGhhcyBCbHVlIENyb3NzIEJsdWUgU2hpZWxkLg0KDQojIEFsbGVyZ2llcw0KTm8gS25vd24gQWxsZXJnaWVzLg0KDQojIE1lZGljYXRpb25zDQpObyBBY3RpdmUgTWVkaWNhdGlvbnMuDQoNCiMgQXNzZXNzbWVudCBhbmQgUGxhbg0KUGF0aWVudCBpcyBwcmVzZW50aW5nIHdpdGggaG91c2luZyB1bnNhdGlzZmFjdG9yeSAoZmluZGluZyksIG9ubHkgcmVjZWl2ZWQgcHJpbWFyeSBzY2hvb2wgZWR1Y2F0aW9uIChmaW5kaW5nKSwgZnVsbC10aW1lIGVtcGxveW1lbnQgKGZpbmRpbmcpLCBzb2NpYWwgaXNvbGF0aW9uIChmaW5kaW5nKSwgc3RyZXNzIChmaW5kaW5nKS4gDQoNCiMjIFBsYW4NCg0K"
}
]
}
--- EDIT ---------------------------------------
This query (suggested in answer below) also does not work. Screen shots are for a newly create patient (the original was deleted).
https://r4.smarthealthit.org/DiagnosticReport?patient=1437050
--- EDIT: STEPS TO REPRODUCE ---------------------------------
It looks like the patients created by end users are routinely deleted from this server (which makes sense). Here are the steps to reproduce the issue.
POST this messge to https://launch.smarthealthit.org/v/r4/fhir/Patient
{
"identifier": [
{
"system": "https://github.com/synthetichealth/synthea",
"value": "d7e5852a-974c-6d45-f81d-5a87bbd05d2a"
},
{
"system": "http://hospital.smarthealthit.org",
"type": {
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "MR",
"display": "Medical Record Number"
}],
"text": "Medical Record Number"
},
"value": "d7e5852a-974c-6d45-f81d-5a87bbd05d2a"
},
{
"system": "http://hl7.org/fhir/sid/us-ssn",
"type": {
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "SS",
"display": "Social Security Number"
}],
"text": "Social Security Number"
},
"value": "999-55-2948"
},
{
"system": "urn:oid:2.16.840.1.113883.4.3.25",
"type": {
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "DL",
"display": "Driver's License"
}],
"text": "Driver's License"
},
"value": "S99934182"
},
{
"system": "http://standardhealthrecord.org/fhir/StructureDefinition/passportNumber",
"type": {
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "PPN",
"display": "Passport Number"
}],
"text": "Passport Number"
},
"value": "X1908681X"
}
],
"extension": [
{
"extension": [
{
"valueCoding": {
"system": "urn:oid:2.16.840.1.113883.6.238",
"code": "2106-3",
"display": "White"
},
"url": "ombCategory"
},
{
"valueString": "White",
"url": "text"
}
],
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race"
},
{
"extension": [
{
"valueCoding": {
"system": "urn:oid:2.16.840.1.113883.6.238",
"code": "2186-5",
"display": "Not Hispanic or Latino"
},
"url": "ombCategory"
},
{
"valueString": "Not Hispanic or Latino",
"url": "text"
}
],
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity"
},
{
"valueString": "Natosha194 Rolfson709",
"url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName"
},
{
"valueCode": "M",
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex"
},
{
"valueAddress": {
"country": "US",
"city": "Westfield",
"state": "Massachusetts"
},
"url": "http://hl7.org/fhir/StructureDefinition/patient-birthPlace"
},
{
"valueDecimal": 0.011850126818590398,
"url": "http://synthetichealth.github.io/synthea/disability-adjusted-life-years"
},
{
"valueDecimal": 30.98814987318141,
"url": "http://synthetichealth.github.io/synthea/quality-adjusted-life-years"
}
],
"address": [{
"country": "US",
"extension": [{
"extension": [
{
"valueDecimal": 42.1419070399434,
"url": "latitude"
},
{
"valueDecimal": -71.28041093915812,
"url": "longitude"
}
],
"url": "http://hl7.org/fhir/StructureDefinition/geolocation"
}],
"city": "Walpole",
"line": ["236 Halvorson Mews Suite 21"],
"state": "MA"
}],
"gender": "male",
"multipleBirthBoolean": false,
"birthDate": "1960-07-09",
"meta": {"profile": ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]},
"deceasedDateTime": "1992-06-21T18:48:35-04:00",
"name": [{
"given": [
"Glenn0",
"Adalberto916"
],
"use": "official",
"prefix": ["Mr."],
"family": "Hermiston71"
}],
"telecom": [{
"system": "phone",
"use": "home",
"value": "555-370-8941"
}],
"text": {
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Generated by <a href=\"https://github.com/synthetichealth/synthea\">Synthea<\/a>.Version identifier: master-branch-latest\n . Person seed: -3481236467670898486 Population seed: 1663786624475<\/div>",
"status": "generated"
},
"communication": [{"language": {
"coding": [{
"system": "urn:ietf:bcp:47",
"code": "en-US",
"display": "English"
}],
"text": "English"
}}],
"maritalStatus": {
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus",
"code": "M",
"display": "M"
}],
"text": "M"
},
"resourceType": "Patient"
}
Modify this message by replacing PATIENT_ID with the id returned when the Patient resource is posted and then post that to https://launch.smarthealthit.org/v/r4/fhir/DiagnosticReport
{
"code": {"coding": [
{
"system": "http://loinc.org",
"code": "34117-2",
"display": "History and physical note"
},
{
"system": "http://loinc.org",
"code": "51847-2",
"display": "Evaluation + Plan note"
}
]},
"performer": [{
"display": "Dr. Debbie941 Macejkovic424"
}],
"effectiveDateTime": "1978-09-02T17:57:46-04:00",
"meta": {"profile": ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note"]},
"subject": {"reference": "https://r4.smarthealthit.org/Patient/PATIENT_ID"},
"presentedForm": [{
"data": "DQoxOTc4LTA5LTAyDQoNCiMgQ2hpZWYgQ29tcGxhaW50DQpObyBjb21wbGFpbnRzLg0KDQojIEhpc3Rvcnkgb2YgUHJlc2VudCBJbGxuZXNzDQpHbGVubjANCiBpcyBhIDE4IHllYXItb2xkIG5vbi1oaXNwYW5pYyB3aGl0ZSBtYWxlLg0KDQojIFNvY2lhbCBIaXN0b3J5DQogUGF0aWVudCBoYXMgbmV2ZXIgc21va2VkLg0KIFBhdGllbnQgaWRlbnRpZmllcyBhcyBoZXRlcm9zZXh1YWwuDQoNClBhdGllbnQgY29tZXMgZnJvbSBhIG1pZGRsZSBzb2Npb2Vjb25vbWljIGJhY2tncm91bmQuDQogUGF0aWVudCBkaWQgbm90IGZpbmlzaCBoaWdoIHNjaG9vbC4NClBhdGllbnQgY3VycmVudGx5IGhhcyBCbHVlIENyb3NzIEJsdWUgU2hpZWxkLg0KDQojIEFsbGVyZ2llcw0KTm8gS25vd24gQWxsZXJnaWVzLg0KDQojIE1lZGljYXRpb25zDQpObyBBY3RpdmUgTWVkaWNhdGlvbnMuDQoNCiMgQXNzZXNzbWVudCBhbmQgUGxhbg0KUGF0aWVudCBpcyBwcmVzZW50aW5nIHdpdGggaG91c2luZyB1bnNhdGlzZmFjdG9yeSAoZmluZGluZyksIG9ubHkgcmVjZWl2ZWQgcHJpbWFyeSBzY2hvb2wgZWR1Y2F0aW9uIChmaW5kaW5nKSwgZnVsbC10aW1lIGVtcGxveW1lbnQgKGZpbmRpbmcpLCBzb2NpYWwgaXNvbGF0aW9uIChmaW5kaW5nKSwgc3RyZXNzIChmaW5kaW5nKS4gDQoNCiMjIFBsYW4NCg0K",
"contentType": "text/plain; charset=utf-8"
}],
"category": [{"coding": [
{
"system": "http://loinc.org",
"code": "34117-2",
"display": "History and physical note"
},
{
"system": "http://loinc.org",
"code": "51847-2",
"display": "Evaluation + Plan note"
}
]}],
"issued": "1978-09-02T17:57:46.296-04:00",
"resourceType": "DiagnosticReport",
"status": "final"
}
Then try to find the DiagnosticReport using the information (e.g. ID) for the Patient.

It appears the Patient and DiagnosticReport are now deleted, but you can use the patient search parameter. For example, https://r4.smarthealthit.org/DiagnosticReport?patient=3190019b-9001-4e31-a3c4-380b12b8002a currently returns a Bundle of 5 DiagnosticReports.

Related

Not getting expected search results from SmartHealthIt FHIR server for DiagnosticReport searching

I'm trying to find a patient with a DiagnosticReport using the SmartHealthIt FHIR server at https://r4.smarthealthit.org.
Queries are based on the guide at https://www.hl7.org/fhir/search.html.
If I execute the following query I get the following result that includes a patient with the id 87a339d0-8cae-418e-89c7-8651e6aab3c6.
Query:
https://r4.smarthealthit.org/Patient?_type=DiagnosticReport&_summary=true
Result:
If I then query for the DiagnosticReport resources for this patient and try to filer for just the DiagnosticReport resources, I get a result that does not include any DiagnosticReport resources as shown below. Likewise, if I just retrieve the patient using https://r4.smarthealthit.org/Patient/87a339d0-8cae-418e-89c7-8651e6aab3c6, I get a response that does not include the text "DiagnosticReport" or "next" (in case the resource was paged).
How do I find the set of patients that have a DiagnosticReport on a FHIR server?
Query:
https://r4.smarthealthit.org/Patient/87a339d0-8cae-418e-89c7-8651e6aab3c6?_elements=DiagnosticReport
Result:
{
"resourceType": "Patient",
"id": "87a339d0-8cae-418e-89c7-8651e6aab3c6",
"meta": {
"versionId": "227",
"lastUpdated": "2022-07-22T03:04:04.165-04:00",
"tag": [
{
"system": "https://smarthealthit.org/tags",
"code": "synthea-5-2019"
}
]
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Generated by Synthea.Version identifier: v2.4.0-100-g26a4b936\n . Person seed: 911708758626700213 Population seed: 1559319163074</div>"
},
"extension": [
{
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race",
"extension": [
{
"url": "ombCategory",
"valueCoding": {
"system": "urn:oid:2.16.840.1.113883.6.238",
"code": "2106-3",
"display": "White"
}
},
{
"url": "text",
"valueString": "White"
}
]
},
{
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity",
"extension": [
{
"url": "ombCategory",
"valueCoding": {
"system": "urn:oid:2.16.840.1.113883.6.238",
"code": "2186-5",
"display": "Not Hispanic or Latino"
}
},
{
"url": "text",
"valueString": "Not Hispanic or Latino"
}
]
},
{
"url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName",
"valueString": "Vonnie Kunde"
},
{
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
"valueCode": "F"
},
{
"url": "http://hl7.org/fhir/StructureDefinition/patient-birthPlace",
"valueAddress": {
"city": "Milton",
"state": "Massachusetts",
"country": "US"
}
},
{
"url": "http://synthetichealth.github.io/synthea/disability-adjusted-life-years",
"valueDecimal": 26.256072397468692
},
{
"url": "http://synthetichealth.github.io/synthea/quality-adjusted-life-years",
"valueDecimal": 29.743927602531308
}
],
"identifier": [
{
"system": "https://github.com/synthetichealth/synthea",
"value": "293ee354-f8ad-4345-b10c-759fdfdcc082"
},
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "MR",
"display": "Medical Record Number"
}
],
"text": "Medical Record Number"
},
"system": "http://hospital.smarthealthit.org",
"value": "293ee354-f8ad-4345-b10c-759fdfdcc082"
},
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "SS",
"display": "Social Security Number"
}
],
"text": "Social Security Number"
},
"system": "http://hl7.org/fhir/sid/us-ssn",
"value": "999-97-9098"
},
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "DL",
"display": "Driver's License"
}
],
"text": "Driver's License"
},
"system": "urn:oid:2.16.840.1.113883.4.3.25",
"value": "S99981121"
},
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "PPN",
"display": "Passport Number"
}
],
"text": "Passport Number"
},
"system": "http://standardhealthrecord.org/fhir/StructureDefinition/passportNumber",
"value": "X1974835X"
}
],
"name": [
{
"use": "official",
"family": "Kshlerin",
"given": [
"Danae"
],
"prefix": [
"Mrs."
]
},
{
"use": "maiden",
"family": "Graham",
"given": [
"Danae"
],
"prefix": [
"Mrs."
]
}
],
"telecom": [
{
"system": "phone",
"value": "555-182-4285",
"use": "home"
}
],
"gender": "female",
"birthDate": "1964-05-13",
"address": [
{
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/geolocation",
"extension": [
{
"url": "latitude",
"valueDecimal": 42.50128
},
{
"url": "longitude",
"valueDecimal": -70.897502
}
]
}
],
"line": [
"662 Ullrich Path Suite 61"
],
"city": "Salem",
"state": "Massachusetts",
"postalCode": "01907",
"country": "US"
}
],
"maritalStatus": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus",
"code": "M",
"display": "M"
}
],
"text": "M"
},
"multipleBirthBoolean": false,
"communication": [
{
"language": {
"coding": [
{
"system": "urn:ietf:bcp:47",
"code": "en-US",
"display": "English"
}
],
"text": "English"
}
}
]
}
---EDIT-----------------------
I'm not seeing the patient id I originally used as an example now (the data could be paged and the order not consistent so it might be on a subsequent page).
This patient ID is coming up and gives the same behavior:
87a339d0-8cae-418e-89c7-8651e6aab3c6
The following query sometimes (often) includes the patient 87a339d0-8cae-418e-89c7-8651e6aab3c6:
https://r4.smarthealthit.org/Patient?_type=DiagnosticReport&_summary=true
The following query response contains neither the text "diag" nor "next"
https://r4.smarthealthit.org/Patient/87a339d0-8cae-418e-89c7-8651e6aab3c6?_elements=DiagnosticReport
The following query response contains neither the text "diag" nor "next"
https://r4.smarthealthit.org/Patient/87a339d0-8cae-418e-89c7-8651e6aab3c6
--- SECOND EDIT -------------------------
Not finding the DiagnosticReport in the Patient resource was just me being forgetful. You need to use the $everything locator as in:
https://r4.smarthealthit.org/Patient/87a339d0-8cae-418e-89c7-8651e6aab3c6/$everything
This does contain a "next" link.
I haven't yet confirmed that you eventually get to the DianosticReport resources using the next links (it seems to time out for the link below).
https://r4.smarthealthit.org/?_getpages=28d6d4cb-7f1e-4049-9cec-d3f44fba9dbf&_getpagesoffset=150&_count=50&_pretty=true&_bundletype=searchset
---THIRD EDIT --------------------------------
This patient can be used to confirm a patient with a DiagnosticReport exists:
d78af07c-9cb9-4f31-9b11-c45a28f2eec8
This url gives the first page of the patient that has a next link:
https://r4.smarthealthit.org/Patient/d78af07c-9cb9-4f31-9b11-c45a28f2eec8/$everything
This is the next link that gives the DiagnosticReport:
https://r4.smarthealthit.org/?_getpages=483b5a20-60e6-4007-8b63-3f7bbd366b18&_getpagesoffset=50&_count=50&_pretty=true&_bundletype=searchset
Here is a DiagnosticReport from the response.
"resource": {
"resourceType": "DiagnosticReport",
"id": "ca42703d-054c-4fc5-aaa5-c9d4f9688e89",
"meta": {
"versionId": "4",
"lastUpdated": "2021-04-06T03:13:59.601-04:00",
"tag": [
{
"system": "https://smarthealthit.org/tags",
"code": "synthea-5-2019"
}
]
},
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0074",
"code": "LAB",
"display": "Laboratory"
}
]
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "57698-3",
"display": "Lipid Panel"
}
],
"text": "Lipid Panel"
},
"subject": {
"reference": "Patient/d78af07c-9cb9-4f31-9b11-c45a28f2eec8"
},
"encounter": {
"reference": "Encounter/2e0cc97b-c879-4762-bb5c-7127e44d7daa"
},
"effectiveDateTime": "2018-09-17T15:29:24+00:00",
"issued": "2018-09-17T15:29:24.181+00:00",
"result": [
{
"reference": "Observation/b512ea5d-c4c2-49e4-9eb1-30b2579136c4",
"display": "Total Cholesterol"
},
{
"reference": "Observation/3acb284d-e861-4db2-bbbc-b1522129df3c",
"display": "Triglycerides"
},
{
"reference": "Observation/9d3359e5-58e7-4c3c-8cfd-8cb6397dbcf7",
"display": "Low Density Lipoprotein Cholesterol"
},
{
"reference": "Observation/a708a2a4-8d9a-4869-a432-c5f09a46e67f",
"display": "High Density Lipoprotein Cholesterol"
}
]
},
For a list of patients having a DiagnosticReport perhaps you could just get a list of all DiagnosticReports because this will contain the references to the patients for each of the DiagnosticReport found.
To do so you can use the query:
https://r4.smarthealthit.org/DiagnosticReport?_summary=true
In the resultset, you will see references to patients e.g.
"subject": {
"reference": "Patient/15661112-796c-460c-bf7a-6b297e33f113"
},
If you already knew the patient id e.g. 87a339d0-8cae-418e-89c7-8651e6aab3c6, you could just do:
https://r4.smarthealthit.org/DiagnosticReport?subject=87a339d0-8cae-418e-89c7-8651e6aab3c6
RE: _type parameter
Just a note on what you tried so far, the query using _type parameters is not quite right because you use type when query against the base endpoint i.e. without specifying the any type, so:
Query: https://r4.smarthealthit.org/Patient?_type=DiagnosticReport&_summary=true
Should actually have been as below, without the Patient type in the query:
Query: https://r4.smarthealthit.org?_type=DiagnosticReport&_summary=true
Read more about the _type parameter here: https://www.hl7.org/fhir/search.html#_type
RE: _elements parameter
Also, the _elements parameter is not meant for resources but for specifying base elements defined in the resource. Your query that has _elements=DiagnosticReport is not correct because the is no such element on the Patient resource, hence why you may be getting results that are not consistent.
Hope that helps?

Add extension to R4 Patient

How do I add the below to an R4 Patient?
"search": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/match-grade",
"valueCode": "certain"
}
],
"mode": "match",
"score": 1.0
}
The objects that were under stu2 and stu3 (I think) have been deprecated.
DSTU3 and Later
// Create an example patient
Patient patient = new Patient();
patient.addIdentifier().setUse(Identifier.IdentifierUse.OFFICIAL).setSystem("urn:example").setValue("7000135");
// Create an extension
Extension ext = new Extension();
ext.setUrl("http://example.com/extensions#someext");
ext.setValue(new DateTimeType("2011-01-02T11:13:15"));
// Add the extension to the resource
patient.addExtension(ext);
Full "response" json from patient match below (sample data, not real data !! )
{
"resourceType": "Bundle",
"id": "94897c77-4120-482f-bdb4-4c8b9a71ade1",
"meta": {
"versionId": "1",
"lastUpdated": "2020-11-24T08:45:49.445-05:00"
},
"type": "searchset",
"total": 1,
"link": [
{
"relation": "self",
"url": "http://wildfhir4.aegis.net/fhir4-0-0/Patient/$match?"
}
],
"entry": [
{
"fullUrl": "http://wildfhir4.aegis.net/fhir4-0-0/Patient/9126db824dcf4d5ab3f68e63bd5eaced",
"resource": {
"resourceType": "Patient",
"id": "9126db824dcf4d5ab3f68e63bd5eaced",
"meta": {
"versionId": "1",
"lastUpdated": "2020-09-03T09:03:28.193-04:00",
"tag": [
{
"system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
"code": "HTEST",
"display": "test health data"
}
]
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><table><tbody><tr><td>Name</td><td>Peter James \n <b>Chalmers</b> ("Jim") \n </td></tr><tr><td>Address</td><td>534 Erewhon, Pleasantville, Vic, 3999</td></tr><tr><td>Contacts</td><td>Home: unknown. Work: (03) 5555 6473</td></tr><tr><td>Id</td><td>MRN: 12345 (Acme Healthcare)</td></tr></tbody></table></div>"
},
"identifier": [
{
"use": "usual",
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "MR"
}
]
},
"system": "urn:oid:1.2.36.146.595.217.0.1",
"value": "12345",
"period": {
"start": "2001-05-06"
},
"assigner": {
"display": "Acme Healthcare"
}
}
],
"active": true,
"name": [
{
"use": "official",
"family": "Chalmers",
"given": [
"Peter",
"James"
]
},
{
"use": "usual",
"given": [
"Jim"
]
},
{
"use": "maiden",
"family": "Windsor",
"given": [
"Peter",
"James"
],
"period": {
"end": "2002"
}
}
],
"telecom": [
{
"use": "home"
},
{
"system": "phone",
"value": "(03) 5555 6473",
"use": "work",
"rank": 1
},
{
"system": "phone",
"value": "(03) 3410 5613",
"use": "mobile",
"rank": 2
},
{
"system": "phone",
"value": "(03) 5555 8834",
"use": "old",
"period": {
"end": "2014"
}
}
],
"gender": "male",
"birthDate": "1974-12-25",
"_birthDate": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/patient-birthTime",
"valueDateTime": "1974-12-25T14:35:45-05:00"
}
]
},
"deceasedBoolean": false,
"address": [
{
"use": "home",
"type": "both",
"text": "534 Erewhon St PeasantVille, Rainbow, Vic 3999",
"line": [
"534 Erewhon St"
],
"city": "PleasantVille",
"district": "Rainbow",
"state": "Vic",
"postalCode": "3999",
"period": {
"start": "1974-12-25"
}
}
],
"contact": [
{
"relationship": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0131",
"code": "N"
}
]
}
],
"name": {
"family": "du Marché",
"_family": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/humanname-own-prefix",
"valueString": "VV"
}
]
},
"given": [
"Bénédicte"
]
},
"telecom": [
{
"system": "phone",
"value": "+33 (237) 998327"
}
],
"address": {
"use": "home",
"type": "both",
"line": [
"534 Erewhon St"
],
"city": "PleasantVille",
"district": "Rainbow",
"state": "Vic",
"postalCode": "3999",
"period": {
"start": "1974-12-25"
}
},
"gender": "female",
"period": {
"start": "2012"
}
}
],
"managingOrganization": {
"reference": "Organization/1"
}
},
"search": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/match-grade",
"valueCode": "certain"
}
],
"mode": "match",
"score": 1.0
}
}
]
}
APPEND: I found this:
https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-structures-r4/org/hl7/fhir/r4/model/codesystems/MatchGrade.html
That extension isn't allowed on Patient. It's defined with a context of Bundle.entry.search. It's not a characteristic of the patient themselves, it's a characteristic of a particular entry in a search result based on a specific set of search criteria. The same Patient instance might well be a good result on one search and a poor result on a different search. So to add the extension, you'd have to add it on a 'search' object, not patient.
Ok.
Here it is. The primary objects were inner/nested objects under Bundle....thus why I didn't see them early. (example : Bundle.BundleEntrySearchComponent)
// a java example with the import statements. #shocking!
//import org.hl7.fhir.r4.model.Bundle;
//import org.hl7.fhir.r4.model.CodeType;
//import org.hl7.fhir.r4.model.Extension;
//import org.hl7.fhir.r4.model.Patient;
//import org.hl7.fhir.r4.model.codesystems.MatchGrade;
//import java.util.Collections;
Bundle innerBundle = new Bundle();
innerBundle.setType(Bundle.BundleType.SEARCHSET);
innerBundle.setTotal(1);
Patient pat = new Patient();
HumanName hn = new HumanName();
hn.setFamily("Smith");
p.setName(Collections.singletonList(hn));
Bundle.BundleEntrySearchComponent besc = new Bundle.BundleEntrySearchComponent();
besc.setScore(0.88);
besc.setMode(Bundle.SearchEntryMode.MATCH);
Bundle.BundleEntryComponent bec = new Bundle.BundleEntryComponent();
Extension matchGradeExtension = besc.addExtension();
matchGradeExtension.setUrl("http://hl7.org/fhir/StructureDefinition/match-grade");
matchGradeExtension.setValue(new CodeType(MatchGrade.PROBABLE.toCode()));
bec.setResource(pat);
bec.setSearch(besc);
innerBundle.setEntry(Collections.singletonList(bec));
Json looks like this:
{
"resourceType": "Bundle",
"type": "searchset",
"total": 1,
"entry": [
{
"resource": {
"resourceType": "Patient",
"name": [
{
"family": "Smith"
}
]
},
"search": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/match-grade",
"valueCode": "certain"
}
],
"mode": "match",
"score": 0.88
}
}
]
}

Vonk FHIR server Bundle validation issue

When posting the FHIR example that uses the ZIB for tobacco use to the Vonk FHIR server in a transaction, Vonk responds with an error.
Request body:
{
"type": "transaction",
"entry": [
{
"resource": {
"resourceType": "Observation",
"id": "medmij-bgz-tobaccouse-ts-01",
"meta": {
"profile": [
"http://nictiz.nl/fhir/StructureDefinition/zib-TobaccoUse"
]
},
"status": "final",
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "365980008",
"display": "Finding of tobacco use and exposure (finding)"
}
]
},
"subject": {
"reference": "Patient/medmij-bgz-patient-ts-01",
"display": "Johan XXX_Helleman"
},
"effectivePeriod": {
"start": "1980",
"end": "1983"
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "8517006",
"display": "Ex-smoker (finding)"
}
]
},
"component": [
{
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "53661000146106",
"display": "Type of tobacco used (observable entity)"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "65568007",
"display": "Cigarette smoker (finding)"
}
]
}
},
{
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "266918002",
"display": "Tobacco smoking consumption (observable entity)"
}
]
},
"valueQuantity": {
"value": "2",
"unit": "packs per week",
"system": "http://unitsofmeasure.org",
"code": "{packs}/wk"
}
},
{
"code": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "401201003",
"display": "Cigarette pack-years (observable entity)"
}
]
},
"valueQuantity": {
"value": "1",
"unit": "PackYears",
"system": "http://unitsofmeasure.org",
"code": "{PackYears}"
}
}
]
},
"request": {
"url": "Observation/medmij-bgz-tobaccouse-ts-01",
"method": "PUT"
}
}
],
"resourceType": "Bundle"
}
Response:
{
"resourceType": "OperationOutcome",
"id": "d230a0cd-5487-489b-8f19-098f66e55744",
"meta": {
"versionId": "ca7e8081-6557-4eba-9a9f-14df426a0ff2",
"lastUpdated": "2019-03-11T09:07:56.638+00:00"
},
"issue": [
{
"severity": "error",
"code": "invalid",
"details": {
"coding": [
{
"system": "http://hl7.org/fhir/dotnet-api-operation-outcome",
"code": "1008"
}
],
"text": "Value is not exactly equal to fixed value 'http://unitsofmeasure.org'"
},
"location": [
"Observation.component[2].value[0].system[0]"
]
},
{
"severity": "warning",
"code": "not-supported",
"details": {
"coding": [
{
"system": "http://hl7.org/fhir/dotnet-api-operation-outcome",
"code": "5003"
}
],
"text": "Argument is not supported"
},
"location": [
"/Observation"
]
},
{
"severity": "warning",
"code": "not-supported",
"details": {
"coding": [
{
"system": "http://hl7.org/fhir/dotnet-api-operation-outcome",
"code": "5003"
}
],
"text": "Argument is not supported"
},
"location": [
"/medmij-bgz-tobaccouse-ts-01"
]
}
]
}
It seems the error complains about an URL mismatch in the PackYears component, however, that is exactly using the url http://unitsofmeasure.org as indicated should be used in the error. Does anybody know if the request is wrong here or Vonk has an issue?
Notice that posting without a transaction to /Observation/ does NOT give an error but completes successfully.
Also notice that the /Bundle/$validate request for the same bundle does NOT indicate any errors, but responds with The operation was successful.
We are using Vonk 1.1.0 and have configured it to use a SQL Server database.
The error is in Vonk. I can reproduce it with Vonk version 1.1.0. We will release a new version of Vonk next week, where this has been resolved.

FHIR and DocumentReference

How can I get DocumentReference for particular document from DocumentManifest list of documents?
Here is an example of returned DocumentManifest
{
"title": {
},
"id": {
},
"updated": {
},
"content": {
"type": {
"#id": "urn:uuid:xxxxxx-xxxx-xxxx-xxxx-xxxxxxx",
"text": "Patient Document List"
},
"resourceType": "DocumentManifest",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Some Test ORG</div>"
},
"contained": {
"resourceType": "Patient",
"identifier": {
"use": "official",
"system": "",
"value": "12345678987654321"
}
},
"subject": {
"reference": "Patient Documents"
},
"recipient": {
"organization": {
"display": "Some Test ORG"
}
},
"created": "2018-02-09T13:26:53-07:00",
"status": "current",
"content": {
"reference": [
"Binary/DOCUMENT-1000123",
"Binary/DOCUMENT-1000124",
"Binary/DOCUMENT-1000125"
]
}
}
}
I have tried to use something like
GET [service-url]/DocumentReference/?_query=generate&uri=[service-url]/BINARY/DOCUMENT-1000125
but I had no luck.
That DocumentManifest is not pointing at a DocumentReference. It is point at a document.
FYI: What you have shown is not compliant with IHE-MHD use of DocumentReference/DocumentManifest/Binary.

When connecting to LUIS, what does the "forceset" parameter do

In my LUIS app I have an intent called GetWeather requiring a Location to be set.
When connecting to the app using the query
What is the weather in london
it correctly returns
{
"query": "what is the weather in london",
"topScoringIntent": {
"intent": "GetWeather",
"score": 0.999875546,
"actions": [
{
"triggered": true,
"name": "GetWeather",
"parameters": [
{
"name": "Location",
"type": "Location",
"required": true,
"value": [
{
"entity": "london",
"type": "Location",
"resolution": {}
}
]
}
]
}
]
},
"entities": [
{
"entity": "london",
"type": "Location",
"startIndex": 23,
"endIndex": 28,
"score": 0.832388461,
"resolution": {}
}
],
"dialog": {
"contextId": "e1df6c2d-e691-4fc6-89f2-3ee2ef519724",
"status": "Finished"
}
}
If I instead use the query
What is the weather
It returns the following expected result.
{
"query": "what is the weather",
"topScoringIntent": {
"intent": "GetWeather",
"score": 1.0,
"actions": [
{
"triggered": false,
"name": "GetWeather",
"parameters": [
{
"name": "Location",
"type": "Location",
"required": true,
"value": null
}
]
}
]
},
"entities": [],
"dialog": {
"prompt": "Where",
"parameterName": "Location",
"parameterType": "Location",
"contextId": "3b0725f4-7d6f-43fd-ab6e-02fc11c3eed1",
"status": "Question"
}
}
I thought that using the contextID together with the forceSet parameter in my next call would set the parameter Location to whatever I send as the query. The conection string I use is this:
https://api.projectoxford.ai/luis/v2.0/apps/{APP_ID}?subscription-key={SUBSCRIPTION_KEY}&q=london&contextid=3b0725f4-7d6f-43fd-ab6e-02fc11c3eed1&forceset=Location
Instead I get the following response back:
{
"query": "london",
"topScoringIntent": {
"intent": "GetWeather",
"score": 1.0,
"actions": [
{
"triggered": false,
"name": "GetWeather",
"parameters": [
{
"name": "Location",
"type": "Location",
"required": true,
"value": null
}
]
}
]
},
"entities": [],
"dialog": {
"prompt": "Where",
"parameterName": "Location",
"parameterType": "Location",
"contextId": "3b0725f4-7d6f-43fd-ab6e-02fc11c3eed1",
"status": "Question"
}
}
I had expected to get something like my first response back.
Am I doing something wrong or just misunderstanding what the forceSet parameter is supposed to do?

Resources