diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/primitive40_50/Canonical40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/primitive40_50/Canonical40_50.java index 8b01c54cf..3e6cf10ec 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/primitive40_50/Canonical40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/primitive40_50/Canonical40_50.java @@ -2,6 +2,8 @@ package org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50; import org.hl7.fhir.convertors.context.ConversionContext40_50; import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.r4.model.Type; +import org.hl7.fhir.r5.model.DataType; public class Canonical40_50 { public static org.hl7.fhir.r5.model.CanonicalType convertCanonical(org.hl7.fhir.r4.model.CanonicalType src) throws FHIRException { @@ -15,4 +17,31 @@ public class Canonical40_50 { ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); return tgt; } + + public static org.hl7.fhir.r5.model.UriType convertCanonicalToUri(org.hl7.fhir.r4.model.CanonicalType src) throws FHIRException { + org.hl7.fhir.r5.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UriType(src.getValueAsString()) : new org.hl7.fhir.r5.model.UriType(); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4.model.UriType convertCanonicalToUri(org.hl7.fhir.r5.model.CanonicalType src) throws FHIRException { + org.hl7.fhir.r4.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.UriType(src.getValueAsString()) : new org.hl7.fhir.r4.model.UriType(); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + return tgt; + } + + + + public static org.hl7.fhir.r5.model.CanonicalType convertUriToCanonical(org.hl7.fhir.r4.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(); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + return tgt; + } + + public static org.hl7.fhir.r4.model.CanonicalType convertUriToCanonical(org.hl7.fhir.r5.model.UriType src) throws FHIRException { + org.hl7.fhir.r4.model.CanonicalType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.CanonicalType(src.getValueAsString()) : new org.hl7.fhir.r4.model.CanonicalType(); + ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); + return tgt; + } + } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MessageHeader40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MessageHeader40_50.java index 2feb5d60c..d36962143 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MessageHeader40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/resources40_50/MessageHeader40_50.java @@ -2,6 +2,7 @@ package org.hl7.fhir.convertors.conv40_50.resources40_50; import org.hl7.fhir.convertors.context.ConversionContext40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.CodeableConcept40_50; +import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Coding40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.ContactPoint40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Canonical40_50; import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50; @@ -45,8 +46,11 @@ public class MessageHeader40_50 { return null; org.hl7.fhir.r5.model.MessageHeader tgt = new org.hl7.fhir.r5.model.MessageHeader(); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt); - if (src.hasEvent()) - tgt.setEvent(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getEvent())); + if (src.hasEventUriType()) + tgt.setEvent(Canonical40_50.convertUriToCanonical(src.getEventUriType())); + if (src.hasEventCoding()) + tgt.setEvent(Coding40_50.convertCoding(src.getEventCoding())); + for (org.hl7.fhir.r4.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); if (src.hasSender()) @@ -74,8 +78,10 @@ public class MessageHeader40_50 { return null; org.hl7.fhir.r4.model.MessageHeader tgt = new org.hl7.fhir.r4.model.MessageHeader(); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt); - if (src.hasEvent()) - tgt.setEvent(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getEvent())); + if (src.hasEventCanonicalType()) + tgt.setEvent(Canonical40_50.convertCanonicalToUri(src.getEventCanonicalType())); + if (src.hasEventCoding()) + tgt.setEvent(Coding40_50.convertCoding(src.getEventCoding())); for (org.hl7.fhir.r5.model.MessageHeader.MessageDestinationComponent t : src.getDestination()) tgt.addDestination(convertMessageDestinationComponent(t)); if (src.hasSender()) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java index bc288eba6..c8b2302ef 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java @@ -115,7 +115,11 @@ public abstract class TerminologyRenderer extends ResourceRenderer { for (UsedConceptMap m : maps) { XhtmlNode td = tr.td(); XhtmlNode b = td.b(); - XhtmlNode a = b.ah(getContext().getSpecificationLink()+m.getLink()); + String link = m.getLink(); + if (!Utilities.isAbsoluteUrl(link)) { + link = getContext().getSpecificationLink()+link; + } + XhtmlNode a = b.ah(link); a.addText(m.getDetails().getName()); if (m.getDetails().isDoDescription() && m.getMap().hasDescription()) addMarkdown(td, m.getMap().getDescription()); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java index 485d8eb5e..5cd90ccdc 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ValueSetRenderer.java @@ -844,14 +844,15 @@ public class ValueSetRenderer extends TerminologyRenderer { } private void addRefToCode(XhtmlNode td, String target, String vslink, String code) { - CodeSystem cs = getContext().getWorker().fetchCodeSystem(target); - String cslink = getCsRef(cs); - XhtmlNode a = null; - if (cslink != null) - a = td.ah(getContext().getSpecificationLink()+cslink+"#"+cs.getId()+"-"+code); - else - a = td.ah(getContext().getSpecificationLink()+vslink+"#"+code); - a.addText(code); + addCodeToTable(false, target, code, null, td); +// CodeSystem cs = getContext().getWorker().fetchCodeSystem(target); +// String cslink = getCsRef(cs); +// String link = cslink != null ? cslink+"#"+cs.getId()+"-"+code : vslink+"#"+code; +// if (!Utilities.isAbsoluteUrl(link)) { +// link = getContext().getSpecificationLink()+link; +// } +// XhtmlNode a = td.ah(link); +// a.addText(code); } private boolean generateComposition(XhtmlNode x, ValueSet vs, boolean header, List maps) throws FHIRException, IOException { diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureDefinitionValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureDefinitionValidator.java index d89bdb288..a33279035 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureDefinitionValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureDefinitionValidator.java @@ -295,6 +295,7 @@ public class StructureDefinitionValidator extends BaseValidator { case "VirtualServiceDetail" :return addCharacteristicsForType(set); case "Availability" :return addCharacteristicsForType(set); case "MonetaryComponent" :return addCharacteristicsForType(set); + case "ElementDefinition" :return addCharacteristicsForType(set); case "BackboneElement" :return addCharacteristicsForType(set); default: