I am trying to use FHIRPath in a MedicationRequest resource such that I would like to check if the reference in MedicationRequest.subject is of type Patient. Specifically, the FHIRPath is"MedicationRequest.subject.where(resolve() is Patient)"and my code is "fhirContext.newFhirPath().evaluate(medicationRequestObj, expression, Patient.class)"I looked into the code for FHIRPathEngine (FPE) and from what I can understand (which can be entirely incorrect), FPE is trying to resolve the resource reference itself. Is my understanding correct?
My requirement however is just to simply return whether or not the reference is of type Patient. Open to all ideas from the group here. Thank you.
--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/1fad42b2-d39b-4bec-bcf0-a8f03ff35dedn%40googlegroups.com.
/**
* Implementation of resolve() function. Passed a string, return matching resource, if one is known - else null
* @appContext - passed in by the host to the FHIRPathEngine
* @param url the reference (Reference.reference or the value of the canonical
* @return
* @throws FHIRException
*/
public Base resolveReference(Object appContext, String url, Base refContext) throws FHIRException;
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/658f97a0-51fa-43cb-b9cc-127f41bc73e0n%40googlegroups.com.