FHIR Chat · Drilling Down PractitionerRole · fhirpath

Stream: fhirpath

Topic: Drilling Down PractitionerRole


view this post on Zulip Tushar Nair (Aug 09 2021 at 21:02):

Hello,
I am new to FHIRPath. I am trying to extract data from the PractitionerRole resource as well as the included Practitioner resource and the included HealthcareService>location.address. Is it possible to write a single FHIRPATH query that extracts the Practitioner Name, Practitioner.identifier(NPI) and the Practitioner.HealthcareService.location.address-postalcode? I was trying to split each one separately . e.g. For Practitinoer Name I wrote PractitionerRole.practitioner.resolve().name, and I get the names back but in the process I lose the traceability . I mean the Practitioner is referenced to which PractitionerRole resource, this I am unable to extract from the query. Is there a way to do this? Similarly, if i have to drill down to extract the PractitionerRole.healthcareService.location.address-code, then is that even feasible?Your suggestions would be most helpful. I have been reading the spec but it doesn't contain such examples as far as I could see. Thank you!!! @Lloyd McKenzie @Ewout Kramer

view this post on Zulip Lloyd McKenzie (Aug 09 2021 at 21:08):

I'm not fully understanding what you're trying to do. Are you wanting to create a single string that concatenates name, id and postal code? Are you using this FHIRPath in an invariant, discriminator or something else?

view this post on Zulip Tushar Nair (Aug 09 2021 at 21:16):

@Lloyd McKenzie I am trying to extract data. The scenario is that we are trying to extract Practitioners belonging to a certain zip code. A fhir query may not help here as it will return PractitionerRole resources where address is belonging to a certain zip code in the PractitionerRole.HealthcareService.location.address. But it's possible that a single Practitioner may be referenced in multiple PractitionerRole resources. So we decided to use FHIRPath to extract this data. Now the address is taken from PractitionerRole as thats where the location as to where they practice is captured. But the name has to be extracted from the Practitioner resource itself. So while we do this we have to ensure that Practitioner names that hare returned also contain the PractitionerRole.id as well to maintain the traceability. Hope it gives some clarity. In essence, would there be a way to write the FHIRPath like PractitionerRole.practitioner.resolve().name wher i get the names as well as the Resource ID for the PractitionerRole back?

view this post on Zulip Lloyd McKenzie (Aug 09 2021 at 21:21):

I'm still not really understanding. Are you writing CQL? FHIRPath isn't a query language. You're first going to need to query your data. You can then execute FHIRPath against it.

view this post on Zulip Tushar Nair (Aug 09 2021 at 21:35):

@Lloyd McKenzie Yes I am extracting the resources from the FHIR query that I am using. This is the FHIR query that I am using [base]/PractitionerRole?_profile=http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-PractitionerRole&_include=PractitionerRole:practitioner&_include=PractitionerRole:service&_include:iterate=HealthcareService:location&service.location.address-code=97401. The resources returned are used to POST as bundle on the HAPI server base/api/main/test/querybundle?fhirpath=PractitionerRole.practitioner.resolve().name. It returns a set of names like:
{
"resourceType": "Parameters",
"parameter": [ {
"name": "expression",
"valueString": "PractitionerRole.practitioner.resolve().name"
}, {
"name": "result",
"valueHumanName": {
"use": "official",
"family": "Marks",
"given": [ "Rudy" ],
"suffix": [ "APRN" ]
}
}, {
"name": "result",
"valueHumanName": {
"use": "official",
"family": "Howell",
"given": [ "Aimee", "Justa" ],
"suffix": [ "MD" ]
}
}, {
"name": "result",
"valueHumanName": {
"use": "official",
"family": "O'Hara",
"given": [ "Stacia" ],
"suffix": [ "MD" ]
}
},
BUt i dont know how to ensure that it also returns the Practitioner.id value with it. That's the challenge am facing
As an approach do you think exporting data for such data asks using FHIRPath is the most efficient approach?

view this post on Zulip Lloyd McKenzie (Aug 09 2021 at 22:19):

I'm not familiar with HAPI's querybundle functionality at all - that's not part of the FHIR spec. What you're trying to do seems like something that GraphQL would be more suited to than FHIRPath. FHIRPath will only give you a collection of existing FHIR types - and all must be of the same type. You can't have a collection that mixes 'id' and 'HumanName'.

view this post on Zulip Tushar Nair (Aug 09 2021 at 23:18):

Lloyd McKenzie thank you for the feedback.


Last updated: Apr 12 2022 at 19:14 UTC