Skip to content

Commit

Permalink
Add test case for duplicate ids on contained resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahame Grieve committed Jan 27, 2025
1 parent 3e6a4bd commit 17a7995
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 10 deletions.
71 changes: 61 additions & 10 deletions validator/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -50799,20 +50799,71 @@
"name": "deprecated-extension",
"file": "patient-deprecated-extension.json",
"version": "5.0",
"supporting" : ["StructureDefinition-deprecated.json"],
"supporting": [
"StructureDefinition-deprecated.json"
],
"description": "checking that the warning message picks up the deprecation notice",
"java": {
"outcome": {
"resourceType" : "OperationOutcome",
"issue" : [{
"severity" : "information",
"code" : "business-rule",
"details" : {
"text" : "The extension http://hl7.org/fhir/test/StructureDefinition/deprecated|4.0.1 is deprecated with the note Testing out the \"validator\" (http://hl7.org/fhir/validator)"
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "information",
"code": "business-rule",
"details": {
"text": "The extension http://hl7.org/fhir/test/StructureDefinition/deprecated|4.0.1 is deprecated with the note Testing out the \"validator\" (http://hl7.org/fhir/validator)"
},
"diagnostics": "[4,4]",
"expression": [
"Patient.extension[0]"
]
}
]
}
}
},
{
"name": "patient-duplicate-contained",
"file": "patient-duplicate-contained.json",
"version": "5.0",
"java": {
"outcome": {
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "duplicate",
"details": {
"text": "Duplicate ID for contained resource: pat1"
},
"diagnostics": "[21,4]",
"expression": [
"Patient.contained[1]/*Patient/pat1*/"
]
},
"diagnostics" : "[4,4]",
"expression" : ["Patient.extension[0]"]
}]
{
"severity": "error",
"code": "invalid",
"details": {
"text": "Resource requires an id, but none is present"
},
"diagnostics": "[27,4]",
"expression": [
"Patient.contained[3]/*Patient/null*/"
]
},
{
"severity": "error",
"code": "invalid",
"details": {
"text": "The contained resource 'null' is not referenced to from elsewhere in the containing resource nor does it refer to the containing resource (dom-3)"
},
"diagnostics": "[27,4]",
"expression": [
"Patient.contained[3]"
]
}
]
}
}
},
Expand Down
31 changes: 31 additions & 0 deletions validator/patient-duplicate-contained.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"resourceType" : "Patient",
"id" : "patient-duplicate-contained",
"link" : [
{
"other" : {
"reference" : "#pat1"
},
"type" : "seealso"
},
{
"other" : {
"reference" : "#pat2"
},
"type" : "seealso"
}
],
"contained" : [{
"resourceType": "Patient",
"id": "pat1"
}, {
"resourceType": "Patient",
"id": "pat1"
}, {
"resourceType": "Patient",
"id": "pat2"
}, {
"resourceType": "Patient",
"active" : true
}]
}

0 comments on commit 17a7995

Please sign in to comment.