1

DSTU2 documentation does not describe ability to search resources by internal references. Is there any way to find the below resource having contained Practitioner resource and internal reference on it like:

[base]/fhir/Patient?careprovider:Practitioner=ContainedId or

[base]/fhir/Patient?careprovider=ContainedId

{
 "resourceType" : "Patient",
 "id" : "ContainedTestPatient",
 "careProvider" : [{
  "reference" : "#ContainedId"
 }],
  "contained" : [{
    "resourceType": "Practitioner",
    "id": "ContainedId",
    "name": {"text": "Good doctor INC"}
  }]
}
Evgeny
  • 11
  • 1
  • 1
    Searching by contained id is a bit unusual - keep in mind that contained ids are scoped by the container - there's no expectation that they'd be the same across references. And in fact, by definition, every contained instance is completely unique and can't be common with a contained resource found inside another resource. So using chaining to query inside a resource is usually used to filter on other more "repeatable" things like name, identifier, etc. – Lloyd McKenzie Feb 15 '17 at 17:51
  • @LloydMcKenzie I absolutely agree with you that search by contained id doesn't make much sense since the contained resource is located only inside its container. But there is a requirement to support search by contained id. – Evgeny Feb 17 '17 at 06:00

1 Answers1

1

Actually DSTU2 documentation does specify how to search for values in contained resources, see http://www.hl7.org/fhir/search.html#contained. It's done with a chained search and looks like this:

[base]/Patient?careprovider._id=ContainedId
Mirjam Baltus
  • 2,035
  • 9
  • 13