Expression (FHIRPath) for 'age' custom search parameter.
See original GitHub issueHello,
I am not sure if this the right place to post my issue. If not, please redirect me to the right thread.
Environment: Docker deployment of IBM FHIR v4.10.0
Issue: I have several Patient resources and wish to perform search requests based on their age. From what I understand, age is not a standard search parameter, thus needs to be imported as a custom search parameter.
I see that on hl7 there is an age SearchParameter: https://www.hl7.org/fhir/patient-extensions-Patient-age.json.html
The description of this search parameter says that: "description" : "Searches for patients based on age as calculated based on current date and date of birth. Deceased patients are excluded from the search."
Thus I copy this json entry as-is, inside extension-search-parameters.json file and copy it inside my container when I fire up the server.
However when I try to use it as a search parameter I always get 0 results, no matter what I try.
I also read that the IBM FHIR Server does not use the XPath during extraction; it only uses the expression (FHIRPath). But I am not sure what the correct FHIRPath is for IBM FHIR server, I can’t seem to find it anywhere.
Can you please help?
P.S. The only search parameter I managed to get to work was from this IBM example: https://ibm.github.io/FHIR/guides/FHIRSearchConfiguration#11-tenant-specific-parameters
My extension-search-parameters.json file is as follows:
{
"resourceType": "Bundle",
"id": "searchParams",
"meta": {
"lastUpdated": "2018-12-27T22:37:54.724+11:00"
},
"type": "collection",
"entry": [
{
"fullUrl": "http://ibm.com/fhir/SearchParameter/Observation-component-code-value-boolean",
"resource": {
"resourceType" : "SearchParameter",
"id" : "patient-extensions-Patient-age",
"url" : "http://hl7.org/fhir/SearchParameter/patient-extensions-Patient-age",
"version" : "4.0.1",
"name" : "age",
"status" : "draft",
"experimental" : true,
"description" : "Searches for patients based on age as calculated based on current date and date of birth. Deceased patients are excluded from the search.",
"code" : "age",
"base" : ["Patient"],
"type" : "number",
"xpath" : "f:Patient/f:birthDate",
"xpathUsage" : "normal",
"expression": ??????,
"multipleOr": true,
"multipleAnd": true
}
}
]
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)

Top Related StackOverflow Question
Age is a tricky one because its a point-in-time thing. The search parameters are extracted and indexed at the time of ingestion. It possible to re-compute the values via our
$reindexprocess but thats somewhat costly (based on the amount of data) and so you might not want to do it each day.Can you search on birthdate instead?
Note, you have to update the Resource to get the new extraction of the SearchParameter values. An alternative is to use
$reindexas Lee previously mentioned (which does not change the version-id).