more validation tests

This commit is contained in:
Grahame Grieve 2019-05-14 15:54:20 +10:00
parent 257603fcff
commit a8c335827f
3 changed files with 101 additions and 0 deletions

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<Practitioner xmlns="http://hl7.org/fhir">
<meta>
<profile value = "https://example.de/fhir/StructureDefinition/MyPractitioner"/>
</meta>
<active value="true"/>
<name>
<use value = "temp"/>
<family value="Meier"/>
<given value="Maria"/>
<given value="Anna"/>
<prefix value = "Dr.med."/>
</name>
<name>
<use value = "maiden"/>
<family value="Müller"/>
<given value="Maria"/>
<given value="Anna"/>
<prefix value = "Dr.med."/>
</name>
<telecom>
<system value="phone" />
<value value= "030-1234567"/>
<use value = "work"/>
</telecom>
<telecom>
<system value="email" />
<value value= "meierA@hno.de"/>
<use value = "work"/>
</telecom>
<address>
<use value = "work"/>
<type value = "physical"/>
<state value = "DE-BE"/>
<postalCode value = "10117"/>
<country value = "DE"/>
</address>
</Practitioner>

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<StructureDefinition xmlns="http://hl7.org/fhir">
<url value="https://example.de/fhir/StructureDefinition/MyPractitioner"/>
<name value="MyPractitioner"/> <status value="draft"/>
<fhirVersion value="3.0.1"/>
<kind value="resource"/>
<abstract value="false"/>
<type value="Practitioner"/>
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Practitioner"/>
<derivation value="constraint"/>
<differential>
<element id="Practitioner">
<path value="Practitioner"/>
<constraint>
<key value="oneOfficialName"/>
<severity value="error"/>
<human value="One name must be official."/>
<expression value="name.where(use=&apos;official&apos;).count()&gt;0"/>
</constraint>
</element>
<element id="Practitioner.name">
<path value="Practitioner.name"/>
<min value="1"/>
</element>
<element id="Practitioner.name.family">
<path value="Practitioner.name.family"/> <min value="1"/> </element>
<element id="Practitioner.name.given">
<path value="Practitioner.name.given"/> <min value="1"/> </element>
<element id="Practitioner.address">
<path value="Practitioner.address"/> <min value="1"/> </element>
<element id="Practitioner.address.use">
<path value="Practitioner.address.use"/> <fixedCode value="work"/> </element>
<element id="Practitioner.address.type">
<path value="Practitioner.address.type"/> <fixedCode value="physical"/> </element>
<element id="Practitioner.address.line.extension:Postfach">
<path value="Practitioner.address.line.extension"/> <sliceName value="Postfach"/> <max value="0"/> </element>
<element id="Practitioner.address.state">
<path value="Practitioner.address.state"/> <binding>
<strength value="required"/> <description value="Bundesl&#228;nder"/> </binding>
</element>
<element id="Practitioner.address.postalCode">
<path value="Practitioner.address.postalCode"/> <min value="1"/> </element>
<element id="Practitioner.address.country">
<path value="Practitioner.address.country"/> <min value="1"/> <binding>
<strength value="required"/> </binding>
</element>
<element id="Practitioner.gender">
<path value="Practitioner.gender"/> <max value="0"/> </element>
<element id="Practitioner.birthDate">
<path value="Practitioner.birthDate"/> <max value="0"/> </element>
<element id="Practitioner.photo">
<path value="Practitioner.photo"/> <max value="0"/> </element>
<element id="Practitioner.communication">
<path value="Practitioner.communication"/> <max value="0"/> </element>
</differential>
</StructureDefinition>

View File

@ -482,6 +482,13 @@
"observation-cholesterol-bad-wrongcode.xml" : {
"errorCount": 2,
"errors": ["ERROR: Observation.code.coding.code: Value is '13457-7' but must be '35200-5'","ERROR: Observation.code.coding.display: Value is 'Cholesterol in LDL [Mass/volume] in Serum or Plasma by calculation' but must be 'Cholesterol [Moles/?volume] in Serum or Plasma'"]
},
"invariant.example.xml" : {
"errorCount": 0,
"profile" : {
"source" : "invariant.profile.xml",
"errorCount": 1
}
}
}
}