diff --git a/master-branch-pipeline.yml b/master-branch-pipeline.yml
index 475fffa5b..92211e3c5 100644
--- a/master-branch-pipeline.yml
+++ b/master-branch-pipeline.yml
@@ -58,6 +58,11 @@ steps:
$(PGP_KEYNAME)$(PGP_PASSPHRASE)
+
+ github-releases
+ markiantorno
+ $(GIT_PACKAGE_PAT)
+
diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml
index 50215f666..d1d3cd7f8 100644
--- a/org.hl7.fhir.convertors/pom.xml
+++ b/org.hl7.fhir.convertors/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhirorg.hl7.fhir.core
- 5.1.18-SNAPSHOT
+ 5.1.21-SNAPSHOT../pom.xml
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_40.java
index 4db50132b..d4628df6e 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_40.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_40.java
@@ -2479,8 +2479,6 @@ public class VersionConvertor_10_40 {
return convertId((org.hl7.fhir.dstu2.model.IdType) src);
if (src instanceof org.hl7.fhir.dstu2.model.InstantType)
return convertInstant((org.hl7.fhir.dstu2.model.InstantType) src);
- if (src instanceof org.hl7.fhir.dstu2.model.IntegerType)
- return convertInteger((org.hl7.fhir.dstu2.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu2.model.MarkdownType)
return convertMarkdown((org.hl7.fhir.dstu2.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.dstu2.model.OidType)
@@ -2493,6 +2491,8 @@ public class VersionConvertor_10_40 {
return convertTime((org.hl7.fhir.dstu2.model.TimeType) src);
if (src instanceof org.hl7.fhir.dstu2.model.UnsignedIntType)
return convertUnsignedInt((org.hl7.fhir.dstu2.model.UnsignedIntType) src);
+ if (src instanceof org.hl7.fhir.dstu2.model.IntegerType)
+ return convertInteger((org.hl7.fhir.dstu2.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu2.model.UriType)
return convertUri((org.hl7.fhir.dstu2.model.UriType) src);
if (src instanceof org.hl7.fhir.dstu2.model.UuidType)
@@ -2569,8 +2569,6 @@ public class VersionConvertor_10_40 {
return convertId((org.hl7.fhir.r4.model.IdType) src);
if (src instanceof org.hl7.fhir.r4.model.InstantType)
return convertInstant((org.hl7.fhir.r4.model.InstantType) src);
- if (src instanceof org.hl7.fhir.r4.model.IntegerType)
- return convertInteger((org.hl7.fhir.r4.model.IntegerType) src);
if (src instanceof org.hl7.fhir.r4.model.MarkdownType)
return convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.r4.model.OidType)
@@ -2583,6 +2581,8 @@ public class VersionConvertor_10_40 {
return convertTime((org.hl7.fhir.r4.model.TimeType) src);
if (src instanceof org.hl7.fhir.r4.model.UnsignedIntType)
return convertUnsignedInt((org.hl7.fhir.r4.model.UnsignedIntType) src);
+ if (src instanceof org.hl7.fhir.r4.model.IntegerType)
+ return convertInteger((org.hl7.fhir.r4.model.IntegerType) src);
if (src instanceof org.hl7.fhir.r4.model.UriType)
return convertUri((org.hl7.fhir.r4.model.UriType) src);
if (src instanceof org.hl7.fhir.r4.model.UuidType)
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_50.java
index 3903d68bf..16f419902 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_50.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_10_50.java
@@ -2503,8 +2503,6 @@ public class VersionConvertor_10_50 {
return convertId((org.hl7.fhir.dstu2.model.IdType) src);
if (src instanceof org.hl7.fhir.dstu2.model.InstantType)
return convertInstant((org.hl7.fhir.dstu2.model.InstantType) src);
- if (src instanceof org.hl7.fhir.dstu2.model.IntegerType)
- return convertInteger((org.hl7.fhir.dstu2.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu2.model.MarkdownType)
return convertMarkdown((org.hl7.fhir.dstu2.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.dstu2.model.OidType)
@@ -2517,6 +2515,8 @@ public class VersionConvertor_10_50 {
return convertTime((org.hl7.fhir.dstu2.model.TimeType) src);
if (src instanceof org.hl7.fhir.dstu2.model.UnsignedIntType)
return convertUnsignedInt((org.hl7.fhir.dstu2.model.UnsignedIntType) src);
+ if (src instanceof org.hl7.fhir.dstu2.model.IntegerType)
+ return convertInteger((org.hl7.fhir.dstu2.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu2.model.UriType)
return convertUri((org.hl7.fhir.dstu2.model.UriType) src);
if (src instanceof org.hl7.fhir.dstu2.model.UuidType)
@@ -2593,8 +2593,6 @@ public class VersionConvertor_10_50 {
return convertId((org.hl7.fhir.r5.model.IdType) src);
if (src instanceof org.hl7.fhir.r5.model.InstantType)
return convertInstant((org.hl7.fhir.r5.model.InstantType) src);
- if (src instanceof org.hl7.fhir.r5.model.IntegerType)
- return convertInteger((org.hl7.fhir.r5.model.IntegerType) src);
if (src instanceof org.hl7.fhir.r5.model.MarkdownType)
return convertMarkdown((org.hl7.fhir.r5.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.r5.model.OidType)
@@ -2607,6 +2605,8 @@ public class VersionConvertor_10_50 {
return convertTime((org.hl7.fhir.r5.model.TimeType) src);
if (src instanceof org.hl7.fhir.r5.model.UnsignedIntType)
return convertUnsignedInt((org.hl7.fhir.r5.model.UnsignedIntType) src);
+ if (src instanceof org.hl7.fhir.r5.model.IntegerType)
+ return convertInteger((org.hl7.fhir.r5.model.IntegerType) src);
if (src instanceof org.hl7.fhir.r5.model.UriType)
return convertUri((org.hl7.fhir.r5.model.UriType) src);
if (src instanceof org.hl7.fhir.r5.model.UuidType)
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_30.java
index 02f5bf909..a6170f876 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_30.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_30.java
@@ -2454,8 +2454,6 @@ public class VersionConvertor_14_30 {
return convertId((org.hl7.fhir.dstu2016may.model.IdType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.InstantType)
return convertInstant((org.hl7.fhir.dstu2016may.model.InstantType) src);
- if (src instanceof org.hl7.fhir.dstu2016may.model.IntegerType)
- return convertInteger((org.hl7.fhir.dstu2016may.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.MarkdownType)
return convertMarkdown((org.hl7.fhir.dstu2016may.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.OidType)
@@ -2468,6 +2466,8 @@ public class VersionConvertor_14_30 {
return convertTime((org.hl7.fhir.dstu2016may.model.TimeType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.UnsignedIntType)
return convertUnsignedInt((org.hl7.fhir.dstu2016may.model.UnsignedIntType) src);
+ if (src instanceof org.hl7.fhir.dstu2016may.model.IntegerType)
+ return convertInteger((org.hl7.fhir.dstu2016may.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.UriType)
return convertUri((org.hl7.fhir.dstu2016may.model.UriType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.UuidType)
@@ -2544,8 +2544,6 @@ public class VersionConvertor_14_30 {
return convertId((org.hl7.fhir.dstu3.model.IdType) src);
if (src instanceof org.hl7.fhir.dstu3.model.InstantType)
return convertInstant((org.hl7.fhir.dstu3.model.InstantType) src);
- if (src instanceof org.hl7.fhir.dstu3.model.IntegerType)
- return convertInteger((org.hl7.fhir.dstu3.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu3.model.MarkdownType)
return convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.dstu3.model.OidType)
@@ -2558,6 +2556,8 @@ public class VersionConvertor_14_30 {
return convertTime((org.hl7.fhir.dstu3.model.TimeType) src);
if (src instanceof org.hl7.fhir.dstu3.model.UnsignedIntType)
return convertUnsignedInt((org.hl7.fhir.dstu3.model.UnsignedIntType) src);
+ if (src instanceof org.hl7.fhir.dstu3.model.IntegerType)
+ return convertInteger((org.hl7.fhir.dstu3.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu3.model.UriType)
return convertUri((org.hl7.fhir.dstu3.model.UriType) src);
if (src instanceof org.hl7.fhir.dstu3.model.UuidType)
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_40.java
index e90801926..96b92e16c 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_40.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_40.java
@@ -2607,8 +2607,6 @@ public class VersionConvertor_14_40 {
return convertId((org.hl7.fhir.dstu2016may.model.IdType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.InstantType)
return convertInstant((org.hl7.fhir.dstu2016may.model.InstantType) src);
- if (src instanceof org.hl7.fhir.dstu2016may.model.IntegerType)
- return convertInteger((org.hl7.fhir.dstu2016may.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.MarkdownType)
return convertMarkdown((org.hl7.fhir.dstu2016may.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.OidType)
@@ -2621,6 +2619,8 @@ public class VersionConvertor_14_40 {
return convertTime((org.hl7.fhir.dstu2016may.model.TimeType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.UnsignedIntType)
return convertUnsignedInt((org.hl7.fhir.dstu2016may.model.UnsignedIntType) src);
+ if (src instanceof org.hl7.fhir.dstu2016may.model.IntegerType)
+ return convertInteger((org.hl7.fhir.dstu2016may.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.UriType)
return convertUri((org.hl7.fhir.dstu2016may.model.UriType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.UuidType)
@@ -2695,8 +2695,6 @@ public class VersionConvertor_14_40 {
return convertId((org.hl7.fhir.r4.model.IdType) src);
if (src instanceof org.hl7.fhir.r4.model.InstantType)
return convertInstant((org.hl7.fhir.r4.model.InstantType) src);
- if (src instanceof org.hl7.fhir.r4.model.IntegerType)
- return convertInteger((org.hl7.fhir.r4.model.IntegerType) src);
if (src instanceof org.hl7.fhir.r4.model.MarkdownType)
return convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.r4.model.OidType)
@@ -2709,6 +2707,8 @@ public class VersionConvertor_14_40 {
return convertTime((org.hl7.fhir.r4.model.TimeType) src);
if (src instanceof org.hl7.fhir.r4.model.UnsignedIntType)
return convertUnsignedInt((org.hl7.fhir.r4.model.UnsignedIntType) src);
+ if (src instanceof org.hl7.fhir.r4.model.IntegerType)
+ return convertInteger((org.hl7.fhir.r4.model.IntegerType) src);
if (src instanceof org.hl7.fhir.r4.model.UriType)
return convertUri((org.hl7.fhir.r4.model.UriType) src);
if (src instanceof org.hl7.fhir.r4.model.UuidType)
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_50.java
index 878f56233..d0ad44110 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_50.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_14_50.java
@@ -2614,8 +2614,6 @@ public class VersionConvertor_14_50 {
return convertId((org.hl7.fhir.dstu2016may.model.IdType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.InstantType)
return convertInstant((org.hl7.fhir.dstu2016may.model.InstantType) src);
- if (src instanceof org.hl7.fhir.dstu2016may.model.IntegerType)
- return convertInteger((org.hl7.fhir.dstu2016may.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.MarkdownType)
return convertMarkdown((org.hl7.fhir.dstu2016may.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.OidType)
@@ -2628,6 +2626,8 @@ public class VersionConvertor_14_50 {
return convertTime((org.hl7.fhir.dstu2016may.model.TimeType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.UnsignedIntType)
return convertUnsignedInt((org.hl7.fhir.dstu2016may.model.UnsignedIntType) src);
+ if (src instanceof org.hl7.fhir.dstu2016may.model.IntegerType)
+ return convertInteger((org.hl7.fhir.dstu2016may.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.UriType)
return convertUri((org.hl7.fhir.dstu2016may.model.UriType) src);
if (src instanceof org.hl7.fhir.dstu2016may.model.UuidType)
@@ -2702,8 +2702,6 @@ public class VersionConvertor_14_50 {
return convertId((org.hl7.fhir.r5.model.IdType) src);
if (src instanceof org.hl7.fhir.r5.model.InstantType)
return convertInstant((org.hl7.fhir.r5.model.InstantType) src);
- if (src instanceof org.hl7.fhir.r5.model.IntegerType)
- return convertInteger((org.hl7.fhir.r5.model.IntegerType) src);
if (src instanceof org.hl7.fhir.r5.model.MarkdownType)
return convertMarkdown((org.hl7.fhir.r5.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.r5.model.OidType)
@@ -2716,6 +2714,8 @@ public class VersionConvertor_14_50 {
return convertTime((org.hl7.fhir.r5.model.TimeType) src);
if (src instanceof org.hl7.fhir.r5.model.UnsignedIntType)
return convertUnsignedInt((org.hl7.fhir.r5.model.UnsignedIntType) src);
+ if (src instanceof org.hl7.fhir.r5.model.IntegerType)
+ return convertInteger((org.hl7.fhir.r5.model.IntegerType) src);
if (src instanceof org.hl7.fhir.r5.model.UriType)
return convertUri((org.hl7.fhir.r5.model.UriType) src);
if (src instanceof org.hl7.fhir.r5.model.UuidType)
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_50.java
index fedf56bb1..7097f9fdd 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_50.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_50.java
@@ -3498,20 +3498,20 @@ public class VersionConvertor_30_50 {
return convertId((org.hl7.fhir.dstu3.model.IdType) src);
if (src instanceof org.hl7.fhir.dstu3.model.InstantType)
return convertInstant((org.hl7.fhir.dstu3.model.InstantType) src);
+ if (src instanceof org.hl7.fhir.dstu3.model.PositiveIntType)
+ return convertPositiveInt((org.hl7.fhir.dstu3.model.PositiveIntType) src);
+ if (src instanceof org.hl7.fhir.dstu3.model.UnsignedIntType)
+ return convertUnsignedInt((org.hl7.fhir.dstu3.model.UnsignedIntType) src);
if (src instanceof org.hl7.fhir.dstu3.model.IntegerType)
return convertInteger((org.hl7.fhir.dstu3.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu3.model.MarkdownType)
return convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.dstu3.model.OidType)
return convertOid((org.hl7.fhir.dstu3.model.OidType) src);
- if (src instanceof org.hl7.fhir.dstu3.model.PositiveIntType)
- return convertPositiveInt((org.hl7.fhir.dstu3.model.PositiveIntType) src);
if (src instanceof org.hl7.fhir.dstu3.model.StringType)
return convertString((org.hl7.fhir.dstu3.model.StringType) src);
if (src instanceof org.hl7.fhir.dstu3.model.TimeType)
return convertTime((org.hl7.fhir.dstu3.model.TimeType) src);
- if (src instanceof org.hl7.fhir.dstu3.model.UnsignedIntType)
- return convertUnsignedInt((org.hl7.fhir.dstu3.model.UnsignedIntType) src);
if (src instanceof org.hl7.fhir.dstu3.model.UriType)
return convertUri((org.hl7.fhir.dstu3.model.UriType) src);
if (src instanceof org.hl7.fhir.dstu3.model.UuidType)
@@ -3604,22 +3604,22 @@ public class VersionConvertor_30_50 {
return convertId((org.hl7.fhir.r5.model.IdType) src);
if (src instanceof org.hl7.fhir.r5.model.InstantType)
return convertInstant((org.hl7.fhir.r5.model.InstantType) src);
- if (src instanceof org.hl7.fhir.r5.model.IntegerType)
- return convertInteger((org.hl7.fhir.r5.model.IntegerType) src);
+ if (src instanceof org.hl7.fhir.r5.model.PositiveIntType)
+ return convertPositiveInt((org.hl7.fhir.r5.model.PositiveIntType) src);
+ if (src instanceof org.hl7.fhir.r5.model.UnsignedIntType)
+ return convertUnsignedInt((org.hl7.fhir.r5.model.UnsignedIntType) src);
if (src instanceof org.hl7.fhir.r5.model.Integer64Type)
return convertInteger64((org.hl7.fhir.r5.model.Integer64Type) src);
+ if (src instanceof org.hl7.fhir.r5.model.IntegerType)
+ return convertInteger((org.hl7.fhir.r5.model.IntegerType) src);
if (src instanceof org.hl7.fhir.r5.model.MarkdownType)
return convertMarkdown((org.hl7.fhir.r5.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.r5.model.OidType)
return convertOid((org.hl7.fhir.r5.model.OidType) src);
- if (src instanceof org.hl7.fhir.r5.model.PositiveIntType)
- return convertPositiveInt((org.hl7.fhir.r5.model.PositiveIntType) src);
if (src instanceof org.hl7.fhir.r5.model.StringType)
return convertString((org.hl7.fhir.r5.model.StringType) src);
if (src instanceof org.hl7.fhir.r5.model.TimeType)
return convertTime((org.hl7.fhir.r5.model.TimeType) src);
- if (src instanceof org.hl7.fhir.r5.model.UnsignedIntType)
- return convertUnsignedInt((org.hl7.fhir.r5.model.UnsignedIntType) src);
if (src instanceof org.hl7.fhir.r5.model.UriType)
return convertUri((org.hl7.fhir.r5.model.UriType) src);
if (src instanceof org.hl7.fhir.r5.model.UuidType)
diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml
index f1632c8b0..50bf1db0d 100644
--- a/org.hl7.fhir.dstu2/pom.xml
+++ b/org.hl7.fhir.dstu2/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhirorg.hl7.fhir.core
- 5.1.18-SNAPSHOT
+ 5.1.21-SNAPSHOT../pom.xml
diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml
index bba455752..cb520f546 100644
--- a/org.hl7.fhir.dstu2016may/pom.xml
+++ b/org.hl7.fhir.dstu2016may/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhirorg.hl7.fhir.core
- 5.1.18-SNAPSHOT
+ 5.1.21-SNAPSHOT../pom.xml
diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml
index 77155d089..da94f2fe6 100644
--- a/org.hl7.fhir.dstu3/pom.xml
+++ b/org.hl7.fhir.dstu3/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhirorg.hl7.fhir.core
- 5.1.18-SNAPSHOT
+ 5.1.21-SNAPSHOT../pom.xml
diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml
index fde67a543..dde7ecaa6 100644
--- a/org.hl7.fhir.r4/pom.xml
+++ b/org.hl7.fhir.r4/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhirorg.hl7.fhir.core
- 5.1.18-SNAPSHOT
+ 5.1.21-SNAPSHOT../pom.xml
diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml
index 1bf00257b..99fc53216 100644
--- a/org.hl7.fhir.r5/pom.xml
+++ b/org.hl7.fhir.r5/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhirorg.hl7.fhir.core
- 5.1.18-SNAPSHOT
+ 5.1.21-SNAPSHOT../pom.xml
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java
index fbb99dd77..bc59a1e1f 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java
@@ -111,6 +111,7 @@ import org.hl7.fhir.r5.utils.XVerExtensionManager.XVerExtensionStatus;
import org.hl7.fhir.r5.utils.formats.CSVWriter;
import org.hl7.fhir.r5.utils.formats.XLSXWriter;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
+import org.hl7.fhir.utilities.MarkDownProcessor;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.i18n.I18nConstants;
@@ -362,9 +363,28 @@ public class ProfileUtilities extends TranslatingUtilities {
public List getChildMap(StructureDefinition profile, ElementDefinition element) throws DefinitionException {
- if (element.getContentReference()!=null) {
- for (ElementDefinition e : profile.getSnapshot().getElement()) {
- if (element.getContentReference().equals("#"+e.getId()))
+ if (element.getContentReference() != null) {
+ List list = null;
+ String id = null;
+ if (element.getContentReference().startsWith("#")) {
+ // internal reference
+ id = element.getContentReference().substring(1);
+ list = profile.getSnapshot().getElement();
+ } else if (element.getContentReference().contains("#")) {
+ // external reference
+ String ref = element.getContentReference();
+ StructureDefinition sd = context.fetchResource(StructureDefinition.class, ref.substring(0, ref.indexOf("#")));
+ if (sd == null) {
+ throw new DefinitionException("unable to process contentReference '"+element.getContentReference()+"' on element '"+element.getId()+"'");
+ }
+ list = sd.getSnapshot().getElement();
+ id = ref.substring(ref.indexOf("#")+1);
+ } else {
+ throw new DefinitionException("unable to process contentReference '"+element.getContentReference()+"' on element '"+element.getId()+"'");
+ }
+
+ for (ElementDefinition e : list) {
+ if (id.equals(e.getId()))
return getChildMap(profile, e);
}
throw new DefinitionException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_NAME_REFERENCE__AT_PATH_, element.getContentReference(), element.getPath()));
@@ -3155,6 +3175,10 @@ public class ProfileUtilities extends TranslatingUtilities {
c.getPieces().add(checkForNoChange(ved.getBinding(), gen.new Piece(corePath+"terminologies.html#"+ved.getBinding().getStrength().toCode(), egt(ved.getBinding().getStrengthElement()), ved.getBinding().getStrength().getDefinition())));
c.getPieces().add(gen.new Piece(null, ")", null));
}
+ if (ved.getBinding().hasDescription() && MarkDownProcessor.isSimpleMarkdown(ved.getBinding().getDescription())) {
+ c.getPieces().add(gen.new Piece(null, ": ", null));
+ c.addMarkdownNoPara(ved.getBinding().getDescription());
+ }
}
c.addPiece(gen.new Piece("br")).addPiece(gen.new Piece(null, describeExtensionContext(ed), null));
r.getCells().add(c);
@@ -3195,12 +3219,17 @@ public class ProfileUtilities extends TranslatingUtilities {
Cell c = gen.new Cell();
r.getCells().add(c);
if (e.hasContentReference()) {
- ElementDefinition ed = getElementByName(profile.getSnapshot().getElement(), e.getContentReference());
+ ElementInStructure ed = getElementByName(profile.getSnapshot().getElement(), e.getContentReference(), profile);
if (ed == null)
c.getPieces().add(gen.new Piece(null, translate("sd.table", "Unknown reference to %s", e.getContentReference()), null));
else {
- c.getPieces().add(gen.new Piece(null, translate("sd.table", "See ", ed.getPath()), null));
- c.getPieces().add(gen.new Piece("#"+ed.getPath(), tail(ed.getPath()), ed.getPath()));
+ if (ed.getSource() == profile) {
+ c.getPieces().add(gen.new Piece(null, translate("sd.table", "See ", ed.getElement().getPath()), null));
+ c.getPieces().add(gen.new Piece("#"+ed.getElement().getPath(), tail(ed.getElement().getPath()), ed.getElement().getPath()));
+ } else {
+ c.getPieces().add(gen.new Piece(null, translate("sd.table", "See ", ed.getElement().getPath()), null));
+ c.getPieces().add(gen.new Piece(ed.getSource().getUserString("path")+"#"+ed.getElement().getPath(), tail(ed.getElement().getPath())+" ("+ed.getSource().getType()+")", ed.getElement().getPath()));
+ }
}
return c;
}
@@ -3385,16 +3414,46 @@ public class ProfileUtilities extends TranslatingUtilities {
}
- private ElementDefinition getElementByName(List elements, String contentReference) {
+ private class ElementInStructure {
+
+ private StructureDefinition source;
+ private ElementDefinition element;
+
+ public ElementInStructure(StructureDefinition source, ElementDefinition ed) {
+ this.source = source;
+ this.element = ed;
+ }
+
+ public StructureDefinition getSource() {
+ return source;
+ }
+
+ public ElementDefinition getElement() {
+ return element;
+ }
+
+ }
+ private ElementInStructure getElementByName(List elements, String contentReference, StructureDefinition source) {
+ if (contentReference.contains("#")) {
+ String url = contentReference.substring(0, contentReference.indexOf("#"));
+ contentReference = contentReference.substring(contentReference.indexOf("#"));
+ if (!url.equals(source.getUrl())) {
+ source = context.fetchResource(StructureDefinition.class, url);
+ if (source == null) {
+ throw new FHIRException("Unable to resolve StructureDefinition "+url+" resolving content reference "+contentReference);
+ }
+ elements = source.getSnapshot().getElement();
+ }
+ }
for (ElementDefinition ed : elements) {
if (("#"+ed.getPath()).equals(contentReference)) {
- return ed;
+ return new ElementInStructure(source, ed);
}
if (("#"+ed.getId()).equals(contentReference)) {
- return ed;
+ return new ElementInStructure(source, ed);
}
}
- throw new Error("getElementByName: can't find "+contentReference+"in "+elements.toString());
+ throw new Error("getElementByName: can't find "+contentReference+" in "+elements.toString()+" from "+source.getUrl());
// return null;
}
@@ -4282,6 +4341,10 @@ public class ProfileUtilities extends TranslatingUtilities {
c.getPieces().add(checkForNoChange(binding, gen.new Piece(corePath+"extension-elementdefinition-minvalueset.html", translate("sd.table", "Min Binding")+": ", "Min Value Set Extension").addStyle("font-weight:bold")));
c.getPieces().add(checkForNoChange(binding, gen.new Piece(br.url == null ? null : Utilities.isAbsoluteUrl(br.url) || !pkp.prependLinks() ? br.url : corePath+br.url, br.display, null)));
}
+ if (binding.hasDescription() && MarkDownProcessor.isSimpleMarkdown(binding.getDescription())) {
+ c.getPieces().add(gen.new Piece(null, ": ", null));
+ c.addMarkdownNoPara(binding.getDescription());
+ }
}
for (ElementDefinitionConstraintComponent inv : definition.getConstraint()) {
if (!inv.hasSource() || profile == null || inv.getSource().equals(profile.getUrl()) || allInvariants) {
@@ -4300,7 +4363,6 @@ public class ProfileUtilities extends TranslatingUtilities {
// don't show this, this it's important: c.getPieces().add(gen.new Piece(null, "This repeating element has no defined order", null));
}
}
-
if (definition.hasFixed()) {
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, translate("sd.table", "Fixed Value")+": ", null).addStyle("font-weight:bold")));
@@ -4548,11 +4610,16 @@ public class ProfileUtilities extends TranslatingUtilities {
if (used) {
if (definition.hasContentReference()) {
- ElementDefinition ed = getElementByName(profile.getSnapshot().getElement(), definition.getContentReference());
+ ElementInStructure ed = getElementByName(profile.getSnapshot().getElement(), definition.getContentReference(), profile);
if (ed == null)
c.getPieces().add(gen.new Piece(null, "Unknown reference to "+definition.getContentReference(), null));
- else
- c.getPieces().add(gen.new Piece("#"+ed.getPath(), "See "+ed.getPath(), null));
+ else {
+ if (ed.getSource() == profile) {
+ c.getPieces().add(gen.new Piece("#"+ed.getElement().getPath(), "See "+ed.getElement().getPath(), null));
+ } else {
+ c.getPieces().add(gen.new Piece(ed.getSource().getUserData("path")+"#"+ed.getElement().getPath(), "See "+ed.getSource().getType()+"."+ed.getElement().getPath(), null));
+ }
+ }
}
if (definition.getPath().endsWith("url") && definition.hasFixed()) {
c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, "\""+buildJson(definition.getFixed())+"\"", null).addStyle("color: darkgreen")));
@@ -4594,6 +4661,10 @@ public class ProfileUtilities extends TranslatingUtilities {
c.getPieces().add(checkForNoChange(binding, gen.new Piece(null, " (", null)));
c.getPieces().add(checkForNoChange(binding, gen.new Piece(corePath+"terminologies.html#"+binding.getStrength().toCode(), binding.getStrength().toCode(), binding.getStrength().getDefinition()))); c.getPieces().add(gen.new Piece(null, ")", null));
}
+ if (binding.hasDescription() && MarkDownProcessor.isSimpleMarkdown(binding.getDescription())) {
+ c.getPieces().add(gen.new Piece(null, ": ", null));
+ c.addMarkdownNoPara(binding.getDescription());
+ }
}
for (ElementDefinitionConstraintComponent inv : definition.getConstraint()) {
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
@@ -5338,12 +5409,12 @@ public class ProfileUtilities extends TranslatingUtilities {
if (!checkFirst || !sd.hasDifferential() || hasMissingIds(sd.getDifferential().getElement())) {
if (!sd.hasDifferential())
sd.setDifferential(new StructureDefinitionDifferentialComponent());
- generateIds(sd.getDifferential().getElement(), sd.getUrl());
+ generateIds(sd.getDifferential().getElement(), sd.getUrl(), sd.getType());
}
if (!checkFirst || !sd.hasSnapshot() || hasMissingIds(sd.getSnapshot().getElement())) {
if (!sd.hasSnapshot())
sd.setSnapshot(new StructureDefinitionSnapshotComponent());
- generateIds(sd.getSnapshot().getElement(), sd.getUrl());
+ generateIds(sd.getSnapshot().getElement(), sd.getUrl(), sd.getType());
}
}
@@ -5388,11 +5459,10 @@ public class ProfileUtilities extends TranslatingUtilities {
}
- private void generateIds(List list, String name) throws DefinitionException {
+ private void generateIds(List list, String name, String type) throws DefinitionException {
if (list.isEmpty())
return;
- Map idMap = new HashMap();
Map idList = new HashMap();
SliceList sliceInfo = new SliceList();
@@ -5420,7 +5490,6 @@ public class ProfileUtilities extends TranslatingUtilities {
}
}
String bs = b.toString();
- idMap.put(ed.hasId() ? ed.getId() : ed.getPath(), bs);
ed.setId(bs);
if (idList.containsKey(bs)) {
if (exception || messages == null) {
@@ -5429,11 +5498,9 @@ public class ProfileUtilities extends TranslatingUtilities {
messages.add(new ValidationMessage(Source.ProfileValidator, ValidationMessage.IssueType.BUSINESSRULE, name+"."+bs, "Duplicate Element id "+bs, ValidationMessage.IssueSeverity.ERROR));
}
idList.put(bs, ed.getPath());
- if (ed.hasContentReference()) {
- String s = ed.getContentReference().substring(1);
- if (idMap.containsKey(s))
- ed.setContentReference("#"+idMap.get(s));
-
+ if (ed.hasContentReference() && ed.getContentReference().startsWith("#")) {
+ String s = ed.getContentReference();
+ ed.setContentReference("http://hl7.org/fhir/StructureDefinition/"+type+s);
}
}
// second path - fix up any broken path based id references
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Element.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Element.java
index 1b14a2dea..73406ba26 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Element.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Element.java
@@ -75,15 +75,15 @@ public class Element extends Base {
CONTAINED, BUNDLE_ENTRY, BUNDLE_OUTCOME, PARAMETER;
public static SpecialElement fromProperty(Property property) {
- if (property.getStructure().getIdElement().getIdPart().equals("Parameters"))
+ if (property.getStructure().getType().equals("Parameters"))
return PARAMETER;
- if (property.getStructure().getIdElement().getIdPart().equals("Bundle") && property.getName().equals("resource"))
+ if (property.getStructure().getType().equals("Bundle") && property.getName().equals("resource"))
return BUNDLE_ENTRY;
- if (property.getStructure().getIdElement().getIdPart().equals("Bundle") && property.getName().equals("outcome"))
+ if (property.getStructure().getType().equals("Bundle") && property.getName().equals("outcome"))
return BUNDLE_OUTCOME;
if (property.getName().equals("contained"))
return CONTAINED;
- throw new Error("Unknown resource containing a native resource: "+property.getDefinition().getId());
+ throw new FHIRException("Unknown resource containing a native resource: "+property.getDefinition().getId());
}
}
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/JsonParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/JsonParser.java
index 82701ee7f..0d29e0cf0 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/JsonParser.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/JsonParser.java
@@ -208,6 +208,9 @@ public class JsonParser extends ParserBase {
JsonElement e = object.get(name);
if (property.isList() && (e instanceof JsonArray)) {
JsonArray arr = (JsonArray) e;
+ if (arr.size() == 0) {
+ logError(line(e), col(e), npath, IssueType.INVALID, context.formatMessage(I18nConstants.ARRAY_CANNOT_BE_EMPTY), IssueSeverity.ERROR);
+ }
int c = 0;
for (JsonElement am : arr) {
parseChildComplexInstance(npath+"["+c+"]", object, element, property, name, am);
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Integer64Type.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Integer64Type.java
index 99010e11c..114a837b3 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Integer64Type.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Integer64Type.java
@@ -1,44 +1,42 @@
package org.hl7.fhir.r5.model;
-/*
- Copyright (c) 2011+, HL7, Inc.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification,
- are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- * Neither the name of HL7 nor the names of its contributors may be used to
- endorse or promote products derived from this software without specific
- prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
- */
+/*
+ Copyright (c) 2011+, HL7, Inc.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of HL7 nor the names of its contributors may be used to
+ endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+ */
-import org.hl7.fhir.instance.model.api.IBaseIntegerDatatype;
-
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
/**
- * Primitive type "integer" in FHIR: A signed 32-bit integer
+ * Primitive type "integer64" in FHIR: A signed 64-bit integer
*/
-@DatatypeDef(name = "integer")
+@DatatypeDef(name = "integer64")
public class Integer64Type extends PrimitiveType /* implements IBaseInteger64Datatype */ {
private static final long serialVersionUID = 3L;
@@ -76,12 +74,8 @@ public class Integer64Type extends PrimitiveType /* implements IBaseIntege
* @throws IllegalArgumentException If the value is too large to fit in a signed integer
*/
public Integer64Type(Long theValue) {
- if (theValue < java.lang.Long.MIN_VALUE || theValue > java.lang.Long.MAX_VALUE) {
- throw new IllegalArgumentException
- (theValue + " cannot be cast to int without changing its value.");
- }
if(theValue!=null) {
- setValue((long)theValue.longValue());
+ setValue(theValue);
}
}
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/LibraryRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/LibraryRenderer.java
index 7173349a3..ecb0d1ccf 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/LibraryRenderer.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/LibraryRenderer.java
@@ -401,7 +401,7 @@ public class LibraryRenderer extends ResourceRenderer {
p.code().tx(att.getContentType()+lang(att));
}
String prismCode = determinePrismCode(att);
- if (prismCode != null) {
+ if (prismCode != null && !tooBig(txt)) {
x.pre().code().setAttribute("class", "language-"+prismCode).tx(txt);
} else {
x.pre().code().tx(txt);
@@ -420,6 +420,10 @@ public class LibraryRenderer extends ResourceRenderer {
}
}
+ private boolean tooBig(String txt) {
+ return txt.length() > 16384;
+ }
+
private String imgExtension(String contentType) {
if (contentType != null && contentType.startsWith("image/")) {
if (contentType.startsWith("image/png")) {
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ParametersRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ParametersRenderer.java
index 1be180ec1..ba056feb8 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ParametersRenderer.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ParametersRenderer.java
@@ -119,8 +119,13 @@ public class ParametersRenderer extends ResourceRenderer {
if (p.hasValue()) {
render(tr.td(), p.getValue());
} else if (p.hasResource()) {
- ResourceRenderer rr = RendererFactory.factory(p.getResource(), context);
- rr.render(tr.td(), p.getResource());
+ Resource r = p.getResource();
+ td = tr.td();
+ XhtmlNode para = td.para();
+ para.tx(r.fhirType()+"/"+r.getId());
+ para.an(r.fhirType()+"_"+r.getId()).tx(" ");
+ ResourceRenderer rr = RendererFactory.factory(r, context);
+ rr.render(td, r);
} else if (p.hasPart()) {
tr.td();
params(tbl, p.getPart(), 1);
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java
index 155e8bbc0..12235debe 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java
@@ -651,7 +651,9 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
child = p.getElementDefinition();
}
if (child != null) {
- generateElementByProfile(res, profile, allElements, x, path, showCodeDetails, indent, p, child);
+ if (!child.getBase().hasPath() || !child.getBase().getPath().startsWith("Resource.")) {
+ generateElementByProfile(res, profile, allElements, x, path, showCodeDetails, indent, p, child);
+ }
}
}
}
@@ -721,7 +723,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
XhtmlNode para = x.para();
para.b().addText(p.getStructure().present());
para.tx(": ");
- renderLeaf(res, v, child, x, para, false, showCodeDetails, displayHints, path, indent);
+ renderLeaf(res, vv, child, x, para, false, showCodeDetails, displayHints, path, indent);
} else if (ev.hasValues()) {
XhtmlNode bq = x.addTag("blockquote");
bq.para().b().addText(isExtension(p) ? p.getStructure().present() : p.getName());
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/OperationOutcomeUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/OperationOutcomeUtilities.java
index 23c2ab5e7..d273381d4 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/OperationOutcomeUtilities.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/OperationOutcomeUtilities.java
@@ -46,6 +46,7 @@ public class OperationOutcomeUtilities {
public static OperationOutcomeIssueComponent convertToIssue(ValidationMessage message, OperationOutcome op) {
OperationOutcomeIssueComponent issue = new OperationOutcome.OperationOutcomeIssueComponent();
+ issue.setUserData("source.vm", message);
issue.setCode(convert(message.getType()));
if (message.getLocation() != null) {
diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/ProfileUtilitiesTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/ProfileUtilitiesTests.java
index 08b9264e2..0c53d558b 100644
--- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/ProfileUtilitiesTests.java
+++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/ProfileUtilitiesTests.java
@@ -104,6 +104,8 @@ public class ProfileUtilitiesTests {
f.setComment(null);
b.setDefinition(null);
f.setDefinition(null);
+ b.setContentReference(null);
+ f.setContentReference(null);
ok = Base.compareDeep(b, f, true);
}
}
diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml
index 524eeab19..fa7b2b286 100644
--- a/org.hl7.fhir.report/pom.xml
+++ b/org.hl7.fhir.report/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhirorg.hl7.fhir.core
- 5.1.18-SNAPSHOT
+ 5.1.21-SNAPSHOT../pom.xml
diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml
index 83223747b..d6da0d28c 100644
--- a/org.hl7.fhir.utilities/pom.xml
+++ b/org.hl7.fhir.utilities/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhirorg.hl7.fhir.core
- 5.1.18-SNAPSHOT
+ 5.1.21-SNAPSHOT../pom.xml
diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/MarkDownProcessor.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/MarkDownProcessor.java
index d85ddc14a..eb6bb9a3e 100644
--- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/MarkDownProcessor.java
+++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/MarkDownProcessor.java
@@ -78,5 +78,10 @@ public class MarkDownProcessor {
html = html.replace("
", "
");
return html;
}
+
+
+ public static boolean isSimpleMarkdown(String description) {
+ return !description.contains("\n");
+ }
}
\ No newline at end of file
diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java
index c74687d8b..a5476d661 100644
--- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java
+++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java
@@ -3,8 +3,8 @@ package org.hl7.fhir.utilities;
import java.util.ArrayList;
import java.util.List;
+import org.apache.commons.lang3.StringUtils;
import org.hl7.fhir.exceptions.FHIRException;
-import org.hl7.fhir.utilities.npm.NpmPackage;
/*
Copyright (c) 2011+, HL7, Inc.
@@ -216,13 +216,17 @@ public class VersionUtilities {
}
/**
- * return true if the current version equals test, or later
- *
- * so if a feature is defined in 4.0, if (VersionUtilities.isThisOrLater("4.0", version))...
+ * return true if the current version equals test, or later,
+ * so if a feature is defined in 4.0, if (VersionUtilities.isThisOrLater("4.0", version))
+ *
+ * This method tries to perform a numeric parse, so that 0.9 will be considered below 0.10
+ * in accordance with SemVer. If either side contains a non-numeric character in a version string, a simple text
+ * compare will be done instead.
+ *
*
- * @param test
- * @param current
- * @return
+ * @param test The value to compare to
+ * @param current The value being compared
+ * @return Is {@literal current} later or equal to {@literal test}? For example, if this = 0.5 and current = 0.6 this method will return true
*/
public static boolean isThisOrLater(String test, String current) {
String t = getMajMin(test);
@@ -230,8 +234,33 @@ public class VersionUtilities {
if (c.compareTo(t) == 0) {
return isMajMinOrLaterPatch(test, current);
}
- boolean ok = c.compareTo(t) >= 0;
- return ok;
+
+ String[] testParts = t.split("\\.");
+ String[] currentParts = c.split("\\.");
+
+ for (int i = 0; i < Math.max(testParts.length, currentParts.length); i++) {
+ if (i == testParts.length) {
+ return true;
+ } else if (i == currentParts.length) {
+ return false;
+ }
+ String testPart = testParts[i];
+ String currentPart = currentParts[i];
+ if (testPart.equals(currentPart)) {
+ continue;
+ }
+ return compareVersionPart(testPart, currentPart);
+ }
+
+ return true;
+ }
+
+ private static boolean compareVersionPart(String theTestPart, String theCurrentPart) {
+ if (StringUtils.isNumeric(theTestPart) && StringUtils.isNumeric(theCurrentPart)) {
+ return Integer.parseInt(theCurrentPart) - Integer.parseInt(theTestPart) >= 0;
+ } else {
+ return theCurrentPart.compareTo(theTestPart) >= 0;
+ }
}
/**
@@ -251,7 +280,7 @@ public class VersionUtilities {
return true;
}
if (pc!=null) {
- return pc.compareTo(pt) >= 0;
+ return compareVersionPart(pt, pc);
}
}
return false;
diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java
index 23c15cc22..36a9960a6 100644
--- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java
+++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/i18n/I18nConstants.java
@@ -12,6 +12,7 @@ public class I18nConstants {
public static final String ALL_OBSERVATIONS_SHOULD_HAVE_A_PERFORMER = "All_observations_should_have_a_performer";
public static final String ALL_OBSERVATIONS_SHOULD_HAVE_A_SUBJECT = "All_observations_should_have_a_subject";
public static final String ALL_OK = "ALL_OK";
+ public static final String ARRAY_CANNOT_BE_EMPTY = "ARRAY_CANNOT_BE_EMPTY";
public static final String ATTEMPT_TO_A_SLICE_AN_ELEMENT_THAT_DOES_NOT_REPEAT__FROM__IN_ = "Attempt_to_a_slice_an_element_that_does_not_repeat__from__in_";
public static final String ATTEMPT_TO_REPLACE_ELEMENT_NAME_FOR_A_NONCHOICE_TYPE = "Attempt_to_replace_element_name_for_a_nonchoice_type";
public static final String ATTEMPT_TO_USE_A_SNAPSHOT_ON_PROFILE__AS__BEFORE_IT_IS_GENERATED = "Attempt_to_use_a_snapshot_on_profile__as__before_it_is_generated";
diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java
index 985065479..23a23ec27 100644
--- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java
+++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java
@@ -351,6 +351,7 @@ public class FilesystemPackageCacheManager extends BasePackageCacheManager imple
System.out.println();
System.out.print(" Installing: ");
}
+
if (npm.name() == null || id == null || !id.equals(npm.name())) {
if (!id.equals("hl7.fhir.r5.core")) {// temporary work around
throw new IOException("Attempt to import a mis-identified package. Expected " + id + ", got " + npm.name());
diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java
index 8edbee65b..94e337d33 100644
--- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java
+++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/HierarchicalTableGenerator.java
@@ -240,6 +240,7 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
pieces.add(piece);
return this;
}
+
public Cell addMarkdown(String md) {
try {
Parser parser = Parser.builder().build();
@@ -253,6 +254,19 @@ public class HierarchicalTableGenerator extends TranslatingUtilities {
return this;
}
+ public Cell addMarkdownNoPara(String md) {
+ try {
+ Parser parser = Parser.builder().build();
+ Node document = parser.parse(md);
+ HtmlRenderer renderer = HtmlRenderer.builder().escapeHtml(true).build();
+ String html = renderer.render(document);
+ pieces.addAll(htmlToParagraphPieces(html));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return this;
+ }
+
private List htmlToParagraphPieces(String html) {
List myPieces = new ArrayList();
try {
diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages.properties b/org.hl7.fhir.utilities/src/main/resources/Messages.properties
index 38e7af318..038b16b7c 100644
--- a/org.hl7.fhir.utilities/src/main/resources/Messages.properties
+++ b/org.hl7.fhir.utilities/src/main/resources/Messages.properties
@@ -209,11 +209,12 @@ Validation_BUNDLE_Message = The first entry in a message must be a MessageHeader
Validation_VAL_Content_Unknown = Unrecognised Content {0}
Validation_VAL_NoType = Unknown type {0}
Validation_VAL_Profile_MatchMultiple = Profile {0}, Element matches more than one slice - {1}, {2}
-Validation_VAL_Profile_Maximum = {0}: max allowed = {1}, but found {2}
-Validation_VAL_Profile_Minimum = {0}: minimum required = {1}, but only found {2}
+// for the next 4 messages, the available parameters are: 0: profile url, 1: ed.path, 2: ed.id, 3: ed.sliceName, 4: ed.label, 5: element.path, 6: ed.min and optionally 7: actual count
+Validation_VAL_Profile_Maximum = {2}: max allowed = {6}, but found {7} (from {0})
+Validation_VAL_Profile_Minimum = {2}: minimum required = {6}, but only found {7} (from {0})
+Validation_VAL_Profile_NoCheckMax = {2}: Unable to check max allowed ({1}) due to lack of slicing validation (from {0})
+Validation_VAL_Profile_NoCheckMin = {2}: Unable to check minimum required ({1}) due to lack of slicing validation (from {0})
Validation_VAL_Profile_MultipleMatches = Found multiple matching profiles among choices: {0}
-Validation_VAL_Profile_NoCheckMax = {0}: Unable to check max allowed ({1}) due to lack of slicing validation
-Validation_VAL_Profile_NoCheckMin = {0}'': Unable to check minimum required ({1}) due to lack of slicing validation
Validation_VAL_Profile_NoDefinition = No definition found for resource type ''{0}''
Validation_VAL_Profile_NoMatch = Unable to find matching profile among choices: {0}
Validation_VAL_Profile_NoSnapshot = StructureDefinition has no snapshot - validation is against the snapshot, so it must be provided
@@ -617,4 +618,5 @@ SD_ED_TYPE_PROFILE_NOTYPE = Found profile {0}, but unable to determine the type
SD_ED_TYPE_PROFILE_WRONG = Profile {0} is for type {1}, but this element has type {2}
TERMINOLOGY_TX_NOSVC_BOUND_REQ = Could not confirm that the codes provided are from the required value set {0} because there is no terminology service
TERMINOLOGY_TX_NOSVC_BOUND_EXT = Could not confirm that the codes provided are from the extensible value set {0} because there is no terminology service
+ARRAY_CANNOT_BE_EMPTY = Array cannot be empty - the property should not be present if it has no values
\ No newline at end of file
diff --git a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/VersionUtilitiesTest.java b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/VersionUtilitiesTest.java
new file mode 100644
index 000000000..1e8b68694
--- /dev/null
+++ b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/VersionUtilitiesTest.java
@@ -0,0 +1,48 @@
+package org.hl7.fhir.utilities;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+public class VersionUtilitiesTest {
+
+ @Test
+ public void isThisOrLater_Simple() {
+ assertTrue(VersionUtilities.isThisOrLater("0.1", "0.2"));
+ assertFalse(VersionUtilities.isThisOrLater("0.2", "0.1"));
+ }
+
+ @Test
+ public void isThisOrLater_NeedNumericComparison() {
+ assertTrue(VersionUtilities.isThisOrLater("0.9", "0.10"));
+ assertFalse(VersionUtilities.isThisOrLater("0.10", "0.9"));
+ }
+
+ @Test
+ public void isThisOrLater_DifferentLengths() {
+ assertTrue(VersionUtilities.isThisOrLater("0.9", "0.9.1"));
+ assertFalse(VersionUtilities.isThisOrLater("0.9.1", "0.9"));
+ }
+
+ @Test
+ public void isThisOrLater_NonNumeric() {
+ assertTrue(VersionUtilities.isThisOrLater("0.A", "0.B"));
+ assertFalse(VersionUtilities.isThisOrLater("0.B", "0.A"));
+ }
+
+
+ @Test
+ public void isMajMinOrLaterPatch_Simple() {
+ assertTrue(VersionUtilities.isMajMinOrLaterPatch("0.9.0", "0.9.0"));
+ assertTrue(VersionUtilities.isMajMinOrLaterPatch("0.9.0", "0.9.1"));
+ assertFalse(VersionUtilities.isThisOrLater("0.9.0", "0.8.1"));
+ }
+
+ @Test
+ public void isMajMinOrLaterPatch_VersionWithX() {
+ assertTrue(VersionUtilities.isMajMinOrLaterPatch("0.9.x", "0.9.0"));
+ assertTrue(VersionUtilities.isMajMinOrLaterPatch("0.9.x", "0.9.1"));
+ assertFalse(VersionUtilities.isThisOrLater("0.9.x", "0.8.1"));
+ }
+
+}
\ No newline at end of file
diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml
index 8362c8676..849541b16 100644
--- a/org.hl7.fhir.validation.cli/pom.xml
+++ b/org.hl7.fhir.validation.cli/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhirorg.hl7.fhir.core
- 5.1.18-SNAPSHOT
+ 5.1.21-SNAPSHOT../pom.xml
diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml
index 6c7e1a8e3..7ad6a3959 100644
--- a/org.hl7.fhir.validation/pom.xml
+++ b/org.hl7.fhir.validation/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhirorg.hl7.fhir.core
- 5.1.18-SNAPSHOT
+ 5.1.21-SNAPSHOT../pom.xml
diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java
index 648f57520..4784f88c3 100644
--- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java
+++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java
@@ -29,6 +29,10 @@ import java.util.UUID;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
import org.apache.commons.io.IOUtils;
import org.hl7.fhir.convertors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.VersionConvertor_10_30;
@@ -56,6 +60,7 @@ import org.hl7.fhir.r5.context.SimpleWorkerContext;
import org.hl7.fhir.r5.elementmodel.Element;
import org.hl7.fhir.r5.elementmodel.Manager;
import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat;
+import org.hl7.fhir.r5.elementmodel.ParserBase.ValidationPolicy;
import org.hl7.fhir.r5.elementmodel.ObjectConverter;
import org.hl7.fhir.r5.formats.FormatUtilities;
import org.hl7.fhir.r5.formats.IParser.OutputStyle;
@@ -98,19 +103,23 @@ import org.hl7.fhir.utilities.TimeTracker;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.i18n.I18nConstants;
+import org.hl7.fhir.utilities.json.JsonTrackingParser;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
import org.hl7.fhir.utilities.npm.NpmPackage;
import org.hl7.fhir.utilities.npm.ToolsVersion;
+import org.hl7.fhir.utilities.turtle.Turtle;
import org.hl7.fhir.utilities.validation.ValidationMessage;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType;
import org.hl7.fhir.utilities.validation.ValidationMessage.Source;
import org.hl7.fhir.utilities.xhtml.XhtmlComposer;
import org.hl7.fhir.validation.BaseValidator.ValidationControl;
+import org.hl7.fhir.validation.ValidationEngine.ValidationRecord;
import org.hl7.fhir.validation.cli.model.ScanOutputItem;
import org.hl7.fhir.validation.cli.services.StandAloneValidatorFetcher.IPackageInstaller;
import org.hl7.fhir.validation.cli.utils.*;
import org.hl7.fhir.validation.instance.InstanceValidator;
+import org.w3c.dom.Document;
import org.xml.sax.SAXException;
@@ -187,6 +196,50 @@ POSSIBILITY OF SUCH DAMAGE.
*/
public class ValidationEngine implements IValidatorResourceFetcher, IPackageInstaller {
+ public class ValidationRecord {
+
+ private String location;
+ private List messages;
+ int err = 0;
+ int warn = 0;
+ int info = 0;
+
+ public ValidationRecord(String location, List messages) {
+ this.location = location;
+ this.messages = messages;
+ for (ValidationMessage vm : messages) {
+ if (vm.getLevel().equals(ValidationMessage.IssueSeverity.FATAL)||vm.getLevel().equals(ValidationMessage.IssueSeverity.ERROR))
+ err++;
+ else if (vm.getLevel().equals(ValidationMessage.IssueSeverity.WARNING))
+ warn++;
+ else if (!vm.isSignpost()) {
+ info++;
+ }
+ }
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public List getMessages() {
+ return messages;
+ }
+
+ public int getErr() {
+ return err;
+ }
+
+ public int getWarn() {
+ return warn;
+ }
+
+ public int getInfo() {
+ return info;
+ }
+
+ }
+
public class TransformSupportServices implements ITransformerServices {
private List outputs;
@@ -538,7 +591,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IPackageInst
throw new FHIRException("Unable to fetch content from "+src+" ("+errors.toString()+")");
}
- FhirFormat fmt = checkIsResource(cnt, src);
+ FhirFormat fmt = checkFormat(cnt, src);
if (fmt != null) {
Map res = new HashMap();
res.put(Utilities.changeFileExt(src, "."+fmt.getExtension()), cnt);
@@ -809,33 +862,99 @@ public class ValidationEngine implements IValidatorResourceFetcher, IPackageInst
this.noInvariantChecks = value;
}
+ private FhirFormat checkFormat(byte[] cnt, String filename) {
+ System.out.println(" ..Detect format for "+filename);
+ try {
+ JsonTrackingParser.parseJson(cnt);
+ return FhirFormat.JSON;
+ } catch (Exception e) {
+ if (debug) {
+ System.out.println("Not JSON: "+e.getMessage());
+ }
+ }
+ try {
+ parseXml(cnt);
+ return FhirFormat.XML;
+ } catch (Exception e) {
+ if (debug) {
+ System.out.println("Not XML: "+e.getMessage());
+ }
+ }
+ try {
+ new Turtle().parse(TextFile.bytesToString(cnt));
+ return FhirFormat.TURTLE;
+ } catch (Exception e) {
+ if (debug) {
+ System.out.println("Not Turtle: "+e.getMessage());
+ }
+ }
+ try {
+ new StructureMapUtilities(context, null, null).parse(TextFile.bytesToString(cnt), null);
+ return FhirFormat.TEXT;
+ } catch (Exception e) {
+ if (debug) {
+ System.out.println("Not Text: "+e.getMessage());
+ }
+ }
+ if (debug)
+ System.out.println(" .. not a resource: "+filename);
+ return null;
+ }
+
+
private FhirFormat checkIsResource(byte[] cnt, String filename) {
System.out.println(" ..Detect format for "+filename);
try {
Manager.parse(context, new ByteArrayInputStream(cnt), FhirFormat.JSON);
return FhirFormat.JSON;
} catch (Exception e) {
+ if (debug) {
+ System.out.println("Not JSON: "+e.getMessage());
+ }
}
try {
- Manager.parse(context, new ByteArrayInputStream(cnt),FhirFormat.XML);
+ parseXml(cnt);
return FhirFormat.XML;
} catch (Exception e) {
+ if (debug) {
+ System.out.println("Not XML: "+e.getMessage());
+ }
}
try {
Manager.parse(context, new ByteArrayInputStream(cnt),FhirFormat.TURTLE);
return FhirFormat.TURTLE;
} catch (Exception e) {
+ if (debug) {
+ System.out.println("Not Turtle: "+e.getMessage());
+ }
}
try {
new StructureMapUtilities(context, null, null).parse(TextFile.bytesToString(cnt), null);
return FhirFormat.TEXT;
} catch (Exception e) {
+ if (debug) {
+ System.out.println("Not Text: "+e.getMessage());
+ }
}
if (debug)
System.out.println(" .. not a resource: "+filename);
return null;
}
+ private Document parseXml(byte[] cnt) throws ParserConfigurationException, SAXException, IOException {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ // xxe protection
+ factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
+ factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
+ factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
+ factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
+ factory.setXIncludeAware(false);
+ factory.setExpandEntityReferences(false);
+ factory.setNamespaceAware(true);
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ return builder.parse(new ByteArrayInputStream(cnt));
+ }
+
private FhirFormat checkIsResource(String path) throws IOException {
String ext = Utilities.getFileExtension(path);
if (Utilities.existsInList(ext, "xml"))
@@ -1097,7 +1216,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IPackageInst
public OperationOutcome validate(String source, List profiles) throws FHIRException, IOException {
List l = new ArrayList();
l.add(source);
- return (OperationOutcome)validate(l, profiles);
+ return (OperationOutcome)validate(l, profiles, null);
}
public List validateScan(List sources, Set guides) throws FHIRException, IOException, EOperationOutcome {
@@ -1193,7 +1312,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IPackageInst
}
}
- public Resource validate(List sources, List profiles) throws FHIRException, IOException {
+ public Resource validate(List sources, List profiles, List record) throws FHIRException, IOException {
if (profiles.size() > 0) {
System.out.println(" Profiles: "+profiles);
}
@@ -1207,7 +1326,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IPackageInst
System.out.print(" Validate " + ref);
Content cnt = loadContent(ref, "validate", false);
try {
- OperationOutcome outcome = validate(ref, cnt.focus, cnt.cntType, profiles);
+ OperationOutcome outcome = validate(ref, cnt.focus, cnt.cntType, profiles, record);
ToolingExtensions.addStringExtension(outcome, ToolingExtensions.EXT_OO_FILE, ref);
System.out.println(" " + context.clock().milestone());
results.addEntry().setResource(outcome);
@@ -1281,7 +1400,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IPackageInst
}
- public OperationOutcome validate(String location, byte[] source, FhirFormat cntType, List profiles) throws FHIRException, IOException, EOperationOutcome, SAXException {
+ public OperationOutcome validate(String location, byte[] source, FhirFormat cntType, List profiles, List record) throws FHIRException, IOException, EOperationOutcome, SAXException {
List messages = new ArrayList();
if (doNative) {
SchemaValidator.validateSchema(location, cntType, messages);
@@ -1291,6 +1410,9 @@ public class ValidationEngine implements IValidatorResourceFetcher, IPackageInst
if (showTimes) {
System.out.println(location+": "+validator.reportTimes());
}
+ if (record != null) {
+ record.add(new ValidationRecord(location, messages));
+ }
return messagesToOutcome(messages);
}
diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java
index 551277f28..6c85d25c9 100644
--- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java
+++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java
@@ -41,6 +41,8 @@ public class CliContext {
private String map = null;
@JsonProperty("output")
private String output = null;
+ @JsonProperty("htmlOutput")
+ private String htmlOutput = null;
@JsonProperty("txServer")
private String txServer = "http://tx.fhir.org";
@JsonProperty("sv")
@@ -252,6 +254,17 @@ public class CliContext {
return this;
}
+ @JsonProperty("htmlOutput")
+ public String getHtmlOutput() {
+ return htmlOutput;
+ }
+
+ @JsonProperty("htmlOutput")
+ public CliContext setHtmlOutput(String htmlOutput) {
+ this.htmlOutput = htmlOutput;
+ return this;
+ }
+
@JsonProperty("canDoNative")
public boolean getCanDoNative() {
return canDoNative;
@@ -472,6 +485,7 @@ public class CliContext {
noExtensibleBindingMessages == that.noExtensibleBindingMessages &&
Objects.equals(map, that.map) &&
Objects.equals(output, that.output) &&
+ Objects.equals(htmlOutput, that.htmlOutput) &&
Objects.equals(txServer, that.txServer) &&
Objects.equals(sv, that.sv) &&
Objects.equals(txLog, that.txLog) &&
@@ -493,7 +507,7 @@ public class CliContext {
@Override
public int hashCode() {
- return Objects.hash(doNative, anyExtensionsAllowed, hintAboutNonMustSupport, recursive, doDebug, assumeValidRestReferences, canDoNative, noInternalCaching, noExtensibleBindingMessages, map, output, txServer, sv, txLog, mapLog, lang, fhirpath, snomedCT, targetVer, igs, questionnaireMode, profiles, sources, mode, locale, locations, crumbTrails, showTimes);
+ return Objects.hash(doNative, anyExtensionsAllowed, hintAboutNonMustSupport, recursive, doDebug, assumeValidRestReferences, canDoNative, noInternalCaching, noExtensibleBindingMessages, map, output, htmlOutput, txServer, sv, txLog, mapLog, lang, fhirpath, snomedCT, targetVer, igs, questionnaireMode, profiles, sources, mode, locale, locations, crumbTrails, showTimes);
}
@Override
@@ -510,6 +524,7 @@ public class CliContext {
", noExtensibleBindingMessages=" + noExtensibleBindingMessages +
", map='" + map + '\'' +
", output='" + output + '\'' +
+ ", htmlOutput='" + htmlOutput + '\'' +
", txServer='" + txServer + '\'' +
", sv='" + sv + '\'' +
", txLog='" + txLog + '\'' +
diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/HTMLOutputGenerator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/HTMLOutputGenerator.java
new file mode 100644
index 000000000..a13abb813
--- /dev/null
+++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/HTMLOutputGenerator.java
@@ -0,0 +1,181 @@
+package org.hl7.fhir.validation.cli.services;
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.List;
+
+import org.hl7.fhir.utilities.Utilities;
+import org.hl7.fhir.utilities.validation.ValidationMessage;
+import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
+import org.hl7.fhir.validation.ValidationEngine.ValidationRecord;
+import org.hl7.fhir.validation.cli.utils.VersionUtil;
+
+public class HTMLOutputGenerator {
+
+ private List records;
+
+ public HTMLOutputGenerator(List records) {
+ super();
+ this.records = records;
+ }
+
+ public String generate(long time) {
+
+ StringBuilder b = new StringBuilder();
+ b.append(genHeader(time));
+ int i = 0;
+ for (ValidationRecord f : records) {
+ i++;
+ b.append(genSummaryRow(i, f));
+ }
+ b.append("
\r\n");
+
+ i = 0;
+ int id = 0;
+ for (ValidationRecord f : records) {
+ i++;
+ b.append(genStart(i, f));
+ if (f.getMessages().size() > 0) {
+ b.append(
+ "
\r\n"+
+ "
\r\n"+
+ "
Path
Severity
Message
\r\n"+
+ "
\r\n");
+ for (ValidationMessage vm : f.getMessages()) {
+ id++;
+ b.append(genDetails(vm, "m"+id));
+ }
+ b.append("