Stream: implementers
Topic: fhirpath resolve()
Richard Townley-O'Neill (Nov 09 2017 at 06:26):
I'm looking at the FHIRpath function resolve()
see http://build.fhir.org/profiling.html#discriminator and http://hl7.org/fhirpath/#additional-functions
Is resolve()
safe to use when slicing a reference?
I want to slice Consent.except
on data.reference.resolve(BodySite.code)
Is that syntax even right?
Grahame Grieve (Nov 09 2017 at 22:01):
no resolve() doesn't take a parameter. What are you trying to do?
Grahame Grieve (Nov 09 2017 at 22:01):
but in principle, yes, you can slice this way
Richard Townley-O'Neill (Nov 09 2017 at 23:56):
@Grahame Grieve
I want to record two types of information in an organ donor Consent resource: 1-whether the patient consents to any donations at all, and 2-for each of a list of organs, whether the patient consents to donation of that particular organ. (Depending upon the business owner, we might be able to get rid of case 1 as it is derivable from case 2, but maybe not.)
I'm exploring using slices of Consent.except
for this. Options include:
slicing on Consent.except.data.reference.reference
and using two profiles of BodySite.
slicing on Consent.except.data.reference.reference---BodySite.code.coding
and using different invariants for each of the two slices.
Where can I find guidance on or an example of using resolve()? - to get the syntax right.
Grahame Grieve (Nov 10 2017 at 06:01):
shouldn't you just use code for the body part?
Grahame Grieve (Nov 10 2017 at 06:01):
data.reference.resolve().code otherwise
Richard Townley-O'Neill (Nov 10 2017 at 06:16):
Thanks.
I'd like to use code
, but its definition makes it seem different to codes used in other resources.
Its definition of "If this code is found in an instance, then the exception applies." makes me think that code is a tag used to identify data of interest. I can't see how that is relevant to consent to donate an organ.
I must create an issue on that to see whether it can be changed in STU4.
I could use an extension. That might be the best option.
Grahame Grieve (Nov 10 2017 at 06:17):
well, you're working against the instantiated scope of the resource. I'd use code... if the code is found in the instance of the body site, then the exception applies
Grahame Grieve (Nov 10 2017 at 06:17):
so it comes to the same thing
Richard Townley-O'Neill (Nov 10 2017 at 06:18):
Please explain more.
Grahame Grieve (Nov 10 2017 at 06:19):
what you're saying: use a body site with a code, and then slicing on it.... that's the same as putting code on the exception itself, since it's just referring to the code in the data (the body site) anyway
Grahame Grieve (Nov 10 2017 at 06:20):
the real wrongness is that you're not consenting to share the body site resource, you're consenting to share the body part itself. So I don't see how code is more wrong than a body site resource
Richard Townley-O'Neill (Nov 10 2017 at 06:24):
Is your suggestion to record the organ in except.data(asBodySite).code
but slice on except.code
?
Richard Townley-O'Neill (Nov 10 2017 at 06:24):
I agree that I seem to have gone down a rabbit hole.
Richard Townley-O'Neill (Nov 10 2017 at 06:25):
I think I might need to add an extension to except to hold what the consent is actually about.
Last updated: Apr 12 2022 at 19:14 UTC