Added conversion support for Conformance.messaging.event

This commit is contained in:
Lloyd McKenzie 2019-12-26 23:33:52 -06:00
parent 4cdd0342c9
commit 2bb872fee2
9 changed files with 262 additions and 8 deletions

View File

@ -29,6 +29,7 @@ public class VersionConvertorConstants {
public final static String MODIFIER_TAKEN = "http://hl7.org/fhir/4.0/StructureDefinition/extension-MedicationStatment.taken";
public final static String MODIFIER_REASON_LEGACY = "No Modifier Reason provideed in previous versions of FHIR";
public final static String PROFILE_EXTENSION = "http://hl7.org/fhir/4.0/StructureDefinition/extension-ElementDefinition.type.profile";
public final static String IG_CONFORMANCE_MESSAGE_EVENT = "http://hl7.org/fhir/1.0/StructureDefinition/extension-Conformance.messaging.event";
public static String refToVS(String url) {
if (url == null)

View File

@ -4737,6 +4737,25 @@ public class VersionConvertor_10_40 {
tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t));
tgt.setReliableCache(src.getReliableCache());
tgt.setDocumentation(src.getDocumentation());
for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent t : src.getEvent()) {
org.hl7.fhir.r4.model.Extension e = new org.hl7.fhir.r4.model.Extension(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT);
e.addExtension(new org.hl7.fhir.r4.model.Extension("code", convertCoding(t.getCode())));
if (t.hasCategory())
e.addExtension(new org.hl7.fhir.r4.model.Extension("category", new org.hl7.fhir.r4.model.CodeType(t.getCategory().toCode())));
e.addExtension(new org.hl7.fhir.r4.model.Extension("mode", new org.hl7.fhir.r4.model.CodeType(t.getMode().toCode())));
if (t.getFocusElement().hasValue())
e.addExtension(new org.hl7.fhir.r4.model.Extension("focus", new org.hl7.fhir.r4.model.StringType(t.getFocus())));
else {
org.hl7.fhir.r4.model.Extension focusE = new org.hl7.fhir.r4.model.Extension("focus");
copyElement(t.getFocusElement(), focusE);
e.addExtension(focusE);
}
e.addExtension(new org.hl7.fhir.r4.model.Extension("request", convertReference(t.getRequest())));
e.addExtension(new org.hl7.fhir.r4.model.Extension("response", convertReference(t.getResponse())));
if (t.hasDocumentation())
e.addExtension(new org.hl7.fhir.r4.model.Extension("documentation", new org.hl7.fhir.r4.model.StringType(t.getDocumentation())));
tgt.addExtension(e);
}
return tgt;
}
@ -4749,6 +4768,25 @@ public class VersionConvertor_10_40 {
tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t));
tgt.setReliableCache(src.getReliableCache());
tgt.setDocumentation(src.getDocumentation());
for (org.hl7.fhir.r4.model.Extension e : src.getExtensionsByUrl(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT)) {
org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent event = new org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent();
tgt.addEvent(event);
event.setCode(convertCoding((org.hl7.fhir.r4.model.Coding)e.getExtensionByUrl("code").getValue()));
if (e.hasExtension("category"))
event.setCategory(org.hl7.fhir.dstu2.model.Conformance.MessageSignificanceCategory.fromCode(e.getExtensionByUrl("category").getValue().toString()));
event.setMode(org.hl7.fhir.dstu2.model.Conformance.ConformanceEventMode.fromCode(e.getExtensionByUrl("mode").getValue().toString()));
org.hl7.fhir.r4.model.Extension focusE = e.getExtensionByUrl("focus");
if (focusE.hasValue())
event.setFocus(focusE.getValue().toString());
else {
event.setFocusElement(new org.hl7.fhir.dstu2.model.CodeType());
copyElement(focusE, event.getFocusElement());
}
event.setRequest(convertReference((org.hl7.fhir.r4.model.Reference)e.getExtensionByUrl("request").getValue()));
event.setResponse(convertReference((org.hl7.fhir.r4.model.Reference)e.getExtensionByUrl("response").getValue()));
if (e.hasExtension("documentation"))
event.setDocumentation(e.getExtensionByUrl("documentation").getValue().toString());
}
return tgt;
}

View File

@ -4744,6 +4744,25 @@ public class VersionConvertor_10_50 {
tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t));
tgt.setReliableCache(src.getReliableCache());
tgt.setDocumentation(src.getDocumentation());
for (org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent t : src.getEvent()) {
org.hl7.fhir.r5.model.Extension e = new org.hl7.fhir.r5.model.Extension(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT);
e.addExtension(new org.hl7.fhir.r5.model.Extension("code", convertCoding(t.getCode())));
if (t.hasCategory())
e.addExtension(new org.hl7.fhir.r5.model.Extension("category", new org.hl7.fhir.r5.model.CodeType(t.getCategory().toCode())));
e.addExtension(new org.hl7.fhir.r5.model.Extension("mode", new org.hl7.fhir.r5.model.CodeType(t.getMode().toCode())));
if (t.getFocusElement().hasValue())
e.addExtension(new org.hl7.fhir.r5.model.Extension("focus", new org.hl7.fhir.r5.model.StringType(t.getFocus())));
else {
org.hl7.fhir.r5.model.Extension focusE = new org.hl7.fhir.r5.model.Extension("focus");
copyElement(t.getFocusElement(), focusE);
e.addExtension(focusE);
}
e.addExtension(new org.hl7.fhir.r5.model.Extension("request", convertReference(t.getRequest())));
e.addExtension(new org.hl7.fhir.r5.model.Extension("response", convertReference(t.getResponse())));
if (t.hasDocumentation())
e.addExtension(new org.hl7.fhir.r5.model.Extension("documentation", new org.hl7.fhir.r5.model.StringType(t.getDocumentation())));
tgt.addExtension(e);
}
return tgt;
}
@ -4756,6 +4775,26 @@ public class VersionConvertor_10_50 {
tgt.addEndpoint(convertConformanceMessagingEndpointComponent(t));
tgt.setReliableCache(src.getReliableCache());
tgt.setDocumentation(src.getDocumentation());
for (org.hl7.fhir.r5.model.Extension e : src.getExtensionsByUrl(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT)) {
org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent event = new org.hl7.fhir.dstu2.model.Conformance.ConformanceMessagingEventComponent();
tgt.addEvent(event);
event.setCode(convertCoding((org.hl7.fhir.r5.model.Coding)e.getExtensionByUrl("code").getValue()));
if (e.hasExtension("category"))
event.setCategory(org.hl7.fhir.dstu2.model.Conformance.MessageSignificanceCategory.fromCode(e.getExtensionByUrl("category").getValue().toString()));
event.setMode(org.hl7.fhir.dstu2.model.Conformance.ConformanceEventMode.fromCode(e.getExtensionByUrl("mode").getValue().toString()));
event.setCode(convertCoding((org.hl7.fhir.r5.model.Coding)e.getExtensionByUrl("code").getValue()));
org.hl7.fhir.r5.model.Extension focusE = e.getExtensionByUrl("focus");
if (focusE.hasValue())
event.setFocus(focusE.getValue().toString());
else {
event.setFocusElement(new org.hl7.fhir.dstu2.model.CodeType());
copyElement(focusE, event.getFocusElement());
}
event.setRequest(convertReference((org.hl7.fhir.r5.model.Reference)e.getExtensionByUrl("request").getValue()));
event.setResponse(convertReference((org.hl7.fhir.r5.model.Reference)e.getExtensionByUrl("response").getValue()));
if (e.hasExtension("documentation"))
event.setDocumentation(e.getExtensionByUrl("documentation").getValue().toString());
}
return tgt;
}

View File

@ -78,7 +78,7 @@ public class VersionConvertor_14_30 {
if (src.hasId())
tgt.setId(src.getId());
for (org.hl7.fhir.dstu2016may.model.Extension e : src.getExtension()) {
if (!Utilities.existsInList(e.getUrl(), exemptExtensions)) {
if (!Utilities.existsInList(e.getUrl(), exemptExtensions) && (!(e.getUrl().equals(VersionConvertorConstants.PROFILE_EXTENSION) || e.getUrl().equals(VersionConvertorConstants.IG_DEPENDSON_PACKAGE_EXTENSION) || e.getUrl().equals(VersionConvertorConstants.IG_DEPENDSON_VERSION_EXTENSION)))) {
tgt.addExtension(convertExtension(e));
}
}
@ -1433,7 +1433,8 @@ public class VersionConvertor_14_30 {
}
for (org.hl7.fhir.dstu2016may.model.Extension t : src.getExtensionsByUrl(VersionConvertorConstants.PROFILE_EXTENSION)) {
// We don't have a good way to distinguish resources that have both 'profile' and 'targetProfile' when the type is reference, so the best we can do is by name.
tgt.setProfile(t.getValue().toString());
String s = ((org.hl7.fhir.dstu2016may.model.PrimitiveType<String>)t.getValue()).getValue();
tgt.setProfile(s);
}
for (org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.ElementDefinition.AggregationMode> t : src.getAggregation())
copyElement(t, tgt.addAggregationElement().setValue(convertAggregationMode(t.getValue())));

View File

@ -113,7 +113,7 @@ public class VersionConvertor_14_40 {
if (src.hasId())
tgt.setId(src.getId());
for (org.hl7.fhir.dstu2016may.model.Extension e : src.getExtension()) {
if (!Utilities.existsInList(e.getUrl(), exemptExtensions) && (!(e.getUrl().equals(VersionConvertorConstants.IG_DEPENDSON_PACKAGE_EXTENSION) || e.getUrl().equals(VersionConvertorConstants.IG_DEPENDSON_VERSION_EXTENSION)))) {
if (!Utilities.existsInList(e.getUrl(), exemptExtensions) && (!(e.getUrl().equals(VersionConvertorConstants.PROFILE_EXTENSION) || e.getUrl().equals(VersionConvertorConstants.IG_DEPENDSON_PACKAGE_EXTENSION) || e.getUrl().equals(VersionConvertorConstants.IG_DEPENDSON_VERSION_EXTENSION)))) {
tgt.addExtension(convertExtension(e));
}
}
@ -1516,7 +1516,8 @@ public class VersionConvertor_14_40 {
}
for (org.hl7.fhir.dstu2016may.model.Extension t : src.getExtensionsByUrl(VersionConvertorConstants.PROFILE_EXTENSION)) {
// We don't have a good way to distinguish resources that have both 'profile' and 'targetProfile' when the type is reference, so the best we can do is by name.
tgt.addProfile(t.getValue().toString());
String s = ((org.hl7.fhir.dstu2016may.model.PrimitiveType<String>)t.getValue()).getValue();
tgt.addProfile(s);
}
} else {
for (org.hl7.fhir.dstu2016may.model.UriType u : src.getProfile())
@ -3997,6 +3998,25 @@ public class VersionConvertor_14_40 {
tgt.setReliableCache(src.getReliableCache());
if (src.hasDocumentation())
tgt.setDocumentation(src.getDocumentation());
for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEventComponent t : src.getEvent()) {
org.hl7.fhir.r4.model.Extension e = new org.hl7.fhir.r4.model.Extension(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT);
e.addExtension(new org.hl7.fhir.r4.model.Extension("code", convertCoding(t.getCode())));
if (t.hasCategory())
e.addExtension(new org.hl7.fhir.r4.model.Extension("category", new org.hl7.fhir.r4.model.CodeType(t.getCategory().toCode())));
e.addExtension(new org.hl7.fhir.r4.model.Extension("mode", new org.hl7.fhir.r4.model.CodeType(t.getMode().toCode())));
if (t.getFocusElement().hasValue())
e.addExtension(new org.hl7.fhir.r4.model.Extension("focus", new org.hl7.fhir.r4.model.StringType(t.getFocus())));
else {
org.hl7.fhir.r4.model.Extension focusE = new org.hl7.fhir.r4.model.Extension("focus");
copyElement(t.getFocusElement(), focusE);
e.addExtension(focusE);
}
e.addExtension(new org.hl7.fhir.r4.model.Extension("request", convertReference(t.getRequest())));
e.addExtension(new org.hl7.fhir.r4.model.Extension("response", convertReference(t.getResponse())));
if (t.hasDocumentation())
e.addExtension(new org.hl7.fhir.r4.model.Extension("documentation", new org.hl7.fhir.r4.model.StringType(t.getDocumentation())));
tgt.addExtension(e);
}
return tgt;
}
@ -4011,6 +4031,29 @@ public class VersionConvertor_14_40 {
tgt.setReliableCache(src.getReliableCache());
if (src.hasDocumentation())
tgt.setDocumentation(src.getDocumentation());
for (org.hl7.fhir.r4.model.Extension e : src.getExtensionsByUrl(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT)) {
org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEventComponent event = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEventComponent();
tgt.addEvent(event);
event.setCode(convertCoding((org.hl7.fhir.r4.model.Coding)e.getExtensionByUrl("code").getValue()));
if (e.hasExtension("category"))
event.setCategory(org.hl7.fhir.dstu2016may.model.Conformance.MessageSignificanceCategory.fromCode(e.getExtensionByUrl("category").getValue().toString()));
event.setMode(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventMode.fromCode(e.getExtensionByUrl("mode").getValue().toString()));
event.setCode(convertCoding((org.hl7.fhir.r4.model.Coding)e.getExtensionByUrl("code").getValue()));
if (e.hasExtension("category"))
event.setCategory(org.hl7.fhir.dstu2016may.model.Conformance.MessageSignificanceCategory.fromCode(e.getExtensionByUrl("category").getValue().toString()));
event.setMode(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventMode.fromCode(e.getExtensionByUrl("mode").getValue().toString()));
org.hl7.fhir.r4.model.Extension focusE = e.getExtensionByUrl("focus");
if (focusE.hasValue())
event.setFocus(focusE.getValue().toString());
else {
event.setFocusElement(new org.hl7.fhir.dstu2016may.model.CodeType());
copyElement(focusE, event.getFocusElement());
}
event.setRequest(convertReference((org.hl7.fhir.r4.model.Reference)e.getExtensionByUrl("request").getValue()));
event.setResponse(convertReference((org.hl7.fhir.r4.model.Reference)e.getExtensionByUrl("response").getValue()));
if (e.hasExtension("documentation"))
event.setDocumentation(e.getExtensionByUrl("documentation").getValue().toString());
}
return tgt;
}

View File

@ -109,11 +109,22 @@ public class VersionConvertor_14_50 {
CANONICAL_URLS.add("http://hl7.org/fhir/StructureDefinition/valueset-system");
}
private static boolean mappedExtension(String url) {
if (
url.equals(VersionConvertorConstants.PROFILE_EXTENSION) ||
url.equals(VersionConvertorConstants.IG_DEPENDSON_PACKAGE_EXTENSION) ||
url.equals(VersionConvertorConstants.IG_DEPENDSON_VERSION_EXTENSION) ||
url.equals(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT)
)
return true;
return false;
}
private static void copyElement(org.hl7.fhir.dstu2016may.model.Element src, org.hl7.fhir.r5.model.Element tgt, String... exemptExtensions) throws FHIRException {
if (src.hasId())
tgt.setId(src.getId());
for (org.hl7.fhir.dstu2016may.model.Extension e : src.getExtension()) {
if (!Utilities.existsInList(e.getUrl(), exemptExtensions) && (!(e.getUrl().equals(VersionConvertorConstants.IG_DEPENDSON_PACKAGE_EXTENSION) || e.getUrl().equals(VersionConvertorConstants.IG_DEPENDSON_VERSION_EXTENSION))))
if (!Utilities.existsInList(e.getUrl(), exemptExtensions) && !mappedExtension(e.getUrl().toString()))
tgt.addExtension(convertExtension(e));
}
}
@ -1516,7 +1527,8 @@ public class VersionConvertor_14_50 {
}
for (org.hl7.fhir.dstu2016may.model.Extension t : src.getExtensionsByUrl(VersionConvertorConstants.PROFILE_EXTENSION)) {
// We don't have a good way to distinguish resources that have both 'profile' and 'targetProfile' when the type is reference, so the best we can do is by name.
tgt.addProfile(t.getValue().toString());
String s = ((org.hl7.fhir.dstu2016may.model.PrimitiveType<String>)t.getValue()).getValue();
tgt.addProfile(s);
}
} else {
for (org.hl7.fhir.dstu2016may.model.UriType u : src.getProfile())
@ -3998,6 +4010,25 @@ public class VersionConvertor_14_50 {
tgt.setReliableCache(src.getReliableCache());
if (src.hasDocumentation())
tgt.setDocumentation(src.getDocumentation());
for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEventComponent t : src.getEvent()) {
org.hl7.fhir.r5.model.Extension e = new org.hl7.fhir.r5.model.Extension(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT);
e.addExtension(new org.hl7.fhir.r5.model.Extension("code", convertCoding(t.getCode())));
if (t.hasCategory())
e.addExtension(new org.hl7.fhir.r5.model.Extension("category", new org.hl7.fhir.r5.model.CodeType(t.getCategory().toCode())));
e.addExtension(new org.hl7.fhir.r5.model.Extension("mode", new org.hl7.fhir.r5.model.CodeType(t.getMode().toCode())));
if (t.getFocusElement().hasValue())
e.addExtension(new org.hl7.fhir.r5.model.Extension("focus", new org.hl7.fhir.r5.model.StringType(t.getFocus())));
else {
org.hl7.fhir.r5.model.Extension focusE = new org.hl7.fhir.r5.model.Extension("focus");
copyElement(t.getFocusElement(), focusE);
e.addExtension(focusE);
}
e.addExtension(new org.hl7.fhir.r5.model.Extension("request", convertReference(t.getRequest())));
e.addExtension(new org.hl7.fhir.r5.model.Extension("response", convertReference(t.getResponse())));
if (t.hasDocumentation())
e.addExtension(new org.hl7.fhir.r5.model.Extension("documentation", new org.hl7.fhir.r5.model.StringType(t.getDocumentation())));
tgt.addExtension(e);
}
return tgt;
}
@ -4012,6 +4043,25 @@ public class VersionConvertor_14_50 {
tgt.setReliableCache(src.getReliableCache());
if (src.hasDocumentation())
tgt.setDocumentation(src.getDocumentation());
for (org.hl7.fhir.r5.model.Extension e : src.getExtensionsByUrl(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT)) {
org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEventComponent event = new org.hl7.fhir.dstu2016may.model.Conformance.ConformanceMessagingEventComponent();
tgt.addEvent(event);
event.setCode(convertCoding((org.hl7.fhir.r5.model.Coding)e.getExtensionByUrl("code").getValue()));
if (e.hasExtension("category"))
event.setCategory(org.hl7.fhir.dstu2016may.model.Conformance.MessageSignificanceCategory.fromCode(e.getExtensionByUrl("category").getValue().toString()));
event.setMode(org.hl7.fhir.dstu2016may.model.Conformance.ConformanceEventMode.fromCode(e.getExtensionByUrl("mode").getValue().toString()));
org.hl7.fhir.r5.model.Extension focusE = e.getExtensionByUrl("focus");
if (focusE.hasValue())
event.setFocus(focusE.getValue().toString());
else {
event.setFocusElement(new org.hl7.fhir.dstu2016may.model.CodeType());
copyElement(focusE, event.getFocusElement());
}
event.setRequest(convertReference((org.hl7.fhir.r5.model.Reference)e.getExtensionByUrl("request").getValue()));
event.setResponse(convertReference((org.hl7.fhir.r5.model.Reference)e.getExtensionByUrl("response").getValue()));
if (e.hasExtension("documentation"))
event.setDocumentation(e.getExtensionByUrl("documentation").getValue().toString());
}
return tgt;
}

View File

@ -5382,6 +5382,25 @@ public class VersionConvertor_30_40 {
tgt.setDocumentation(src.getDocumentation());
for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage())
tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t));
for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent t : src.getEvent()) {
org.hl7.fhir.r4.model.Extension e = new org.hl7.fhir.r4.model.Extension(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT);
e.addExtension(new org.hl7.fhir.r4.model.Extension("code", convertCoding(t.getCode())));
if (t.hasCategory())
e.addExtension(new org.hl7.fhir.r4.model.Extension("category", new org.hl7.fhir.r4.model.CodeType(t.getCategory().toCode())));
e.addExtension(new org.hl7.fhir.r4.model.Extension("mode", new org.hl7.fhir.r4.model.CodeType(t.getMode().toCode())));
if (t.getFocusElement().hasValue())
e.addExtension(new org.hl7.fhir.r4.model.Extension("focus", new org.hl7.fhir.r4.model.StringType(t.getFocus())));
else {
org.hl7.fhir.r4.model.Extension focusE = new org.hl7.fhir.r4.model.Extension("focus");
copyElement(t.getFocusElement(), focusE);
e.addExtension(focusE);
}
e.addExtension(new org.hl7.fhir.r4.model.Extension("request", convertReference(t.getRequest())));
e.addExtension(new org.hl7.fhir.r4.model.Extension("response", convertReference(t.getResponse())));
if (t.hasDocumentation())
e.addExtension(new org.hl7.fhir.r4.model.Extension("documentation", new org.hl7.fhir.r4.model.StringType(t.getDocumentation())));
tgt.addExtension(e);
}
return tgt;
}
@ -5398,6 +5417,29 @@ public class VersionConvertor_30_40 {
tgt.setDocumentation(src.getDocumentation());
for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage())
tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t));
for (org.hl7.fhir.r4.model.Extension e : src.getExtensionsByUrl(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT)) {
org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent event = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent();
tgt.addEvent(event);
event.setCode(convertCoding((org.hl7.fhir.r4.model.Coding)e.getExtensionByUrl("code").getValue()));
if (e.hasExtension("category"))
event.setCategory(org.hl7.fhir.dstu3.model.CapabilityStatement.MessageSignificanceCategory.fromCode(e.getExtensionByUrl("category").getValue().toString()));
event.setMode(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.fromCode(e.getExtensionByUrl("mode").getValue().toString()));
event.setCode(convertCoding((org.hl7.fhir.r4.model.Coding)e.getExtensionByUrl("code").getValue()));
if (e.hasExtension("category"))
event.setCategory(org.hl7.fhir.dstu3.model.Conformance.MessageSignificanceCategory.fromCode(e.getExtensionByUrl("category").getValue().toString()));
event.setMode(org.hl7.fhir.dstu3.model.Conformance.ConformanceEventMode.fromCode(e.getExtensionByUrl("mode").getValue().toString()));
org.hl7.fhir.r4.model.Extension focusE = e.getExtensionByUrl("focus");
if (focusE.hasValue())
event.setFocus(focusE.getValue().toString());
else {
event.setFocusElement(new org.hl7.fhir.dstu3.model.CodeType());
copyElement(focusE, event.getFocusElement());
}
event.setRequest(convertReference((org.hl7.fhir.r4.model.Reference)e.getExtensionByUrl("request").getValue()));
event.setResponse(convertReference((org.hl7.fhir.r4.model.Reference)e.getExtensionByUrl("response").getValue()));
if (e.hasExtension("documentation"))
event.setDocumentation(e.getExtensionByUrl("documentation").getValue().toString());
}
return tgt;
}

View File

@ -5369,6 +5369,25 @@ public class VersionConvertor_30_50 {
tgt.setDocumentation(src.getDocumentation());
for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage())
tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t));
for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent t : src.getEvent()) {
org.hl7.fhir.r5.model.Extension e = new org.hl7.fhir.r5.model.Extension(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT);
e.addExtension(new org.hl7.fhir.r5.model.Extension("code", convertCoding(t.getCode())));
if (t.hasCategory())
e.addExtension(new org.hl7.fhir.r5.model.Extension("category", new org.hl7.fhir.r5.model.CodeType(t.getCategory().toCode())));
e.addExtension(new org.hl7.fhir.r5.model.Extension("mode", new org.hl7.fhir.r5.model.CodeType(t.getMode().toCode())));
if (t.getFocusElement().hasValue())
e.addExtension(new org.hl7.fhir.r5.model.Extension("focus", new org.hl7.fhir.r5.model.StringType(t.getFocus())));
else {
org.hl7.fhir.r5.model.Extension focusE = new org.hl7.fhir.r5.model.Extension("focus");
copyElement(t.getFocusElement(), focusE);
e.addExtension(focusE);
}
e.addExtension(new org.hl7.fhir.r5.model.Extension("request", convertReference(t.getRequest())));
e.addExtension(new org.hl7.fhir.r5.model.Extension("response", convertReference(t.getResponse())));
if (t.hasDocumentation())
e.addExtension(new org.hl7.fhir.r5.model.Extension("documentation", new org.hl7.fhir.r5.model.StringType(t.getDocumentation())));
tgt.addExtension(e);
}
return tgt;
}
@ -5385,6 +5404,25 @@ public class VersionConvertor_30_50 {
tgt.setDocumentation(src.getDocumentation());
for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage())
tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t));
for (org.hl7.fhir.r5.model.Extension e : src.getExtensionsByUrl(VersionConvertorConstants.IG_CONFORMANCE_MESSAGE_EVENT)) {
org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent event = new org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingEventComponent();
tgt.addEvent(event);
event.setCode(convertCoding((org.hl7.fhir.r5.model.Coding)e.getExtensionByUrl("code").getValue()));
if (e.hasExtension("category"))
event.setCategory(org.hl7.fhir.dstu3.model.CapabilityStatement.MessageSignificanceCategory.fromCode(e.getExtensionByUrl("category").getValue().toString()));
event.setMode(org.hl7.fhir.dstu3.model.CapabilityStatement.EventCapabilityMode.fromCode(e.getExtensionByUrl("mode").getValue().toString()));
org.hl7.fhir.r5.model.Extension focusE = e.getExtensionByUrl("focus");
if (focusE.hasValue())
event.setFocus(focusE.getValue().toString());
else {
event.setFocusElement(new org.hl7.fhir.dstu3.model.CodeType());
copyElement(focusE, event.getFocusElement());
}
event.setRequest(convertReference((org.hl7.fhir.r5.model.Reference)e.getExtensionByUrl("request").getValue()));
event.setResponse(convertReference((org.hl7.fhir.r5.model.Reference)e.getExtensionByUrl("response").getValue()));
if (e.hasExtension("documentation"))
event.setDocumentation(e.getExtensionByUrl("documentation").getValue().toString());
}
return tgt;
}

View File

@ -2279,8 +2279,9 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (!candidateProfiles.isEmpty()) {
for (String pr: candidateProfiles) {
profiles.add(pr);
StructureDefinition cpr = (StructureDefinition)context.fetchResource(StructureDefinition.class, pr);
List<ValidationMessage> profileErrors = new ArrayList<ValidationMessage>();
doResourceProfile(hostContext, we, pr, profileErrors, stack.push(we, -1, null, null), path, element, profile);
doResourceProfile(hostContext, we, pr, profileErrors, stack.push(we, -1, null, null), path, element, cpr);
if (hasErrors(profileErrors))
badProfiles.add(profileErrors);
@ -2347,9 +2348,10 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
private void doResourceProfile(ValidatorHostContext hostContext, Element resource, String profile, List<ValidationMessage> errors, NodeStack stack, String path, Element element, StructureDefinition containingProfile) throws FHIRException, IOException {
ResourceProfiles resourceProfiles = addResourceProfile(errors, resource, profile, path, element, stack, containingProfile);
if (resourceProfiles.isProcessed()) {
if (!resourceProfiles.isProcessed()) {
start(hostContext, errors, resource, resource, null, stack);
}
// lloyd capture errors?
}
private ResourceProfiles getResourceProfiles(Element resource, NodeStack stack) {