References
Reference types:
- absolute reference
- relative reference, which is relative to the Service Base URL
- logical Reference
- conditional reference
- urn:uuid
- internal fragment reference (for "Contained Resources")
Absolute reference.
Absolute reference is a reference that points to other fhir server. Kodjin does not validate an absolute reference.
example of the reference:
Relative reference.
Relative reference is a reference that
-
consits of a resourceType and logical id of the resource.
-
or is an absolute referense that starts with the domain name.
Kodjin validates that relative reference exists in the data base. If there is no such resource Kodjin will return an error. If this type of reference is present in the bundle with typetransaction
, then Kodjin validates that reference is in the data base or in the current Bindle.
Logical Reference.
Reference that does not exist in current data base could be presented in the type of identifier.
Kodjin validates reference as identifier according to the StructureDefinition.Conditional reference.
When users do not know the logical reference of the resource they could use conditinal reference in the bundles.
Kodjin performs search during validating such reference. And only with a single match will return no error during validation. In all other case, like no matches, multiple match, validation will return an error. While saving resources with conditional reference to DB, Kodjin changes conditional reference to relative reference
urn:uuid
While posting a Bundle user could not know logical IDs for resources in the Bundle. In this case in oder to reference such resources in the Bundle from other resources in the same Bundle 'urn:uuid' fullUrl could be used.
{
"resourceType": "Bundle",
"id": "bundle_id",
"type": "transaction",
"entry": [
{
"fullUrl": "Patient/patient_id",
"resource": {
"resourceType": "Patient",
"managingOrganization":{
"reference": "urn:uuid:7c6f767d-b302-4ef6-bd6f-29aab87a958b"
}
},
"request": {
"method": "POST",
"url": "Patient"
}
},
{
"fullUrl": "urn:uuid:7c6f767d-b302-4ef6-bd6f-29aab87a958b",
"resource": {
"resourceType": "Organization",
"id":"{{generated_organization_id}}",
"name": "Organization"
},
"request": {
"method": "POST",
"url": "Organization"
}
}
]
}
Internal fragment reference (for "Contained Resources")
If user wants to reference a contained resource (more about contained resource here) the special type of reference should be used
In the same way works references between contained resources.Also the contained resource could reference resource for which it is a contained one