--
You received this message because you are subscribed to the Google Groups "SMART on FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smart-on-fhi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smart-on-fhir/7d4db11c-e894-4df8-906c-42a95d64fe86%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smart-on-fhir/CANSMLKFgF_pUNsamVwYhmh_-PY%3DxVPogwkRiq0Q%3DVhWLb7kmAQ%40mail.gmail.com.
Thanks, Josh. While working out an example for the issue, I discovered that this problem was a side effect for a workaround to another issue. I am new to this framework and scrambling to get a demo working for a HIMSS kiosk. More on my situation:Contained vs standalone Medication resources is a good, common example that should be supported, either within MedicationDispense (my use case) or MedicationRequest. I believe US Core explicitly allows for either approach in MedicationRequest. So, a client does not know in advance which approach may be found within a query. My query looks like this (with additional search params that I omitted):return pdmpClient.request("MedicationDispense,{ pageLimit: 0, flat: true,resolveReferences: ["medicationReference", "subject", "performer.0.actor"] })When using all standalone references, this works as expected. If one of the references is contained then I get a runtime 400 error where the framework is attempting to search on the #xyz reference, e.g. the 400 error on a URL similar to this: https://myserver.com/fhir/#pdmp-med-mae-1I will submit an issue with example resource bundle, but can you suggest a workaround? My previous message with incorrect inlining of resolution was because I had attempted a workaround for the real issue by appending a resource type to the base url, e.g.pdmpClient = new FHIR.client(endpoint+"/MedicationDispense");Obviously not the right solution, but it removed the 400 error if I used a query string without resource type. But then the resolution of contained "#id" simply returned the full base resource. No runtime error, but incorrect result.Thanks!Dave
To view this discussion on the web visit https://groups.google.com/d/msgid/smart-on-fhir/CAMCPe65nxPQMeRPMzWN-DYNuP4G2BUVSp9jpbjrt7g93q4Kpaw%40mail.gmail.com.
Hi Vlad,Yes, I understand the purpose of resolveReferences, and it works very well. The problem lies when several reference in my resource *may* be contained and I don't have any control over the source data structure. Also, in my situation, some endpoints might use all remote references and another all contained. This could be a problem for any client app retrieving MedicationRequest based on US Core and resolving medicationReference.Because the current implementation for resolveReferences will throw a runtime exception whenever it encounters a contained reference, I cannot use resolveReferences for any of my elements. I'll need to inspect each reference and either retrieve the contained, or call another server request for each of the remote references. Could resolveReferences check for a "#" prefix to ignore contained links, and then proceed with current logic otherwise? Then I can inspect and retrieve only contained references using a "#id".Thanks,Dave