Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test bundle versioned reference resolution #210

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 137 additions & 0 deletions validator/bundle-document-versioned-references-bad.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
{
"resourceType": "Bundle",
"id": "BundleExample1",
"identifier": {
"system": "urn:ietf:rfc:3986",
"value": "urn:uuid:ba2d1426-ed83-4d55-8032-c6345382c92b"
},
"entry": [
{
"fullUrl": "http://example.org/Composition/CompositionExample1",
"resource": {
"resourceType": "Composition",
"id": "CompositionExample1",
"author": [
{
"reference": "Practitioner/PractitionerExample"
}
],
"section": [
{
"entry": [
{
"reference": "Observation/ObservationExample/_history/3"
},
{
"reference": "Observation/ObservationExample"
}
]
}
],
"status": "final",
"type": {
"coding": [
{
"code": "18776-5",
"system": "http://loinc.org",
"display": "Plan of care note"
}
]
},
"subject": {
"reference": "Patient/PatientExample"
},
"date": "2024-12-01",
"title": "Document example"
}
},
{
"fullUrl": "http://example.org/Observation/ObservationExample",
"resource": {
"resourceType": "Observation",
"id": "ObservationExample",
"meta": {
"versionId": "1",
"lastUpdated": "2024-11-30T13:28:17.239+02:00"
},
"performer": [
{
"reference": "Practitioner/PractitionerExample"
}
],
"status": "final",
"code": {
"text" : "test"
},
"subject": {
"reference": "Patient/PatientExample"
},
"effectiveDateTime": "2024-11-30",
"valueQuantity": {
"value": 170,
"code": "cm",
"system": "http://unitsofmeasure.org",
"unit": "cm"
}
}
},
{
"fullUrl": "http://example.org/Observation/ObservationExample",
"resource": {
"resourceType": "Observation",
"id": "ObservationExample",
"meta": {
"versionId": "2",
"lastUpdated": "2024-12-01T13:28:17.239+02:00"
},
"performer": [
{
"reference": "Practitioner/PractitionerExample"
}
],
"status": "final",
"code": {
"text" : "test"
},
"subject": {
"reference": "Patient/PatientExample"
},
"effectiveDateTime": "2024-11-30",
"valueQuantity": {
"value": 170,
"code": "cm",
"system": "http://unitsofmeasure.org",
"unit": "cm"
}
}
},
{
"fullUrl": "http://example.org/Patient/PatientExample",
"resource": {
"resourceType": "Patient",
"id": "PatientExample",
"name": [
{
"given": ["James"],
"family": "Toad"
}
]
}
},
{
"fullUrl": "http://example.org/Practitioner/PractitionerExample",
"resource": {
"resourceType": "Practitioner",
"id": "PractitionerExample",
"name": [
{
"given": ["Gina"],
"family": "Pond"
}
]
}
}
],
"type": "document",
"timestamp": "2024-12-01T13:28:17.239+02:00"
}
139 changes: 139 additions & 0 deletions validator/bundle-document-versioned-references-good.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
"resourceType": "Bundle",
"id": "BundleExample1",
"identifier": {
"system": "urn:ietf:rfc:3986",
"value": "urn:uuid:ba2d1426-ed83-4d55-8032-c6345382c92b"
},
"entry": [
{
"fullUrl": "http://example.org/Composition/CompositionExample1",
"resource": {
"resourceType": "Composition",
"id": "CompositionExample1",
"author": [
{
"reference": "Practitioner/PractitionerExample"
}
],
"section": [
{
"entry": [
{
"reference": "Observation/ObservationExample/_history/1"
},
{
"reference": "Observation/ObservationExample/_history/2"
}
]
}
],
"status": "final",
"type": {
"coding": [
{
"code": "18776-5",
"system": "http://loinc.org",
"display": "Plan of care note"
}
]
},
"subject": {
"reference": "Patient/PatientExample"
},
"date": "2024-12-01",
"title": "Document example"
}
},
{
"fullUrl": "http://example.org/Observation/ObservationExample",
"resource": {
"resourceType": "Observation",
"id": "ObservationExample",
"meta": {
"versionId": "1",
"lastUpdated": "2024-11-30T13:28:17.239+02:00"
},
"performer": [
{
"reference": "Practitioner/PractitionerExample"
}
],
"status": "final",
"code": {
"text" : "test"
},
"subject": {
"reference": "Patient/PatientExample"
},
"effectiveDateTime": "2024-11-30",
"valueQuantity": {
"value": 170,
"code": "cm",
"system": "http://unitsofmeasure.org"
}
}
},
{
"fullUrl": "http://example.org/Observation/ObservationExample",
"resource": {
"resourceType": "Observation",
"id": "ObservationExample",
"meta": {
"versionId": "2",
"lastUpdated": "2024-12-01T13:28:17.239+02:00"
},
"performer": [
{
"reference": "Practitioner/PractitionerExample"
}
],
"status": "final",
"code": {
"text" : "test"
},
"subject": {
"reference": "Patient/PatientExample"
},
"effectiveDateTime": "2024-11-30",
"valueQuantity": {
"value": 170,
"code": "cm",
"system": "http://unitsofmeasure.org"
}
}
},
{
"fullUrl": "http://example.org/Patient/PatientExample",
"resource": {
"resourceType": "Patient",
"id": "PatientExample",
"name": [
{
"given": [
"James"
],
"family": "Toad"
}
]
}
},
{
"fullUrl": "http://example.org/Practitioner/PractitionerExample",
"resource": {
"resourceType": "Practitioner",
"id": "PractitionerExample",
"name": [
{
"given": [
"Gina"
],
"family": "Pond"
}
]
}
}
],
"type": "document",
"timestamp": "2024-12-01T13:28:17.239+02:00"
}
87 changes: 87 additions & 0 deletions validator/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,93 @@
"output": []
}
},
{
"name": "bundle-document-versioned-references-good",
"file": "bundle-document-versioned-references-good.json",
"version": "4.0",
"java": {
"errorCount": 0,
"output": []
}
},
{
"name": "bundle-document-versioned-references-bad",
"file": "bundle-document-versioned-references-bad.json",
"version": "4.0",
"java": {
"outcome": {
"resourceType" : "OperationOutcome",
"issue" : [{
"severity" : "warning",
"code" : "required",
"details" : {
"text" : "The bundle contains no match for http://example.org/Observation/ObservationExample by the rules of Bundle reference resolution, but it has multiple resources that match Observation/ObservationExample/_history/3 by resource type and id"
},
"expression" : ["Bundle.entry[0].resource/*Composition/CompositionExample1*/.section[0].entry[0]"]
},
{
"severity" : "warning",
"code" : "required",
"details" : {
"text" : "Entry 1 matches the reference Observation/ObservationExample/_history/3 by type and id but it's fullUrl http://example.org/Observation/ObservationExample does not match the full target URL http://example.org/Observation/ObservationExample by Bundle resolution rules"
},
"expression" : ["Bundle.entry[0].resource/*Composition/CompositionExample1*/.section[0].entry[0]"]
},
{
"severity" : "warning",
"code" : "required",
"details" : {
"text" : "Entry 2 matches the reference Observation/ObservationExample/_history/3 by type and id but it's fullUrl http://example.org/Observation/ObservationExample does not match the full target URL http://example.org/Observation/ObservationExample by Bundle resolution rules"
},
"expression" : ["Bundle.entry[0].resource/*Composition/CompositionExample1*/.section[0].entry[0]"]
},
{
"severity" : "error",
"code" : "forbidden",
"details" : {
"text" : "Multiple matches in bundle for reference Observation/ObservationExample"
},
"expression" : ["Bundle.entry[0].resource/*Composition/CompositionExample1*/.section[0].entry[1]"]
},
{
"severity" : "error",
"code" : "invalid",
"details" : {
"text" : "Can't find 'Observation/ObservationExample/_history/3' in the bundle (Section Entry). Note that there are 2 resources in the bundle with the same type and id, but they do not match because of the fullUrl based rules around matching relative references (one of ``http://example.org/Observation/ObservationExample``)"
},
"diagnostics" : "[22,16]",
"expression" : ["Bundle.entry[1].resource.section[1].entry[1]"]
},
{
"severity" : "error",
"code" : "invalid",
"details" : {
"text" : "Found 2 matches for 'Observation/ObservationExample' in the bundle (Section Entry)"
},
"diagnostics" : "[25,16]",
"expression" : ["Bundle.entry[1].resource.section[1].entry[2]"]
},
{
"severity" : "warning",
"code" : "invalid",
"details" : {
"text" : "Entry 'http://example.org/Observation/ObservationExample' isn't reachable by traversing forwards from the Composition. Only Provenance is approved to be used this way (R4 section 3.3.1)"
},
"diagnostics" : "[48,6]",
"expression" : ["Bundle.entry[6]"]
},
{
"severity" : "warning",
"code" : "invalid",
"details" : {
"text" : "Entry 'http://example.org/Observation/ObservationExample' isn't reachable by traversing forwards from the Composition. Only Provenance is approved to be used this way (R4 section 3.3.1)"
},
"diagnostics" : "[78,6]",
"expression" : ["Bundle.entry[6]"]
}]
}
}
},
{
"name": "bundle-documentation-miss-last-updated",
"file": "bundle-documentation-miss-last-updated.json",
Expand Down
Loading