diff --git a/schemas/vitals-RESTRICTS.json b/schemas/vitals-RESTRICTS.json index f74aa7ca..5fe75945 100644 --- a/schemas/vitals-RESTRICTS.json +++ b/schemas/vitals-RESTRICTS.json @@ -1,286 +1,310 @@ { - "@context": "http://www.w3.org/ns/shex.jsonld", "type": "Schema", "shapes": [ - { "type": "ShapeDecl", - "id": "http://a.example/#Observation", - "shapeExpr": { - "type": "Shape", - "expression": { - "type": "EachOf", - "expressions": [ - { - "type": "TripleConstraint", - "predicate": "http://hl7.org/ns/fhir#code", - "min": 0, - "max": 1 - }, - { - "type": "TripleConstraint", - "predicate": "http://hl7.org/ns/fhir#component", - "valueExpr": { - "type": "Shape", - "expression": { - "type": "EachOf", - "expressions": [ - { - "type": "TripleConstraint", - "predicate": "http://hl7.org/ns/fhir#code" - }, - { - "type": "TripleConstraint", - "predicate": "http://hl7.org/ns/fhir#value" - } - ] - } + { + "type": "ShapeDecl", + "id": "http://a.example/#Observation", + "shapeExpr": { + "type": "Shape", + "closed": true, + "expression": { + "type": "EachOf", + "expressions": [ + { + "type": "TripleConstraint", + "predicate": "http://hl7.org/ns/fhir#code", + "min": 0, + "max": 1 }, - "min": 0, - "max": -1 - } - ] + { + "type": "TripleConstraint", + "predicate": "http://hl7.org/ns/fhir#component", + "valueExpr": { + "type": "Shape", + "closed": true, + "expression": { + "type": "EachOf", + "expressions": [ + { + "type": "TripleConstraint", + "predicate": "http://hl7.org/ns/fhir#code" + }, + { + "type": "TripleConstraint", + "predicate": "http://hl7.org/ns/fhir#value" + } + ] + } + }, + "min": 0, + "max": -1 + } + ] + } } - } }, + }, { - "id": "http://a.example/#Vital", "type": "ShapeDecl", + "id": "http://a.example/#Vital", "abstract": true, "shapeExpr": { - "type": "ShapeAnd", - "shapeExprs": [ - "http://a.example/#Observation", - { - "type": "Shape" - } - ] + "type": "Shape", + "extends": [ + "http://a.example/#Observation" + ], + "closed": true } }, { + "type": "ShapeDecl", "id": "http://a.example/#PostureVital", + "abstract": true, + "shapeExpr": { + "type": "Shape", + "extends": [ + "http://a.example/#Vital", + "http://a.example/#Posture" + ], + "closed": true + } + }, + { "type": "ShapeDecl", + "id": "http://a.example/#ReclinedVital", "abstract": true, + "shapeExpr": { + "type": "Shape", + "extends": [ + "http://a.example/#PostureVital", + "http://a.example/#Reclined" + ], + "closed": true + } + }, + { + "type": "ShapeDecl", + "id": "http://a.example/#BP", "shapeExpr": { "type": "ShapeAnd", "shapeExprs": [ - "http://a.example/#Vital", { "type": "Shape", "extends": [ - "http://a.example/#Posture" - ] + "http://a.example/#Vital" + ], + "closed": true + }, + { + "type": "Shape", + "closed": true, + "expression": { + "type": "EachOf", + "expressions": [ + { + "type": "TripleConstraint", + "predicate": "http://hl7.org/ns/fhir#component", + "valueExpr": { + "type": "Shape", + "expression": { + "type": "TripleConstraint", + "predicate": "http://hl7.org/ns/fhir#code", + "valueExpr": { + "type": "NodeConstraint", + "values": [ + { + "value": "systolic" + } + ] + } + } + } + }, + { + "type": "TripleConstraint", + "predicate": "http://hl7.org/ns/fhir#component", + "valueExpr": { + "type": "Shape", + "expression": { + "type": "TripleConstraint", + "predicate": "http://hl7.org/ns/fhir#code", + "valueExpr": { + "type": "NodeConstraint", + "values": [ + { + "value": "diastolic" + } + ] + } + } + } + } + ] + } } ] } }, { - "id": "http://a.example/#ReclinedVital", "type": "ShapeDecl", - "abstract": true, + "id": "http://a.example/#PostureBP", + "shapeExpr": { + "type": "Shape", + "extends": [ + "http://a.example/#BP", + "http://a.example/#PostureVital" + ], + "closed": true + } + }, + { + "type": "ShapeDecl", + "id": "http://a.example/#ReclinedBP", + "shapeExpr": { + "type": "Shape", + "extends": [ + "http://a.example/#BP", + "http://a.example/#ReclinedVital" + ], + "closed": true + } + }, + { + "type": "ShapeDecl", + "id": "http://a.example/#Pulse", "shapeExpr": { "type": "ShapeAnd", "shapeExprs": [ - "http://a.example/#PostureVital", { "type": "Shape", "extends": [ - "http://a.example/#Reclined" - ] + "http://a.example/#Vital" + ], + "closed": true + }, + { + "type": "Shape", + "expression": { + "type": "TripleConstraint", + "predicate": "http://hl7.org/ns/fhir#code", + "valueExpr": { + "type": "NodeConstraint", + "values": [ + { + "value": "pulse" + } + ] + } + } } ] } }, - { "type": "ShapeDecl", - "id": "http://a.example/#BP", - "shapeExpr": { - "type": "ShapeAnd", - "shapeExprs": [ - { - "type": "Shape", - "extends": [ - "http://a.example/#Vital" - ] - }, - { - "type": "Shape", - "expression": { - "type": "EachOf", - "expressions": [ - { - "type": "TripleConstraint", - "predicate": "http://hl7.org/ns/fhir#component", - "valueExpr": { - "type": "Shape", - "expression": { - "type": "TripleConstraint", - "predicate": "http://hl7.org/ns/fhir#code", - "valueExpr": { - "type": "NodeConstraint", - "values": [ - { - "value": "systolic" - } - ] - } - } - } - }, - { - "type": "TripleConstraint", - "predicate": "http://hl7.org/ns/fhir#component", - "valueExpr": { - "type": "Shape", - "expression": { - "type": "TripleConstraint", - "predicate": "http://hl7.org/ns/fhir#code", - "valueExpr": { - "type": "NodeConstraint", - "values": [ - { - "value": "diastolic" - } - ] - } + { + "type": "ShapeDecl", + "id": "http://a.example/#PosturePulse", + "shapeExpr": { + "type": "Shape", + "extends": [ + "http://a.example/#Pulse", + "http://a.example/#PostureVital" + ], + "closed": true + } + }, + { + "type": "ShapeDecl", + "id": "http://a.example/#ReclinedPulse", + "shapeExpr": { + "type": "Shape", + "extends": [ + "http://a.example/#Pulse", + "http://a.example/#ReclinedVital" + ], + "closed": true + } + }, + { + "type": "ShapeDecl", + "id": "http://a.example/#Posture", + "shapeExpr": { + "type": "Shape", + "expression": { + "type": "TripleConstraint", + "predicate": "http://hl7.org/ns/fhir#component", + "valueExpr": { + "type": "Shape", + "expression": { + "type": "TripleConstraint", + "predicate": "http://hl7.org/ns/fhir#code", + "valueExpr": { + "type": "NodeConstraint", + "values": [ + { + "value": "posture" } - } + ] } - ] - } - } - ] - } }, - { "type": "ShapeDecl", - "id": "http://a.example/#PostureBP", - "shapeExpr": { - "type": "Shape", - "extends": [ - "http://a.example/#BP", - "http://a.example/#PostureVital" - ] - } }, - { "type": "ShapeDecl", - "id": "http://a.example/#ReclinedBP", - "shapeExpr": { - "type": "Shape", - "extends": [ - "http://a.example/#BP", - "http://a.example/#ReclinedVital" - ] - } }, - { "type": "ShapeDecl", - "id": "http://a.example/#Pulse", - "shapeExpr": { - "type": "ShapeAnd", - "shapeExprs": [ - { - "type": "Shape", - "extends": [ - "http://a.example/#Vital" - ] - }, - { - "type": "Shape", - "expression": { - "type": "TripleConstraint", - "predicate": "http://hl7.org/ns/fhir#code", - "valueExpr": { - "type": "NodeConstraint", - "values": [ - { - "value": "pulse" - } - ] - } - } - } - ] - } }, - { "type": "ShapeDecl", - "id": "http://a.example/#PosturePulse", - "shapeExpr": { - "type": "Shape", - "extends": [ - "http://a.example/#Pulse", - "http://a.example/#PostureVital" - ] - } }, - { "type": "ShapeDecl", - "id": "http://a.example/#ReclinedPulse", - "shapeExpr": { - "type": "Shape", - "extends": [ - "http://a.example/#Pulse", - "http://a.example/#ReclinedVital" - ] - } }, - { "type": "ShapeDecl", - "id": "http://a.example/#Posture", - "shapeExpr": { - "type": "Shape", - "expression": { - "type": "TripleConstraint", - "predicate": "http://hl7.org/ns/fhir#component", - "valueExpr": { - "type": "Shape", - "expression": { - "type": "TripleConstraint", - "predicate": "http://hl7.org/ns/fhir#code", - "valueExpr": { - "type": "NodeConstraint", - "values": [ - { - "value": "posture" - } - ] } } } } - } }, - { "type": "ShapeDecl", - "id": "http://a.example/#Reclined", - "shapeExpr": { - "type": "ShapeAnd", - "shapeExprs": [ - "http://a.example/#Posture", - { - "type": "Shape", - "expression": { - "type": "TripleConstraint", - "predicate": "http://hl7.org/ns/fhir#component", - "valueExpr": { - "type": "Shape", - "expression": { - "type": "EachOf", - "expressions": [ - { - "type": "TripleConstraint", - "predicate": "http://hl7.org/ns/fhir#code", - "valueExpr": { - "type": "NodeConstraint", - "values": [ - { - "value": "posture" - } - ] - } - }, - { - "type": "TripleConstraint", - "predicate": "http://hl7.org/ns/fhir#value", - "valueExpr": { - "type": "NodeConstraint", - "values": [ - { - "value": "reclined" - } - ] + }, + { + "type": "ShapeDecl", + "id": "http://a.example/#Reclined", + "shapeExpr": { + "type": "ShapeAnd", + "shapeExprs": [ + { + "type": "Shape", + "extends": [ + "http://a.example/#Posture" + ], + "closed": true + }, + { + "type": "Shape", + "expression": { + "type": "TripleConstraint", + "predicate": "http://hl7.org/ns/fhir#component", + "valueExpr": { + "type": "Shape", + "closed": true, + "expression": { + "type": "EachOf", + "expressions": [ + { + "type": "TripleConstraint", + "predicate": "http://hl7.org/ns/fhir#code", + "valueExpr": { + "type": "NodeConstraint", + "values": [ + { + "value": "posture" + } + ] + } + }, + { + "type": "TripleConstraint", + "predicate": "http://hl7.org/ns/fhir#value", + "valueExpr": { + "type": "NodeConstraint", + "values": [ + { + "value": "reclined" + } + ] + } } - } - ] + ] + } } } } - } - ] - } } - ] + ] + } + } + ], + "@context": "http://www.w3.org/ns/shex.jsonld" } diff --git a/schemas/vitals-RESTRICTS.shex b/schemas/vitals-RESTRICTS.shex index 76f86150..b50460b4 100644 --- a/schemas/vitals-RESTRICTS.shex +++ b/schemas/vitals-RESTRICTS.shex @@ -4,34 +4,35 @@ PREFIX : PREFIX fhir: PREFIX xsd: -<#Observation> { +<#Observation> CLOSED { fhir:code .? ; - fhir:component { + fhir:component CLOSED { fhir:code . ; fhir:value . }* } # -- super-classes -- -ABSTRACT <#Vital> @<#Observation> AND . -ABSTRACT <#PostureVital> @<#Vital> AND EXTENDS @<#Posture> {} -ABSTRACT <#ReclinedVital> @<#PostureVital> AND EXTENDS @<#Reclined> {} +ABSTRACT <#Vital> EXTENDS @<#Observation> CLOSED { } +ABSTRACT <#PostureVital> EXTENDS @<#Vital> EXTENDS @<#Posture> CLOSED { } +ABSTRACT <#ReclinedVital> EXTENDS @<#PostureVital> EXTENDS @<#Reclined> CLOSED { } +# ABSTRACT <#ReclinedVital> EXTENDS @<#PostureVital> CLOSED { } AND @<#Reclined> # -- BP -- -<#BP> EXTENDS @<#Vital> {} AND { +<#BP> EXTENDS @<#Vital> CLOSED { } AND CLOSED { fhir:component { fhir:code ["systolic"] } ; fhir:component { fhir:code ["diastolic"] } } -<#PostureBP> EXTENDS @<#BP> EXTENDS @<#PostureVital> { } -<#ReclinedBP> EXTENDS @<#BP> EXTENDS @<#ReclinedVital> { } +<#PostureBP> EXTENDS @<#BP> EXTENDS @<#PostureVital> CLOSED { } +<#ReclinedBP> EXTENDS @<#BP> EXTENDS @<#ReclinedVital> CLOSED { } # -- Pulse -- -<#Pulse> EXTENDS @<#Vital> {} AND { +<#Pulse> EXTENDS @<#Vital> CLOSED { } AND { fhir:code ["pulse"] } -<#PosturePulse> EXTENDS @<#Pulse> EXTENDS @<#PostureVital> { } -<#ReclinedPulse> EXTENDS @<#Pulse> EXTENDS @<#ReclinedVital> { } +<#PosturePulse> EXTENDS @<#Pulse> EXTENDS @<#PostureVital> CLOSED { } +<#ReclinedPulse> EXTENDS @<#Pulse> EXTENDS @<#ReclinedVital> CLOSED { } # -- postures -- <#Posture> { @@ -40,10 +41,9 @@ ABSTRACT <#ReclinedVital> @<#PostureVital> AND EXTENDS @<#Reclined> {} } } -<#Reclined> @<#Posture> AND { - fhir:component { +<#Reclined> EXTENDS @<#Posture> CLOSED { } AND { + fhir:component CLOSED { fhir:code ["posture"] ; fhir:value ["reclined"] } } - diff --git a/schemas/vitals-RESTRICTS.ttl b/schemas/vitals-RESTRICTS.ttl index af6d202c..dda2721d 100644 --- a/schemas/vitals-RESTRICTS.ttl +++ b/schemas/vitals-RESTRICTS.ttl @@ -4,8 +4,8 @@ PREFIX xsd: [] a sx:Schema ; sx:shapes ( ) . - a sx:ShapeDecl ; sx:shapeExpr [ a sx:Shape ; -sx:expression [ a sx:EachOf; + a sx:ShapeDecl ; sx:shapeExpr [ a sx:Shape ; sx:closed true ; + sx:expression [ a sx:EachOf; sx:expressions ( [ a sx:TripleConstraint ; sx:predicate ; sx:min 0; @@ -14,6 +14,7 @@ sx:expression [ a sx:EachOf; [ a sx:TripleConstraint ; sx:predicate ; sx:valueExpr [ a sx:Shape ; + sx:closed true ; sx:expression [ a sx:EachOf; sx:expressions ( [ a sx:TripleConstraint ; sx:predicate @@ -32,41 +33,39 @@ sx:expression [ a sx:EachOf; a sx:ShapeDecl ; sx:abstract true ; - sx:shapeExpr [ a sx:ShapeAnd ; - sx:shapeExprs ( - - [ a sx:Shape ] - ) + sx:shapeExpr [ a sx:Shape ; + sx:extends ( ) ; + sx:closed true ] . a sx:ShapeDecl ; sx:abstract true ; - sx:shapeExpr [ a sx:ShapeAnd ; - sx:shapeExprs ( + sx:shapeExpr [ a sx:Shape ; + sx:extends ( - [ a sx:Shape ; - sx:extends () - ] - ) + + ) ; + sx:closed true ] . a sx:ShapeDecl ; sx:abstract true ; - sx:shapeExpr [ a sx:ShapeAnd ; - sx:shapeExprs ( + sx:shapeExpr [ a sx:Shape ; + sx:extends ( - [ a sx:Shape ; - sx:extends () - ] - ) + + ) ; + sx:closed true ] . a sx:ShapeDecl ; sx:shapeExpr [ a sx:ShapeAnd ; sx:shapeExprs ( [ a sx:Shape ; - sx:extends () + sx:extends () ; + sx:closed true ] [ a sx:Shape ; + sx:closed true ; sx:expression [ a sx:EachOf; sx:expressions ( [ a sx:TripleConstraint ; sx:predicate ; @@ -96,15 +95,18 @@ sx:expression [ a sx:EachOf; ) ] . a sx:ShapeDecl ; sx:shapeExpr [ a sx:Shape ; - sx:extends ( ) ] . + sx:extends ( ) ; + sx:closed true ] . a sx:ShapeDecl ; sx:shapeExpr [ a sx:Shape ; - sx:extends ( ) ] . + sx:extends ( ) ; + sx:closed true ] . a sx:ShapeDecl ; sx:shapeExpr [ a sx:ShapeAnd ; sx:shapeExprs ( [ a sx:Shape ; - sx:extends () + sx:extends () ; + sx:closed true ] [ a sx:Shape ; sx:expression [ a sx:TripleConstraint ; @@ -117,10 +119,12 @@ sx:expression [ a sx:EachOf; ) ] . a sx:ShapeDecl ; sx:shapeExpr [ a sx:Shape ; - sx:extends ( ) ] . + sx:extends ( ) ; + sx:closed true ] . a sx:ShapeDecl ; sx:shapeExpr [ a sx:Shape ; - sx:extends ( ) ] . + sx:extends ( ) ; + sx:closed true ] . a sx:ShapeDecl ; sx:shapeExpr [ a sx:Shape ; sx:expression [ a sx:TripleConstraint ; sx:predicate ; @@ -136,11 +140,14 @@ sx:expression [ a sx:EachOf; a sx:ShapeDecl ; sx:shapeExpr [ a sx:ShapeAnd ; sx:shapeExprs ( - + [ a sx:Shape ; + sx:extends () ; + sx:closed true ] [ a sx:Shape ; sx:expression [ a sx:TripleConstraint ; - sx:predicate ; + sx:predicate ; sx:valueExpr [ a sx:Shape ; + sx:closed true ; sx:expression [ a sx:EachOf; sx:expressions ( [ a sx:TripleConstraint ; sx:predicate ;