Open hackermd opened 3 years ago
@nazrulworld any thoughts on this?
@hackermd I am so sorry for the late reply. Unfortunately from the version of 6.x.x, this library is completely standalone, it does not any idea about any server info/connection so unable to resolve the reference. Now it's the developer's responsibility to create a resolver according to his/her own business logic. For example https://github.com/nazrulworld/fhirpath/blob/master/src/fhirpath/utils.py#L766
Thanks for your feedback @nazrulworld. It seems version 6 introduced several breaking API changes. You have listed three in the README, but it would be great if you could document these changes more comprehensively.
Description
Resolution of references within a Bundle fails unless an instance to a server is provided (and a couple of additional undocumented assumptions are met).
The problem is in fhir.resources.fhirresource.FHIRResource.resolved(). In case of a relative reference, the method attempts to build the
fullUrl
based on the value ofbundle.server.base_uri
. If no server instance is set, resolution fails.The standard states
The important part is
extract the [root] from the fullUrl, and append the reference (type/id) to it
. For example:The
bundle.server.base_uri
is not needed (and should not be expected to be present).What I Did
results in