FHIR Chat · CustomSearchParameter, FHIR path, expression · hapi

Stream: hapi

Topic: CustomSearchParameter, FHIR path, expression


view this post on Zulip Marian Hummel (Aug 05 2020 at 15:15):

Hi everyone.

according to https://www.hl7.org/fhir/searchparameter-registry.html Section Appointment the path (expression) for parameter practitioner is Appointment.​participant.​actor.​where(resolve() is Practitioner)

Now i want to build one for relatedPersons as well.

My custom Parameter looks like this

            participantsSearchParameter.addBase("Appointment")
            participantsSearchParameter.code = "participatingRelatives"
            participantsSearchParameter.type = Enumerations.SearchParamType.REFERENCE
            participantsSearchParameter.title = "Appointment participating relatives"
            participantsSearchParameter.expression = "participant.actor.where(resolve() is RelatedPerson)"
            participantsSearchParameter.xpathUsage = SearchParameter.XPathUsageType.NORMAL
            participantsSearchParameter.status = Enumerations.PublicationStatus.DRAFT
            participantsSearchParameter.addComparator(SearchParameter.SearchComparator.EQ)
            participantsSearchParameter.addModifier(SearchParameter.SearchModifierCode.CONTAINS)

This one can be created and used without error message, but it does not work as wanted.

My first intention was to set the expression at the xpath parameter

            participantsSearchParameter.xpath = "participant.actor.where(resolve() is RelatedPerson)"

My next idea is to set a reference to parameter actor and use chained search parameters from here

            participantsSearchParameter.type = Enumerations.SearchParamType.REFERENCE
            participantsSearchParameter.expression = "participant.actor"

Unfortunately my approaches do not work, where am I wrong?

view this post on Zulip Marian Hummel (Aug 06 2020 at 09:57):

Now i went for

            participantsSearchParameter.type = Enumerations.SearchParamType.TOKEN
            participantsSearchParameter.xpath = "participant.actor"
            participantsSearchParameter.expression = "Appointment.actor"

i can now search for general participants, but i cannot distinguish by type (Patient, Practitioner, RelatedPersons)

Its not ideal, but it would work. Any other ideas?


Last updated: Apr 12 2022 at 19:14 UTC