Skip to content

Commit

Permalink
Merge branch 'develop' into feature/IElementSchemaResolver-public
Browse files Browse the repository at this point in the history
  • Loading branch information
marcovisserFurore authored Dec 19, 2023
2 parents df4cff7 + b583165 commit 9dc555f
Show file tree
Hide file tree
Showing 24 changed files with 918 additions and 474 deletions.
4 changes: 3 additions & 1 deletion src/Firely.Fhir.Validation.Shared/Validator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ internal OperationOutcome Validate(IScopedNode sn, string? profile = null)

var validator = new SchemaReferenceValidator(profile);
updateContext();
return validator.Validate(sn, _settings).ToOperationOutcome();
return validator.Validate(sn, _settings)
.CleanUp() // cleans up the error outcomes.
.ToOperationOutcome();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
</Content>
</ItemGroup>

<ItemGroup>
<Content Include="TestData\DocumentComposition\*.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Hl7.Fhir.R4" Version="$(FirelySdkVersion)" />
<PackageReference Include="Hl7.Fhir.Specification.Data.R4" Version="$(FirelySdkVersion)" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<StructureDefinition xmlns="http://hl7.org/fhir">
<url value="http://example.org/StructureDefinition/DocumentBundle" />
<name value="DocumentBundle" />
<status value="draft" />
<fhirVersion value="4.0.1" />
<kind value="resource" />
<abstract value="false" />
<type value="Bundle" />
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Bundle" />
<derivation value="constraint" />
<differential>
<element>
<path value="Bundle" />
<type>
<code value="Bundle" />
</type>
</element>
<element>
<path value="Bundle.type" />
<fixedCode value="document" />
</element>
<element>
<path value="Bundle.total" />
<max value="0" />
</element>
<element>
<path value="Bundle.link" />
<max value="0" />
</element>
<element>
<path value="Bundle.entry" />
<min value="1" />
</element>
</differential>
</StructureDefinition>
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<StructureDefinition xmlns="http://hl7.org/fhir">
<meta>
<lastUpdated value="2016-10-06T11:07:20.873+02:00" />
</meta>
<url value="http://example.org/StructureDefinition/DocumentComposition" />
<name value="DocumentComposition" />
<status value="draft" />
<fhirVersion value="4.0.1" />
<kind value="resource" />
<abstract value="false" />
<type value="Composition" />
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Composition" />
<derivation value="constraint" />
<differential>
<element>
<path value="Composition" />
<type>
<code value="Composition" />
</type>
</element>
<element>
<path value="Composition.type" />
<patternCodeableConcept>
<coding>
<system value="http://loinc.org"/>
<code value="18842-5"/>
</coding>
</patternCodeableConcept>
</element>
<element>
<path value="Composition.subject" />
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
<aggregation value="referenced" />
</type>
</element>
<element>
<path value="Composition.author" />
<max value="1" />
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
<aggregation value="bundled" />
</type>
</element>

<!-- Slice intro on Composition.section with some child constraints -->
<element>
<extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
<valueString value="Section" />
</extension>
<path value="Composition.section" />
<slicing>
<discriminator>
<type value="value" />
<path value="code" />
</discriminator>
<ordered value="false" />
<rules value="open" />
</slicing>
<min value="1" />
</element>
<element>
<path value="Composition.section.title" />
<min value="1" />
<maxLength value="20" />
</element>
<element>
<path value="Composition.section.code" />
<min value="1" />
<binding>
<strength value="required" />
<valueSet value="http://example.org/ValueSet/SectionTitles" />
</binding>
</element>
<element>
<path value="Composition.section.entry" />
<type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Observation" />
<aggregation value="referenced" />
<aggregation value="bundled" />
</type>
</element>
<element>
<path value="Composition.section.emptyReason" />
<max value="0" />
</element>
<element>
<path value="Composition.section.section" />
<max value="0" />
</element>

<!-- slice on Composition.section: vital signs, EXACTLY 1 -->
<element>
<path value="Composition.section" />
<sliceName value="vitalSigns" />
<min value="1" />
<max value="1" />
</element>
<element>
<path value="Composition.section.code" />
<min value="1" />
<patternCodeableConcept>
<coding>
<system value="http://loinc.org" />
<code value="8716-3" />
</coding>
</patternCodeableConcept>
</element>

<!-- slice on Composition.section: chief complaint, MAX 1 -->
<element>
<path value="Composition.section" />
<sliceName value="chiefComplaint" />
<min value="0" />
<max value="1" />
</element>
<element>
<path value="Composition.section.code" />
<min value="1" />
<patternCodeableConcept>
<coding>
<system value="http://loinc.org" />
<code value="10154-3" />
</coding>
</patternCodeableConcept>
</element>
</differential>
</StructureDefinition>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<StructureDefinition xmlns="http://hl7.org/fhir">
<meta>
<lastUpdated value="2016-10-05T18:16:38.432+02:00" />
</meta>
<text>
<status value="empty" />
<div xmlns="http://www.w3.org/1999/xhtml" />
</text>
<url value="http://example.org/StructureDefinition/HeightQuantity" />
<name value="HeightQuantity" />
<status value="draft" />
<fhirVersion value="4.0.1" />
<kind value="primitive-type" />
<abstract value="false" />
<type value="Quantity" />
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Quantity" />
<derivation value="constraint" />
<differential>
<element>
<path value="Quantity" />
<type>
<code value="Quantity" />
</type>
</element>
<element>
<path value="Quantity.value" />
<min value="1" />
<minValueDecimal value="0" />
<maxValueDecimal value="350" />
</element>
<element>
<path value="Quantity.comparator" />
<max value="0" />
</element>
<element>
<path value="Quantity.system" />
<min value="1" />
<fixedUri value="http://unitsofmeasure.org" />
</element>
<element>
<path value="Quantity.code" />
<min value="1" />
<fixedCode value="cm" />
</element>
</differential>
</StructureDefinition>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<Practitioner xmlns="http://hl7.org/fhir">
<id value="Hippocrates"/>
<meta>
<lastUpdated value="2012-05-29T23:45:32Z"/>
</meta>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
Hippocrates, Harold. SSN:
444444444
</div>
</text>
<identifier>
<type>
<coding>
<system value="http://hl7.org/fhir/v2/0203"/>
<code value="DL"/>
</coding>
</type>
<system value="http://hl7.org/fhir/sid/us-ssn"/>
<value value="444444444"/>
</identifier>
<name>
<use value="official"/>
<family value="Hippocrates"/>
<given value="Harold"/>
</name>
<telecom>
<system value="phone"/>
<value value="555-555-1003"/>
<use value="work"/>
</telecom>
<address>
<use value="home"/>
<line value="1003 Healthcare Drive"/>
</address>
<gender value="male"/>
</Practitioner>
Loading

0 comments on commit 9dc555f

Please sign in to comment.