Skip to content

Searching with more than one chained Bundle SearchParameter returns incorrect results #5623

@nathandoef

Description

@nathandoef

Describe the bug

Searching with more than one chained Bundle SearchParameter (i.e. Composition) is returning incorrect results.

To Reproduce

  1. PUT /SearchParameter/bundle-composition-patient-birthdate
{
  "resourceType": "SearchParameter",
  "id": "bundle-composition-patient-birthdate",
  "url": "http://example.org/SearchParameter/bundle-composition-patient-birthdate",
  "name": "composition.patient.birthdate",
  "status": "active",
  "code": "composition.patient.birthdate",
  "base": [ "Bundle" ],
  "type": "date",
  "expression": "Bundle.entry.resource.ofType(Patient).birthDate"
}
  1. PUT SearchParameter/bundle-composition-patient-identifier
{
  "resourceType": "SearchParameter",
  "id": "bundle-composition-patient-identifier",
  "url": "http://example.org/SearchParameter/bundle-composition-patient-identifier",
  "name": "composition.patient.identifier",
  "status": "active",
  "code": "composition.patient.identifier",
  "base": [ "Bundle" ],
  "type": "token",
  "expression": "Bundle.entry.resource.ofType(Patient).identifier"
}
  1. PUT /Patient/patient-1
{
  "resourceType": "Patient",
  "id": "patient-1",
  "identifier": [ {
    "system": "http://identifiers",
    "value": "value-1"
  } ],
  "birthDate": "1980-10-11"
}
  1. POST /Bundle
{
  "resourceType": "Bundle",
  "type": "document",
  "entry": [ {
    "resource": {
      "resourceType": "Composition",
      "type": {
        "coding": [ {
          "system": "http://example.org",
          "code": "code"
        } ]
      },
      "subject": {
        "reference": "Patient/patient-1"
      }
    }
  }, {
    "resource": {
      "resourceType": "Patient",
      "id": "patient-1",
      "meta": {
        "versionId": "1",
        "lastUpdated": "2024-01-19T15:42:55.057-05:00"
      },
      "identifier": [ {
        "system": "http://identifiers",
        "value": "value-1"
      } ],
      "birthDate": "1980-10-11"
    }
  } ]
}
  1. Search for a Patient inside of a Bundle with incorrect Patient birthdate and a correct Patient identifier.

/Bundle?composition.patient.birthdate=2000-01-01&composition.patient.identifier=http://identifiers|value-1

  1. See 1 result is returned.

Expected behaviour

No results should be returned

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions