question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expression (FHIRPath) for 'age' custom search parameter.

See original GitHub issue

Hello,

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:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lmsurprecommented, Jan 21, 2022

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 $reindex process 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?

0reactions
prb112commented, Jan 21, 2022

Note, you have to update the Resource to get the new extraction of the SearchParameter values. An alternative is to use $reindex as Lee previously mentioned (which does not change the version-id).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding FHIR Search Parameters - Firely
FHIR Search is defined in terms of predefined search parameters, not in arbitrary FHIRPath statements. You can add custom search parameters to ...
Read more >
fhirpath Documentation
For case of Elasticsearch based engine, you should use custom analyzer ... Add support for search parameter expression that contains with ...
Read more >
Custom Search Parameters in HAPI FHIR | Smile Digital Health
The idea is that you create one of these SearchParameter resources and give it a code (the name of the URL parameter), a...
Read more >
Searchparameter-registry - FHIR v5.0.0-snapshot3
This page lists all search parameters defined as part of this specification. ... A custom search profile that describes a specific defined query...
Read more >
FHIRPath: Custom Search On Date Difference
I'd like to make a custom SearchParameter that allows me to search Specimens on the Patient's age at the time the Specimen was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found