fhirbase / fhirbase-plv8

[DEPRECATED] Fhirbase 2.0 is an FHIR relational storage
https://health-samurai.io/fhirbase
Other
105 stars 39 forks source link

Resolving references in transaction bundle is sensitive to order of entry elements. #145

Closed ratp0is0n closed 8 years ago

ratp0is0n commented 8 years ago

Tested on v1.3.0.25

for example after SELECT fhir_transaction with json incorrect bundle request.txt

I recived response incorrect bundle response.txt with unresolved reference "detail": [{ "reference": "urn:uuid:4f6a30fb-cd3c-4ab6-8757-532101f72067" }] in Order resource.

If I change resource order from [Order, DiagnosticOrder] to [DiagnosticOrder, Order] like in this example correct bundle request.txt, reference is resolved correctly "detail": [{ "reference": "/DiagnosticOrder/4ce9a9a6-841d-410d-aa8b-1d6549ccf8f5"}] correct bundle response.txt

mlapshin commented 8 years ago

Correct, resources in transaction should be ordered topologically to make transaction code correctly resolve local references in CREATE and UPDATE operations. Circular references also won't work.

ratp0is0n commented 8 years ago

Ok, thanks!