Skip to content
Merged
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
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<version>2.25.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>dev.dsf</groupId>
<artifactId>dsf-fhir-validation</artifactId>
Expand All @@ -91,7 +91,7 @@
</includes>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -216,7 +216,7 @@
</executions>
</plugin>
</plugins>

<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
Expand Down
9 changes: 7 additions & 2 deletions src/main/resources/fhir/CodeSystem/dsf-hello-world.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@
<concept>
<code value="questionnaire-response-reference" />
<display value="QuestionnaireResponse Reference" />
<definition value="QuestionnaireResponse reference onput value" />
<definition value="QuestionnaireResponse reference input value" />
</concept>
</CodeSystem>
<concept>
<code value="quantity-example" />
<display value="Quantity Example" />
<definition value="Example quantity input value" />
</concept>
</CodeSystem>
12 changes: 12 additions & 0 deletions src/main/resources/fhir/Questionnaire/dsf-hello-user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,16 @@
<text value="Do you approve the release of the data-set?"/>
<required value="false"/>
</item>
<item>
<linkId value="choice-example"/>
<type value="choice"/>
<text value="Add a coding to test the choice type"/>
<required value="false"/>
</item>
<item>
<linkId value="quantity-example"/>
<type value="quantity"/>
<text value="Add a quantity to test the quantity type"/>
<required value="false"/>
</item>
</Questionnaire>
Original file line number Diff line number Diff line change
Expand Up @@ -545,5 +545,40 @@
<element id="Task.input:coding-example.value[x].code">
<path value="Task.input.value[x].code" />
</element>
<element id="Task.input:quantity-example">
<path value="Task.input" />
<sliceName value="quantity-example" />
<min value="0" />
<max value="1" />
</element>
<element id="Task.input:quantity-example.type">
<path value="Task.input.type" />
<binding>
<strength value="required" />
<valueSet value="http://dsf.dev/fhir/ValueSet/hello-world|#{version}" />
</binding>
</element>
<element id="Task.input:quantity-example.type.coding">
<path value="Task.input.type.coding" />
<min value="1" />
<max value="1" />
</element>
<element id="Task.input:quantity-example.system">
<path value="Task.input.type.coding.system" />
<min value="1" />
<fixedUri value="http://dsf.dev/fhir/CodeSystem/hello-world" />
</element>
<element id="Task.input:quantity-example.type.coding.code">
<path value="Task.input.type.coding.code" />
<min value="1" />
<fixedCode value="quantity-example" />
</element>
<element id="Task.input:quantity-example.value[x]">
<path value="Task.input.value[x]" />
<min value="1" />
<type>
<code value="Quantity" />
</type>
</element>
</differential>
</StructureDefinition>
15 changes: 15 additions & 0 deletions src/main/resources/fhir/Task/dsf-task-hello-world.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,19 @@
<code value="coding-example" />
</valueCoding>
</input>
<input>
<type>
<coding>
<system value="http://dsf.dev/fhir/CodeSystem/hello-world" />
<code value="quantity-example" />
</coding>
</type>
<valueQuantity>
<comparator value="&lt;=" />
<value value="10" />
<unit value="m" />
<system value="http://unitsofmeasure.org" />
<code value="m" />
</valueQuantity>
</input>
</Task>
6 changes: 6 additions & 0 deletions src/test/java/dev/dsf/fhir/profile/TaskProfileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.hl7.fhir.r4.model.Identifier;
import org.hl7.fhir.r4.model.InstantType;
import org.hl7.fhir.r4.model.IntegerType;
import org.hl7.fhir.r4.model.Quantity;
import org.hl7.fhir.r4.model.Reference;
import org.hl7.fhir.r4.model.ResourceType;
import org.hl7.fhir.r4.model.StringType;
Expand Down Expand Up @@ -102,6 +103,11 @@ public void testMaximalTaskHelloWorldValid()
new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world").setCode("coding-example"))
.getType().addCoding(
new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world").setCode("coding-example"));
task.addInput()
.setValue(new Quantity().setSystem("http://unitsofmeasure.org").setCode("m").setUnit("m").setValue(1)
.setComparator(Quantity.QuantityComparator.LESS_OR_EQUAL))
.getType().addCoding(new Coding().setSystem("http://dsf.dev/fhir/CodeSystem/hello-world")
.setCode("quantity-example"));

ValidationResult result = resourceValidator.validate(task);
ValidationSupportRule.logValidationMessages(logger, result);
Expand Down
Loading