Move ignore extension logic in 30_50 convertors

This commit is contained in:
dotasek 2023-05-01 17:40:48 -04:00
parent fa3c87aaec
commit 077a079083
5 changed files with 204 additions and 120 deletions

View File

@ -29,11 +29,10 @@ public class BaseAdvisor_30_50 extends BaseAdvisor50<org.hl7.fhir.dstu3.model.Ex
final String lastPath = paths.get(paths.size() - 1); final String lastPath = paths.get(paths.size() - 1);
if ((lastPath.equals("ValueSet")) && (valueSetIgnoredUrls.contains(url))) { if ((lastPath.equals("ValueSet")) && (valueSetIgnoredUrls.contains(url))) {
return true; return true;
} else if (lastPath.equals("Basic") && url.startsWith("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.")) {
return true;
} else if (lastPath.equals("Basic") && url.startsWith("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.")) {
return true;
} else
return (lastPath.equals("CapabilityStatement")) && (capabilityStatementIgnoredUrls.contains(url));
} }
else
return (lastPath.equals("CapabilityStatement")) && (capabilityStatementIgnoredUrls.contains(url));
}
} }

View File

@ -91,6 +91,8 @@ import org.hl7.fhir.convertors.conv30_50.resources30_50.ValueSet30_50;
import org.hl7.fhir.dstu3.model.Basic; import org.hl7.fhir.dstu3.model.Basic;
import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.FHIRException;
import java.util.Arrays;
public class Resource30_50 { public class Resource30_50 {
public final BaseAdvisor_30_50 advisor; public final BaseAdvisor_30_50 advisor;
@ -451,7 +453,7 @@ public class Resource30_50 {
} }
public void copyDomainResource(org.hl7.fhir.dstu3.model.DomainResource src, public void copyDomainResource(org.hl7.fhir.dstu3.model.DomainResource src,
org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException { org.hl7.fhir.r5.model.DomainResource tgt, String... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt); copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative30_50.convertNarrative(src.getText())); if (src.hasText()) tgt.setText(Narrative30_50.convertNarrative(src.getText()));
src.getContained().stream() src.getContained().stream()
@ -462,7 +464,7 @@ public class Resource30_50 {
org.hl7.fhir.r5.model.Extension convertExtension = new org.hl7.fhir.r5.model.Extension(); org.hl7.fhir.r5.model.Extension convertExtension = new org.hl7.fhir.r5.model.Extension();
advisor.handleExtension(ConversionContext30_50.INSTANCE.path(), extension, convertExtension); advisor.handleExtension(ConversionContext30_50.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension); tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext30_50.INSTANCE.path(), extension)) { } else if (!advisor.ignoreExtension(ConversionContext30_50.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension30_50.convertExtension(extension)); tgt.addExtension(Extension30_50.convertExtension(extension));
} }
}); });
@ -473,7 +475,7 @@ public class Resource30_50 {
} }
public void copyDomainResource(org.hl7.fhir.r5.model.DomainResource src, public void copyDomainResource(org.hl7.fhir.r5.model.DomainResource src,
org.hl7.fhir.dstu3.model.DomainResource tgt) throws FHIRException { org.hl7.fhir.dstu3.model.DomainResource tgt, String... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt); copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative30_50.convertNarrative(src.getText())); if (src.hasText()) tgt.setText(Narrative30_50.convertNarrative(src.getText()));
src.getContained().stream() src.getContained().stream()
@ -484,7 +486,7 @@ public class Resource30_50 {
org.hl7.fhir.dstu3.model.Extension convertExtension = new org.hl7.fhir.dstu3.model.Extension(); org.hl7.fhir.dstu3.model.Extension convertExtension = new org.hl7.fhir.dstu3.model.Extension();
advisor.handleExtension(ConversionContext30_50.INSTANCE.path(), extension, convertExtension); advisor.handleExtension(ConversionContext30_50.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension); tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext30_50.INSTANCE.path(), extension)) { } else if (!advisor.ignoreExtension(ConversionContext30_50.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension30_50.convertExtension(extension)); tgt.addExtension(Extension30_50.convertExtension(extension));
} }
}); });

View File

@ -131,13 +131,13 @@ public class VersionConvertor_30_50 {
} }
public void copyDomainResource(@Nonnull org.hl7.fhir.dstu3.model.DomainResource src, public void copyDomainResource(@Nonnull org.hl7.fhir.dstu3.model.DomainResource src,
@Nonnull org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException { @Nonnull org.hl7.fhir.r5.model.DomainResource tgt, String... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt); resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
} }
public void copyDomainResource(@Nonnull org.hl7.fhir.r5.model.DomainResource src, public void copyDomainResource(@Nonnull org.hl7.fhir.r5.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu3.model.DomainResource tgt) throws FHIRException { @Nonnull org.hl7.fhir.dstu3.model.DomainResource tgt, String... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt); resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
} }
public void copyElement(@Nonnull org.hl7.fhir.dstu3.model.Element src, public void copyElement(@Nonnull org.hl7.fhir.dstu3.model.Element src,

View File

@ -50,6 +50,50 @@ import org.hl7.fhir.r5.model.UsageContext;
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ActorDefinition30_50 { public class ActorDefinition30_50 {
public static final String URL_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.url";
public static final String VERSION_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.version";
public static final String NAME_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.name";
public static final String TITLE_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.title";
public static final String STATUS_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.status";
public static final String EXPERIMENTAL_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.experimental";
public static final String DATE_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.date";
public static final String PUBLISHER_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.publisher";
public static final String CONTACT_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.contact";
public static final String DESCRIPTION_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.description";
public static final String USE_CONTEXT_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.useContext";
public static final String JURISDICTION_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.jurisdiction";
public static final String PURPOSE_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.purpose";
public static final String COPYRIGHT_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyright";
public static final String COPYRIGHT_LABEL_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyrightLabel";
public static final String TYPE_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.type";
public static final String DOCUMENTATION_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.documentation";
public static final String REFERENCE_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.reference";
public static final String CAPABILITIES_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.capabilities";
public static final String DERIVED_FROM_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.derivedFrom";
private static final String[] IGNORED_EXTENSION_URLS = new String[]{
URL_EXTENSION_URL,
VERSION_EXTENSION_URL,
NAME_EXTENSION_URL,
TITLE_EXTENSION_URL,
STATUS_EXTENSION_URL,
EXPERIMENTAL_EXTENSION_URL,
DATE_EXTENSION_URL,
PUBLISHER_EXTENSION_URL,
CONTACT_EXTENSION_URL,
DESCRIPTION_EXTENSION_URL,
USE_CONTEXT_EXTENSION_URL,
JURISDICTION_EXTENSION_URL,
PURPOSE_EXTENSION_URL,
COPYRIGHT_EXTENSION_URL,
COPYRIGHT_LABEL_EXTENSION_URL,
TYPE_EXTENSION_URL,
DOCUMENTATION_EXTENSION_URL,
REFERENCE_EXTENSION_URL,
CAPABILITIES_EXTENSION_URL,
DERIVED_FROM_EXTENSION_URL
};
public static org.hl7.fhir.r5.model.ActorDefinition convertActorDefinition(org.hl7.fhir.dstu3.model.Basic src) throws FHIRException { public static org.hl7.fhir.r5.model.ActorDefinition convertActorDefinition(org.hl7.fhir.dstu3.model.Basic src) throws FHIRException {
if (src == null) if (src == null)
return null; return null;
@ -57,70 +101,70 @@ public class ActorDefinition30_50 {
throw new FHIRException("Error in logic: this basic resource is not an ActorDefinition"); throw new FHIRException("Error in logic: this basic resource is not an ActorDefinition");
} }
org.hl7.fhir.r5.model.ActorDefinition tgt = new org.hl7.fhir.r5.model.ActorDefinition(); org.hl7.fhir.r5.model.ActorDefinition tgt = new org.hl7.fhir.r5.model.ActorDefinition();
//FIXME add ignore
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier30_50.convertIdentifier(t)); tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.url")) { if (src.hasExtension(URL_EXTENSION_URL)) {
tgt.setUrlElement(Uri30_50.convertUri((org.hl7.fhir.dstu3.model.UriType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.url").getValue())); tgt.setUrlElement(Uri30_50.convertUri((org.hl7.fhir.dstu3.model.UriType) src.getExtensionByUrl(URL_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.version")) { if (src.hasExtension(VERSION_EXTENSION_URL)) {
tgt.setVersionElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.version").getValue())); tgt.setVersionElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl(VERSION_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.name")) { if (src.hasExtension(NAME_EXTENSION_URL)) {
tgt.setNameElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.name").getValue())); tgt.setNameElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl(NAME_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.title")) { if (src.hasExtension(TITLE_EXTENSION_URL)) {
tgt.setTitleElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.title").getValue())); tgt.setTitleElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl(TITLE_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.status")) { if (src.hasExtension(STATUS_EXTENSION_URL)) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.status").getValue().primitiveValue())); tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl(STATUS_EXTENSION_URL).getValue().primitiveValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.experimental")) { if (src.hasExtension(EXPERIMENTAL_EXTENSION_URL)) {
tgt.setExperimentalElement(Boolean30_50.convertBoolean((org.hl7.fhir.dstu3.model.BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.experimental").getValue())); tgt.setExperimentalElement(Boolean30_50.convertBoolean((org.hl7.fhir.dstu3.model.BooleanType) src.getExtensionByUrl(EXPERIMENTAL_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.date")) { if (src.hasExtension(DATE_EXTENSION_URL)) {
tgt.setDateElement(DateTime30_50.convertDateTime((org.hl7.fhir.dstu3.model.DateTimeType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.date").getValue())); tgt.setDateElement(DateTime30_50.convertDateTime((org.hl7.fhir.dstu3.model.DateTimeType) src.getExtensionByUrl(DATE_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.publisher")) { if (src.hasExtension(PUBLISHER_EXTENSION_URL)) {
tgt.setPublisherElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.publisher").getValue())); tgt.setPublisherElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl(PUBLISHER_EXTENSION_URL).getValue()));
} }
for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.contact")) { for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl(CONTACT_EXTENSION_URL)) {
tgt.addContact(ContactDetail30_50.convertContactDetail((org.hl7.fhir.dstu3.model.ContactDetail) ext.getValue())); tgt.addContact(ContactDetail30_50.convertContactDetail((org.hl7.fhir.dstu3.model.ContactDetail) ext.getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.description")) { if (src.hasExtension(DESCRIPTION_EXTENSION_URL)) {
tgt.setPublisherElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.description").getValue())); tgt.setPublisherElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl(DESCRIPTION_EXTENSION_URL).getValue()));
} }
for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.useContext")) { for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl(USE_CONTEXT_EXTENSION_URL)) {
tgt.addUseContext(UsageContext30_50.convertUsageContext((org.hl7.fhir.dstu3.model.UsageContext) ext.getValue())); tgt.addUseContext(UsageContext30_50.convertUsageContext((org.hl7.fhir.dstu3.model.UsageContext) ext.getValue()));
} }
for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.jurisdiction")) { for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl(JURISDICTION_EXTENSION_URL)) {
tgt.addJurisdiction(CodeableConcept30_50.convertCodeableConcept((org.hl7.fhir.dstu3.model.CodeableConcept) ext.getValue())); tgt.addJurisdiction(CodeableConcept30_50.convertCodeableConcept((org.hl7.fhir.dstu3.model.CodeableConcept) ext.getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.purpose")) { if (src.hasExtension(PURPOSE_EXTENSION_URL)) {
tgt.setPurposeElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.purpose").getValue())); tgt.setPurposeElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl(PURPOSE_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyright")) { if (src.hasExtension(COPYRIGHT_EXTENSION_URL)) {
tgt.setCopyrightElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyright").getValue())); tgt.setCopyrightElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl(COPYRIGHT_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyrightLabel")) { if (src.hasExtension(COPYRIGHT_LABEL_EXTENSION_URL)) {
tgt.setCopyrightLabelElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyrightLabel").getValue())); tgt.setCopyrightLabelElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl(COPYRIGHT_LABEL_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.type")) { if (src.hasExtension(TYPE_EXTENSION_URL)) {
tgt.setType(ExampleScenarioActorType.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.type").getValue().primitiveValue())); tgt.setType(ExampleScenarioActorType.fromCode(src.getExtensionByUrl(TYPE_EXTENSION_URL).getValue().primitiveValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.documentation")) { if (src.hasExtension(DOCUMENTATION_EXTENSION_URL)) {
tgt.setDocumentationElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.documentation").getValue())); tgt.setDocumentationElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl(DOCUMENTATION_EXTENSION_URL).getValue()));
} }
for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.reference")) { for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl(REFERENCE_EXTENSION_URL)) {
tgt.getReference().add(Uri30_50.convertUrl((org.hl7.fhir.dstu3.model.UriType) ext.getValue())); tgt.getReference().add(Uri30_50.convertUrl((org.hl7.fhir.dstu3.model.UriType) ext.getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.capabilities")) { if (src.hasExtension(CAPABILITIES_EXTENSION_URL)) {
tgt.setCapabilitiesElement(Uri30_50.convertCanonical((org.hl7.fhir.dstu3.model.UriType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.capabilities").getValue())); tgt.setCapabilitiesElement(Uri30_50.convertCanonical((org.hl7.fhir.dstu3.model.UriType) src.getExtensionByUrl(CAPABILITIES_EXTENSION_URL).getValue()));
} }
for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.derivedFrom")) { for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl(DERIVED_FROM_EXTENSION_URL)) {
tgt.getDerivedFrom().add(Uri30_50.convertCanonical((org.hl7.fhir.dstu3.model.UriType) ext.getValue())); tgt.getDerivedFrom().add(Uri30_50.convertCanonical((org.hl7.fhir.dstu3.model.UriType) ext.getValue()));
} }
return tgt; return tgt;
@ -136,64 +180,64 @@ public class ActorDefinition30_50 {
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier30_50.convertIdentifier(t)); tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
if (src.hasUrl()) { if (src.hasUrl()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.url", Uri30_50.convertUri(src.getUrlElement())); tgt.addExtension(URL_EXTENSION_URL, Uri30_50.convertUri(src.getUrlElement()));
} }
if (src.hasVersion()) { if (src.hasVersion()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.version", String30_50.convertString(src.getVersionElement())); tgt.addExtension(VERSION_EXTENSION_URL, String30_50.convertString(src.getVersionElement()));
} }
if (src.hasName()) { if (src.hasName()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.name", String30_50.convertString(src.getNameElement())); tgt.addExtension(NAME_EXTENSION_URL, String30_50.convertString(src.getNameElement()));
} }
if (src.hasTitle()) { if (src.hasTitle()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.title", String30_50.convertString(src.getTitleElement())); tgt.addExtension(TITLE_EXTENSION_URL, String30_50.convertString(src.getTitleElement()));
} }
if (src.hasStatus()) { if (src.hasStatus()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.status", new org.hl7.fhir.dstu3.model.CodeType(src.getStatus().toCode())); tgt.addExtension(STATUS_EXTENSION_URL, new org.hl7.fhir.dstu3.model.CodeType(src.getStatus().toCode()));
} }
if (src.hasExperimental()) { if (src.hasExperimental()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.experimental", Boolean30_50.convertBoolean(src.getExperimentalElement())); tgt.addExtension(EXPERIMENTAL_EXTENSION_URL, Boolean30_50.convertBoolean(src.getExperimentalElement()));
} }
if (src.hasDate()) { if (src.hasDate()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.date", DateTime30_50.convertDateTime(src.getDateElement())); tgt.addExtension(DATE_EXTENSION_URL, DateTime30_50.convertDateTime(src.getDateElement()));
} }
if (src.hasPublisher()) { if (src.hasPublisher()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.publisher", String30_50.convertString(src.getPublisherElement())); tgt.addExtension(PUBLISHER_EXTENSION_URL, String30_50.convertString(src.getPublisherElement()));
} }
for (ContactDetail cd : src.getContact()) { for (ContactDetail cd : src.getContact()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.contact", ContactDetail30_50.convertContactDetail(cd)); tgt.addExtension(CONTACT_EXTENSION_URL, ContactDetail30_50.convertContactDetail(cd));
} }
if (src.hasDescription()) { if (src.hasDescription()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.description", MarkDown30_50.convertMarkdown(src.getDescriptionElement())); tgt.addExtension(DESCRIPTION_EXTENSION_URL, MarkDown30_50.convertMarkdown(src.getDescriptionElement()));
} }
for (UsageContext cd : src.getUseContext()) { for (UsageContext cd : src.getUseContext()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.useContext", UsageContext30_50.convertUsageContext(cd)); tgt.addExtension(USE_CONTEXT_EXTENSION_URL, UsageContext30_50.convertUsageContext(cd));
} }
for (CodeableConcept cd : src.getJurisdiction()) { for (CodeableConcept cd : src.getJurisdiction()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.jurisdiction", CodeableConcept30_50.convertCodeableConcept(cd)); tgt.addExtension(JURISDICTION_EXTENSION_URL, CodeableConcept30_50.convertCodeableConcept(cd));
} }
if (src.hasPurpose()) { if (src.hasPurpose()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.purpose", MarkDown30_50.convertMarkdown(src.getPurposeElement())); tgt.addExtension(PURPOSE_EXTENSION_URL, MarkDown30_50.convertMarkdown(src.getPurposeElement()));
} }
if (src.hasCopyright()) { if (src.hasCopyright()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyright", MarkDown30_50.convertMarkdown(src.getCopyrightElement())); tgt.addExtension(COPYRIGHT_EXTENSION_URL, MarkDown30_50.convertMarkdown(src.getCopyrightElement()));
} }
if (src.hasCopyrightLabel()) { if (src.hasCopyrightLabel()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyrightLabel", String30_50.convertString(src.getCopyrightLabelElement())); tgt.addExtension(COPYRIGHT_LABEL_EXTENSION_URL, String30_50.convertString(src.getCopyrightLabelElement()));
} }
if (src.hasType()) { if (src.hasType()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.type", new org.hl7.fhir.dstu3.model.CodeType(src.getType().toCode())); tgt.addExtension(TYPE_EXTENSION_URL, new org.hl7.fhir.dstu3.model.CodeType(src.getType().toCode()));
} }
if (src.hasDocumentation()) { if (src.hasDocumentation()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.documentation", MarkDown30_50.convertMarkdown(src.getDocumentationElement())); tgt.addExtension(DOCUMENTATION_EXTENSION_URL, MarkDown30_50.convertMarkdown(src.getDocumentationElement()));
} }
for (UrlType ref : src.getReference()) { for (UrlType ref : src.getReference()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.reference", Uri30_50.convertUrl(ref)); tgt.addExtension(REFERENCE_EXTENSION_URL, Uri30_50.convertUrl(ref));
} }
if (src.hasCapabilities()) { if (src.hasCapabilities()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.capabilities", Uri30_50.convertCanonical(src.getCapabilitiesElement())); tgt.addExtension(CAPABILITIES_EXTENSION_URL, Uri30_50.convertCanonical(src.getCapabilitiesElement()));
} }
for (CanonicalType ct : src.getDerivedFrom()) { for (CanonicalType ct : src.getDerivedFrom()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.derivedFrom", Uri30_50.convertCanonical(ct)); tgt.addExtension(DERIVED_FROM_EXTENSION_URL, Uri30_50.convertCanonical(ct));
} }
return tgt; return tgt;

View File

@ -56,6 +56,45 @@ import org.hl7.fhir.r5.model.UsageContext;
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0 // Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Requirements30_50 { public class Requirements30_50 {
public static final String URL_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.url";
public static final String VERSION_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.version";
public static final String NAME_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.name";
public static final String TITLE_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.title";
public static final String STATUS_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.status";
public static final String EXPERIMENTAL_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.experimental";
public static final String DATE_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.date";
public static final String PUBLISHER_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.publisher";
public static final String CONTACT_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.contact";
public static final String DESCRIPTION_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.description";
public static final String USE_CONTEXT_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.useContext";
public static final String JURISDICTION_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.jurisdiction";
public static final String PURPOSE_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.purpose";
public static final String COPYRIGHT_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyright";
public static final String COPYRIGHT_LABEL_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyrightLabel";
public static final String DERIVED_FROM_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.derivedFrom";
public static final String ACTOR_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.actor";
public static final String STATEMENT_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement";
private static final String[] IGNORED_EXTENSION_URLS = new String[]{
URL_EXTENSION_URL,
VERSION_EXTENSION_URL,
NAME_EXTENSION_URL,
TITLE_EXTENSION_URL,
STATUS_EXTENSION_URL,
EXPERIMENTAL_EXTENSION_URL,
DATE_EXTENSION_URL,
PUBLISHER_EXTENSION_URL,
CONTACT_EXTENSION_URL,
DESCRIPTION_EXTENSION_URL,
USE_CONTEXT_EXTENSION_URL,
JURISDICTION_EXTENSION_URL,
PURPOSE_EXTENSION_URL,
COPYRIGHT_EXTENSION_URL,
COPYRIGHT_LABEL_EXTENSION_URL,
DERIVED_FROM_EXTENSION_URL,
ACTOR_EXTENSION_URL,
STATEMENT_EXTENSION_URL
};
public static org.hl7.fhir.r5.model.Requirements convertRequirements(org.hl7.fhir.dstu3.model.Basic src) throws FHIRException { public static org.hl7.fhir.r5.model.Requirements convertRequirements(org.hl7.fhir.dstu3.model.Basic src) throws FHIRException {
if (src == null) if (src == null)
return null; return null;
@ -63,64 +102,64 @@ public class Requirements30_50 {
throw new FHIRException("Error in logic: this basic resource is not an Requirements"); throw new FHIRException("Error in logic: this basic resource is not an Requirements");
} }
org.hl7.fhir.r5.model.Requirements tgt = new org.hl7.fhir.r5.model.Requirements(); org.hl7.fhir.r5.model.Requirements tgt = new org.hl7.fhir.r5.model.Requirements();
//FIXME add ignore
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier30_50.convertIdentifier(t)); tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.url")) { if (src.hasExtension(URL_EXTENSION_URL)) {
tgt.setUrlElement(Uri30_50.convertUri((org.hl7.fhir.dstu3.model.UriType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.url").getValue())); tgt.setUrlElement(Uri30_50.convertUri((org.hl7.fhir.dstu3.model.UriType) src.getExtensionByUrl(URL_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.version")) { if (src.hasExtension(VERSION_EXTENSION_URL)) {
tgt.setVersionElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.version").getValue())); tgt.setVersionElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl(VERSION_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.name")) { if (src.hasExtension(NAME_EXTENSION_URL)) {
tgt.setNameElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.name").getValue())); tgt.setNameElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl(NAME_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.title")) { if (src.hasExtension(TITLE_EXTENSION_URL)) {
tgt.setTitleElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.title").getValue())); tgt.setTitleElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl(TITLE_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.status")) { if (src.hasExtension(STATUS_EXTENSION_URL)) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.status").getValue().primitiveValue())); tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl(STATUS_EXTENSION_URL).getValue().primitiveValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.experimental")) { if (src.hasExtension(EXPERIMENTAL_EXTENSION_URL)) {
tgt.setExperimentalElement(Boolean30_50.convertBoolean((org.hl7.fhir.dstu3.model.BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.experimental").getValue())); tgt.setExperimentalElement(Boolean30_50.convertBoolean((org.hl7.fhir.dstu3.model.BooleanType) src.getExtensionByUrl(EXPERIMENTAL_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.date")) { if (src.hasExtension(DATE_EXTENSION_URL)) {
tgt.setDateElement(DateTime30_50.convertDateTime((org.hl7.fhir.dstu3.model.DateTimeType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.date").getValue())); tgt.setDateElement(DateTime30_50.convertDateTime((org.hl7.fhir.dstu3.model.DateTimeType) src.getExtensionByUrl(DATE_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.publisher")) { if (src.hasExtension(PUBLISHER_EXTENSION_URL)) {
tgt.setPublisherElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.publisher").getValue())); tgt.setPublisherElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl(PUBLISHER_EXTENSION_URL).getValue()));
} }
for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.contact")) { for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl(CONTACT_EXTENSION_URL)) {
tgt.addContact(ContactDetail30_50.convertContactDetail((org.hl7.fhir.dstu3.model.ContactDetail) ext.getValue())); tgt.addContact(ContactDetail30_50.convertContactDetail((org.hl7.fhir.dstu3.model.ContactDetail) ext.getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.description")) { if (src.hasExtension(DESCRIPTION_EXTENSION_URL)) {
tgt.setPublisherElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.description").getValue())); tgt.setPublisherElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl(DESCRIPTION_EXTENSION_URL).getValue()));
} }
for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.useContext")) { for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl(USE_CONTEXT_EXTENSION_URL)) {
tgt.addUseContext(UsageContext30_50.convertUsageContext((org.hl7.fhir.dstu3.model.UsageContext) ext.getValue())); tgt.addUseContext(UsageContext30_50.convertUsageContext((org.hl7.fhir.dstu3.model.UsageContext) ext.getValue()));
} }
for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.jurisdiction")) { for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl(JURISDICTION_EXTENSION_URL)) {
tgt.addJurisdiction(CodeableConcept30_50.convertCodeableConcept((org.hl7.fhir.dstu3.model.CodeableConcept) ext.getValue())); tgt.addJurisdiction(CodeableConcept30_50.convertCodeableConcept((org.hl7.fhir.dstu3.model.CodeableConcept) ext.getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.purpose")) { if (src.hasExtension(PURPOSE_EXTENSION_URL)) {
tgt.setPurposeElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.purpose").getValue())); tgt.setPurposeElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl(PURPOSE_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyright")) { if (src.hasExtension(COPYRIGHT_EXTENSION_URL)) {
tgt.setCopyrightElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyright").getValue())); tgt.setCopyrightElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl(COPYRIGHT_EXTENSION_URL).getValue()));
} }
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyrightLabel")) { if (src.hasExtension(COPYRIGHT_LABEL_EXTENSION_URL)) {
tgt.setCopyrightLabelElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyrightLabel").getValue())); tgt.setCopyrightLabelElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl(COPYRIGHT_LABEL_EXTENSION_URL).getValue()));
} }
for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.derivedFrom")) { for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl(DERIVED_FROM_EXTENSION_URL)) {
tgt.getDerivedFrom().add(Uri30_50.convertCanonical((org.hl7.fhir.dstu3.model.UriType) ext.getValue())); tgt.getDerivedFrom().add(Uri30_50.convertCanonical((org.hl7.fhir.dstu3.model.UriType) ext.getValue()));
} }
for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.actor")) { for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl(ACTOR_EXTENSION_URL)) {
tgt.getActor().add(Uri30_50.convertCanonical((org.hl7.fhir.dstu3.model.UriType) ext.getValue())); tgt.getActor().add(Uri30_50.convertCanonical((org.hl7.fhir.dstu3.model.UriType) ext.getValue()));
} }
for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement")) { for (org.hl7.fhir.dstu3.model.Extension ext : src.getExtensionsByUrl(STATEMENT_EXTENSION_URL)) {
convertRequirementsStatement(ext, tgt.addStatement()); convertRequirementsStatement(ext, tgt.addStatement());
} }
return tgt; return tgt;
@ -137,58 +176,58 @@ public class Requirements30_50 {
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier30_50.convertIdentifier(t)); tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
if (src.hasUrl()) { if (src.hasUrl()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.url", Uri30_50.convertUri(src.getUrlElement())); tgt.addExtension(URL_EXTENSION_URL, Uri30_50.convertUri(src.getUrlElement()));
} }
if (src.hasVersion()) { if (src.hasVersion()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.version", String30_50.convertString(src.getVersionElement())); tgt.addExtension(VERSION_EXTENSION_URL, String30_50.convertString(src.getVersionElement()));
} }
if (src.hasName()) { if (src.hasName()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.name", String30_50.convertString(src.getNameElement())); tgt.addExtension(NAME_EXTENSION_URL, String30_50.convertString(src.getNameElement()));
} }
if (src.hasTitle()) { if (src.hasTitle()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.title", String30_50.convertString(src.getTitleElement())); tgt.addExtension(TITLE_EXTENSION_URL, String30_50.convertString(src.getTitleElement()));
} }
if (src.hasStatus()) { if (src.hasStatus()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.status", new org.hl7.fhir.dstu3.model.CodeType(src.getStatus().toCode())); tgt.addExtension(STATUS_EXTENSION_URL, new org.hl7.fhir.dstu3.model.CodeType(src.getStatus().toCode()));
} }
if (src.hasExperimental()) { if (src.hasExperimental()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.experimental", Boolean30_50.convertBoolean(src.getExperimentalElement())); tgt.addExtension(EXPERIMENTAL_EXTENSION_URL, Boolean30_50.convertBoolean(src.getExperimentalElement()));
} }
if (src.hasDate()) { if (src.hasDate()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.date", DateTime30_50.convertDateTime(src.getDateElement())); tgt.addExtension(DATE_EXTENSION_URL, DateTime30_50.convertDateTime(src.getDateElement()));
} }
if (src.hasPublisher()) { if (src.hasPublisher()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.publisher", String30_50.convertString(src.getPublisherElement())); tgt.addExtension(PUBLISHER_EXTENSION_URL, String30_50.convertString(src.getPublisherElement()));
} }
for (ContactDetail cd : src.getContact()) { for (ContactDetail cd : src.getContact()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.contact", ContactDetail30_50.convertContactDetail(cd)); tgt.addExtension(CONTACT_EXTENSION_URL, ContactDetail30_50.convertContactDetail(cd));
} }
if (src.hasDescription()) { if (src.hasDescription()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.description", MarkDown30_50.convertMarkdown(src.getDescriptionElement())); tgt.addExtension(DESCRIPTION_EXTENSION_URL, MarkDown30_50.convertMarkdown(src.getDescriptionElement()));
} }
for (UsageContext cd : src.getUseContext()) { for (UsageContext cd : src.getUseContext()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.useContext", UsageContext30_50.convertUsageContext(cd)); tgt.addExtension(USE_CONTEXT_EXTENSION_URL, UsageContext30_50.convertUsageContext(cd));
} }
for (CodeableConcept cd : src.getJurisdiction()) { for (CodeableConcept cd : src.getJurisdiction()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.jurisdiction", CodeableConcept30_50.convertCodeableConcept(cd)); tgt.addExtension(JURISDICTION_EXTENSION_URL, CodeableConcept30_50.convertCodeableConcept(cd));
} }
if (src.hasPurpose()) { if (src.hasPurpose()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.purpose", MarkDown30_50.convertMarkdown(src.getPurposeElement())); tgt.addExtension(PURPOSE_EXTENSION_URL, MarkDown30_50.convertMarkdown(src.getPurposeElement()));
} }
if (src.hasCopyright()) { if (src.hasCopyright()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyright", MarkDown30_50.convertMarkdown(src.getCopyrightElement())); tgt.addExtension(COPYRIGHT_EXTENSION_URL, MarkDown30_50.convertMarkdown(src.getCopyrightElement()));
} }
if (src.hasCopyrightLabel()) { if (src.hasCopyrightLabel()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyrightLabel", String30_50.convertString(src.getCopyrightLabelElement())); tgt.addExtension(COPYRIGHT_LABEL_EXTENSION_URL, String30_50.convertString(src.getCopyrightLabelElement()));
} }
for (CanonicalType ref : src.getDerivedFrom()) { for (CanonicalType ref : src.getDerivedFrom()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.derivedFrom", Uri30_50.convertCanonical(ref)); tgt.addExtension(DERIVED_FROM_EXTENSION_URL, Uri30_50.convertCanonical(ref));
} }
for (CanonicalType ref : src.getActor()) { for (CanonicalType ref : src.getActor()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.actor", Uri30_50.convertCanonical(ref)); tgt.addExtension(ACTOR_EXTENSION_URL, Uri30_50.convertCanonical(ref));
} }
for (RequirementsStatementComponent ref : src.getStatement()) { for (RequirementsStatementComponent ref : src.getStatement()) {
org.hl7.fhir.dstu3.model.Extension tgte = new org.hl7.fhir.dstu3.model.Extension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement"); org.hl7.fhir.dstu3.model.Extension tgte = new org.hl7.fhir.dstu3.model.Extension(STATEMENT_EXTENSION_URL);
tgt.addExtension(tgte); tgt.addExtension(tgte);
convertRequirementsStatement(ref, tgte); convertRequirementsStatement(ref, tgte);
} }