From 8d1724328ac4e943c535008e2f032d38521c53a5 Mon Sep 17 00:00:00 2001 From: Patrick Werner Date: Thu, 28 Nov 2024 14:57:22 +0100 Subject: [PATCH] add reference-slice-resolve test --- ...on-TestObservationInstanceWithResolve.json | 23 +++++++++ ...ion-TestObservationProfileWithResolve.json | 48 +++++++++++++++++++ validator/manifest.json | 30 ++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 validator/Observation-TestObservationInstanceWithResolve.json create mode 100644 validator/StructureDefinition-TestObservationProfileWithResolve.json diff --git a/validator/Observation-TestObservationInstanceWithResolve.json b/validator/Observation-TestObservationInstanceWithResolve.json new file mode 100644 index 00000000..6a5a90c8 --- /dev/null +++ b/validator/Observation-TestObservationInstanceWithResolve.json @@ -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" + } + ] + } +} diff --git a/validator/StructureDefinition-TestObservationProfileWithResolve.json b/validator/StructureDefinition-TestObservationProfileWithResolve.json new file mode 100644 index 00000000..3c4d9fee --- /dev/null +++ b/validator/StructureDefinition-TestObservationProfileWithResolve.json @@ -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" + ] + } + ] + } + ] + } +} diff --git a/validator/manifest.json b/validator/manifest.json index 445ff51c..6d42e894 100644 --- a/validator/manifest.json +++ b/validator/manifest.json @@ -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",