Merge pull request #921 from hapifhir/gg-202209-cm-fix

Gg 202209 cm fix
This commit is contained in:
Grahame Grieve 2022-09-10 15:49:59 +10:00 committed by GitHub
commit 489350e58b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 13 deletions

View File

@ -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;
}
}

View File

@ -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())

View File

@ -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());

View File

@ -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<UsedConceptMap> maps) throws FHIRException, IOException {

View File

@ -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: