Skip to content
Open
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
13 changes: 13 additions & 0 deletions source/activitydefinition/invariant-tests/adf-2.p1.pass.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"resourceType": "ActivityDefinition",
"status": "active",
"relatedArtifact": [
{
"type": "depends-on",
"resource": "http://x/Library/a",
"resourceReference": {
"reference": "Library/a"
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@
<key value="adf-2"/>
<severity value="warning"/>
<human value="Dependencies of an ActivityDefinition should reference a resource"/>
<expression value="type in ('depends-on' | 'part-of') implies ((resource.exists() xor resourceReference.exists()) or (artifact is canonical xor artifact is Reference))"/>
<expression value="type in ('depends-on' | 'part-of') implies (resource.exists() or resourceReference.exists())"/>
<source value="http://hl7.org/fhir/StructureDefinition/ActivityDefinition"/>
</constraint>
<constraint>
Expand Down
30 changes: 30 additions & 0 deletions source/bundle/invariant-tests/bdl-14.f2.fail.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"resourceType": "Bundle",
"type": "history",
"entry": [
{
"fullUrl": "http://x/Patient/1",
"request": {
"method": "GET",
"url": "Patient/1"
},
"response": {
"status": "200"
}
},
{
"fullUrl": "http://x/Patient/2",
"request": {
"method": "PATCH",
"url": "Patient/2"
},
"resource": {
"resourceType": "Patient",
"id": "2"
},
"response": {
"status": "200"
}
}
]
}
24 changes: 24 additions & 0 deletions source/bundle/invariant-tests/bdl-16.p2.pass.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"resourceType": "Bundle",
"type": "batch-response",
"entry": [
{
"response": {
"status": "200"
}
}
],
"issues": {
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "warning",
"code": "informational"
},
{
"severity": "warning",
"code": "informational"
}
]
}
}
34 changes: 34 additions & 0 deletions source/bundle/invariant-tests/bdl-7.p1.pass.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"resourceType": "Bundle",
"type": "collection",
"entry": [
{
"fullUrl": "http://x/Observation/123",
"resource": {
"resourceType": "Observation",
"id": "123",
"status": "final",
"code": {
"text": "t"
},
"meta": {
"versionId": "4"
}
}
},
{
"fullUrl": "http://x/Observation/12",
"resource": {
"resourceType": "Observation",
"id": "12",
"status": "final",
"code": {
"text": "t"
},
"meta": {
"versionId": "34"
}
}
}
]
}
8 changes: 4 additions & 4 deletions source/bundle/structuredefinition-Bundle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<constraint>
<key value="bdl-3b"/>
<severity value="error"/>
<human value="For collections of type history, all entries must contain request or response elements, and resources if the method is POST, PUT or PATCH"/>
<human value="For collections of type history, all entries must contain request and response elements, and resources if the method is POST, PUT or PATCH"/>
<expression value="type = 'history' implies entry.all(request.exists() and response.exists() and ((request.method in ('POST' | 'PATCH' | 'PUT')) = resource.exists()))"/>
<source value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
</constraint>
Expand All @@ -129,7 +129,7 @@
<key value="bdl-7"/>
<severity value="error"/>
<human value="FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId (except in history bundles)"/>
<expression value="(type = 'history') or entry.where(fullUrl.exists()).select(fullUrl&amp;iif(resource.meta.versionId.exists(), resource.meta.versionId, '')).isDistinct()"/>
<expression value="(type = 'history') or entry.where(fullUrl.exists()).select(fullUrl&amp;'|'&amp;iif(resource.meta.versionId.exists(), resource.meta.versionId, '')).isDistinct()"/>
<source value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
</constraint>
<constraint>
Expand Down Expand Up @@ -171,7 +171,7 @@
<key value="bdl-14"/>
<severity value="error"/>
<human value="entry.request.method PATCH not allowed for history"/>
<expression value="type = 'history' implies entry.request.method != 'PATCH'"/>
<expression value="type = 'history' implies entry.request.all(method != 'PATCH')"/>
<source value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
</constraint>
<constraint>
Expand All @@ -185,7 +185,7 @@
<key value="bdl-16"/>
<severity value="error"/>
<human value="Issue.severity for all issues within the OperationOutcome must be either 'information' or 'warning'."/>
<expression value="issues.exists() implies (issues.issue.severity = 'information' or issues.issue.severity = 'warning')"/>
<expression value="issues.exists() implies issues.issue.all(severity = 'information' or severity = 'warning')"/>
</constraint>
<constraint>
<key value="bdl-17"/>
Expand Down
16 changes: 16 additions & 0 deletions source/codesystem/invariant-tests/csd-1.f2.fail.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"resourceType": "CodeSystem",
"url": "http://example.org/cs/csd1nested",
"status": "draft",
"content": "complete",
"concept": [
{
"code": "parent",
"concept": [
{
"code": "parent"
}
]
}
]
}
34 changes: 34 additions & 0 deletions source/codesystem/invariant-tests/csd-3.f3.fail.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"resourceType": "CodeSystem",
"url": "http://example.org/cs/csd3",
"status": "draft",
"content": "complete",
"property": [
{
"code": "parent",
"type": "code"
},
{
"code": "status",
"type": "string"
}
],
"concept": [
{
"code": "root"
},
{
"code": "c1",
"property": [
{
"code": "status",
"valueString": "a"
},
{
"code": "parent",
"valueCode": "root"
}
]
}
]
}
9 changes: 9 additions & 0 deletions source/codesystem/invariant-tests/csd-6.p2.pass.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"resourceType": "CodeSystem", "url": "http://example.org/cs/csd6-multi", "status": "draft",
"caseSensitive": true, "content": "complete",
"concept": [
{ "code": "A", "property": [ { "code": "alternateCode", "valueCode": "B" } ] },
{ "code": "B", "property": [ { "code": "alternateCode", "valueCode": "A" }, { "code": "alternateCode", "valueCode": "C" } ] },
{ "code": "C", "property": [ { "code": "alternateCode", "valueCode": "B" } ] }
]
}
6 changes: 3 additions & 3 deletions source/codesystem/structuredefinition-CodeSystem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<key value="csd-1"/>
<severity value="error"/>
<human value="Within a code system definition, all the codes SHALL be unique"/>
<expression value="concept.exists() implies concept.code.combine(%resource.concept.descendants().concept.code).isDistinct()"/>
<expression value="concept.exists() implies concept.code.combine(concept.combine(concept.descendants()).concept.code).isDistinct()"/>
<source value="http://hl7.org/fhir/StructureDefinition/CodeSystem"/>
</constraint>
<constraint>
Expand All @@ -106,7 +106,7 @@
<key value="csd-3"/>
<severity value="warning"/>
<human value="If there is an implicit hierarchy, a hierarchyMeaning should be provided"/>
<expression value="concept.where(property.code = 'parent' or property.code = 'child').exists() implies hierarchyMeaning.exists()"/>
<expression value="concept.where(property.where(code = 'parent' or code = 'child').exists()).exists() implies hierarchyMeaning.exists()"/>
<source value="http://hl7.org/fhir/StructureDefinition/CodeSystem"/>
</constraint>
<constraint>
Expand Down Expand Up @@ -881,7 +881,7 @@
<key value="csd-6"/>
<severity value="error"/>
<human value="If a concept identifies an alternate, there must be a reciprocal relationship"/>
<expression value="defineVariable('sc', code).property.all((code = 'alternateCode') implies defineVariable('ac', value).%resource.repeat(concept).where(code = %ac).exists(property.where(code = 'alternateCode').value = %sc))"/>
<expression value="defineVariable('sc', code).property.all((code = 'alternateCode') implies defineVariable('ac', value).%resource.repeat(concept).where(code = %ac).exists(property.where(code = 'alternateCode' and value = %sc).exists()))"/>
<source value="http://hl7.org/fhir/StructureDefinition/CodeSystem"/>
</constraint>
</element>
Expand Down
2 changes: 1 addition & 1 deletion source/datatypes/count.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3209,7 +3209,7 @@
<Cell ss:StyleID="s106"><Data ss:Type="String">Count</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s106"><Data ss:Type="String">There SHALL be a code with a value of "1" if there is a value. If system is present, it SHALL be UCUM. If present, the value SHALL be a whole number.</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s83"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s106"><Data ss:Type="String">(code.exists() or value.empty()) and (system.empty() or system = %ucum) and (code.empty() or code = '1') and (value.empty() or value.hasValue().not() or value.toString().contains('.').not()) and (value.empty() or value.hasValue().not() or value &gt;= 0)</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s106"><Data ss:Type="String">(code.exists() or value.empty()) and (system.empty() or system = %ucum) and (code.empty() or code = '1') and (value.empty() or value.hasValue().not() or value = value.round()) and (value.empty() or value.hasValue().not() or value &gt;= 0)</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s106"><Data ss:Type="String">(f:code or not(f:value)) and (not(exists(f:system)) or (f:system/@value='http://unitsofmeasure.org' and f:code/@value='1')) and not(contains(f:value/@value, '.')) </Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
</Row>
<Row ss:AutoFitHeight="0">
Expand Down
2 changes: 1 addition & 1 deletion source/datatypes/duration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3302,7 +3302,7 @@
<Cell ss:StyleID="s84"><Data ss:Type="String">Duration</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s107"><Data ss:Type="String">There SHALL be a code if there is a value and it SHALL be an expression of time. If system is present, it SHALL be UCUM.</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s84"><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s107"><Data ss:Type="String">code.exists() implies ((system = %ucum) and value.exists())</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s107"><Data ss:Type="String">(value.exists() implies code.exists()) and (system.exists() implies system = %ucum)</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s107"><Data ss:Type="String">(f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
</Row>
<Row ss:AutoFitHeight="0">
Expand Down
4 changes: 2 additions & 2 deletions source/datatypes/elementdefinition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4699,7 +4699,7 @@
<Cell ss:StyleID="s92"><Data ss:Type="String">ElementDefinition.binding</Data></Cell>
<Cell ss:StyleID="s92"><Data ss:Type="String">ValueSet SHALL start with http:// or https:// or urn: or #</Data></Cell>
<Cell ss:StyleID="s92"/>
<Cell ss:StyleID="s92"><Data ss:Type="String">valueSet.exists() implies (valueSet.startsWith('http:') or valueSet.startsWith('https') or valueSet.startsWith('urn:') or valueSet.startsWith('#'))</Data></Cell>
<Cell ss:StyleID="s92"><Data ss:Type="String">valueSet.exists() implies (valueSet.startsWith('http:') or valueSet.startsWith('https:') or valueSet.startsWith('urn:') or valueSet.startsWith('#'))</Data></Cell>
<Cell ss:StyleID="s109"><Data ss:Type="String">(starts-with(string(f:valueSet/@value), 'http:') or starts-with(string(f:valueSet/@value), 'https:') or starts-with(string(f:valueSet/@value), 'urn:') or starts-with(string(f:valueSet/@value), 'x'))</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="60">
Expand Down Expand Up @@ -4789,7 +4789,7 @@
<Cell ss:StyleID="s92"><Data ss:Type="String">ElementDefinition.constraint</Data></Cell>
<Cell ss:StyleID="s92"><Data ss:Type="String">Constraints should have an expression or else validators will not be able to enforce them</Data></Cell>
<Cell ss:StyleID="s92"/>
<Cell ss:StyleID="s92"><Data ss:Type="String">expression.exists()</Data></Cell>
<Cell ss:StyleID="s92"><Data ss:Type="String">expression.hasValue()</Data></Cell>
<Cell ss:StyleID="s110"><Data ss:Type="String">exists(f:expression/@value)</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="30">
Expand Down
2 changes: 1 addition & 1 deletion source/datatypes/expression.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3457,7 +3457,7 @@
<Cell ss:StyleID="s84"><Data ss:Type="String">error</Data></Cell>
<Cell ss:StyleID="s84"><Data ss:Type="String">Expression</Data></Cell>
<Cell ss:StyleID="s84"><Data ss:Type="String">The name must be a valid variable name in most computer languages</Data></Cell>
<Cell ss:StyleID="s84"><Data ss:Type="String">name.hasValue() implies name.matches('[A-Za-z][A-Za-z0-9\\_]{0,63}')</Data></Cell>
<Cell ss:StyleID="s84"><Data ss:Type="String">name.hasValue() implies name.matches('^[A-Za-z][A-Za-z0-9\\_]{0,63}$')</Data></Cell>
<Cell ss:StyleID="s102"><Data ss:Type="String">exists(f:expression) or exists(f:reference)</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<constraint>
<key value="docRef-2"/>
<severity value="warning"/>
<human value="practiceSetting SHALL only be present if context is not present"/>
<human value="practiceSetting SHALL only be present if context is not an encounter"/>
<expression value="practiceSetting.empty() or context.where(resolve() is Encounter).empty()"/>
<source value="http://hl7.org/fhir/StructureDefinition/DocumentReference"/>
</constraint>
Expand Down
2 changes: 1 addition & 1 deletion source/event/event-spreadsheet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1762,7 +1762,7 @@
<Cell ss:StyleID="s94"/>
<Cell ss:StyleID="s119"><Data ss:Type="String">Event</Data></Cell>
<Cell ss:StyleID="s94"><Data ss:Type="String">reason elements can only be specified if status is NOT 'not-done'</Data></Cell>
<Cell ss:StyleID="s94"><Data ss:Type="String">status!='not-done' or (reasonCode.exists().not() and reasonReference.exists().not())</Data></Cell>
<Cell ss:StyleID="s94"><Data ss:Type="String">status!='not-done' or reason.exists().not()</Data></Cell>
<Cell ss:StyleID="s120"><Data ss:Type="String">not(f:status/@value='not-done') or not(exists(f:reasonCode) or exists(f:reasonReference))</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="62">
Expand Down
23 changes: 23 additions & 0 deletions source/imagingselection/invariant-tests/isl-10.p1.pass.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"resourceType": "ImagingSelection",
"status": "available",
"code": {
"text": "s"
},
"instance": [
{
"uid": "a",
"frameNumber": [
1,
2,
3
]
},
{
"uid": "b",
"segmentNumber": [
1
]
}
]
}
23 changes: 23 additions & 0 deletions source/imagingselection/invariant-tests/isl-11.f2.fail.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"resourceType": "ImagingSelection",
"status": "available",
"code": {
"text": "r"
},
"instance": [
{
"uid": "a",
"waveFormChannel": [
1
]
},
{
"uid": "b",
"waveFormChannel": [
1,
2,
3
]
}
]
}
32 changes: 32 additions & 0 deletions source/imagingselection/invariant-tests/isl-7.f2.fail.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"resourceType": "ImagingSelection",
"status": "available",
"code": {
"text": "r"
},
"instance": [
{
"uid": "i",
"imageRegion2D": [
{
"regionType": "polyline",
"coordinate": [
0.1,
0.2,
0.3
]
},
{
"regionType": "polyline",
"coordinate": [
0.1,
0.2,
0.3,
0.4,
0.5
]
}
]
}
]
}
Loading
Loading