Skip to content

Observation-code-value-date search not work #2020

Open
@tongwu-sh

Description

@tongwu-sh

Describe the bug
When create a Observation resource with code and valueDateTime, search for Observation-code-value-date not return correct result.

I believe the root cause is the definition for SearchParameter is incorrect.

"expression" : "value.as(DateTime) | value.as(Period)" should be "expression" : "value.as(dateTime) | value.as(period)"

FHIR Version?
Stu3/R4/R5

Data provider?
CosmosDB/SQL Server

To Reproduce
Steps to reproduce the behavior:

  1. Create resource with following payload.
{
	"resourceType": "Observation",
	"id": "f205",
	"text": {
		"status": "generated",
		"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative</b></p><p><b>status</b>: entered-in-error</p><p><b>category</b>: <span>Vital Signs</span></p><p><b>code</b>: <span>Temperature</span></p><p><b>subject</b>: <a>Roel. Generated Summary: BSN: 123456789 (OFFICIAL), BSN: 123456789 (OFFICIAL); active; Roel(OFFICIAL); Phone: +31612345678, Phone: +31201234567; gender: male; birthDate: 1960-03-13; <span>Legally married</span>; </a></p><p><b>issued</b>: Apr 4, 2013 12:27:00 PM</p><p><b>performer</b>: <a>Generated Summary: UZI-nummer: 12345678901 (OFFICIAL); active; Dokter Bronsig(OFFICIAL); Phone: +31715269111; gender: male; birthDate: 1956-12-24</a></p><p><b>value</b>: 39 degrees C</p><p><b>interpretation</b>: <span>High</span></p><p><b>bodySite</b>: <span>Oral cavity</span></p><p><b>method</b>: <span>Oral temperature taking</span></p><h3>ReferenceRanges</h3><table><tr><td>-</td><td><b>High</b></td></tr><tr><td>*</td><td>38.2 degrees C</td></tr></table></div>"
	},
	"status": "entered-in-error",
	"category": [
		{
			"coding": [
				{
					"system": "http://terminology.hl7.org/CodeSystem/observation-category",
					"code": "vital-signs",
					"display": "Vital Signs"
				}
			]
		}
	],
	"code": {
		"coding": [
			{
				"system": "http://acme.lab",
				"code": "BT",
				"display": "Body temperature"
			},
			{
				"system": "http://loinc.org",
				"code": "8310-5",
				"display": "Body temperature"
			},
			{
				"system": "http://loinc.org",
				"code": "8331-1",
				"display": "Oral temperature"
			},
			{
				"system": "http://snomed.info/sct",
				"code": "56342008",
				"display": "Temperature taking"
			}
		],
		"text": "Temperature"
	},
	"subject": {
		"reference": "Patient/f201",
		"display": "Roel"
	},
	"issued": "2013-04-04T13:27:00+01:00",
	"performer": [
		{
			"reference": "Practitioner/f201"
		}
	],
	"valueDateTime": "2013-04-04T13:27:00+01:00",
	"interpretation": [
		{
			"coding": [
				{
					"system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",
					"code": "H"
				}
			]
		}
	],
	"bodySite": {
		"coding": [
			{
				"system": "http://snomed.info/sct",
				"code": "74262004",
				"display": "Oral cavity"
			}
		]
	},
	"method": {
		"coding": [
			{
				"system": "http://snomed.info/sct",
				"code": "89003005",
				"display": "Oral temperature taking"
			}
		]
	},
	"referenceRange": [
		{
			"high": {
				"value": 38.2,
				"unit": "degrees C"
			}
		}
	]
}
  1. Search query:
https://import-k.azurewebsites.net/Observation?code-value-date=http://loinc.org|8331-1$lt2022-04-04'

Expected behavior
Observation should return

Actual behavior
search result is empty

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBug bug bug.SpecificationAn issue referring or related to the FHIR SpecificationVSTS-BacklogOn VSTS Backlog

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions