Stream: implementers
Topic: validating a transaction Bundle
Job Schipper (May 11 2020 at 11:17):
I have a use case where I want to validate a transaction bundle by doing a POST baseDstu3/Bundle/$validate. The bundle includes some resources that should be created. One of the validation errors i'm getting as a response is:
{
"severity": "error",
"code": "processing",
"diagnostics": "Bundle entry missing fullUrl",
"location": [ "Bundle.entry[0]", "Line 1, Col 36" ]
}
The STU3 spec says that the fullUrl of a Bundle entry must contain the "Absolute URL for resource (server address, or UUID/OID)". However, in this case some of the entries in the transaction bundle don't exist yet (they are of request type POST), and as I cannot tell the server what ID to use, there is no way for me to predict what the fullUrl should be.
Feels like this is a chicken/egg problem, where I want to validate my transaction before creating a set of (possible invalid) resources, but I can't validate the resources because they have not been created yet. Is there a way around this? Any help would be very much appreciated :)
Rik Smithies (May 11 2020 at 11:35):
You are right but that is specifically what the urn:uuid version of the reference is for. You just generate a random one, and put that in fullUrl and it whatever references that fullUrl. They act as placeholders, and get replaced by the actual server assigned ids.
Job Schipper (May 11 2020 at 11:56):
@Rik Smithies thanks, i will give that a try!
Job Schipper (May 11 2020 at 12:15):
works nicely! great
Last updated: Apr 12 2022 at 19:14 UTC