Skip to content

Commit

Permalink
add reference-slice-resolve test
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-werner committed Nov 28, 2024
1 parent 6b8e927 commit 8d17243
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
23 changes: 23 additions & 0 deletions validator/Observation-TestObservationInstanceWithResolve.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"resourceType": "Observation",
"id": "TestObservationInstanceWithResolve",
"meta": {
"profile": [
"http://example.org/StructureDefinition/TestObservationProfileWithResolve"
]
},
"performer": [
{
"reference": "Patient/pat-good"
}
],
"status": "final",
"code": {
"coding": [
{
"code": "test",
"system": "http://test.org/CodeSystem"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"resourceType": "StructureDefinition",
"id": "TestObservationProfileWithResolve",
"url": "http://example.org/StructureDefinition/TestObservationProfileWithResolve",
"name": "TestObservationProfileWithResolve",
"title": "TestObservationProfileWithResolve",
"status": "draft",
"description": "TestObservationProfileWithResolve",
"fhirVersion": "4.0.1",
"kind": "resource",
"abstract": false,
"type": "Observation",
"baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
"derivation": "constraint",
"differential": {
"element": [
{
"id": "Observation.performer",
"path": "Observation.performer",
"slicing": {
"discriminator": [
{
"type": "type",
"path": "$this.resolve()"
}
],
"rules": "open"
},
"min": 1
},
{
"id": "Observation.performer:test",
"path": "Observation.performer",
"sliceName": "test",
"min": 1,
"max": "1",
"type": [
{
"code": "Reference",
"targetProfile": [
"http://hl7.org/fhir/StructureDefinition/Patient"
]
}
]
}
]
}
}
30 changes: 30 additions & 0 deletions validator/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -50178,6 +50178,36 @@
}
}
},
{
"name": "reference-slice-resolve",
"file": "Observation-TestObservationInstanceWithResolve.json",
"version": "4.0",
"description": "Validator should be able to fetch reference from validation context",
"supporting": [
"StructureDefinition-TestObservationProfileWithResolve.json",
"patient-good.json"
],
"java": {
"warningCount": 1,
"outcome": {
"resource": {
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "warning",
"code": "not-found",
"details": {
"text": "A definition for CodeSystem 'http://test.org/CodeSystem' could not be found, so the code cannot be validated"
},
"expression": [
"Observation.code.coding[0].system"
]
}
]
}
}
}
},
{
"name": "zzz",
"file": "zzz.json",
Expand Down

0 comments on commit 8d17243

Please sign in to comment.