Add support for mustHaveValue and valueAlternatives + render imposesProfile + compliesWithProfile
This commit is contained in:
parent
11eb2cef53
commit
dfb4404ce6
|
@ -12,7 +12,12 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Id10
|
|||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Integer10_50;
|
||||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.MarkDown10_50;
|
||||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50;
|
||||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Uri10_50;
|
||||
import org.hl7.fhir.convertors.conv10_50.resources10_50.Enumerations10_50;
|
||||
import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Boolean14_50;
|
||||
import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50;
|
||||
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
|
||||
import org.hl7.fhir.dstu2.utils.ToolingExtensions;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
|
||||
|
@ -23,7 +28,7 @@ public class ElementDefinition10_50 {
|
|||
public static org.hl7.fhir.r5.model.ElementDefinition convertElementDefinition(org.hl7.fhir.dstu2.model.ElementDefinition src, List<String> slicePaths, List<org.hl7.fhir.dstu2.model.ElementDefinition> context, int pos) throws FHIRException {
|
||||
if (src == null || src.isEmpty()) return null;
|
||||
org.hl7.fhir.r5.model.ElementDefinition tgt = new org.hl7.fhir.r5.model.ElementDefinition();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt, "http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue", "http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives");
|
||||
if (src.hasPathElement()) tgt.setPathElement(String10_50.convertString(src.getPathElement()));
|
||||
tgt.setRepresentation(src.getRepresentation().stream().map(ElementDefinition10_50::convertPropertyRepresentation).collect(Collectors.toList()));
|
||||
if (src.hasName()) {
|
||||
|
@ -74,6 +79,13 @@ public class ElementDefinition10_50 {
|
|||
for (org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
|
||||
tgt.addMapping(convertElementDefinitionMappingComponent(t));
|
||||
if (!tgt.hasId()) tgt.setId(tgt.getPath());
|
||||
|
||||
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue")) {
|
||||
tgt.setMustHaveValueElement(Boolean10_50.convertBoolean((org.hl7.fhir.dstu2.model.BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue").getValue()));
|
||||
}
|
||||
for (org.hl7.fhir.dstu2.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives")) {
|
||||
tgt.addValueAlternative(Uri10_50.convertCanonical((org.hl7.fhir.dstu2.model.UriType)ext.getValue()));
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -127,6 +139,14 @@ public class ElementDefinition10_50 {
|
|||
if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
|
||||
for (org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
|
||||
tgt.addMapping(convertElementDefinitionMappingComponent(t));
|
||||
if (src.hasMustHaveValue()) {
|
||||
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue", Boolean10_50.convertBoolean(src.getMustHaveValueElement()));
|
||||
}
|
||||
for (org.hl7.fhir.r5.model.CanonicalType ct : src.getValueAlternatives()) {
|
||||
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives", Uri10_50.convertCanonical(ct));
|
||||
}
|
||||
|
||||
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50;
|
||||
|
||||
import org.hl7.fhir.convertors.context.ConversionContext10_50;
|
||||
import org.hl7.fhir.convertors.context.ConversionContext14_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
|
||||
public class Uri10_50 {
|
||||
|
@ -15,4 +16,18 @@ public class Uri10_50 {
|
|||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
||||
public static org.hl7.fhir.r5.model.CanonicalType convertCanonical(org.hl7.fhir.dstu2.model.UriType src) throws FHIRException {
|
||||
org.hl7.fhir.r5.model.CanonicalType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.CanonicalType(src.getValueAsString()) : new org.hl7.fhir.r5.model.CanonicalType();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.dstu2.model.UriType convertCanonical(org.hl7.fhir.r5.model.CanonicalType src) throws FHIRException {
|
||||
org.hl7.fhir.dstu2.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.UriType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.UriType();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
return tgt;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,8 +15,13 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Mark
|
|||
import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.String14_50;
|
||||
import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.Uri14_50;
|
||||
import org.hl7.fhir.convertors.conv14_50.resources14_50.Enumerations14_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Boolean30_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Boolean40_50;
|
||||
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
|
||||
import org.hl7.fhir.dstu2016may.model.ElementDefinition;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r4.model.BooleanType;
|
||||
import org.hl7.fhir.r5.conformance.profile.ProfileUtilities;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
|
||||
|
@ -24,7 +29,7 @@ public class ElementDefinition14_50 {
|
|||
public static org.hl7.fhir.r5.model.ElementDefinition convertElementDefinition(org.hl7.fhir.dstu2016may.model.ElementDefinition src, List<ElementDefinition> context, int pos) throws FHIRException {
|
||||
if (src == null || src.isEmpty()) return null;
|
||||
org.hl7.fhir.r5.model.ElementDefinition tgt = new org.hl7.fhir.r5.model.ElementDefinition();
|
||||
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt);
|
||||
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt, "http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue", "http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives");
|
||||
if (src.hasPathElement()) tgt.setPathElement(String14_50.convertString(src.getPathElement()));
|
||||
tgt.setRepresentation(src.getRepresentation().stream().map(ElementDefinition14_50::convertPropertyRepresentation).collect(Collectors.toList()));
|
||||
if (src.hasName()) tgt.setSliceNameElement(String14_50.convertString(src.getNameElement()));
|
||||
|
@ -75,6 +80,14 @@ public class ElementDefinition14_50 {
|
|||
for (ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
|
||||
tgt.addMapping(convertElementDefinitionMappingComponent(t));
|
||||
}
|
||||
|
||||
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue")) {
|
||||
tgt.setMustHaveValueElement(Boolean14_50.convertBoolean((org.hl7.fhir.dstu2016may.model.BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue").getValue()));
|
||||
}
|
||||
for (org.hl7.fhir.dstu2016may.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives")) {
|
||||
tgt.addValueAlternative(Uri14_50.convertCanonical((org.hl7.fhir.dstu2016may.model.UriType)ext.getValue()));
|
||||
}
|
||||
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -126,6 +139,14 @@ public class ElementDefinition14_50 {
|
|||
if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
|
||||
for (org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
|
||||
tgt.addMapping(convertElementDefinitionMappingComponent(t));
|
||||
if (src.hasMustHaveValue()) {
|
||||
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue", Boolean14_50.convertBoolean(src.getMustHaveValueElement()));
|
||||
}
|
||||
for (org.hl7.fhir.r5.model.CanonicalType ct : src.getValueAlternatives()) {
|
||||
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives", Uri14_50.convertCanonical(ct));
|
||||
}
|
||||
|
||||
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50;
|
||||
|
||||
import org.hl7.fhir.convertors.context.ConversionContext14_50;
|
||||
import org.hl7.fhir.convertors.context.ConversionContext30_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
|
||||
public class Uri14_50 {
|
||||
|
@ -15,4 +16,19 @@ public class Uri14_50 {
|
|||
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt);
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
||||
public static org.hl7.fhir.r5.model.CanonicalType convertCanonical(org.hl7.fhir.dstu2016may.model.UriType src) throws FHIRException {
|
||||
org.hl7.fhir.r5.model.CanonicalType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.CanonicalType(src.getValueAsString()) : new org.hl7.fhir.r5.model.CanonicalType();
|
||||
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt);
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.dstu2016may.model.UriType convertCanonical(org.hl7.fhir.r5.model.CanonicalType src) throws FHIRException {
|
||||
org.hl7.fhir.dstu2016may.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.dstu2016may.model.UriType(src.getValueAsString()) : new org.hl7.fhir.dstu2016may.model.UriType();
|
||||
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt);
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,10 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Stri
|
|||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.UnsignedInt30_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.resources30_50.Enumerations30_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Boolean40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Canonical40_50;
|
||||
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
|
||||
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.CanonicalType;
|
||||
import org.hl7.fhir.r5.model.DataType;
|
||||
|
@ -26,7 +30,7 @@ public class ElementDefinition30_50 {
|
|||
public static org.hl7.fhir.r5.model.ElementDefinition convertElementDefinition(org.hl7.fhir.dstu3.model.ElementDefinition src) throws FHIRException {
|
||||
if (src == null) return null;
|
||||
org.hl7.fhir.r5.model.ElementDefinition tgt = new org.hl7.fhir.r5.model.ElementDefinition();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt, "http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue", "http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives");
|
||||
if (src.hasPath()) tgt.setPathElement(String30_50.convertString(src.getPathElement()));
|
||||
tgt.setRepresentation(src.getRepresentation().stream().map(ElementDefinition30_50::convertPropertyRepresentation).collect(Collectors.toList()));
|
||||
if (src.hasSliceName()) tgt.setSliceNameElement(String30_50.convertString(src.getSliceNameElement()));
|
||||
|
@ -75,6 +79,14 @@ public class ElementDefinition30_50 {
|
|||
if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
|
||||
for (org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
|
||||
tgt.addMapping(convertElementDefinitionMappingComponent(t));
|
||||
|
||||
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue")) {
|
||||
tgt.setMustHaveValueElement(Boolean30_50.convertBoolean((org.hl7.fhir.dstu3.model.BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue").getValueAsPrimitive()));
|
||||
}
|
||||
for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives")) {
|
||||
tgt.addValueAlternative(Uri30_50.convertCanonical((org.hl7.fhir.dstu3.model.UriType)ext.getValue()));
|
||||
}
|
||||
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -127,6 +139,13 @@ public class ElementDefinition30_50 {
|
|||
if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
|
||||
for (org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
|
||||
tgt.addMapping(convertElementDefinitionMappingComponent(t));
|
||||
if (src.hasMustHaveValue()) {
|
||||
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue", Boolean30_50.convertBoolean(src.getMustHaveValueElement()));
|
||||
}
|
||||
for (org.hl7.fhir.r5.model.CanonicalType ct : src.getValueAlternatives()) {
|
||||
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives", Uri30_50.convertCanonical(ct));
|
||||
}
|
||||
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.stream.Collectors;
|
|||
|
||||
import org.hl7.fhir.convertors.VersionConvertorConstants;
|
||||
import org.hl7.fhir.convertors.context.ConversionContext40_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Boolean30_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.BackboneElement40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Coding40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Boolean40_50;
|
||||
|
@ -16,13 +17,16 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_
|
|||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.UnsignedInt40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.resources40_50.Enumerations40_50;
|
||||
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
|
||||
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r4.model.BooleanType;
|
||||
|
||||
public class ElementDefinition40_50 {
|
||||
public static org.hl7.fhir.r5.model.ElementDefinition convertElementDefinition(org.hl7.fhir.r4.model.ElementDefinition src) throws FHIRException {
|
||||
if (src == null) return null;
|
||||
org.hl7.fhir.r5.model.ElementDefinition tgt = new org.hl7.fhir.r5.model.ElementDefinition();
|
||||
BackboneElement40_50.copyBackboneElement(src, tgt);
|
||||
BackboneElement40_50.copyBackboneElement(src, tgt, "http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue", "http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives");
|
||||
if (src.hasPath()) tgt.setPathElement(String40_50.convertString(src.getPathElement()));
|
||||
tgt.setRepresentation(src.getRepresentation().stream().map(ElementDefinition40_50::convertPropertyRepresentation).collect(Collectors.toList()));
|
||||
if (src.hasSliceName()) tgt.setSliceNameElement(String40_50.convertString(src.getSliceNameElement()));
|
||||
|
@ -70,6 +74,14 @@ public class ElementDefinition40_50 {
|
|||
if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
|
||||
for (org.hl7.fhir.r4.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
|
||||
tgt.addMapping(convertElementDefinitionMappingComponent(t));
|
||||
|
||||
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue")) {
|
||||
tgt.setMustHaveValueElement(Boolean40_50.convertBoolean((org.hl7.fhir.r4.model.BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue").getValueAsPrimitive()));
|
||||
}
|
||||
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives")) {
|
||||
tgt.addValueAlternative(Canonical40_50.convertCanonical((org.hl7.fhir.r4.model.CanonicalType)ext.getValue()));
|
||||
}
|
||||
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -124,6 +136,13 @@ public class ElementDefinition40_50 {
|
|||
if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
|
||||
for (org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
|
||||
tgt.addMapping(convertElementDefinitionMappingComponent(t));
|
||||
if (src.hasMustHaveValue()) {
|
||||
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue", Boolean40_50.convertBoolean(src.getMustHaveValueElement()));
|
||||
}
|
||||
for (org.hl7.fhir.r5.model.CanonicalType ct : src.getValueAlternatives()) {
|
||||
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives", Canonical40_50.convertCanonical(ct));
|
||||
}
|
||||
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.stream.Collectors;
|
|||
|
||||
import org.hl7.fhir.convertors.VersionConvertorConstants;
|
||||
import org.hl7.fhir.convertors.context.ConversionContext43_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Canonical40_50;
|
||||
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneElement43_50;
|
||||
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50;
|
||||
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
|
||||
|
@ -22,7 +23,7 @@ public class ElementDefinition43_50 {
|
|||
public static org.hl7.fhir.r5.model.ElementDefinition convertElementDefinition(org.hl7.fhir.r4b.model.ElementDefinition src) throws FHIRException {
|
||||
if (src == null) return null;
|
||||
org.hl7.fhir.r5.model.ElementDefinition tgt = new org.hl7.fhir.r5.model.ElementDefinition();
|
||||
BackboneElement43_50.copyBackboneElement(src, tgt);
|
||||
BackboneElement43_50.copyBackboneElement(src, tgt, "http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue", "http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives");
|
||||
if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement()));
|
||||
tgt.setRepresentation(src.getRepresentation().stream().map(ElementDefinition43_50::convertPropertyRepresentation).collect(Collectors.toList()));
|
||||
if (src.hasSliceName()) tgt.setSliceNameElement(String43_50.convertString(src.getSliceNameElement()));
|
||||
|
@ -70,6 +71,14 @@ public class ElementDefinition43_50 {
|
|||
if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
|
||||
for (org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
|
||||
tgt.addMapping(convertElementDefinitionMappingComponent(t));
|
||||
|
||||
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue")) {
|
||||
tgt.setMustHaveValueElement(Boolean43_50.convertBoolean(src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue").getValueBooleanType()));
|
||||
}
|
||||
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives")) {
|
||||
tgt.addValueAlternative(Canonical43_50.convertCanonical(ext.getValueCanonicalType()));
|
||||
}
|
||||
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -124,6 +133,13 @@ public class ElementDefinition43_50 {
|
|||
if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
|
||||
for (org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
|
||||
tgt.addMapping(convertElementDefinitionMappingComponent(t));
|
||||
if (src.hasMustHaveValue()) {
|
||||
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.mustHaveValue", Boolean43_50.convertBoolean(src.getMustHaveValueElement()));
|
||||
}
|
||||
for (org.hl7.fhir.r5.model.CanonicalType ct : src.getValueAlternatives()) {
|
||||
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ElementDefinition.valueAlternatives", Canonical43_50.convertCanonical(ct));
|
||||
}
|
||||
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ package org.hl7.fhir.dstu2.model;
|
|||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
*/
|
||||
|
||||
// Generated on Wed, Jul 13, 2016 05:32+1000 for FHIR v1.0.2
|
||||
import java.util.ArrayList;
|
||||
|
@ -177,6 +177,31 @@ public abstract class Element extends Base implements IBaseHasExtensions, IBaseE
|
|||
}
|
||||
return java.util.Collections.unmodifiableList(retVal);
|
||||
}
|
||||
|
||||
public Extension getExtensionByUrl(String theUrl) {
|
||||
org.apache.commons.lang3.Validate.notBlank(theUrl, "theUrl must not be blank or null");
|
||||
ArrayList<Extension> retVal = new ArrayList<Extension>();
|
||||
for (Extension next : getExtension()) {
|
||||
if (theUrl.equals(next.getUrl())) {
|
||||
retVal.add(next);
|
||||
}
|
||||
}
|
||||
if (retVal.size() == 0)
|
||||
return null;
|
||||
else {
|
||||
org.apache.commons.lang3.Validate.isTrue(retVal.size() == 1, "Url "+theUrl+" must have only one match");
|
||||
return retVal.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
public void addExtension(String url, Type value) {
|
||||
Extension ex = new Extension();
|
||||
ex.setUrl(url);
|
||||
ex.setValue(value);
|
||||
getExtension().add(ex);
|
||||
}
|
||||
|
||||
|
||||
public boolean hasExtension(String theUrl) {
|
||||
return !getExtensionsByUrl(theUrl).isEmpty();
|
||||
}
|
||||
|
|
|
@ -30,12 +30,13 @@ package org.hl7.fhir.dstu2016may.model;
|
|||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
*/
|
||||
|
||||
// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.instance.model.api.IBaseElement;
|
||||
import org.hl7.fhir.instance.model.api.IBaseHasExtensions;
|
||||
|
@ -178,10 +179,33 @@ public abstract class Element extends Base implements IBaseHasExtensions, IBaseE
|
|||
}
|
||||
return java.util.Collections.unmodifiableList(retVal);
|
||||
}
|
||||
public Extension getExtensionByUrl(String theUrl) {
|
||||
org.apache.commons.lang3.Validate.notBlank(theUrl, "theUrl must not be blank or null");
|
||||
ArrayList<Extension> retVal = new ArrayList<Extension>();
|
||||
for (Extension next : getExtension()) {
|
||||
if (theUrl.equals(next.getUrl())) {
|
||||
retVal.add(next);
|
||||
}
|
||||
}
|
||||
if (retVal.size() == 0)
|
||||
return null;
|
||||
else {
|
||||
org.apache.commons.lang3.Validate.isTrue(retVal.size() == 1, "Url "+theUrl+" must have only one match");
|
||||
return retVal.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasExtension(String theUrl) {
|
||||
return !getExtensionsByUrl(theUrl).isEmpty();
|
||||
}
|
||||
|
||||
public void addExtension(String url, Type value) {
|
||||
Extension ex = new Extension();
|
||||
ex.setUrl(url);
|
||||
ex.setValue(value);
|
||||
getExtension().add(ex);
|
||||
}
|
||||
|
||||
public String getExtensionString(String theUrl) throws FHIRException {
|
||||
List<Extension> ext = getExtensionsByUrl(theUrl);
|
||||
if (ext.isEmpty())
|
||||
|
|
|
@ -29,7 +29,7 @@ package org.hl7.fhir.dstu3.model;
|
|||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
*/
|
||||
|
||||
// Generated on Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x
|
||||
import java.util.ArrayList;
|
||||
|
@ -354,7 +354,7 @@ public abstract class Element extends Base implements IBaseHasExtensions, IBaseE
|
|||
public void setIdBase(String value) {
|
||||
setId(value);
|
||||
}
|
||||
// added from java-adornments.txt:
|
||||
// added from java-adornments.txt:
|
||||
public void addExtension(String url, Type value) {
|
||||
Extension ex = new Extension();
|
||||
ex.setUrl(url);
|
||||
|
@ -363,6 +363,6 @@ public abstract class Element extends Base implements IBaseHasExtensions, IBaseE
|
|||
}
|
||||
|
||||
|
||||
// end addition
|
||||
// end addition
|
||||
|
||||
}
|
|
@ -55,6 +55,7 @@ import org.hl7.fhir.r5.elementmodel.ObjectConverter;
|
|||
import org.hl7.fhir.r5.elementmodel.Property;
|
||||
import org.hl7.fhir.r5.model.Base;
|
||||
import org.hl7.fhir.r5.model.BooleanType;
|
||||
import org.hl7.fhir.r5.model.CanonicalType;
|
||||
import org.hl7.fhir.r5.model.Coding;
|
||||
import org.hl7.fhir.r5.model.DataType;
|
||||
import org.hl7.fhir.r5.model.Element;
|
||||
|
@ -2428,7 +2429,18 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
else
|
||||
derived.getMustHaveValueElement().setUserData(UD_DERIVATION_EQUALS, true);
|
||||
}
|
||||
|
||||
if (derived.hasValueAlternatives()) {
|
||||
if (!Base.compareDeep(derived.getValueAlternatives(), base.getValueAlternatives(), false))
|
||||
for (CanonicalType s : derived.getValueAlternatives()) {
|
||||
if (!base.hasValueAlternatives(s.getValue()))
|
||||
base.getValueAlternatives().add(s.copy());
|
||||
}
|
||||
else if (trimDifferential)
|
||||
derived.getValueAlternatives().clear();
|
||||
else
|
||||
for (CanonicalType t : derived.getValueAlternatives())
|
||||
t.setUserData(UD_DERIVATION_EQUALS, true);
|
||||
}
|
||||
|
||||
// profiles cannot change : isModifier, defaultValue, meaningWhenMissing
|
||||
// but extensions can change isModifier
|
||||
|
|
|
@ -12853,6 +12853,14 @@ If a pattern[x] is declared on a repeating element, the pattern applies to all r
|
|||
return getMin() == 1;
|
||||
}
|
||||
|
||||
public CanonicalType addValueAlternative(CanonicalType t) {
|
||||
if (this.valueAlternatives == null)
|
||||
this.valueAlternatives = new ArrayList<CanonicalType>();
|
||||
this.valueAlternatives.add(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
// end addition
|
||||
|
||||
}
|
||||
|
|
|
@ -85,68 +85,68 @@ import org.hl7.fhir.utilities.xhtml.XhtmlNodeList;
|
|||
|
||||
public class StructureDefinitionRenderer extends ResourceRenderer {
|
||||
|
||||
// public class ObligationWrapper {
|
||||
//
|
||||
// private Extension ext;
|
||||
//
|
||||
// public ObligationWrapper(Extension ext) {
|
||||
// this.ext = ext;
|
||||
// }
|
||||
//
|
||||
// public boolean hasActor() {
|
||||
// return ext.hasExtension("actor");
|
||||
// }
|
||||
//
|
||||
// public boolean hasActor(String id) {
|
||||
// return ext.hasExtension("actor") && id.equals(ext.getExtensionByUrl("actor").getValue().primitiveValue());
|
||||
// }
|
||||
//
|
||||
// public Coding getCode() {
|
||||
// Extension code = ext.getExtensionByUrl("obligation");
|
||||
// if (code != null && code.hasValueCoding()) {
|
||||
// return code.getValueCoding();
|
||||
// }
|
||||
// if (code != null && code.hasValueCodeType()) {
|
||||
// return new Coding().setSystem("http://hl7.org/fhir/tools/CodeSystem/obligation").setCode(code.getValueCodeType().primitiveValue());
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// public boolean hasFilter() {
|
||||
// return ext.hasExtension("filter");
|
||||
// }
|
||||
//
|
||||
// public String getFilter() {
|
||||
// Extension code = ext.getExtensionByUrl("filter");
|
||||
// if (code != null && code.getValue() != null) {
|
||||
// return code.getValue().primitiveValue();
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// public boolean hasUsage() {
|
||||
// return ext.hasExtension("usage");
|
||||
// }
|
||||
//
|
||||
// public String getFilterDocumentation() {
|
||||
// Extension code = ext.getExtensionByUrl("filter-desc");
|
||||
// if (code != null && code.getValue() != null) {
|
||||
// return code.getValue().primitiveValue();
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// public List<UsageContext> getUsage() {
|
||||
// List<UsageContext> usage = new ArrayList<>();
|
||||
// for (Extension u : ext.getExtensionsByUrl("usage" )) {
|
||||
// if (u.hasValueUsageContext()) {
|
||||
// usage.add(u.getValueUsageContext());
|
||||
// }
|
||||
// }
|
||||
// return usage;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// public class ObligationWrapper {
|
||||
//
|
||||
// private Extension ext;
|
||||
//
|
||||
// public ObligationWrapper(Extension ext) {
|
||||
// this.ext = ext;
|
||||
// }
|
||||
//
|
||||
// public boolean hasActor() {
|
||||
// return ext.hasExtension("actor");
|
||||
// }
|
||||
//
|
||||
// public boolean hasActor(String id) {
|
||||
// return ext.hasExtension("actor") && id.equals(ext.getExtensionByUrl("actor").getValue().primitiveValue());
|
||||
// }
|
||||
//
|
||||
// public Coding getCode() {
|
||||
// Extension code = ext.getExtensionByUrl("obligation");
|
||||
// if (code != null && code.hasValueCoding()) {
|
||||
// return code.getValueCoding();
|
||||
// }
|
||||
// if (code != null && code.hasValueCodeType()) {
|
||||
// return new Coding().setSystem("http://hl7.org/fhir/tools/CodeSystem/obligation").setCode(code.getValueCodeType().primitiveValue());
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// public boolean hasFilter() {
|
||||
// return ext.hasExtension("filter");
|
||||
// }
|
||||
//
|
||||
// public String getFilter() {
|
||||
// Extension code = ext.getExtensionByUrl("filter");
|
||||
// if (code != null && code.getValue() != null) {
|
||||
// return code.getValue().primitiveValue();
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// public boolean hasUsage() {
|
||||
// return ext.hasExtension("usage");
|
||||
// }
|
||||
//
|
||||
// public String getFilterDocumentation() {
|
||||
// Extension code = ext.getExtensionByUrl("filter-desc");
|
||||
// if (code != null && code.getValue() != null) {
|
||||
// return code.getValue().primitiveValue();
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// public List<UsageContext> getUsage() {
|
||||
// List<UsageContext> usage = new ArrayList<>();
|
||||
// for (Extension u : ext.getExtensionsByUrl("usage" )) {
|
||||
// if (u.hasValueUsageContext()) {
|
||||
// usage.add(u.getValueUsageContext());
|
||||
// }
|
||||
// }
|
||||
// return usage;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
@ -194,10 +194,10 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||
}
|
||||
|
||||
|
||||
// private static final int AGG_NONE = 0;
|
||||
// private static final int AGG_IND = 1;
|
||||
// private static final int AGG_GR = 2;
|
||||
// private static final boolean TABLE_FORMAT_FOR_FIXED_VALUES = false;
|
||||
// private static final int AGG_NONE = 0;
|
||||
// private static final int AGG_IND = 1;
|
||||
// private static final int AGG_GR = 2;
|
||||
// private static final boolean TABLE_FORMAT_FOR_FIXED_VALUES = false;
|
||||
public static final String CONSTRAINT_CHAR = "C";
|
||||
public static final String CONSTRAINT_STYLE = "padding-left: 3px; padding-right: 3px; border: 1px maroon solid; font-weight: bold; color: #301212; background-color: #fdf4f4;";
|
||||
private final boolean ADD_REFERENCE_TO_TABLE = true;
|
||||
|
@ -323,7 +323,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||
}
|
||||
}
|
||||
throw new Error("getElementByName: can't find "+contentReference+" in "+elements.toString()+" from "+source.getUrl());
|
||||
// return null;
|
||||
// return null;
|
||||
}
|
||||
|
||||
public XhtmlNode generateGrid(String defFile, StructureDefinition profile, String imageFolder, boolean inlineGraphics, String profileBaseFileName, String corePath, String imagePath, Set<String> outputTracker) throws IOException, FHIRException {
|
||||
|
@ -539,8 +539,8 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||
Row typesRow = null;
|
||||
|
||||
List<ElementDefinition> children = getChildren(all, element);
|
||||
// if (!snapshot && isExtension && extensions != null && extensions != isExtension)
|
||||
// return;
|
||||
// if (!snapshot && isExtension && extensions != null && extensions != isExtension)
|
||||
// return;
|
||||
|
||||
if (!onlyInformationIsMapping(all, element)) {
|
||||
Row row = gen.new Row();
|
||||
|
@ -716,10 +716,10 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||
}
|
||||
}
|
||||
}
|
||||
// if (!snapshot && (extensions == null || !extensions))
|
||||
// for (ElementDefinition child : children)
|
||||
// if (child.getPath().endsWith(".extension") || child.getPath().endsWith(".modifierExtension"))
|
||||
// genElement(defPath, gen, row.getSubRows(), child, all, profiles, showMissing, profileBaseFileName, true, false, corePath, imagePath, false, logicalModel, isConstraintMode, allInvariants);
|
||||
// if (!snapshot && (extensions == null || !extensions))
|
||||
// for (ElementDefinition child : children)
|
||||
// if (child.getPath().endsWith(".extension") || child.getPath().endsWith(".modifierExtension"))
|
||||
// genElement(defPath, gen, row.getSubRows(), child, all, profiles, showMissing, profileBaseFileName, true, false, corePath, imagePath, false, logicalModel, isConstraintMode, allInvariants);
|
||||
}
|
||||
if (typesRow != null && !element.prohibited() && context.getStructureMode() == StructureDefinitionRendererMode.SUMMARY) {
|
||||
makeChoiceRows(typesRow.getSubRows(), element, gen, corePath, profileBaseFileName, mustSupport, srcSD);
|
||||
|
@ -843,6 +843,9 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||
if (element != null && element.getIsSummary()) {
|
||||
checkForNoChange(element.getIsSummaryElement(), gc.addStyledText(translate("sd.table", "This element is included in summaries"), "\u03A3", null, null, null, false));
|
||||
}
|
||||
if (element != null && element.getMustHaveValue()) {
|
||||
checkForNoChange(element.getMustHaveValueElement(), gc.addStyledText(translate("sd.table", "This primitive element must have a value"), "V", "maroon", null, null, true));
|
||||
}
|
||||
if (element != null && (hasNonBaseConstraints(element.getConstraint()) || hasNonBaseConditions(element.getCondition()))) {
|
||||
Piece p = gc.addText(CONSTRAINT_CHAR);
|
||||
p.setHint(translate("sd.table", "This element has or is affected by constraints ("+listConstraintsAndConditions(element)+")"));
|
||||
|
@ -1154,6 +1157,9 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||
c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_BINDING_STYLE), null));
|
||||
c.getPieces().add(gen.new Piece(null, " binding style", null));
|
||||
}
|
||||
if (definition.hasValueAlternatives()) {
|
||||
addCanonicalList(gen, c, definition.getValueAlternatives(), "The primitive value may be replaced by the extension", true);
|
||||
}
|
||||
if (definition.hasExtension(ToolingExtensions.EXT_IMPLIED_PREFIX)) {
|
||||
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
|
||||
c.getPieces().add(gen.new Piece(null, "When this element is read ", null));
|
||||
|
@ -1272,19 +1278,9 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
|
||||
c.addPiece(gen.new Piece(null, "This is an obligation profile that only contains obligations and additional bindings", null).addStyle("font-weight:bold"));
|
||||
}
|
||||
for (Extension ext : profile.getExtensionsByUrl(ToolingExtensions.EXT_OBLIGATION_INHERITS)) {
|
||||
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
|
||||
String iu = ext.getValue().primitiveValue();
|
||||
c.addPiece(gen.new Piece(null, "This profile picks up obligations and additional bindings from ", null).addStyle("font-weight:bold"));
|
||||
StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, iu);
|
||||
if (sd == null) {
|
||||
c.addPiece(gen.new Piece(null, iu, null).addStyle("font-weight:bold"));
|
||||
} else if (sd.hasWebPath()) {
|
||||
c.addPiece(gen.new Piece(sd.getWebPath(), sd.present(), null).addStyle("font-weight:bold"));
|
||||
} else {
|
||||
c.addPiece(gen.new Piece(iu, sd.present(), null).addStyle("font-weight:bold"));
|
||||
}
|
||||
}
|
||||
addCanonicalListExt(gen, c, profile.getExtensionsByUrl(ToolingExtensions.EXT_OBLIGATION_INHERITS), "This profile picks up obligations and additional bindings from the profile", true);
|
||||
addCanonicalListExt(gen, c, profile.getExtensionsByUrl(ToolingExtensions.EXT_SD_IMPOSE_PROFILE), "This profile also imposes the profile", true);
|
||||
addCanonicalListExt(gen, c, profile.getExtensionsByUrl(ToolingExtensions.EXT_SD_COMPLIES_WITH_PROFILE), "This profile also complies with the profile", true);
|
||||
|
||||
if (profile.getKind() == StructureDefinitionKind.LOGICAL) {
|
||||
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
|
||||
|
@ -1415,6 +1411,50 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||
}
|
||||
|
||||
|
||||
private void addCanonicalListExt(HierarchicalTableGenerator gen, Cell c, List<Extension> list, String start, boolean bold) {
|
||||
List<CanonicalType> clist = new ArrayList<>();
|
||||
for (Extension ext : list) {
|
||||
if (ext.hasValueCanonicalType()) {
|
||||
clist.add(ext.getValueCanonicalType());
|
||||
}
|
||||
}
|
||||
addCanonicalList(gen, c, clist, start, bold);
|
||||
}
|
||||
|
||||
private void addCanonicalList(HierarchicalTableGenerator gen, Cell c, List<CanonicalType> list, String start, boolean bold) {
|
||||
if (!list.isEmpty()) {
|
||||
|
||||
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
|
||||
Piece p = gen.new Piece(null, start+(list.size() != 1 ? "s" : "")+" ", null);
|
||||
c.addPiece(p);
|
||||
if (bold) p.addStyle("font-weight:bold");
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
CanonicalType ct = list.get(i);
|
||||
if (i > 0) {
|
||||
if (i < list.size() - 1) {
|
||||
c.addPiece(gen.new Piece(null, ", ", null));
|
||||
} else {
|
||||
c.addPiece(gen.new Piece(null, " and ", null));
|
||||
}
|
||||
}
|
||||
String iu = ct.primitiveValue();
|
||||
StructureDefinition sd = context.getContext().fetchResource(StructureDefinition.class, iu);
|
||||
if (sd == null) {
|
||||
p = gen.new Piece(null, iu, null).addStyle("font-weight:bold");
|
||||
c.addPiece(p);
|
||||
} else if (sd.hasWebPath()) {
|
||||
p = gen.new Piece(sd.getWebPath(), sd.present(), null).addStyle("font-weight:bold");
|
||||
c.addPiece(p);
|
||||
} else {
|
||||
p = gen.new Piece(iu, sd.present(), null).addStyle("font-weight:bold");
|
||||
c.addPiece(p);
|
||||
}
|
||||
if (bold) p.addStyle("font-weight:bold");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Piece checkForNoChange(Element source, Piece piece) {
|
||||
if (source.hasUserData(ProfileUtilities.UD_DERIVATION_EQUALS)) {
|
||||
piece.addStyle("opacity: 0.5");
|
||||
|
@ -1706,7 +1746,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||
else
|
||||
row.getCells().add(gen.new Cell());
|
||||
generateGridDescription(gen, row, element, null, used.used, null, null, profile, corePath, imagePath, root, null);
|
||||
/* if (element.hasSlicing()) {
|
||||
/* if (element.hasSlicing()) {
|
||||
if (standardExtensionSlicing(element)) {
|
||||
used.used = element.hasType() && element.getType().get(0).hasProfile();
|
||||
showMissing = false;
|
||||
|
@ -2118,14 +2158,14 @@ public class StructureDefinitionRenderer extends ResourceRenderer {
|
|||
c.getPieces().add(gen.new Piece(null, "Definition: ", null).addStyle("font-weight:bold"));
|
||||
c.addPiece(gen.new Piece("br"));
|
||||
c.addMarkdown(definition.getDefinition());
|
||||
// c.getPieces().add(checkForNoChange(definition.getCommentElement(), gen.new Piece(null, definition.getComment(), null)));
|
||||
// c.getPieces().add(checkForNoChange(definition.getCommentElement(), gen.new Piece(null, definition.getComment(), null)));
|
||||
}
|
||||
if (definition.getComment()!=null) {
|
||||
if (!c.getPieces().isEmpty()) { c.addPiece(gen.new Piece("br")); }
|
||||
c.getPieces().add(gen.new Piece(null, "Comments: ", null).addStyle("font-weight:bold"));
|
||||
c.addPiece(gen.new Piece("br"));
|
||||
c.addMarkdown(definition.getComment());
|
||||
// c.getPieces().add(checkForNoChange(definition.getCommentElement(), gen.new Piece(null, definition.getComment(), null)));
|
||||
// c.getPieces().add(checkForNoChange(definition.getCommentElement(), gen.new Piece(null, definition.getComment(), null)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -210,6 +210,7 @@ public class ToolingExtensions {
|
|||
public static final String EXT_CAP_STMT_EXPECT = "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation";
|
||||
public static final String EXT_ED_HEIRARCHY = "http://hl7.org/fhir/StructureDefinition/elementdefinition-heirarchy";
|
||||
public static final String EXT_SD_IMPOSE_PROFILE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-imposeProfile";
|
||||
public static final String EXT_SD_COMPLIES_WITH_PROFILE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-compliesWithProfile";
|
||||
public static final String EXT_XML_NO_ORDER = "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-no-order";
|
||||
public static final String EXT_DEF_TYPE = "http://hl7.org/fhir/StructureDefinition/elementdefinition-defaulttype";
|
||||
public static final String EXT_TYPE_SPEC = "http://hl7.org/fhir/tools/StructureDefinition/type-specifier";
|
||||
|
@ -225,7 +226,7 @@ public class ToolingExtensions {
|
|||
public static final String EXT_DATE_FORMAT = "http://hl7.org/fhir/tools/StructureDefinition/elementdefinition-date-format";
|
||||
public static final String EXT_ID_EXPECTATION = "http://hl7.org/fhir/tools/StructureDefinition/id-expectation";
|
||||
public static final String EXT_JSON_PRIMITIVE_CHOICE = "http://hl7.org/fhir/tools/StructureDefinition/json-primitive-choice";
|
||||
public static final String EXT_SUMMARY = "http://hl7.org/fhir/tools/StructureDefinition/profile-summary";
|
||||
public static final String EXT_SUMMARY = "http://hl7.org/fhir/StructureDefinition/structuredefinition-summary";
|
||||
public static final String EXT_BINDING_DEFINITION = "http://hl7.org/fhir/tools/StructureDefinition/binding-definition";
|
||||
|
||||
|
||||
|
@ -750,6 +751,13 @@ public class ToolingExtensions {
|
|||
element.getExtension().add(extension);
|
||||
}
|
||||
|
||||
public static boolean hasAllowedUnits(ElementDefinition eld) {
|
||||
for (Extension e : eld.getExtension())
|
||||
if (e.getUrl().equals(EXT_ALLOWABLE_UNITS))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static DataType getAllowedUnits(ElementDefinition eld) {
|
||||
for (Extension e : eld.getExtension())
|
||||
if (e.getUrl().equals(EXT_ALLOWABLE_UNITS))
|
||||
|
|
|
@ -907,6 +907,8 @@ public class I18nConstants {
|
|||
public static final String QUESTIONNAIRE_Q_ITEM_DERIVED_NI_ANSWER_VS = "QUESTIONNAIRE_Q_ITEM_DERIVED_NI_ANSWER_VS";
|
||||
public static final String QUESTIONNAIRE_Q_ITEM_DERIVED_ANSWER_OPTIONS = "QUESTIONNAIRE_Q_ITEM_DERIVED_ANSWER_OPTIONS";
|
||||
public static final String QUESTIONNAIRE_Q_ITEM_DERIVED_ANSWER_OPTIONS_NEW = "QUESTIONNAIRE_Q_ITEM_DERIVED_ANSWER_OPTIONS_NEW";
|
||||
public static final String PRIMITIVE_MUSTHAVEVALUE_MESSAGE = "PRIMITIVE_MUSTHAVEVALUE_MESSAGE";
|
||||
public static final String PRIMITIVE_VALUE_ALTERNATIVES_MESSAGE = "PRIMITIVE_VALUE_ALTERNATIVES_MESSAGE";
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ import java.io.OutputStream;
|
|||
import java.io.OutputStreamWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.xml.IXMLWriter;
|
||||
|
@ -79,6 +80,15 @@ public class XhtmlComposer {
|
|||
return sdst.toString();
|
||||
}
|
||||
|
||||
public String compose(List<XhtmlNode> nodes) throws IOException {
|
||||
StringWriter sdst = new StringWriter();
|
||||
dst = sdst;
|
||||
for (XhtmlNode node : nodes) {
|
||||
writeNode("", node, false);
|
||||
}
|
||||
return sdst.toString();
|
||||
}
|
||||
|
||||
public void compose(OutputStream stream, XhtmlDocument doc) throws IOException {
|
||||
byte[] bom = new byte[] { (byte)0xEF, (byte)0xBB, (byte)0xBF };
|
||||
stream.write(bom);
|
||||
|
@ -361,4 +371,9 @@ public class XhtmlComposer {
|
|||
}
|
||||
}
|
||||
|
||||
public String compose(XhtmlNodeList childNodes) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -960,4 +960,6 @@ QUESTIONNAIRE_Q_ITEM_DERIVED_NC_ANSWER_TYPE = The item with linkId ''{1}'' found
|
|||
QUESTIONNAIRE_Q_ITEM_DERIVED_NI_ANSWER_VS = The validator can''t check derived item value set consistency (yet?)
|
||||
QUESTIONNAIRE_Q_ITEM_DERIVED_ANSWER_OPTIONS = The item with linkId ''{1}'' found in questionnaire ''{0}'' has answerOptions, so this item must have some too
|
||||
QUESTIONNAIRE_Q_ITEM_DERIVED_ANSWER_OPTIONS_NEW = The item with linkId ''{1}'' found in questionnaire ''{0}'' does not have this answerOption, so it is not valid
|
||||
|
||||
PRIMITIVE_MUSTHAVEVALUE_MESSAGE = The element definition ``{0}`` in the profile ''{1}'' requires that a value be present in this element
|
||||
PRIMITIVE_VALUE_ALTERNATIVES_MESSAGE_one = The element definition ``{0}`` in the profile ''{1}'' requires that if a value is not present, the extension ''{2}'' must be present
|
||||
PRIMITIVE_VALUE_ALTERNATIVES_MESSAGE_other = The element definition ``{0}`` in the profile ''{1}'' requires that if a value is not present, one of the extensions ''{2}'' must be present
|
||||
|
|
|
@ -2290,6 +2290,16 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
if (context.hasBinding()) {
|
||||
ok = rule(errors, NO_RULE_DATE, IssueType.CODEINVALID, e.line(), e.col(), path, context.getBinding().getStrength() != BindingStrength.REQUIRED, I18nConstants.Terminology_TX_Code_ValueSet_MISSING) && ok;
|
||||
}
|
||||
ok = rule(errors, "2023-06-18", IssueType.INVALID, e.line(), e.col(), path, !context.getMustHaveValue(), I18nConstants.PRIMITIVE_MUSTHAVEVALUE_MESSAGE, context.getId(), profile.getVersionedUrl()) && ok;
|
||||
if (context.hasValueAlternatives()) {
|
||||
boolean found = false;
|
||||
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
|
||||
for (CanonicalType ct : context.getValueAlternatives()) {
|
||||
found = found || e.hasExtension(ct.getValue());
|
||||
b.append(ct.getValue());
|
||||
}
|
||||
ok = rulePlural(errors, "2023-06-18", IssueType.INVALID, e.line(), e.col(), path, found, context.getValueAlternatives().size(), I18nConstants.PRIMITIVE_VALUE_ALTERNATIVES_MESSAGE, context.getId(), profile.getVersionedUrl(), b.toString()) && ok;
|
||||
}
|
||||
return ok;
|
||||
} else {
|
||||
boolean hasBiDiControls = UnicodeUtilities.hasBiDiChars(e.primitiveValue());
|
||||
|
|
Loading…
Reference in New Issue