4

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"
}
RNHTTR
  • 2,235
  • 2
  • 15
  • 30
Vikash Kumar
  • 538
  • 7
  • 16
  • Hi! Where did you find that SearchParameter definition? It contains an error, so if you send us the link, I can report it to have it fixed. – Mirjam Baltus Nov 30 '18 at 20:20

3 Answers3

1

Two steps are required: first, you need to define a custom SearchParameter that searchs on the element you wish in the way you wish. Second, all relevant servers must be manually changed (i.e. have code written) to support the new search parameter.

Lloyd McKenzie
  • 6,345
  • 1
  • 13
  • 10
  • Thank you for looking into, seems like I am on the right path. I have updated question with actual JSON data. I guess with the second statement you meant after extra coding FHIR Conformance would come with /metadata URL. Can you please verify if that is correct JSON values for FHIR expression. – Vikash Kumar Nov 27 '18 at 05:58
  • I tried with Hapi server, it worked fine, must be an issue related to MS source code. – Vikash Kumar Nov 27 '18 at 12:12
0

You still miss the second step that Lloyd mentions: the server should be made aware of the SearchParameter and needs to be implemented to support it. Reading through the MS server documentation, they use a file with all SearchParameters in it. This is read by the server on startup, so the server can support them. So you will need to find it (searchparameters.json) and add your SearchParameter to it, then restart and see if it works.

I'm not sure how to rebuild the search index, so it might only work on newly uploaded resources unless you find out how it's done.

Mirjam Baltus
  • 2,035
  • 9
  • 13
0

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