Search code examples
hl7hl7-fhir

FHIR search by extension


How can I search for extension values in FHIR? Is SearchParameter registration necessary for searching for the extension? Any help with an example would be great. I have been trying with my own FHIR server (https://github.com/Microsoft/fhir-server) using mothersMaidenName after SearchParameter registration but it gives all the Patients from the server.

Update

I have this JSON set as Extension for Patient Resource.

{
  "extension": [
    {
      "url": "http://hl7.org/fhir/SearchParameter/patient-extensions-Patient-mothersMaidenName",
      "valueString": "trial"
    }
  ]
}

The SearchParameters registration is done like this (these are from https://www.hl7.org/fhir):

{
  "resourceType": "SearchParameter",
  "id": "e3f10e54-f558-49bb-8732-faee3a4dda8d",
  "url": "http://hl7.org/fhir/SearchParameter/patient-extensions-Patient-mothersMaidenName",
  "version": "3.6.0",
  "name": "mothersMaidenName",
  "status": "draft",
  "experimental": true,
  "code": "mothersMaidenName",
  "base": [
    "Patient"
  ],
  "type": "string",
  "description": "Search based on patient's mother's maiden name",
  "expression": "Patient.extension(http://hl7.org/fhir/SearchParameter/patient-extensions-Patient-mothersMaidenName)",
  "xpathUsage": "normal"
}

Solution

  • We currently don't support search on extensions in our FHIR server. It is on our roadmap. https://github.com/Microsoft/fhir-server/blob/master/docs/Roadmap.md#extensions

    Matjaz