Merge pull request #1256 from hapifhir/do-20230501-conversion-refactor

Refactor extension ignore in conversion
This commit is contained in:
Grahame Grieve 2023-05-09 14:42:48 -05:00 committed by GitHub
commit fd630de50f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
87 changed files with 3656 additions and 793 deletions

View File

@ -10,8 +10,6 @@ import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor30;
public class BaseAdvisor_10_30 extends BaseAdvisor30<org.hl7.fhir.dstu2.model.Extension> {
private final List<String> ignoredUrls = new ArrayList<>(Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"));
public BaseAdvisor_10_30() {
}
@ -21,6 +19,7 @@ public class BaseAdvisor_10_30 extends BaseAdvisor30<org.hl7.fhir.dstu2.model.Ex
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) {
return this.ignoredUrls.contains(url);
// no globally ignored extensions here.
return false;
}
}

View File

@ -13,7 +13,6 @@ import org.hl7.fhir.r4.model.Type;
public class BaseAdvisor_10_40 extends BaseAdvisor40<org.hl7.fhir.dstu2.model.Extension> {
final List<String> conformanceIgnoredUrls = Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown");
private final List<Class<?>> ignoredExtensionTypes = new ArrayList<>(Collections.singletonList(Expression.class));
public BaseAdvisor_10_40() {
@ -26,9 +25,8 @@ public class BaseAdvisor_10_40 extends BaseAdvisor40<org.hl7.fhir.dstu2.model.Ex
@Override
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) {
final List<String> paths = Arrays.asList(path.split(","));
final String lastPath = paths.get(paths.size() - 1);
return (lastPath.equals("Conformance")) && (conformanceIgnoredUrls.contains(url));
// no globally ignored extensions here.
return false;
}
@Override

View File

@ -12,7 +12,7 @@ import org.hl7.fhir.r5.model.DataType;
import org.hl7.fhir.r5.model.Expression;
public class BaseAdvisor_10_50 extends BaseAdvisor50<org.hl7.fhir.dstu2.model.Extension> {
final List<String> conformanceIgnoredUrls = Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown");
private final List<Class<?>> ignoredExtensionTypes = new ArrayList<>(Collections.singletonList(Expression.class));
public BaseAdvisor_10_50() {
@ -24,9 +24,8 @@ public class BaseAdvisor_10_50 extends BaseAdvisor50<org.hl7.fhir.dstu2.model.Ex
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) {
final List<String> paths = Arrays.asList(path.split(","));
final String lastPath = paths.get(paths.size() - 1);
return (lastPath.equals("Conformance")) && (conformanceIgnoredUrls.contains(url));
// no globally ignored extensions here.
return false;
}
public boolean ignoreType(@Nonnull String path,

View File

@ -10,8 +10,6 @@ import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor30;
public class BaseAdvisor_14_30 extends BaseAdvisor30<org.hl7.fhir.dstu2016may.model.Extension> {
private final List<String> ignoredUrls = new ArrayList<>(Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"));
public BaseAdvisor_14_30() {
}
@ -22,6 +20,7 @@ public class BaseAdvisor_14_30 extends BaseAdvisor30<org.hl7.fhir.dstu2016may.mo
@Override
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) {
return this.ignoredUrls.contains(url);
// no globally ignored extensions here.
return false;
}
}

View File

@ -13,8 +13,6 @@ import org.hl7.fhir.r4.model.Type;
public class BaseAdvisor_14_40 extends BaseAdvisor40<org.hl7.fhir.dstu2016may.model.Extension> {
final List<String> conformanceIgnoredUrls = Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown");
private final List<String> ignoredUrls = new ArrayList<>(Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"));
private final List<Class<?>> ignoredExtensionTypes = new ArrayList<>(Collections.singletonList(Expression.class));
public BaseAdvisor_14_40() {
@ -27,13 +25,8 @@ public class BaseAdvisor_14_40 extends BaseAdvisor40<org.hl7.fhir.dstu2016may.mo
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) {
final List<String> paths = Arrays.asList(path.split(","));
final String lastPath = paths.get(paths.size() - 1);
if ((lastPath.equals("Conformance")) && (conformanceIgnoredUrls.contains(url))) {
return true;
} else {
return this.ignoredUrls.contains(url);
}
// no globally ignored extensions here.
return false;
}
public boolean ignoreType(@Nonnull String path, @Nonnull Type type) {

View File

@ -11,8 +11,6 @@ import org.hl7.fhir.exceptions.FHIRException;
public class BaseAdvisor_14_50 extends BaseAdvisor50<org.hl7.fhir.dstu2016may.model.Extension> {
final List<String> capabilityStatementIgnoredUrls = Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown");
public BaseAdvisor_14_50() {
}
@ -23,8 +21,7 @@ public class BaseAdvisor_14_50 extends BaseAdvisor50<org.hl7.fhir.dstu2016may.mo
@Override
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) throws FHIRException {
final List<String> paths = Arrays.asList(path.split(","));
final String lastPath = paths.get(paths.size() - 1);
return (lastPath.equals("CapabilityStatement")) && (capabilityStatementIgnoredUrls.contains(url));
// no globally ignored extensions here.
return false;
}
}

View File

@ -10,11 +10,6 @@ import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor40;
import org.hl7.fhir.exceptions.FHIRException;
public class BaseAdvisor_30_40 extends BaseAdvisor40<org.hl7.fhir.dstu3.model.Extension> {
final List<String> capabilityStatementIgnoredUrls = Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown");
final List<String> immunizationIgnoredUrls = Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-Immunization.notGiven");
public BaseAdvisor_30_40() {
}
@ -25,13 +20,7 @@ public class BaseAdvisor_30_40 extends BaseAdvisor40<org.hl7.fhir.dstu3.model.Ex
@Override
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) throws FHIRException {
final List<String> paths = Arrays.asList(path.split(","));
final String lastPath = paths.get(paths.size() - 1);
if (lastPath.equals("CapabilityStatement")) {
return capabilityStatementIgnoredUrls.contains(url);
} else if (lastPath.equals("Immunization")) {
return immunizationIgnoredUrls.contains(url);
}
// no globally ignored extensions here.
return false;
}
}

View File

@ -11,10 +11,6 @@ import org.hl7.fhir.exceptions.FHIRException;
public class BaseAdvisor_30_50 extends BaseAdvisor50<org.hl7.fhir.dstu3.model.Extension> {
final List<String> valueSetIgnoredUrls = Collections.singletonList("http://hl7.org/fhir/StructureDefinition/valueset-extensible");
final List<String> capabilityStatementIgnoredUrls = Arrays.asList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown",
"http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile");
public BaseAdvisor_30_50() {
}
@ -25,15 +21,8 @@ public class BaseAdvisor_30_50 extends BaseAdvisor50<org.hl7.fhir.dstu3.model.Ex
@Override
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) throws FHIRException {
final List<String> paths = Arrays.asList(path.split(","));
final String lastPath = paths.get(paths.size() - 1);
if ((lastPath.equals("ValueSet")) && (valueSetIgnoredUrls.contains(url))) {
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));
// no globally ignored extensions here.
return false;
}
}

View File

@ -34,11 +34,8 @@ public class BaseAdvisor_40_50 extends BaseAdvisor50<org.hl7.fhir.r4.model.Exten
final String lastPath = paths.get(paths.size() - 1);
if ((lastPath.equals("TestScript")) && (TestScriptIgnoredUrls.contains(url))) {
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
}
else
return false;
}

View File

@ -27,12 +27,6 @@ public class BaseAdvisor_43_50 extends BaseAdvisor50<org.hl7.fhir.r4b.model.Exte
final String lastPath = paths.get(paths.size() - 1);
if ((lastPath.equals("TestScript")) && (TestScriptIgnoredUrls.contains(url))) {
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 if (lastPath.equals("SubscriptionTopic") && url.startsWith("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.")) {
return true;
}
else
return false;

View File

@ -113,25 +113,32 @@ public class VersionConvertor_10_30 {
}
}
public void copyDomainResource(@Nonnull org.hl7.fhir.dstu2.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu3.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.dstu2.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu3.model.DomainResource tgt,
String ... extensionUrlsToIgnore
) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt,extensionUrlsToIgnore);
}
public void copyDomainResource(@Nonnull org.hl7.fhir.dstu3.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.dstu3.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2.model.DomainResource tgt,
String ... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.dstu2.model.Element src,
@Nonnull org.hl7.fhir.dstu3.model.Element tgt, String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_30.INSTANCE.path(), var);
public void copyElement(
@Nonnull org.hl7.fhir.dstu2.model.Element src,
@Nonnull org.hl7.fhir.dstu3.model.Element tgt, String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_30.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.dstu3.model.Element src,
public void copyElement(
@Nonnull org.hl7.fhir.dstu3.model.Element src,
@Nonnull org.hl7.fhir.dstu2.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_30.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_30.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.dstu3.model.DomainResource src,

View File

@ -4,19 +4,21 @@ import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class BackboneElement10_30 {
static public void copyBackboneElement(org.hl7.fhir.dstu2.model.BackboneElement src,
static public void copyBackboneElement(
org.hl7.fhir.dstu2.model.BackboneElement src,
org.hl7.fhir.dstu3.model.BackboneElement tgt,
String ... var) throws FHIRException {
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt, var);
String ... extensionUrlsToIgnore) throws FHIRException {
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.dstu2.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension10_30.convertExtension(e));
}
}
static public void copyBackboneElement(org.hl7.fhir.dstu3.model.BackboneElement src,
static public void copyBackboneElement(
org.hl7.fhir.dstu3.model.BackboneElement src,
org.hl7.fhir.dstu2.model.BackboneElement tgt,
String ... var) throws FHIRException {
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt, var);
String ... extensionUrlsToIgnore) throws FHIRException {
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.dstu3.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension10_30.convertExtension(e));
}

View File

@ -14,17 +14,17 @@ public class Element10_30 {
this.advisor = advisor;
}
public boolean isExemptExtension(String url, String[] extensionsToIgnore) {
return Arrays.asList(extensionsToIgnore).contains(url);
public boolean isExemptExtension(String url, String[] extensionUrlsToIgnore) {
return Arrays.asList(extensionUrlsToIgnore).contains(url);
}
public void copyElement(org.hl7.fhir.dstu2.model.Element src,
org.hl7.fhir.dstu3.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.dstu3.model.Extension convertedExtension = new org.hl7.fhir.dstu3.model.Extension();
@ -39,10 +39,10 @@ public class Element10_30 {
public void copyElement(org.hl7.fhir.dstu3.model.Element src,
org.hl7.fhir.dstu2.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.dstu2.model.Extension convertedExtension = new org.hl7.fhir.dstu2.model.Extension();

View File

@ -6,6 +6,8 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Meta10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Narrative10_30;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.Arrays;
public class Resource10_30 {
public final BaseAdvisor_10_30 advisor;
@ -14,26 +16,34 @@ public class Resource10_30 {
this.advisor = advisor;
}
public void copyDomainResource(org.hl7.fhir.dstu2.model.DomainResource src,
org.hl7.fhir.dstu3.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(
org.hl7.fhir.dstu2.model.DomainResource src,
org.hl7.fhir.dstu3.model.DomainResource tgt,
String ... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
tgt.setText(Narrative10_30.convertNarrative(src.getText()));
for (org.hl7.fhir.dstu2.model.Resource t : src.getContained()) tgt.addContained(convertResource(t));
for (org.hl7.fhir.dstu2.model.Extension t : src.getExtension())
tgt.addExtension(Extension10_30.convertExtension(t));
for (org.hl7.fhir.dstu2.model.Extension t : src.getModifierExtension())
tgt.addModifierExtension(Extension10_30.convertExtension(t));
for (org.hl7.fhir.dstu2.model.Resource containedResource : src.getContained()) tgt.addContained(convertResource(containedResource));
for (org.hl7.fhir.dstu2.model.Extension extension : src.getExtension())
if (!Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl()))
tgt.addExtension(Extension10_30.convertExtension(extension));
for (org.hl7.fhir.dstu2.model.Extension modifierExtension : src.getModifierExtension())
tgt.addModifierExtension(Extension10_30.convertExtension(modifierExtension));
}
public void copyDomainResource(org.hl7.fhir.dstu3.model.DomainResource src,
org.hl7.fhir.dstu2.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(
org.hl7.fhir.dstu3.model.DomainResource src,
org.hl7.fhir.dstu2.model.DomainResource tgt,
String ... extensionUrlsToIgnore
) throws FHIRException {
copyResource(src, tgt);
tgt.setText(Narrative10_30.convertNarrative(src.getText()));
for (org.hl7.fhir.dstu3.model.Resource t : src.getContained()) tgt.addContained(convertResource(t));
for (org.hl7.fhir.dstu3.model.Extension t : src.getExtension())
tgt.addExtension(Extension10_30.convertExtension(t));
for (org.hl7.fhir.dstu3.model.Extension t : src.getModifierExtension())
tgt.addModifierExtension(Extension10_30.convertExtension(t));
for (org.hl7.fhir.dstu3.model.Resource containedResource : src.getContained()) tgt.addContained(convertResource(containedResource));
for (org.hl7.fhir.dstu3.model.Extension extension : src.getExtension())
if (!Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl()))
tgt.addExtension(Extension10_30.convertExtension(extension));
for (org.hl7.fhir.dstu3.model.Extension modifierExtension : src.getModifierExtension())
tgt.addModifierExtension(Extension10_30.convertExtension(modifierExtension));
}
public void copyResource(org.hl7.fhir.dstu2.model.Resource src, org.hl7.fhir.dstu3.model.Resource tgt) throws FHIRException {

View File

@ -143,32 +143,36 @@ public class VersionConvertor_10_40 {
}
}
public void copyDomainResource(@Nonnull org.hl7.fhir.dstu2.model.DomainResource src,
@Nonnull org.hl7.fhir.r4.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.dstu2.model.DomainResource src,
@Nonnull org.hl7.fhir.r4.model.DomainResource tgt,
String ... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyDomainResource(@Nonnull org.hl7.fhir.r4.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.r4.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2.model.DomainResource tgt,
String ... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.dstu2.model.Element src,
@Nonnull org.hl7.fhir.r4.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_40.INSTANCE.path(), var);
String... ignoredExtensionUrls) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_40.INSTANCE.path(), ignoredExtensionUrls);
}
public void copyElement(@Nonnull org.hl7.fhir.r4.model.Element src,
@Nonnull org.hl7.fhir.dstu2.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_40.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_40.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.r4.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_40.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_40.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.r4.model.BackboneElement src,

View File

@ -4,19 +4,21 @@ import org.hl7.fhir.convertors.context.ConversionContext10_40;
import org.hl7.fhir.exceptions.FHIRException;
public class BackboneElement10_40 {
static public void copyBackboneElement(org.hl7.fhir.dstu2.model.BackboneElement src,
static public void copyBackboneElement(
org.hl7.fhir.dstu2.model.BackboneElement src,
org.hl7.fhir.r4.model.BackboneElement tgt,
String ... var) throws FHIRException {
ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt, var);
String ... extensionUrlsToIgnore) throws FHIRException {
ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.dstu2.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension10_40.convertExtension(e));
}
}
static public void copyBackboneElement(org.hl7.fhir.r4.model.BackboneElement src,
static public void copyBackboneElement(
org.hl7.fhir.r4.model.BackboneElement src,
org.hl7.fhir.dstu2.model.BackboneElement tgt,
String ... var) throws FHIRException {
ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt, var);
String ... extensionUrlsToIgnore) throws FHIRException {
ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.r4.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension10_40.convertExtension(e));
}

View File

@ -20,10 +20,10 @@ public class Element10_40 {
public void copyElement(org.hl7.fhir.dstu2.model.Element src,
org.hl7.fhir.r4.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.r4.model.Extension convertedExtension = new org.hl7.fhir.r4.model.Extension();

View File

@ -21,6 +21,11 @@ import org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction;
public class Conformance10_40 {
public static final String ACCEPT_UNKNOWN_EXTENSION_URL = "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown";
private static final String[] IGNORED_EXTENSION_URLS = new String[]{
ACCEPT_UNKNOWN_EXTENSION_URL
};
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatus> convertConditionalDeleteStatus(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
@ -69,7 +74,7 @@ public class Conformance10_40 {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Conformance tgt = new org.hl7.fhir.dstu2.model.Conformance();
ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyDomainResource(src, tgt);
ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_40.convertUri(src.getUrlElement()));
if (src.hasVersionElement())
@ -100,8 +105,8 @@ public class Conformance10_40 {
tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation()));
if (src.hasFhirVersion())
tgt.setFhirVersion(src.getFhirVersion().toCode());
if (src.hasExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"))
tgt.setAcceptUnknown(org.hl7.fhir.dstu2.model.Conformance.UnknownContentCode.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").getValue().primitiveValue()));
if (src.hasExtension(ACCEPT_UNKNOWN_EXTENSION_URL))
tgt.setAcceptUnknown(org.hl7.fhir.dstu2.model.Conformance.UnknownContentCode.fromCode(src.getExtensionByUrl(ACCEPT_UNKNOWN_EXTENSION_URL).getValue().primitiveValue()));
for (org.hl7.fhir.r4.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
for (CapabilityStatementRestComponent r : src.getRest())
for (CapabilityStatementRestResourceComponent rr : r.getResource())
@ -152,7 +157,7 @@ public class Conformance10_40 {
if (src.hasFhirVersion())
tgt.setFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion()));
if (src.hasAcceptUnknown())
tgt.addExtension().setUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").setValue(new org.hl7.fhir.r4.model.CodeType(src.getAcceptUnknownElement().asStringValue()));
tgt.addExtension().setUrl(ACCEPT_UNKNOWN_EXTENSION_URL).setValue(new org.hl7.fhir.r4.model.CodeType(src.getAcceptUnknownElement().asStringValue()));
for (org.hl7.fhir.dstu2.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent t : src.getRest())
tgt.addRest(convertConformanceRestComponent(t));

View File

@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_40.datatypes10_40.Narrative10_40;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.Extension;
import java.util.Arrays;
public class Resource10_40 {
public final BaseAdvisor_10_40 advisor;
@ -272,20 +274,22 @@ public class Resource10_40 {
}
}
public void copyDomainResource(org.hl7.fhir.dstu2.model.DomainResource src,
org.hl7.fhir.r4.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(
org.hl7.fhir.dstu2.model.DomainResource src,
org.hl7.fhir.r4.model.DomainResource tgt,
String ... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative10_40.convertNarrative(src.getText()));
src.getContained().stream()
.map(this::convertResource)
.forEach(tgt::addContained);
src.getExtension().forEach(ext -> {
if (advisor.useAdvisorForExtension(ConversionContext10_40.INSTANCE.path(), ext)) {
src.getExtension().forEach(extension -> {
if (advisor.useAdvisorForExtension(ConversionContext10_40.INSTANCE.path(), extension)) {
Extension convertExtension = new Extension();
advisor.handleExtension(ConversionContext10_40.INSTANCE.path(), ext, convertExtension);
advisor.handleExtension(ConversionContext10_40.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext10_40.INSTANCE.path(), ext)) {
tgt.addExtension(Extension10_40.convertExtension(ext));
} else if (!advisor.ignoreExtension(ConversionContext10_40.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension10_40.convertExtension(extension));
}
});
src.getModifierExtension().stream()
@ -294,8 +298,10 @@ public class Resource10_40 {
.forEach(tgt::addModifierExtension);
}
public void copyDomainResource(org.hl7.fhir.r4.model.DomainResource src,
org.hl7.fhir.dstu2.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(
org.hl7.fhir.r4.model.DomainResource src,
org.hl7.fhir.dstu2.model.DomainResource tgt,
String ... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative10_40.convertNarrative(src.getText()));
src.getContained().stream()
@ -306,7 +312,7 @@ public class Resource10_40 {
org.hl7.fhir.dstu2.model.Extension convertExtension = new org.hl7.fhir.dstu2.model.Extension();
advisor.handleExtension(ConversionContext10_40.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext10_40.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext10_40.INSTANCE.path(), extension)&& !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension10_40.convertExtension(extension));
}
});

View File

@ -144,43 +144,50 @@ public class VersionConvertor_10_50 {
}
}
public void copyDomainResource(@Nonnull org.hl7.fhir.dstu2.model.DomainResource src,
@Nonnull org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.dstu2.model.DomainResource src,
@Nonnull org.hl7.fhir.r5.model.DomainResource tgt,
String ... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyDomainResource(@Nonnull org.hl7.fhir.r5.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.r5.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2.model.DomainResource tgt,
String ... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.dstu2.model.Element src,
@Nonnull org.hl7.fhir.r5.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_50.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_50.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.r5.model.Element src,
@Nonnull org.hl7.fhir.dstu2.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_50.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_50.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.r5.model.DomainResource src,
public void copyElement(
@Nonnull org.hl7.fhir.r5.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_50.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_50.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.r5.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.r5.model.BackboneElement src,
@Nonnull org.hl7.fhir.dstu2.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.dstu2.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.dstu2.model.BackboneElement src,
@Nonnull org.hl7.fhir.r5.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
}

View File

@ -4,19 +4,21 @@ import org.hl7.fhir.convertors.context.ConversionContext10_50;
import org.hl7.fhir.exceptions.FHIRException;
public class BackboneElement10_50 {
static public void copyBackboneElement(org.hl7.fhir.dstu2.model.BackboneElement src,
static public void copyBackboneElement(
org.hl7.fhir.dstu2.model.BackboneElement src,
org.hl7.fhir.r5.model.BackboneElement tgt,
String ... var) throws FHIRException {
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt, var);
String ... extensionUrlsToIgnore) throws FHIRException {
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.dstu2.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension10_50.convertExtension(e));
}
}
static public void copyBackboneElement(org.hl7.fhir.r5.model.BackboneElement src,
static public void copyBackboneElement(
org.hl7.fhir.r5.model.BackboneElement src,
org.hl7.fhir.dstu2.model.BackboneElement tgt,
String ... var) throws FHIRException {
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt, var);
String ... extensionUrlsToIgnore) throws FHIRException {
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.r5.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension10_50.convertExtension(e));
}

View File

@ -20,10 +20,10 @@ public class Element10_50 {
public void copyElement(org.hl7.fhir.dstu2.model.Element src,
org.hl7.fhir.r5.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.r5.model.Extension convertedExtension = new org.hl7.fhir.r5.model.Extension();
@ -38,10 +38,10 @@ public class Element10_50 {
public void copyElement(org.hl7.fhir.r5.model.Element src,
org.hl7.fhir.dstu2.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.dstu2.model.Extension convertedExtension = new org.hl7.fhir.dstu2.model.Extension();
@ -56,10 +56,10 @@ public class Element10_50 {
public void copyElement(org.hl7.fhir.r5.model.DomainResource src,
org.hl7.fhir.dstu2.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.dstu2.model.Extension convertedExtension = new org.hl7.fhir.dstu2.model.Extension();

View File

@ -20,6 +20,12 @@ import org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction;
public class Conformance10_50 {
public static final String ACCEPT_UNKNOWN_EXTENSION_URL = "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown";
private static final String[] IGNORED_EXTENSION_URLS = new String[]{
ACCEPT_UNKNOWN_EXTENSION_URL
};
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Conformance.ConditionalDeleteStatus> convertConditionalDeleteStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
@ -72,7 +78,7 @@ public class Conformance10_50 {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Conformance tgt = new org.hl7.fhir.dstu2.model.Conformance();
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyDomainResource(src, tgt);
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_50.convertUri(src.getUrlElement()));
if (src.hasVersionElement())
@ -103,8 +109,8 @@ public class Conformance10_50 {
tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation()));
if (src.hasFhirVersion())
tgt.setFhirVersion(src.getFhirVersion().toCode());
if (src.hasExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"))
tgt.setAcceptUnknown(org.hl7.fhir.dstu2.model.Conformance.UnknownContentCode.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").getValue().primitiveValue()));
if (src.hasExtension(ACCEPT_UNKNOWN_EXTENSION_URL))
tgt.setAcceptUnknown(org.hl7.fhir.dstu2.model.Conformance.UnknownContentCode.fromCode(src.getExtensionByUrl(ACCEPT_UNKNOWN_EXTENSION_URL).getValue().primitiveValue()));
for (org.hl7.fhir.r5.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
for (CapabilityStatementRestComponent r : src.getRest())
for (CapabilityStatementRestResourceComponent rr : r.getResource())
@ -155,7 +161,7 @@ public class Conformance10_50 {
if (src.hasFhirVersion())
tgt.setFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion()));
if (src.hasAcceptUnknown())
tgt.addExtension().setUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").setValue(new org.hl7.fhir.r5.model.CodeType(src.getAcceptUnknownElement().asStringValue()));
tgt.addExtension().setUrl(ACCEPT_UNKNOWN_EXTENSION_URL).setValue(new org.hl7.fhir.r5.model.CodeType(src.getAcceptUnknownElement().asStringValue()));
for (org.hl7.fhir.dstu2.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
for (org.hl7.fhir.dstu2.model.Conformance.ConformanceRestComponent t : src.getRest())
tgt.addRest(convertConformanceRestComponent(t));

View File

@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.Narrative10_50;
import org.hl7.fhir.dstu2.model.Extension;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.Arrays;
public class Resource10_50 {
public final BaseAdvisor_10_50 advisor;
@ -264,7 +266,10 @@ public class Resource10_50 {
}
}
public void copyDomainResource(org.hl7.fhir.dstu2.model.DomainResource src, org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(
org.hl7.fhir.dstu2.model.DomainResource src,
org.hl7.fhir.r5.model.DomainResource tgt,
String ... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative10_50.convertNarrative(src.getText()));
src.getContained().stream()
@ -275,7 +280,7 @@ public class Resource10_50 {
org.hl7.fhir.r5.model.Extension convertExtension = new org.hl7.fhir.r5.model.Extension();
advisor.handleExtension(ConversionContext10_50.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext10_50.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext10_50.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension10_50.convertExtension(extension));
}
});
@ -285,7 +290,10 @@ public class Resource10_50 {
.forEach(tgt::addModifierExtension);
}
public void copyDomainResource(org.hl7.fhir.r5.model.DomainResource src, org.hl7.fhir.dstu2.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(
org.hl7.fhir.r5.model.DomainResource src,
org.hl7.fhir.dstu2.model.DomainResource tgt,
String ... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative10_50.convertNarrative(src.getText()));
src.getContained().stream()
@ -296,7 +304,7 @@ public class Resource10_50 {
Extension convertExtension = new Extension();
advisor.handleExtension(ConversionContext10_50.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext10_50.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext10_50.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension10_50.convertExtension(extension));
}
});

View File

@ -113,37 +113,45 @@ public class VersionConvertor_14_30 {
}
}
public void copyDomainResource(@Nonnull org.hl7.fhir.dstu2016may.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu3.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.dstu2016may.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu3.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyDomainResource(@Nonnull org.hl7.fhir.dstu3.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2016may.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.dstu3.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2016may.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.dstu2016may.model.Element src,
public void copyElement(
@Nonnull org.hl7.fhir.dstu2016may.model.Element src,
@Nonnull org.hl7.fhir.dstu3.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext14_30.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext14_30.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.dstu3.model.Element src,
public void copyElement(
@Nonnull org.hl7.fhir.dstu3.model.Element src,
@Nonnull org.hl7.fhir.dstu2016may.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext14_30.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext14_30.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.dstu2016may.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.dstu2016may.model.BackboneElement src,
@Nonnull org.hl7.fhir.dstu3.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.dstu3.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.dstu3.model.BackboneElement src,
@Nonnull org.hl7.fhir.dstu2016may.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
}

View File

@ -4,19 +4,21 @@ import org.hl7.fhir.convertors.context.ConversionContext14_30;
import org.hl7.fhir.exceptions.FHIRException;
public class BackboneElement14_30 {
static public void copyBackboneElement(org.hl7.fhir.dstu2016may.model.BackboneElement src,
static public void copyBackboneElement(
org.hl7.fhir.dstu2016may.model.BackboneElement src,
org.hl7.fhir.dstu3.model.BackboneElement tgt,
String ... var) throws FHIRException {
ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt, var);
String ... extensionUrlsToIgnore) throws FHIRException {
ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.dstu2016may.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension14_30.convertExtension(e));
}
}
static public void copyBackboneElement(org.hl7.fhir.dstu3.model.BackboneElement src,
static public void copyBackboneElement(
org.hl7.fhir.dstu3.model.BackboneElement src,
org.hl7.fhir.dstu2016may.model.BackboneElement tgt,
String ... var) throws FHIRException {
ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt, var);
String ... extensionUrlsToIgnore) throws FHIRException {
ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.dstu3.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension14_30.convertExtension(e));
}

View File

@ -21,10 +21,10 @@ public class Element14_30 {
public void copyElement(org.hl7.fhir.dstu2016may.model.Element src,
org.hl7.fhir.dstu3.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore)
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore)
&& (!(e.getUrl().equals(VersionConvertorConstants.PROFILE_EXTENSION)
|| e.getUrl().equals(VersionConvertorConstants.IG_DEPENDSON_PACKAGE_EXTENSION)
|| e.getUrl().equals(VersionConvertorConstants.IG_DEPENDSON_VERSION_EXTENSION))))
@ -42,10 +42,10 @@ public class Element14_30 {
public void copyElement(org.hl7.fhir.dstu3.model.Element src,
org.hl7.fhir.dstu2016may.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.dstu2016may.model.Extension convertedExtension = new org.hl7.fhir.dstu2016may.model.Extension();

View File

@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv14_30.datatypes14_30.Meta14_30;
import org.hl7.fhir.convertors.conv14_30.datatypes14_30.Narrative14_30;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.Arrays;
public class Resource14_30 {
public final BaseAdvisor_14_30 advisor;
@ -115,8 +117,10 @@ public class Resource14_30 {
}
}
public void copyDomainResource(org.hl7.fhir.dstu2016may.model.DomainResource src,
org.hl7.fhir.dstu3.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(
org.hl7.fhir.dstu2016may.model.DomainResource src,
org.hl7.fhir.dstu3.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative14_30.convertNarrative(src.getText()));
src.getContained().stream()
@ -127,7 +131,7 @@ public class Resource14_30 {
org.hl7.fhir.dstu3.model.Extension convertExtension = new org.hl7.fhir.dstu3.model.Extension();
advisor.handleExtension(ConversionContext14_30.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext14_30.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext14_30.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension14_30.convertExtension(extension));
}
});
@ -137,8 +141,11 @@ public class Resource14_30 {
.forEach(tgt::addModifierExtension);
}
public void copyDomainResource(org.hl7.fhir.dstu3.model.DomainResource src,
org.hl7.fhir.dstu2016may.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(
org.hl7.fhir.dstu3.model.DomainResource src,
org.hl7.fhir.dstu2016may.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative14_30.convertNarrative(src.getText()));
src.getContained().stream()
@ -149,7 +156,7 @@ public class Resource14_30 {
org.hl7.fhir.dstu2016may.model.Extension convertExtension = new org.hl7.fhir.dstu2016may.model.Extension();
advisor.handleExtension(ConversionContext14_30.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext14_30.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext14_30.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension14_30.convertExtension(extension));
}
});

View File

@ -137,37 +137,45 @@ public class VersionConvertor_14_40 {
}
}
public void copyDomainResource(@Nonnull org.hl7.fhir.dstu2016may.model.DomainResource src,
@Nonnull org.hl7.fhir.r4.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.dstu2016may.model.DomainResource src,
@Nonnull org.hl7.fhir.r4.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyDomainResource(@Nonnull org.hl7.fhir.r4.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2016may.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.r4.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2016may.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.dstu2016may.model.Element src,
public void copyElement(
@Nonnull org.hl7.fhir.dstu2016may.model.Element src,
@Nonnull org.hl7.fhir.r4.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext14_40.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext14_40.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.r4.model.Element src,
public void copyElement(
@Nonnull org.hl7.fhir.r4.model.Element src,
@Nonnull org.hl7.fhir.dstu2016may.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext14_40.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext14_40.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.r4.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.r4.model.BackboneElement src,
@Nonnull org.hl7.fhir.dstu2016may.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.dstu2016may.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.dstu2016may.model.BackboneElement src,
@Nonnull org.hl7.fhir.r4.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
}

View File

@ -6,8 +6,8 @@ import org.hl7.fhir.exceptions.FHIRException;
public class BackboneElement14_40 {
static public void copyBackboneElement(org.hl7.fhir.dstu2016may.model.BackboneElement src,
org.hl7.fhir.r4.model.BackboneElement tgt,
String ... var) throws FHIRException {
ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt, var);
String ... extensionUrlsToIgnore) throws FHIRException {
ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.dstu2016may.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension14_40.convertExtension(e));
}
@ -15,8 +15,8 @@ public class BackboneElement14_40 {
static public void copyBackboneElement(org.hl7.fhir.r4.model.BackboneElement src,
org.hl7.fhir.dstu2016may.model.BackboneElement tgt,
String ... var) throws FHIRException {
ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt, var);
String ... extensionUrlsToIgnore) throws FHIRException {
ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.r4.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension14_40.convertExtension(e));
}

View File

@ -20,10 +20,10 @@ public class Element14_40 {
public void copyElement(org.hl7.fhir.dstu2016may.model.Element src,
org.hl7.fhir.r4.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.r4.model.Extension convertedExtension = new org.hl7.fhir.r4.model.Extension();
@ -38,10 +38,10 @@ public class Element14_40 {
public void copyElement(org.hl7.fhir.r4.model.Element src,
org.hl7.fhir.dstu2016may.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.dstu2016may.model.Extension convertedExtension = new org.hl7.fhir.dstu2016may.model.Extension();

View File

@ -19,6 +19,12 @@ import org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResource
public class Conformance14_40 {
public static final String ACCEPT_UNKNOWN_EXTENSION_URL = "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown";
private static final String[] IGNORED_EXTENSION_URLS = new String[]{
ACCEPT_UNKNOWN_EXTENSION_URL
};
static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus> convertConditionalDeleteStatus(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
@ -67,7 +73,7 @@ public class Conformance14_40 {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2016may.model.Conformance tgt = new org.hl7.fhir.dstu2016may.model.Conformance();
ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyDomainResource(src, tgt);
ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
if (src.hasUrl())
tgt.setUrlElement(Uri14_40.convertUri(src.getUrlElement()));
if (src.hasVersion())
@ -102,8 +108,8 @@ public class Conformance14_40 {
if (src.hasImplementation())
tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation()));
tgt.setFhirVersion(src.getFhirVersion().toCode());
if (src.hasExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"))
tgt.setAcceptUnknown(org.hl7.fhir.dstu2016may.model.Conformance.UnknownContentCode.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").getValue().primitiveValue()));
if (src.hasExtension(ACCEPT_UNKNOWN_EXTENSION_URL))
tgt.setAcceptUnknown(org.hl7.fhir.dstu2016may.model.Conformance.UnknownContentCode.fromCode(src.getExtensionByUrl(ACCEPT_UNKNOWN_EXTENSION_URL).getValue().primitiveValue()));
for (org.hl7.fhir.r4.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
for (CapabilityStatementRestComponent r : src.getRest())
for (CapabilityStatementRestResourceComponent rr : r.getResource())
@ -159,7 +165,7 @@ public class Conformance14_40 {
if (src.hasFhirVersion())
tgt.setFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion()));
if (src.hasAcceptUnknown())
tgt.addExtension().setUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").setValue(new org.hl7.fhir.r4.model.CodeType(src.getAcceptUnknownElement().asStringValue()));
tgt.addExtension().setUrl(ACCEPT_UNKNOWN_EXTENSION_URL).setValue(new org.hl7.fhir.r4.model.CodeType(src.getAcceptUnknownElement().asStringValue()));
for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent t : src.getRest())
tgt.addRest(convertConformanceRestComponent(t));

View File

@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv14_40.datatypes14_40.Meta14_40;
import org.hl7.fhir.convertors.conv14_40.datatypes14_40.Narrative14_40;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.Arrays;
public class Resource14_40 {
public final BaseAdvisor_14_40 advisor;
@ -113,8 +115,10 @@ public class Resource14_40 {
}
}
public void copyDomainResource(org.hl7.fhir.dstu2016may.model.DomainResource src,
org.hl7.fhir.r4.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(
org.hl7.fhir.dstu2016may.model.DomainResource src,
org.hl7.fhir.r4.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative14_40.convertNarrative(src.getText()));
src.getContained().stream()
@ -125,7 +129,7 @@ public class Resource14_40 {
org.hl7.fhir.r4.model.Extension convertExtension = new org.hl7.fhir.r4.model.Extension();
advisor.handleExtension(ConversionContext14_40.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext14_40.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext14_40.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension14_40.convertExtension(extension));
}
});
@ -135,8 +139,10 @@ public class Resource14_40 {
.forEach(tgt::addModifierExtension);
}
public void copyDomainResource(org.hl7.fhir.r4.model.DomainResource src,
org.hl7.fhir.dstu2016may.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(
org.hl7.fhir.r4.model.DomainResource src,
org.hl7.fhir.dstu2016may.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative14_40.convertNarrative(src.getText()));
src.getContained().stream()
@ -147,7 +153,7 @@ public class Resource14_40 {
org.hl7.fhir.dstu2016may.model.Extension convertExtension = new org.hl7.fhir.dstu2016may.model.Extension();
advisor.handleExtension(ConversionContext14_40.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext14_40.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext14_40.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension14_40.convertExtension(extension));
}
});

View File

@ -129,37 +129,45 @@ public class VersionConvertor_14_50 {
}
}
public void copyDomainResource(@Nonnull org.hl7.fhir.dstu2016may.model.DomainResource src,
@Nonnull org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.dstu2016may.model.DomainResource src,
@Nonnull org.hl7.fhir.r5.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyDomainResource(@Nonnull org.hl7.fhir.r5.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2016may.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.r5.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2016may.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.dstu2016may.model.Element src,
public void copyElement(
@Nonnull org.hl7.fhir.dstu2016may.model.Element src,
@Nonnull org.hl7.fhir.r5.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext14_50.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext14_50.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.r5.model.Element src,
public void copyElement(
@Nonnull org.hl7.fhir.r5.model.Element src,
@Nonnull org.hl7.fhir.dstu2016may.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext14_50.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext14_50.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.r5.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.r5.model.BackboneElement src,
@Nonnull org.hl7.fhir.dstu2016may.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.dstu2016may.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.dstu2016may.model.BackboneElement src,
@Nonnull org.hl7.fhir.r5.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
}

View File

@ -4,19 +4,21 @@ import org.hl7.fhir.convertors.context.ConversionContext14_50;
import org.hl7.fhir.exceptions.FHIRException;
public class BackboneElement14_50 {
static public void copyBackboneElement(org.hl7.fhir.dstu2016may.model.BackboneElement src,
static public void copyBackboneElement(
org.hl7.fhir.dstu2016may.model.BackboneElement src,
org.hl7.fhir.r5.model.BackboneElement tgt,
String... var) throws FHIRException {
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.dstu2016may.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension14_50.convertExtension(e));
}
}
static public void copyBackboneElement(org.hl7.fhir.r5.model.BackboneElement src,
static public void copyBackboneElement(
org.hl7.fhir.r5.model.BackboneElement src,
org.hl7.fhir.dstu2016may.model.BackboneElement tgt,
String... var) throws FHIRException {
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.r5.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension14_50.convertExtension(e));
}

View File

@ -21,10 +21,10 @@ public class Element14_50 {
public void copyElement(org.hl7.fhir.dstu2016may.model.Element src,
org.hl7.fhir.r5.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.r5.model.Extension convertedExtension = new org.hl7.fhir.r5.model.Extension();
@ -39,10 +39,10 @@ public class Element14_50 {
public void copyElement(org.hl7.fhir.r5.model.Element src,
org.hl7.fhir.dstu2016may.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.dstu2016may.model.Extension convertedExtension = new org.hl7.fhir.dstu2016may.model.Extension();

View File

@ -18,6 +18,12 @@ import org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResource
public class Conformance14_50 {
public static final String ACCEPT_UNKNOWN_EXTENSION_URL = "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown";
private static final String[] IGNORED_EXTENSION_URLS = new String[]{
ACCEPT_UNKNOWN_EXTENSION_URL
};
static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Conformance.ConditionalDeleteStatus> convertConditionalDeleteStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
@ -103,7 +109,7 @@ public class Conformance14_50 {
if (src.hasFhirVersion())
tgt.setFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion()));
if (src.hasAcceptUnknown())
tgt.addExtension().setUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").setValue(new org.hl7.fhir.r5.model.CodeType(src.getAcceptUnknownElement().asStringValue()));
tgt.addExtension().setUrl(ACCEPT_UNKNOWN_EXTENSION_URL).setValue(new org.hl7.fhir.r5.model.CodeType(src.getAcceptUnknownElement().asStringValue()));
for (org.hl7.fhir.dstu2016may.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
for (org.hl7.fhir.dstu2016may.model.Conformance.ConformanceRestComponent t : src.getRest())
tgt.addRest(convertConformanceRestComponent(t));
@ -118,7 +124,7 @@ public class Conformance14_50 {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2016may.model.Conformance tgt = new org.hl7.fhir.dstu2016may.model.Conformance();
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyDomainResource(src, tgt);
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
if (src.hasUrl())
tgt.setUrlElement(Uri14_50.convertUri(src.getUrlElement()));
if (src.hasVersion())
@ -153,8 +159,8 @@ public class Conformance14_50 {
if (src.hasImplementation())
tgt.setImplementation(convertConformanceImplementationComponent(src.getImplementation()));
tgt.setFhirVersion(src.getFhirVersion().toCode());
if (src.hasExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"))
tgt.setAcceptUnknown(org.hl7.fhir.dstu2016may.model.Conformance.UnknownContentCode.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").getValue().primitiveValue()));
if (src.hasExtension(ACCEPT_UNKNOWN_EXTENSION_URL))
tgt.setAcceptUnknown(org.hl7.fhir.dstu2016may.model.Conformance.UnknownContentCode.fromCode(src.getExtensionByUrl(ACCEPT_UNKNOWN_EXTENSION_URL).getValue().primitiveValue()));
for (org.hl7.fhir.r5.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
for (CapabilityStatementRestComponent r : src.getRest())
for (CapabilityStatementRestResourceComponent rr : r.getResource())

View File

@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.Meta14_50;
import org.hl7.fhir.convertors.conv14_50.datatypes14_50.Narrative14_50;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.Arrays;
public class Resource14_50 {
public final BaseAdvisor_14_50 advisor;
@ -113,8 +115,10 @@ public class Resource14_50 {
}
}
public void copyDomainResource(org.hl7.fhir.dstu2016may.model.DomainResource src,
org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(
org.hl7.fhir.dstu2016may.model.DomainResource src,
org.hl7.fhir.r5.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative14_50.convertNarrative(src.getText()));
src.getContained().stream()
@ -125,7 +129,7 @@ public class Resource14_50 {
org.hl7.fhir.r5.model.Extension convertExtension = new org.hl7.fhir.r5.model.Extension();
advisor.handleExtension(ConversionContext14_50.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext14_50.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext14_50.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension14_50.convertExtension(extension));
}
});
@ -135,8 +139,10 @@ public class Resource14_50 {
.forEach(tgt::addModifierExtension);
}
public void copyDomainResource(org.hl7.fhir.r5.model.DomainResource src,
org.hl7.fhir.dstu2016may.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(
org.hl7.fhir.r5.model.DomainResource src,
org.hl7.fhir.dstu2016may.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative14_50.convertNarrative(src.getText()));
src.getContained().stream()
@ -147,7 +153,7 @@ public class Resource14_50 {
org.hl7.fhir.dstu2016may.model.Extension convertExtension = new org.hl7.fhir.dstu2016may.model.Extension();
advisor.handleExtension(ConversionContext14_50.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext14_50.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext14_50.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension14_50.convertExtension(extension));
}
});

View File

@ -133,36 +133,42 @@ public class VersionConvertor_30_40 {
}
public void copyDomainResource(@Nonnull org.hl7.fhir.dstu3.model.DomainResource src,
@Nonnull org.hl7.fhir.r4.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
@Nonnull org.hl7.fhir.r4.model.DomainResource tgt, String... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyDomainResource(@Nonnull org.hl7.fhir.r4.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu3.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.r4.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu3.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
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,
@Nonnull org.hl7.fhir.r4.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext30_40.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext30_40.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.r4.model.Element src,
public void copyElement(
@Nonnull org.hl7.fhir.r4.model.Element src,
@Nonnull org.hl7.fhir.dstu3.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext30_40.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext30_40.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.r4.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.r4.model.BackboneElement src,
@Nonnull org.hl7.fhir.dstu3.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.dstu3.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.dstu3.model.BackboneElement src,
@Nonnull org.hl7.fhir.r4.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
}

View File

@ -4,15 +4,15 @@ import org.hl7.fhir.convertors.context.ConversionContext30_40;
import org.hl7.fhir.exceptions.FHIRException;
public class BackboneElement30_40 {
static public void copyBackboneElement(org.hl7.fhir.dstu3.model.BackboneElement src, org.hl7.fhir.r4.model.BackboneElement tgt, String... var) throws FHIRException {
ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt, var);
static public void copyBackboneElement(org.hl7.fhir.dstu3.model.BackboneElement src, org.hl7.fhir.r4.model.BackboneElement tgt, String... extensionUrlsToIgnore) throws FHIRException {
ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.dstu3.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension30_40.convertExtension(e));
}
}
static public void copyBackboneElement(org.hl7.fhir.r4.model.BackboneElement src, org.hl7.fhir.dstu3.model.BackboneElement tgt, String... var) throws FHIRException {
ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt, var);
static public void copyBackboneElement(org.hl7.fhir.r4.model.BackboneElement src, org.hl7.fhir.dstu3.model.BackboneElement tgt, String... extensionUrlsToIgnore) throws FHIRException {
ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.r4.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension30_40.convertExtension(e));
}

View File

@ -13,17 +13,17 @@ public class Element30_40 {
this.advisor = advisor;
}
public boolean isExemptExtension(String url, String[] extensionsToIgnore) {
return Arrays.asList(extensionsToIgnore).contains(url);
public boolean isExemptExtension(String url, String[] extensionUrlsToIgnore) {
return Arrays.asList(extensionUrlsToIgnore).contains(url);
}
public void copyElement(org.hl7.fhir.dstu3.model.Element src,
org.hl7.fhir.r4.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.r4.model.Extension convertedExtension = new org.hl7.fhir.r4.model.Extension();
@ -38,10 +38,10 @@ public class Element30_40 {
public void copyElement(org.hl7.fhir.r4.model.Element src,
org.hl7.fhir.dstu3.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.dstu3.model.Extension convertedExtension = new org.hl7.fhir.dstu3.model.Extension();

View File

@ -20,11 +20,17 @@ import org.hl7.fhir.exceptions.FHIRException;
public class CapabilityStatement30_40 {
public static final String ACCEPT_UNKNOWN_EXTENSION_URL = "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown";
private static final String[] IGNORED_EXTENSION_URLS = new String[]{
ACCEPT_UNKNOWN_EXTENSION_URL
};
public static org.hl7.fhir.dstu3.model.CapabilityStatement convertCapabilityStatement(org.hl7.fhir.r4.model.CapabilityStatement src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.dstu3.model.CapabilityStatement tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement();
ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt);
ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
if (src.hasUrl())
tgt.setUrlElement(Uri30_40.convertUri(src.getUrlElement()));
if (src.hasVersion())
@ -62,8 +68,8 @@ public class CapabilityStatement30_40 {
tgt.setImplementation(convertCapabilityStatementImplementationComponent(src.getImplementation()));
if (src.hasFhirVersion())
tgt.setFhirVersion(src.getFhirVersion().toCode());
if (src.hasExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"))
tgt.setAcceptUnknown(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").getValue().primitiveValue()));
if (src.hasExtension(ACCEPT_UNKNOWN_EXTENSION_URL))
tgt.setAcceptUnknown(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.fromCode(src.getExtensionByUrl(ACCEPT_UNKNOWN_EXTENSION_URL).getValue().primitiveValue()));
for (org.hl7.fhir.r4.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
for (org.hl7.fhir.r4.model.CodeType t : src.getPatchFormat()) tgt.addPatchFormat(t.getValue());
for (org.hl7.fhir.r4.model.UriType t : src.getImplementationGuide()) tgt.addImplementationGuide(t.getValue());
@ -128,7 +134,7 @@ public class CapabilityStatement30_40 {
if (src.hasFhirVersion())
tgt.setFhirVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.fromCode(src.getFhirVersion()));
if (src.hasAcceptUnknown())
tgt.addExtension().setUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").setValue(new org.hl7.fhir.r4.model.CodeType(src.getAcceptUnknownElement().asStringValue()));
tgt.addExtension().setUrl(ACCEPT_UNKNOWN_EXTENSION_URL).setValue(new org.hl7.fhir.r4.model.CodeType(src.getAcceptUnknownElement().asStringValue()));
for (org.hl7.fhir.dstu3.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
for (org.hl7.fhir.dstu3.model.CodeType t : src.getPatchFormat()) tgt.addPatchFormat(t.getValue());
for (org.hl7.fhir.dstu3.model.UriType t : src.getImplementationGuide()) tgt.addImplementationGuide(t.getValue());

View File

@ -20,6 +20,10 @@ public class Immunization30_40 {
public static final String NOT_GIVEN_EXTENSION_URL = "http://hl7.org/fhir/3.0/StructureDefinition/extension-Immunization.notGiven";
private static final String[] IGNORED_EXTENSION_URLS = new String[]{
NOT_GIVEN_EXTENSION_URL
};
public static org.hl7.fhir.r4.model.Immunization convertImmunization(org.hl7.fhir.dstu3.model.Immunization src) throws FHIRException {
if (src == null)
return null;
@ -82,7 +86,8 @@ public class Immunization30_40 {
if (src == null)
return null;
org.hl7.fhir.dstu3.model.Immunization tgt = new org.hl7.fhir.dstu3.model.Immunization();
ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt);
ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier30_40.convertIdentifier(t));
if (src.hasStatus()) {

View File

@ -7,6 +7,8 @@ import org.hl7.fhir.convertors.conv30_40.datatypes30_40.Meta30_40;
import org.hl7.fhir.convertors.conv30_40.datatypes30_40.Narrative30_40;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.Arrays;
public class Resource30_40 {
public final BaseAdvisor_30_40 advisor;
@ -384,7 +386,8 @@ public class Resource30_40 {
}
public void copyDomainResource(org.hl7.fhir.dstu3.model.DomainResource src,
org.hl7.fhir.r4.model.DomainResource tgt) throws FHIRException {
org.hl7.fhir.r4.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative30_40.convertNarrative(src.getText()));
src.getContained().stream()
@ -396,7 +399,7 @@ public class Resource30_40 {
org.hl7.fhir.r4.model.Extension convertExtension = new org.hl7.fhir.r4.model.Extension();
advisor.handleExtension(ConversionContext30_40.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext30_40.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext30_40.INSTANCE.path(), extension)&& !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension30_40.convertExtension(extension));
}
});
@ -407,7 +410,8 @@ public class Resource30_40 {
}
public void copyDomainResource(org.hl7.fhir.r4.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);
if (src.hasText()) tgt.setText(Narrative30_40.convertNarrative(src.getText()));
src.getContained().stream()
@ -418,7 +422,7 @@ public class Resource30_40 {
org.hl7.fhir.dstu3.model.Extension convertExtension = new org.hl7.fhir.dstu3.model.Extension();
advisor.handleExtension(ConversionContext30_40.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext30_40.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext30_40.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension30_40.convertExtension(extension));
}
});

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.exceptions.FHIRException;
import java.util.Arrays;
public class Resource30_50 {
public final BaseAdvisor_30_50 advisor;
@ -451,7 +453,7 @@ public class Resource30_50 {
}
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);
if (src.hasText()) tgt.setText(Narrative30_50.convertNarrative(src.getText()));
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();
advisor.handleExtension(ConversionContext30_50.INSTANCE.path(), extension, 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));
}
});
@ -473,7 +475,7 @@ public class Resource30_50 {
}
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);
if (src.hasText()) tgt.setText(Narrative30_50.convertNarrative(src.getText()));
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();
advisor.handleExtension(ConversionContext30_50.INSTANCE.path(), extension, 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));
}
});

View File

@ -130,37 +130,45 @@ public class VersionConvertor_30_50 {
}
}
public void copyDomainResource(@Nonnull org.hl7.fhir.dstu3.model.DomainResource src,
@Nonnull org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.dstu3.model.DomainResource src,
@Nonnull org.hl7.fhir.r5.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyDomainResource(@Nonnull org.hl7.fhir.r5.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu3.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.r5.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu3.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
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,
@Nonnull org.hl7.fhir.r5.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext30_50.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext30_50.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.r5.model.Element src,
public void copyElement(
@Nonnull org.hl7.fhir.r5.model.Element src,
@Nonnull org.hl7.fhir.dstu3.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext30_50.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext30_50.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.r5.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.r5.model.BackboneElement src,
@Nonnull org.hl7.fhir.dstu3.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.dstu3.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.dstu3.model.BackboneElement src,
@Nonnull org.hl7.fhir.r5.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
}

View File

@ -4,15 +4,15 @@ import org.hl7.fhir.convertors.context.ConversionContext30_50;
import org.hl7.fhir.exceptions.FHIRException;
public class BackboneElement30_50 {
static public void copyBackboneElement(org.hl7.fhir.dstu3.model.BackboneElement src, org.hl7.fhir.r5.model.BackboneElement tgt, String ... var) throws FHIRException {
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src,tgt, var);
static public void copyBackboneElement(org.hl7.fhir.dstu3.model.BackboneElement src, org.hl7.fhir.r5.model.BackboneElement tgt, String ... extensionUrlsToIgnore) throws FHIRException {
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src,tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.dstu3.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension30_50.convertExtension(e));
}
}
static public void copyBackboneElement(org.hl7.fhir.r5.model.BackboneElement src, org.hl7.fhir.dstu3.model.BackboneElement tgt, String ... var) throws FHIRException {
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt, var);
static public void copyBackboneElement(org.hl7.fhir.r5.model.BackboneElement src, org.hl7.fhir.dstu3.model.BackboneElement tgt, String ... extensionUrlsToIgnore) throws FHIRException {
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.r5.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension30_50.convertExtension(e));
}

View File

@ -13,17 +13,17 @@ public class Element30_50 {
this.advisor = advisor;
}
public boolean isExemptExtension(String url, String[] extensionsToIgnore) {
return Arrays.asList(extensionsToIgnore).contains(url);
public boolean isExemptExtension(String url, String[] extensionUrlsToIgnore) {
return Arrays.asList(extensionUrlsToIgnore).contains(url);
}
public void copyElement(org.hl7.fhir.dstu3.model.Element src,
org.hl7.fhir.r5.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.r5.model.Extension convertedExtension = new org.hl7.fhir.r5.model.Extension();
@ -38,10 +38,10 @@ public class Element30_50 {
public void copyElement(org.hl7.fhir.r5.model.Element src,
org.hl7.fhir.dstu3.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.dstu3.model.Extension convertedExtension = new org.hl7.fhir.dstu3.model.Extension();

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
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 {
if (src == null)
return null;
@ -57,69 +101,70 @@ public class ActorDefinition30_50 {
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();
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())
tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.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()));
if (src.hasExtension(URL_EXTENSION_URL)) {
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")) {
tgt.setVersionElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.version").getValue()));
if (src.hasExtension(VERSION_EXTENSION_URL)) {
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")) {
tgt.setNameElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.name").getValue()));
if (src.hasExtension(NAME_EXTENSION_URL)) {
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")) {
tgt.setTitleElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.title").getValue()));
if (src.hasExtension(TITLE_EXTENSION_URL)) {
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")) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.status").getValue().primitiveValue()));
if (src.hasExtension(STATUS_EXTENSION_URL)) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl(STATUS_EXTENSION_URL).getValue().primitiveValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.experimental")) {
tgt.setExperimentalElement(Boolean30_50.convertBoolean((org.hl7.fhir.dstu3.model.BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.experimental").getValue()));
if (src.hasExtension(EXPERIMENTAL_EXTENSION_URL)) {
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")) {
tgt.setDateElement(DateTime30_50.convertDateTime((org.hl7.fhir.dstu3.model.DateTimeType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.date").getValue()));
if (src.hasExtension(DATE_EXTENSION_URL)) {
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")) {
tgt.setPublisherElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.publisher").getValue()));
if (src.hasExtension(PUBLISHER_EXTENSION_URL)) {
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()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.description")) {
tgt.setPublisherElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.description").getValue()));
if (src.hasExtension(DESCRIPTION_EXTENSION_URL)) {
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()));
}
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()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.purpose")) {
tgt.setPurposeElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.purpose").getValue()));
if (src.hasExtension(PURPOSE_EXTENSION_URL)) {
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")) {
tgt.setCopyrightElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyright").getValue()));
if (src.hasExtension(COPYRIGHT_EXTENSION_URL)) {
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")) {
tgt.setCopyrightLabelElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyrightLabel").getValue()));
if (src.hasExtension(COPYRIGHT_LABEL_EXTENSION_URL)) {
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")) {
tgt.setType(ExampleScenarioActorType.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.type").getValue().primitiveValue()));
if (src.hasExtension(TYPE_EXTENSION_URL)) {
tgt.setType(ExampleScenarioActorType.fromCode(src.getExtensionByUrl(TYPE_EXTENSION_URL).getValue().primitiveValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.documentation")) {
tgt.setDocumentationElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.documentation").getValue()));
if (src.hasExtension(DOCUMENTATION_EXTENSION_URL)) {
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()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.capabilities")) {
tgt.setCapabilitiesElement(Uri30_50.convertCanonical((org.hl7.fhir.dstu3.model.UriType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.capabilities").getValue()));
if (src.hasExtension(CAPABILITIES_EXTENSION_URL)) {
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()));
}
return tgt;
@ -135,64 +180,64 @@ public class ActorDefinition30_50 {
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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;

View File

@ -20,6 +20,14 @@ import org.hl7.fhir.exceptions.FHIRException;
public class CapabilityStatement30_50 {
public static final String ACCEPT_UNKNOWN_EXTENSION_URL = "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown";
public static final String PROFILE_EXTENSION_URL = "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile";
private static final String[] IGNORED_EXTENSION_URLS = new String[]{
ACCEPT_UNKNOWN_EXTENSION_URL,
PROFILE_EXTENSION_URL
};
public static org.hl7.fhir.r5.model.CapabilityStatement convertCapabilityStatement(org.hl7.fhir.dstu3.model.CapabilityStatement src) throws FHIRException {
if (src == null)
return null;
@ -63,14 +71,14 @@ public class CapabilityStatement30_50 {
if (src.hasFhirVersion())
tgt.setFhirVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.fromCode(fixCode(src.getFhirVersion())));
if (src.hasAcceptUnknown())
tgt.addExtension().setUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").setValue(new org.hl7.fhir.r5.model.CodeType(src.getAcceptUnknownElement().asStringValue()));
tgt.addExtension().setUrl(ACCEPT_UNKNOWN_EXTENSION_URL).setValue(new org.hl7.fhir.r5.model.CodeType(src.getAcceptUnknownElement().asStringValue()));
for (org.hl7.fhir.dstu3.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
for (org.hl7.fhir.dstu3.model.CodeType t : src.getPatchFormat()) tgt.addPatchFormat(t.getValue());
for (org.hl7.fhir.dstu3.model.UriType t : src.getImplementationGuide()) tgt.addImplementationGuide(t.getValue());
for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest())
tgt.addRest(convertCapabilityStatementRestComponent(t));
for (org.hl7.fhir.dstu3.model.Reference t : src.getProfile())
tgt.addExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile", Reference30_50.convertReference(t));
tgt.addExtension(PROFILE_EXTENSION_URL, Reference30_50.convertReference(t));
for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging())
tgt.addMessaging(convertCapabilityStatementMessagingComponent(t));
for (org.hl7.fhir.dstu3.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument())
@ -90,7 +98,7 @@ public class CapabilityStatement30_50 {
if (src == null)
return null;
org.hl7.fhir.dstu3.model.CapabilityStatement tgt = new org.hl7.fhir.dstu3.model.CapabilityStatement();
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
if (src.hasUrl())
tgt.setUrlElement(Uri30_50.convertUri(src.getUrlElement()));
if (src.hasVersion())
@ -128,8 +136,8 @@ public class CapabilityStatement30_50 {
tgt.setImplementation(convertCapabilityStatementImplementationComponent(src.getImplementation()));
if (src.hasFhirVersion())
tgt.setFhirVersion(src.getFhirVersion().toCode());
if (src.hasExtension("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"))
tgt.setAcceptUnknown(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown").getValue().primitiveValue()));
if (src.hasExtension(ACCEPT_UNKNOWN_EXTENSION_URL))
tgt.setAcceptUnknown(org.hl7.fhir.dstu3.model.CapabilityStatement.UnknownContentCode.fromCode(src.getExtensionByUrl(ACCEPT_UNKNOWN_EXTENSION_URL).getValue().primitiveValue()));
for (org.hl7.fhir.r5.model.CodeType t : src.getFormat()) tgt.addFormat(t.getValue());
for (org.hl7.fhir.r5.model.CodeType t : src.getPatchFormat()) tgt.addPatchFormat(t.getValue());
for (org.hl7.fhir.r5.model.UriType t : src.getImplementationGuide()) tgt.addImplementationGuide(t.getValue());
@ -138,7 +146,7 @@ public class CapabilityStatement30_50 {
for (org.hl7.fhir.r5.model.CanonicalType t : rr.getSupportedProfile())
tgt.addProfile(Reference30_50.convertCanonicalToReference(t));
for (org.hl7.fhir.r5.model.Extension ext : src.getExtension()) {
if ("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile".equals(ext.getUrl())) {
if (PROFILE_EXTENSION_URL.equals(ext.getUrl())) {
tgt.addProfile(Reference30_50.convertReference((org.hl7.fhir.r5.model.Reference) ext.getValue()));
}
}

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
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 {
if (src == null)
return null;
@ -63,63 +102,64 @@ public class Requirements30_50 {
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();
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())
tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.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()));
if (src.hasExtension(URL_EXTENSION_URL)) {
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")) {
tgt.setVersionElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.version").getValue()));
if (src.hasExtension(VERSION_EXTENSION_URL)) {
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")) {
tgt.setNameElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.name").getValue()));
if (src.hasExtension(NAME_EXTENSION_URL)) {
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")) {
tgt.setTitleElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.title").getValue()));
if (src.hasExtension(TITLE_EXTENSION_URL)) {
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")) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.status").getValue().primitiveValue()));
if (src.hasExtension(STATUS_EXTENSION_URL)) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl(STATUS_EXTENSION_URL).getValue().primitiveValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.experimental")) {
tgt.setExperimentalElement(Boolean30_50.convertBoolean((org.hl7.fhir.dstu3.model.BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.experimental").getValue()));
if (src.hasExtension(EXPERIMENTAL_EXTENSION_URL)) {
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")) {
tgt.setDateElement(DateTime30_50.convertDateTime((org.hl7.fhir.dstu3.model.DateTimeType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.date").getValue()));
if (src.hasExtension(DATE_EXTENSION_URL)) {
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")) {
tgt.setPublisherElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.publisher").getValue()));
if (src.hasExtension(PUBLISHER_EXTENSION_URL)) {
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()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.description")) {
tgt.setPublisherElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.description").getValue()));
if (src.hasExtension(DESCRIPTION_EXTENSION_URL)) {
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()));
}
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()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.purpose")) {
tgt.setPurposeElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.purpose").getValue()));
if (src.hasExtension(PURPOSE_EXTENSION_URL)) {
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")) {
tgt.setCopyrightElement(MarkDown30_50.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyright").getValue()));
if (src.hasExtension(COPYRIGHT_EXTENSION_URL)) {
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")) {
tgt.setCopyrightLabelElement(String30_50.convertString((org.hl7.fhir.dstu3.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyrightLabel").getValue()));
if (src.hasExtension(COPYRIGHT_LABEL_EXTENSION_URL)) {
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()));
}
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()));
}
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());
}
return tgt;
@ -136,58 +176,58 @@ public class Requirements30_50 {
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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()) {
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);
convertRequirementsStatement(ref, tgte);
}

View File

@ -19,6 +19,11 @@ import org.hl7.fhir.r5.model.BooleanType;
public class ValueSet30_50 {
public static final String EXTENSIBLE_EXTENSION_URL = "http://hl7.org/fhir/StructureDefinition/valueset-extensible";
private static final String[] IGNORED_EXTENSION_URLS = new String[]{
EXTENSIBLE_EXTENSION_URL
};
public static org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent convertConceptReferenceComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent src) throws FHIRException {
if (src == null)
return null;
@ -215,7 +220,7 @@ public class ValueSet30_50 {
if (src.hasCopyright())
tgt.setCopyrightElement(MarkDown30_50.convertMarkdown(src.getCopyrightElement()));
if (src.hasExtensible())
tgt.addExtension("http://hl7.org/fhir/StructureDefinition/valueset-extensible", new BooleanType(src.getExtensible()));
tgt.addExtension(EXTENSIBLE_EXTENSION_URL, new BooleanType(src.getExtensible()));
if (src.hasCompose())
tgt.setCompose(convertValueSetComposeComponent(src.getCompose()));
if (src.hasExpansion())
@ -227,7 +232,7 @@ public class ValueSet30_50 {
if (src == null)
return null;
org.hl7.fhir.dstu3.model.ValueSet tgt = new org.hl7.fhir.dstu3.model.ValueSet();
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
if (src.hasUrl())
tgt.setUrlElement(Uri30_50.convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
@ -260,8 +265,8 @@ public class ValueSet30_50 {
tgt.setPurposeElement(MarkDown30_50.convertMarkdown(src.getPurposeElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(MarkDown30_50.convertMarkdown(src.getCopyrightElement()));
if (src.hasExtension("http://hl7.org/fhir/StructureDefinition/valueset-extensible"))
tgt.setExtensible(((BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/StructureDefinition/valueset-extensible").getValue()).booleanValue());
if (src.hasExtension(EXTENSIBLE_EXTENSION_URL))
tgt.setExtensible(((BooleanType) src.getExtensionByUrl(EXTENSIBLE_EXTENSION_URL).getValue()).booleanValue());
if (src.hasCompose())
tgt.setCompose(convertValueSetComposeComponent(src.getCompose()));
if (src.hasExpansion())

View File

@ -107,37 +107,45 @@ public class VersionConvertor_40_50 {
}
}
public void copyDomainResource(@Nonnull org.hl7.fhir.r4.model.DomainResource src,
@Nonnull org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.r4.model.DomainResource src,
@Nonnull org.hl7.fhir.r5.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyDomainResource(@Nonnull org.hl7.fhir.r5.model.DomainResource src,
@Nonnull org.hl7.fhir.r4.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.r5.model.DomainResource src,
@Nonnull org.hl7.fhir.r4.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.r4.model.Element src,
public void copyElement(
@Nonnull org.hl7.fhir.r4.model.Element src,
@Nonnull org.hl7.fhir.r5.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext40_50.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext40_50.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.r5.model.Element src,
public void copyElement(
@Nonnull org.hl7.fhir.r5.model.Element src,
@Nonnull org.hl7.fhir.r4.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext40_50.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext40_50.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.r5.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.r5.model.BackboneElement src,
@Nonnull org.hl7.fhir.r4.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.r4.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.r4.model.BackboneElement src,
@Nonnull org.hl7.fhir.r5.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
}

View File

@ -5,15 +5,15 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Extension40
import org.hl7.fhir.exceptions.FHIRException;
public class BackboneElement40_50 {
public static void copyBackboneElement(org.hl7.fhir.r4.model.BackboneElement src, org.hl7.fhir.r5.model.BackboneElement tgt, String ... var) throws FHIRException {
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt, var);
public static void copyBackboneElement(org.hl7.fhir.r4.model.BackboneElement src, org.hl7.fhir.r5.model.BackboneElement tgt, String ... extensionUrlsToIgnore) throws FHIRException {
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.r4.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension40_50.convertExtension(e));
}
}
public static void copyBackboneElement(org.hl7.fhir.r5.model.BackboneElement src, org.hl7.fhir.r4.model.BackboneElement tgt, String... var) throws FHIRException {
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt, var);
public static void copyBackboneElement(org.hl7.fhir.r5.model.BackboneElement src, org.hl7.fhir.r4.model.BackboneElement tgt, String... extensionUrlsToIgnore) throws FHIRException {
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.r5.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension40_50.convertExtension(e));
}

View File

@ -21,10 +21,10 @@ public class Element40_50 {
public void copyElement(org.hl7.fhir.r4.model.Element src,
org.hl7.fhir.r5.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.r5.model.Extension convertedExtension = new org.hl7.fhir.r5.model.Extension();
@ -39,10 +39,10 @@ public class Element40_50 {
public void copyElement(org.hl7.fhir.r5.model.Element src,
org.hl7.fhir.r4.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.r4.model.Extension convertedExtension = new org.hl7.fhir.r4.model.Extension();

View File

@ -52,6 +52,50 @@ import org.hl7.fhir.r5.model.UsageContext;
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ActorDefinition40_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.r4.model.Basic src) throws FHIRException {
if (src == null)
return null;
@ -59,69 +103,70 @@ public class ActorDefinition40_50 {
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();
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.url")) {
tgt.setUrlElement(Uri40_50.convertUri((org.hl7.fhir.r4.model.UriType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.url").getValue()));
if (src.hasExtension(URL_EXTENSION_URL)) {
tgt.setUrlElement(Uri40_50.convertUri((org.hl7.fhir.r4.model.UriType) src.getExtensionByUrl(URL_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.version")) {
tgt.setVersionElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.version").getValue()));
if (src.hasExtension(VERSION_EXTENSION_URL)) {
tgt.setVersionElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(VERSION_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.name")) {
tgt.setNameElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.name").getValue()));
if (src.hasExtension(NAME_EXTENSION_URL)) {
tgt.setNameElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(NAME_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.title")) {
tgt.setTitleElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.title").getValue()));
if (src.hasExtension(TITLE_EXTENSION_URL)) {
tgt.setTitleElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(TITLE_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.status")) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.status").getValue().primitiveValue()));
if (src.hasExtension(STATUS_EXTENSION_URL)) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl(STATUS_EXTENSION_URL).getValue().primitiveValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.experimental")) {
tgt.setExperimentalElement(Boolean40_50.convertBoolean((org.hl7.fhir.r4.model.BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.experimental").getValue()));
if (src.hasExtension(EXPERIMENTAL_EXTENSION_URL)) {
tgt.setExperimentalElement(Boolean40_50.convertBoolean((org.hl7.fhir.r4.model.BooleanType) src.getExtensionByUrl(EXPERIMENTAL_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.date")) {
tgt.setDateElement(DateTime40_50.convertDateTime((org.hl7.fhir.r4.model.DateTimeType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.date").getValue()));
if (src.hasExtension(DATE_EXTENSION_URL)) {
tgt.setDateElement(DateTime40_50.convertDateTime((org.hl7.fhir.r4.model.DateTimeType) src.getExtensionByUrl(DATE_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.publisher")) {
tgt.setPublisherElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.publisher").getValue()));
if (src.hasExtension(PUBLISHER_EXTENSION_URL)) {
tgt.setPublisherElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(PUBLISHER_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.contact")) {
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(CONTACT_EXTENSION_URL)) {
tgt.addContact(ContactDetail40_50.convertContactDetail((org.hl7.fhir.r4.model.ContactDetail) ext.getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.description")) {
tgt.setPublisherElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.description").getValue()));
if (src.hasExtension(DESCRIPTION_EXTENSION_URL)) {
tgt.setPublisherElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl(DESCRIPTION_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.useContext")) {
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(USE_CONTEXT_EXTENSION_URL)) {
tgt.addUseContext(UsageContext40_50.convertUsageContext((org.hl7.fhir.r4.model.UsageContext) ext.getValue()));
}
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.jurisdiction")) {
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(JURISDICTION_EXTENSION_URL)) {
tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept((org.hl7.fhir.r4.model.CodeableConcept) ext.getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.purpose")) {
tgt.setPurposeElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.purpose").getValue()));
if (src.hasExtension(PURPOSE_EXTENSION_URL)) {
tgt.setPurposeElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl(PURPOSE_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyright")) {
tgt.setCopyrightElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyright").getValue()));
if (src.hasExtension(COPYRIGHT_EXTENSION_URL)) {
tgt.setCopyrightElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl(COPYRIGHT_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyrightLabel")) {
tgt.setCopyrightLabelElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyrightLabel").getValue()));
if (src.hasExtension(COPYRIGHT_LABEL_EXTENSION_URL)) {
tgt.setCopyrightLabelElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(COPYRIGHT_LABEL_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.type")) {
tgt.setType(ExampleScenarioActorType.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.type").getValue().primitiveValue()));
if (src.hasExtension(TYPE_EXTENSION_URL)) {
tgt.setType(ExampleScenarioActorType.fromCode(src.getExtensionByUrl(TYPE_EXTENSION_URL).getValue().primitiveValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.documentation")) {
tgt.setDocumentationElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.documentation").getValue()));
if (src.hasExtension(DOCUMENTATION_EXTENSION_URL)) {
tgt.setDocumentationElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl(DOCUMENTATION_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.reference")) {
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(REFERENCE_EXTENSION_URL)) {
tgt.getReference().add(Url40_50.convertUrl((org.hl7.fhir.r4.model.UrlType) ext.getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.capabilities")) {
tgt.setCapabilitiesElement(Canonical40_50.convertCanonical((org.hl7.fhir.r4.model.CanonicalType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.capabilities").getValue()));
if (src.hasExtension(CAPABILITIES_EXTENSION_URL)) {
tgt.setCapabilitiesElement(Canonical40_50.convertCanonical((org.hl7.fhir.r4.model.CanonicalType) src.getExtensionByUrl(CAPABILITIES_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.derivedFrom")) {
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(DERIVED_FROM_EXTENSION_URL)) {
tgt.getDerivedFrom().add(Canonical40_50.convertCanonical((org.hl7.fhir.r4.model.CanonicalType) ext.getValue()));
}
return tgt;
@ -137,64 +182,64 @@ public class ActorDefinition40_50 {
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
if (src.hasUrl()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.url", Uri40_50.convertUri(src.getUrlElement()));
tgt.addExtension(URL_EXTENSION_URL, Uri40_50.convertUri(src.getUrlElement()));
}
if (src.hasVersion()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.version", String40_50.convertString(src.getVersionElement()));
tgt.addExtension(VERSION_EXTENSION_URL, String40_50.convertString(src.getVersionElement()));
}
if (src.hasName()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.name", String40_50.convertString(src.getNameElement()));
tgt.addExtension(NAME_EXTENSION_URL, String40_50.convertString(src.getNameElement()));
}
if (src.hasTitle()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.title", String40_50.convertString(src.getTitleElement()));
tgt.addExtension(TITLE_EXTENSION_URL, String40_50.convertString(src.getTitleElement()));
}
if (src.hasStatus()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.status", new org.hl7.fhir.r4.model.CodeType(src.getStatus().toCode()));
tgt.addExtension(STATUS_EXTENSION_URL, new org.hl7.fhir.r4.model.CodeType(src.getStatus().toCode()));
}
if (src.hasExperimental()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.experimental", Boolean40_50.convertBoolean(src.getExperimentalElement()));
tgt.addExtension(EXPERIMENTAL_EXTENSION_URL, Boolean40_50.convertBoolean(src.getExperimentalElement()));
}
if (src.hasDate()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.date", DateTime40_50.convertDateTime(src.getDateElement()));
tgt.addExtension(DATE_EXTENSION_URL, DateTime40_50.convertDateTime(src.getDateElement()));
}
if (src.hasPublisher()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.publisher", String40_50.convertString(src.getPublisherElement()));
tgt.addExtension(PUBLISHER_EXTENSION_URL, String40_50.convertString(src.getPublisherElement()));
}
for (ContactDetail cd : src.getContact()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.contact", ContactDetail40_50.convertContactDetail(cd));
tgt.addExtension(CONTACT_EXTENSION_URL, ContactDetail40_50.convertContactDetail(cd));
}
if (src.hasDescription()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.description", MarkDown40_50.convertMarkdown(src.getDescriptionElement()));
tgt.addExtension(DESCRIPTION_EXTENSION_URL, MarkDown40_50.convertMarkdown(src.getDescriptionElement()));
}
for (UsageContext cd : src.getUseContext()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.useContext", UsageContext40_50.convertUsageContext(cd));
tgt.addExtension(USE_CONTEXT_EXTENSION_URL, UsageContext40_50.convertUsageContext(cd));
}
for (CodeableConcept cd : src.getJurisdiction()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.jurisdiction", CodeableConcept40_50.convertCodeableConcept(cd));
tgt.addExtension(JURISDICTION_EXTENSION_URL, CodeableConcept40_50.convertCodeableConcept(cd));
}
if (src.hasPurpose()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.purpose", MarkDown40_50.convertMarkdown(src.getPurposeElement()));
tgt.addExtension(PURPOSE_EXTENSION_URL, MarkDown40_50.convertMarkdown(src.getPurposeElement()));
}
if (src.hasCopyright()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyright", MarkDown40_50.convertMarkdown(src.getCopyrightElement()));
tgt.addExtension(COPYRIGHT_EXTENSION_URL, MarkDown40_50.convertMarkdown(src.getCopyrightElement()));
}
if (src.hasCopyrightLabel()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyrightLabel", String40_50.convertString(src.getCopyrightLabelElement()));
tgt.addExtension(COPYRIGHT_LABEL_EXTENSION_URL, String40_50.convertString(src.getCopyrightLabelElement()));
}
if (src.hasType()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.type", new org.hl7.fhir.r4.model.CodeType(src.getType().toCode()));
tgt.addExtension(TYPE_EXTENSION_URL, new org.hl7.fhir.r4.model.CodeType(src.getType().toCode()));
}
if (src.hasDocumentation()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.documentation", MarkDown40_50.convertMarkdown(src.getDocumentationElement()));
tgt.addExtension(DOCUMENTATION_EXTENSION_URL, MarkDown40_50.convertMarkdown(src.getDocumentationElement()));
}
for (UrlType ref : src.getReference()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.reference", Url40_50.convertUrl(ref));
tgt.addExtension(REFERENCE_EXTENSION_URL, Url40_50.convertUrl(ref));
}
if (src.hasCapabilities()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.capabilities", Canonical40_50.convertCanonical(src.getCapabilitiesElement()));
tgt.addExtension(CAPABILITIES_EXTENSION_URL, Canonical40_50.convertCanonical(src.getCapabilitiesElement()));
}
for (CanonicalType ct : src.getDerivedFrom()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.derivedFrom", Canonical40_50.convertCanonical(ct));
tgt.addExtension(DERIVED_FROM_EXTENSION_URL, Canonical40_50.convertCanonical(ct));
}
return tgt;

View File

@ -58,6 +58,46 @@ import org.hl7.fhir.r5.model.UsageContext;
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Requirements40_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.r4.model.Basic src) throws FHIRException {
if (src == null)
return null;
@ -65,63 +105,64 @@ public class Requirements40_50 {
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();
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.url")) {
tgt.setUrlElement(Uri40_50.convertUri((org.hl7.fhir.r4.model.UriType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.url").getValue()));
if (src.hasExtension(URL_EXTENSION_URL)) {
tgt.setUrlElement(Uri40_50.convertUri((org.hl7.fhir.r4.model.UriType) src.getExtensionByUrl(URL_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.version")) {
tgt.setVersionElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.version").getValue()));
if (src.hasExtension(VERSION_EXTENSION_URL)) {
tgt.setVersionElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(VERSION_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.name")) {
tgt.setNameElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.name").getValue()));
if (src.hasExtension(NAME_EXTENSION_URL)) {
tgt.setNameElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(NAME_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.title")) {
tgt.setTitleElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.title").getValue()));
if (src.hasExtension(TITLE_EXTENSION_URL)) {
tgt.setTitleElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(TITLE_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.status")) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.status").getValue().primitiveValue()));
if (src.hasExtension(STATUS_EXTENSION_URL)) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl(STATUS_EXTENSION_URL).getValue().primitiveValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.experimental")) {
tgt.setExperimentalElement(Boolean40_50.convertBoolean((org.hl7.fhir.r4.model.BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.experimental").getValue()));
if (src.hasExtension(EXPERIMENTAL_EXTENSION_URL)) {
tgt.setExperimentalElement(Boolean40_50.convertBoolean((org.hl7.fhir.r4.model.BooleanType) src.getExtensionByUrl(EXPERIMENTAL_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.date")) {
tgt.setDateElement(DateTime40_50.convertDateTime((org.hl7.fhir.r4.model.DateTimeType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.date").getValue()));
if (src.hasExtension(DATE_EXTENSION_URL)) {
tgt.setDateElement(DateTime40_50.convertDateTime((org.hl7.fhir.r4.model.DateTimeType) src.getExtensionByUrl(DATE_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.publisher")) {
tgt.setPublisherElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.publisher").getValue()));
if (src.hasExtension(PUBLISHER_EXTENSION_URL)) {
tgt.setPublisherElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(PUBLISHER_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.contact")) {
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(CONTACT_EXTENSION_URL)) {
tgt.addContact(ContactDetail40_50.convertContactDetail((org.hl7.fhir.r4.model.ContactDetail) ext.getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.description")) {
tgt.setPublisherElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.description").getValue()));
if (src.hasExtension(DESCRIPTION_EXTENSION_URL)) {
tgt.setPublisherElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl(DESCRIPTION_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.useContext")) {
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(USE_CONTEXT_EXTENSION_URL)) {
tgt.addUseContext(UsageContext40_50.convertUsageContext((org.hl7.fhir.r4.model.UsageContext) ext.getValue()));
}
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.jurisdiction")) {
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(JURISDICTION_EXTENSION_URL)) {
tgt.addJurisdiction(CodeableConcept40_50.convertCodeableConcept((org.hl7.fhir.r4.model.CodeableConcept) ext.getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.purpose")) {
tgt.setPurposeElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.purpose").getValue()));
if (src.hasExtension(PURPOSE_EXTENSION_URL)) {
tgt.setPurposeElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl(PURPOSE_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyright")) {
tgt.setCopyrightElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyright").getValue()));
if (src.hasExtension(COPYRIGHT_EXTENSION_URL)) {
tgt.setCopyrightElement(MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src.getExtensionByUrl(COPYRIGHT_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyrightLabel")) {
tgt.setCopyrightLabelElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyrightLabel").getValue()));
if (src.hasExtension(COPYRIGHT_LABEL_EXTENSION_URL)) {
tgt.setCopyrightLabelElement(String40_50.convertString((org.hl7.fhir.r4.model.StringType) src.getExtensionByUrl(COPYRIGHT_LABEL_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.derivedFrom")) {
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(DERIVED_FROM_EXTENSION_URL)) {
tgt.getDerivedFrom().add(Canonical40_50.convertCanonical((org.hl7.fhir.r4.model.CanonicalType) ext.getValue()));
}
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.actor")) {
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(ACTOR_EXTENSION_URL)) {
tgt.getActor().add(Canonical40_50.convertCanonical((org.hl7.fhir.r4.model.CanonicalType) ext.getValue()));
}
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement")) {
for (org.hl7.fhir.r4.model.Extension ext : src.getExtensionsByUrl(STATEMENT_EXTENSION_URL)) {
convertRequirementsStatement(ext, tgt.addStatement());
}
return tgt;
@ -138,58 +179,58 @@ public class Requirements40_50 {
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
if (src.hasUrl()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.url", Uri40_50.convertUri(src.getUrlElement()));
tgt.addExtension(URL_EXTENSION_URL, Uri40_50.convertUri(src.getUrlElement()));
}
if (src.hasVersion()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.version", String40_50.convertString(src.getVersionElement()));
tgt.addExtension(VERSION_EXTENSION_URL, String40_50.convertString(src.getVersionElement()));
}
if (src.hasName()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.name", String40_50.convertString(src.getNameElement()));
tgt.addExtension(NAME_EXTENSION_URL, String40_50.convertString(src.getNameElement()));
}
if (src.hasTitle()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.title", String40_50.convertString(src.getTitleElement()));
tgt.addExtension(TITLE_EXTENSION_URL, String40_50.convertString(src.getTitleElement()));
}
if (src.hasStatus()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.status", new org.hl7.fhir.r4.model.CodeType(src.getStatus().toCode()));
tgt.addExtension(STATUS_EXTENSION_URL, new org.hl7.fhir.r4.model.CodeType(src.getStatus().toCode()));
}
if (src.hasExperimental()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.experimental", Boolean40_50.convertBoolean(src.getExperimentalElement()));
tgt.addExtension(EXPERIMENTAL_EXTENSION_URL, Boolean40_50.convertBoolean(src.getExperimentalElement()));
}
if (src.hasDate()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.date", DateTime40_50.convertDateTime(src.getDateElement()));
tgt.addExtension(DATE_EXTENSION_URL, DateTime40_50.convertDateTime(src.getDateElement()));
}
if (src.hasPublisher()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.publisher", String40_50.convertString(src.getPublisherElement()));
tgt.addExtension(PUBLISHER_EXTENSION_URL, String40_50.convertString(src.getPublisherElement()));
}
for (ContactDetail cd : src.getContact()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.contact", ContactDetail40_50.convertContactDetail(cd));
tgt.addExtension(CONTACT_EXTENSION_URL, ContactDetail40_50.convertContactDetail(cd));
}
if (src.hasDescription()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.description", MarkDown40_50.convertMarkdown(src.getDescriptionElement()));
tgt.addExtension(DESCRIPTION_EXTENSION_URL, MarkDown40_50.convertMarkdown(src.getDescriptionElement()));
}
for (UsageContext cd : src.getUseContext()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.useContext", UsageContext40_50.convertUsageContext(cd));
tgt.addExtension(USE_CONTEXT_EXTENSION_URL, UsageContext40_50.convertUsageContext(cd));
}
for (CodeableConcept cd : src.getJurisdiction()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.jurisdiction", CodeableConcept40_50.convertCodeableConcept(cd));
tgt.addExtension(JURISDICTION_EXTENSION_URL, CodeableConcept40_50.convertCodeableConcept(cd));
}
if (src.hasPurpose()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.purpose", MarkDown40_50.convertMarkdown(src.getPurposeElement()));
tgt.addExtension(PURPOSE_EXTENSION_URL, MarkDown40_50.convertMarkdown(src.getPurposeElement()));
}
if (src.hasCopyright()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyright", MarkDown40_50.convertMarkdown(src.getCopyrightElement()));
tgt.addExtension(COPYRIGHT_EXTENSION_URL, MarkDown40_50.convertMarkdown(src.getCopyrightElement()));
}
if (src.hasCopyrightLabel()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyrightLabel", String40_50.convertString(src.getCopyrightLabelElement()));
tgt.addExtension(COPYRIGHT_LABEL_EXTENSION_URL, String40_50.convertString(src.getCopyrightLabelElement()));
}
for (CanonicalType ref : src.getDerivedFrom()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.derivedFrom", Canonical40_50.convertCanonical(ref));
tgt.addExtension(DERIVED_FROM_EXTENSION_URL, Canonical40_50.convertCanonical(ref));
}
for (CanonicalType ref : src.getActor()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.actor", Canonical40_50.convertCanonical(ref));
tgt.addExtension(ACTOR_EXTENSION_URL, Canonical40_50.convertCanonical(ref));
}
for (RequirementsStatementComponent ref : src.getStatement()) {
org.hl7.fhir.r4.model.Extension tgte = new org.hl7.fhir.r4.model.Extension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement");
org.hl7.fhir.r4.model.Extension tgte = new org.hl7.fhir.r4.model.Extension(STATEMENT_EXTENSION_URL);
tgt.addExtension(tgte);
convertRequirementsStatement(ref, tgte);
}

View File

@ -11,6 +11,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Narrative40
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.Basic;
import java.util.Arrays;
public class Resource40_50 {
public final BaseAdvisor_40_50 advisor;
@ -525,7 +527,7 @@ public class Resource40_50 {
}
}
public void copyDomainResource(org.hl7.fhir.r4.model.DomainResource src, org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(org.hl7.fhir.r4.model.DomainResource src, org.hl7.fhir.r5.model.DomainResource tgt, String... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative40_50.convertNarrative(src.getText()));
src.getContained().stream()
@ -536,7 +538,7 @@ public class Resource40_50 {
org.hl7.fhir.r5.model.Extension convertExtension = new org.hl7.fhir.r5.model.Extension();
advisor.handleExtension(ConversionContext40_50.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext40_50.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext40_50.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension40_50.convertExtension(extension));
}
});
@ -546,7 +548,7 @@ public class Resource40_50 {
.forEach(tgt::addModifierExtension);
}
public void copyDomainResource(org.hl7.fhir.r5.model.DomainResource src, org.hl7.fhir.r4.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(org.hl7.fhir.r5.model.DomainResource src, org.hl7.fhir.r4.model.DomainResource tgt, String... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative40_50.convertNarrative(src.getText()));
src.getContained().stream()
@ -557,7 +559,7 @@ public class Resource40_50 {
org.hl7.fhir.r4.model.Extension convertExtension = new org.hl7.fhir.r4.model.Extension();
advisor.handleExtension(ConversionContext40_50.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext40_50.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext40_50.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension40_50.convertExtension(extension));
}
});

View File

@ -107,37 +107,45 @@ public class VersionConvertor_43_50 {
}
}
public void copyDomainResource(@Nonnull org.hl7.fhir.r4b.model.DomainResource src,
@Nonnull org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.r4b.model.DomainResource src,
@Nonnull org.hl7.fhir.r5.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyDomainResource(@Nonnull org.hl7.fhir.r5.model.DomainResource src,
@Nonnull org.hl7.fhir.r4b.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
public void copyDomainResource(
@Nonnull org.hl7.fhir.r5.model.DomainResource src,
@Nonnull org.hl7.fhir.r4b.model.DomainResource tgt,
String... extensionUrlsToIgnore) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt, extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.r4b.model.Element src,
public void copyElement(
@Nonnull org.hl7.fhir.r4b.model.Element src,
@Nonnull org.hl7.fhir.r5.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext43_50.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext43_50.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyElement(@Nonnull org.hl7.fhir.r5.model.Element src,
public void copyElement(
@Nonnull org.hl7.fhir.r5.model.Element src,
@Nonnull org.hl7.fhir.r4b.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext43_50.INSTANCE.path(), var);
String... extensionUrlsToIgnore) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext43_50.INSTANCE.path(), extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.r5.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.r5.model.BackboneElement src,
@Nonnull org.hl7.fhir.r4b.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
public void copyBackboneElement(@Nonnull org.hl7.fhir.r4b.model.BackboneElement src,
public void copyBackboneElement(
@Nonnull org.hl7.fhir.r4b.model.BackboneElement src,
@Nonnull org.hl7.fhir.r5.model.BackboneElement tgt,
String... var) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, var);
String... extensionUrlsToIgnore) throws FHIRException {
backboneElementConvertor.copyBackboneElement(src, tgt, extensionUrlsToIgnore);
}
}

View File

@ -5,15 +5,15 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Extension43
import org.hl7.fhir.exceptions.FHIRException;
public class BackboneElement43_50 {
public static void copyBackboneElement(org.hl7.fhir.r4b.model.BackboneElement src, org.hl7.fhir.r5.model.BackboneElement tgt, String ... var) throws FHIRException {
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, var);
public static void copyBackboneElement(org.hl7.fhir.r4b.model.BackboneElement src, org.hl7.fhir.r5.model.BackboneElement tgt, String ... extensionUrlsToIgnore) throws FHIRException {
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.r4b.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension43_50.convertExtension(e));
}
}
public static void copyBackboneElement(org.hl7.fhir.r5.model.BackboneElement src, org.hl7.fhir.r4b.model.BackboneElement tgt, String... var) throws FHIRException {
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, var);
public static void copyBackboneElement(org.hl7.fhir.r5.model.BackboneElement src, org.hl7.fhir.r4b.model.BackboneElement tgt, String... extensionUrlsToIgnore) throws FHIRException {
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, extensionUrlsToIgnore);
for (org.hl7.fhir.r5.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension43_50.convertExtension(e));
}

View File

@ -14,17 +14,17 @@ public class Element43_50 {
this.advisor = advisor;
}
public static boolean isExemptExtension(String url, String[] extensionsToIgnore) {
return Arrays.asList(extensionsToIgnore).contains(url);
public static boolean isExemptExtension(String url, String[] extensionUrlsToIgnore) {
return Arrays.asList(extensionUrlsToIgnore).contains(url);
}
public void copyElement(org.hl7.fhir.r4b.model.Element src,
org.hl7.fhir.r5.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.r5.model.Extension convertedExtension = new org.hl7.fhir.r5.model.Extension();
@ -39,10 +39,10 @@ public class Element43_50 {
public void copyElement(org.hl7.fhir.r5.model.Element src,
org.hl7.fhir.r4b.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
String... extensionUrlsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.filter(e -> !isExemptExtension(e.getUrl(), extensionUrlsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.r4b.model.Extension convertedExtension = new org.hl7.fhir.r4b.model.Extension();

View File

@ -52,6 +52,50 @@ import org.hl7.fhir.r5.model.UsageContext;
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ActorDefinition43_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.r4b.model.Basic src) throws FHIRException {
if (src == null)
return null;
@ -59,69 +103,70 @@ public class ActorDefinition43_50 {
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();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.url")) {
tgt.setUrlElement(Uri43_50.convertUri((org.hl7.fhir.r4b.model.UriType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.url").getValue()));
if (src.hasExtension(URL_EXTENSION_URL)) {
tgt.setUrlElement(Uri43_50.convertUri((org.hl7.fhir.r4b.model.UriType) src.getExtensionByUrl(URL_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.version")) {
tgt.setVersionElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.version").getValue()));
if (src.hasExtension(VERSION_EXTENSION_URL)) {
tgt.setVersionElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl(VERSION_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.name")) {
tgt.setNameElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.name").getValue()));
if (src.hasExtension(NAME_EXTENSION_URL)) {
tgt.setNameElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl(NAME_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.title")) {
tgt.setTitleElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.title").getValue()));
if (src.hasExtension(TITLE_EXTENSION_URL)) {
tgt.setTitleElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl(TITLE_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.status")) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.status").getValue().primitiveValue()));
if (src.hasExtension(STATUS_EXTENSION_URL)) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl(STATUS_EXTENSION_URL).getValue().primitiveValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.experimental")) {
tgt.setExperimentalElement(Boolean43_50.convertBoolean((org.hl7.fhir.r4b.model.BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.experimental").getValue()));
if (src.hasExtension(EXPERIMENTAL_EXTENSION_URL)) {
tgt.setExperimentalElement(Boolean43_50.convertBoolean((org.hl7.fhir.r4b.model.BooleanType) src.getExtensionByUrl(EXPERIMENTAL_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.date")) {
tgt.setDateElement(DateTime43_50.convertDateTime((org.hl7.fhir.r4b.model.DateTimeType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.date").getValue()));
if (src.hasExtension(DATE_EXTENSION_URL)) {
tgt.setDateElement(DateTime43_50.convertDateTime((org.hl7.fhir.r4b.model.DateTimeType) src.getExtensionByUrl(DATE_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.publisher")) {
tgt.setPublisherElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.publisher").getValue()));
if (src.hasExtension(PUBLISHER_EXTENSION_URL)) {
tgt.setPublisherElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl(PUBLISHER_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.contact")) {
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl(CONTACT_EXTENSION_URL)) {
tgt.addContact(ContactDetail43_50.convertContactDetail((org.hl7.fhir.r4b.model.ContactDetail) ext.getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.description")) {
tgt.setPublisherElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.description").getValue()));
if (src.hasExtension(DESCRIPTION_EXTENSION_URL)) {
tgt.setPublisherElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl(DESCRIPTION_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.useContext")) {
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl(USE_CONTEXT_EXTENSION_URL)) {
tgt.addUseContext(UsageContext43_50.convertUsageContext((org.hl7.fhir.r4b.model.UsageContext) ext.getValue()));
}
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.jurisdiction")) {
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl(JURISDICTION_EXTENSION_URL)) {
tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept((org.hl7.fhir.r4b.model.CodeableConcept) ext.getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.purpose")) {
tgt.setPurposeElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.purpose").getValue()));
if (src.hasExtension(PURPOSE_EXTENSION_URL)) {
tgt.setPurposeElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl(PURPOSE_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyright")) {
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyright").getValue()));
if (src.hasExtension(COPYRIGHT_EXTENSION_URL)) {
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl(COPYRIGHT_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyrightLabel")) {
tgt.setCopyrightLabelElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyrightLabel").getValue()));
if (src.hasExtension(COPYRIGHT_LABEL_EXTENSION_URL)) {
tgt.setCopyrightLabelElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl(COPYRIGHT_LABEL_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.type")) {
tgt.setType(ExampleScenarioActorType.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.type").getValue().primitiveValue()));
if (src.hasExtension(TYPE_EXTENSION_URL)) {
tgt.setType(ExampleScenarioActorType.fromCode(src.getExtensionByUrl(TYPE_EXTENSION_URL).getValue().primitiveValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.documentation")) {
tgt.setDocumentationElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.documentation").getValue()));
if (src.hasExtension(DOCUMENTATION_EXTENSION_URL)) {
tgt.setDocumentationElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl(DOCUMENTATION_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.reference")) {
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl(REFERENCE_EXTENSION_URL)) {
tgt.getReference().add(Url43_50.convertUrl((org.hl7.fhir.r4b.model.UrlType) ext.getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.capabilities")) {
tgt.setCapabilitiesElement(Canonical43_50.convertCanonical((org.hl7.fhir.r4b.model.CanonicalType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.capabilities").getValue()));
if (src.hasExtension(CAPABILITIES_EXTENSION_URL)) {
tgt.setCapabilitiesElement(Canonical43_50.convertCanonical((org.hl7.fhir.r4b.model.CanonicalType) src.getExtensionByUrl(CAPABILITIES_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.derivedFrom")) {
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl(DERIVED_FROM_EXTENSION_URL)) {
tgt.getDerivedFrom().add(Canonical43_50.convertCanonical((org.hl7.fhir.r4b.model.CanonicalType) ext.getValue()));
}
return tgt;
@ -137,64 +182,64 @@ public class ActorDefinition43_50 {
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasUrl()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.url", Uri43_50.convertUri(src.getUrlElement()));
tgt.addExtension(URL_EXTENSION_URL, Uri43_50.convertUri(src.getUrlElement()));
}
if (src.hasVersion()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.version", String43_50.convertString(src.getVersionElement()));
tgt.addExtension(VERSION_EXTENSION_URL, String43_50.convertString(src.getVersionElement()));
}
if (src.hasName()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.name", String43_50.convertString(src.getNameElement()));
tgt.addExtension(NAME_EXTENSION_URL, String43_50.convertString(src.getNameElement()));
}
if (src.hasTitle()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.title", String43_50.convertString(src.getTitleElement()));
tgt.addExtension(TITLE_EXTENSION_URL, String43_50.convertString(src.getTitleElement()));
}
if (src.hasStatus()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.status", new org.hl7.fhir.r4b.model.CodeType(src.getStatus().toCode()));
tgt.addExtension(STATUS_EXTENSION_URL, new org.hl7.fhir.r4b.model.CodeType(src.getStatus().toCode()));
}
if (src.hasExperimental()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.experimental", Boolean43_50.convertBoolean(src.getExperimentalElement()));
tgt.addExtension(EXPERIMENTAL_EXTENSION_URL, Boolean43_50.convertBoolean(src.getExperimentalElement()));
}
if (src.hasDate()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.date", DateTime43_50.convertDateTime(src.getDateElement()));
tgt.addExtension(DATE_EXTENSION_URL, DateTime43_50.convertDateTime(src.getDateElement()));
}
if (src.hasPublisher()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.publisher", String43_50.convertString(src.getPublisherElement()));
tgt.addExtension(PUBLISHER_EXTENSION_URL, String43_50.convertString(src.getPublisherElement()));
}
for (ContactDetail cd : src.getContact()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.contact", ContactDetail43_50.convertContactDetail(cd));
tgt.addExtension(CONTACT_EXTENSION_URL, ContactDetail43_50.convertContactDetail(cd));
}
if (src.hasDescription()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.description", MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
tgt.addExtension(DESCRIPTION_EXTENSION_URL, MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
}
for (UsageContext cd : src.getUseContext()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.useContext", UsageContext43_50.convertUsageContext(cd));
tgt.addExtension(USE_CONTEXT_EXTENSION_URL, UsageContext43_50.convertUsageContext(cd));
}
for (CodeableConcept cd : src.getJurisdiction()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.jurisdiction", CodeableConcept43_50.convertCodeableConcept(cd));
tgt.addExtension(JURISDICTION_EXTENSION_URL, CodeableConcept43_50.convertCodeableConcept(cd));
}
if (src.hasPurpose()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.purpose", MarkDown43_50.convertMarkdown(src.getPurposeElement()));
tgt.addExtension(PURPOSE_EXTENSION_URL, MarkDown43_50.convertMarkdown(src.getPurposeElement()));
}
if (src.hasCopyright()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyright", MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
tgt.addExtension(COPYRIGHT_EXTENSION_URL, MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
}
if (src.hasCopyrightLabel()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.copyrightLabel", String43_50.convertString(src.getCopyrightLabelElement()));
tgt.addExtension(COPYRIGHT_LABEL_EXTENSION_URL, String43_50.convertString(src.getCopyrightLabelElement()));
}
if (src.hasType()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.type", new org.hl7.fhir.r4b.model.CodeType(src.getType().toCode()));
tgt.addExtension(TYPE_EXTENSION_URL, new org.hl7.fhir.r4b.model.CodeType(src.getType().toCode()));
}
if (src.hasDocumentation()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.documentation", MarkDown43_50.convertMarkdown(src.getDocumentationElement()));
tgt.addExtension(DOCUMENTATION_EXTENSION_URL, MarkDown43_50.convertMarkdown(src.getDocumentationElement()));
}
for (UrlType ref : src.getReference()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.reference", Url43_50.convertUrl(ref));
tgt.addExtension(REFERENCE_EXTENSION_URL, Url43_50.convertUrl(ref));
}
if (src.hasCapabilities()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.capabilities", Canonical43_50.convertCanonical(src.getCapabilitiesElement()));
tgt.addExtension(CAPABILITIES_EXTENSION_URL, Canonical43_50.convertCanonical(src.getCapabilitiesElement()));
}
for (CanonicalType ct : src.getDerivedFrom()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-ActorDefinition.derivedFrom", Canonical43_50.convertCanonical(ct));
tgt.addExtension(DERIVED_FROM_EXTENSION_URL, Canonical43_50.convertCanonical(ct));
}
return tgt;

View File

@ -58,6 +58,46 @@ import org.hl7.fhir.r5.model.UsageContext;
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Requirements43_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 REQUIREMENTS_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,
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,
REQUIREMENTS_STATEMENT_EXTENSION_URL
};
public static org.hl7.fhir.r5.model.Requirements convertRequirements(org.hl7.fhir.r4b.model.Basic src) throws FHIRException {
if (src == null)
return null;
@ -65,63 +105,63 @@ public class Requirements43_50 {
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();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.url")) {
tgt.setUrlElement(Uri43_50.convertUri((org.hl7.fhir.r4b.model.UriType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.url").getValue()));
if (src.hasExtension(URL_EXTENSION_URL)) {
tgt.setUrlElement(Uri43_50.convertUri((org.hl7.fhir.r4b.model.UriType) src.getExtensionByUrl(URL_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.version")) {
tgt.setVersionElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.version").getValue()));
if (src.hasExtension(VERSION_EXTENSION_URL)) {
tgt.setVersionElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl(VERSION_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.name")) {
tgt.setNameElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.name").getValue()));
if (src.hasExtension(NAME_EXTENSION_URL)) {
tgt.setNameElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl(NAME_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.title")) {
tgt.setTitleElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.title").getValue()));
if (src.hasExtension(TITLE_EXTENSION_URL)) {
tgt.setTitleElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl(TITLE_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.status")) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.status").getValue().primitiveValue()));
if (src.hasExtension(STATUS_EXTENSION_URL)) {
tgt.setStatus(PublicationStatus.fromCode(src.getExtensionByUrl(STATUS_EXTENSION_URL).getValue().primitiveValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.experimental")) {
tgt.setExperimentalElement(Boolean43_50.convertBoolean((org.hl7.fhir.r4b.model.BooleanType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.experimental").getValue()));
if (src.hasExtension(EXPERIMENTAL_EXTENSION_URL)) {
tgt.setExperimentalElement(Boolean43_50.convertBoolean((org.hl7.fhir.r4b.model.BooleanType) src.getExtensionByUrl(EXPERIMENTAL_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.date")) {
tgt.setDateElement(DateTime43_50.convertDateTime((org.hl7.fhir.r4b.model.DateTimeType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.date").getValue()));
if (src.hasExtension(DATE_EXTENSION_URL)) {
tgt.setDateElement(DateTime43_50.convertDateTime((org.hl7.fhir.r4b.model.DateTimeType) src.getExtensionByUrl(DATE_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.publisher")) {
tgt.setPublisherElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.publisher").getValue()));
if (src.hasExtension(PUBLISHER_EXTENSION_URL)) {
tgt.setPublisherElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl(PUBLISHER_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.contact")) {
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl(CONTACT_EXTENSION_URL)) {
tgt.addContact(ContactDetail43_50.convertContactDetail((org.hl7.fhir.r4b.model.ContactDetail) ext.getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.description")) {
tgt.setPublisherElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.description").getValue()));
if (src.hasExtension(DESCRIPTION_EXTENSION_URL)) {
tgt.setPublisherElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl(DESCRIPTION_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.useContext")) {
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl(USE_CONTEXT_EXTENSION_URL)) {
tgt.addUseContext(UsageContext43_50.convertUsageContext((org.hl7.fhir.r4b.model.UsageContext) ext.getValue()));
}
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.jurisdiction")) {
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl(JURISDICTION_EXTENSION_URL)) {
tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept((org.hl7.fhir.r4b.model.CodeableConcept) ext.getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.purpose")) {
tgt.setPurposeElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.purpose").getValue()));
if (src.hasExtension(PURPOSE_EXTENSION_URL)) {
tgt.setPurposeElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl(PURPOSE_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyright")) {
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyright").getValue()));
if (src.hasExtension(COPYRIGHT_EXTENSION_URL)) {
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src.getExtensionByUrl(COPYRIGHT_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyrightLabel")) {
tgt.setCopyrightLabelElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyrightLabel").getValue()));
if (src.hasExtension(COPYRIGHT_LABEL_EXTENSION_URL)) {
tgt.setCopyrightLabelElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl(COPYRIGHT_LABEL_EXTENSION_URL).getValue()));
}
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.derivedFrom")) {
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl(DERIVED_FROM_EXTENSION_URL)) {
tgt.getDerivedFrom().add(Canonical43_50.convertCanonical((org.hl7.fhir.r4b.model.CanonicalType) ext.getValue()));
}
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.actor")) {
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl(ACTOR_EXTENSION_URL)) {
tgt.getActor().add(Canonical43_50.convertCanonical((org.hl7.fhir.r4b.model.CanonicalType) ext.getValue()));
}
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement")) {
for (org.hl7.fhir.r4b.model.Extension ext : src.getExtensionsByUrl(REQUIREMENTS_STATEMENT_EXTENSION_URL)) {
convertRequirementsStatement(ext, tgt.addStatement());
}
return tgt;
@ -138,58 +178,58 @@ public class Requirements43_50 {
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasUrl()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.url", Uri43_50.convertUri(src.getUrlElement()));
tgt.addExtension(URL_EXTENSION_URL, Uri43_50.convertUri(src.getUrlElement()));
}
if (src.hasVersion()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.version", String43_50.convertString(src.getVersionElement()));
tgt.addExtension(VERSION_EXTENSION_URL, String43_50.convertString(src.getVersionElement()));
}
if (src.hasName()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.name", String43_50.convertString(src.getNameElement()));
tgt.addExtension(NAME_EXTENSION_URL, String43_50.convertString(src.getNameElement()));
}
if (src.hasTitle()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.title", String43_50.convertString(src.getTitleElement()));
tgt.addExtension(TITLE_EXTENSION_URL, String43_50.convertString(src.getTitleElement()));
}
if (src.hasStatus()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.status", new org.hl7.fhir.r4b.model.CodeType(src.getStatus().toCode()));
tgt.addExtension(STATUS_EXTENSION_URL, new org.hl7.fhir.r4b.model.CodeType(src.getStatus().toCode()));
}
if (src.hasExperimental()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.experimental", Boolean43_50.convertBoolean(src.getExperimentalElement()));
tgt.addExtension(EXPERIMENTAL_EXTENSION_URL, Boolean43_50.convertBoolean(src.getExperimentalElement()));
}
if (src.hasDate()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.date", DateTime43_50.convertDateTime(src.getDateElement()));
tgt.addExtension(DATE_EXTENSION_URL, DateTime43_50.convertDateTime(src.getDateElement()));
}
if (src.hasPublisher()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.publisher", String43_50.convertString(src.getPublisherElement()));
tgt.addExtension(PUBLISHER_EXTENSION_URL, String43_50.convertString(src.getPublisherElement()));
}
for (ContactDetail cd : src.getContact()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.contact", ContactDetail43_50.convertContactDetail(cd));
tgt.addExtension(CONTACT_EXTENSION_URL, ContactDetail43_50.convertContactDetail(cd));
}
if (src.hasDescription()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.description", MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
tgt.addExtension(DESCRIPTION_EXTENSION_URL, MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
}
for (UsageContext cd : src.getUseContext()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.useContext", UsageContext43_50.convertUsageContext(cd));
tgt.addExtension(USE_CONTEXT_EXTENSION_URL, UsageContext43_50.convertUsageContext(cd));
}
for (CodeableConcept cd : src.getJurisdiction()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.jurisdiction", CodeableConcept43_50.convertCodeableConcept(cd));
tgt.addExtension(JURISDICTION_EXTENSION_URL, CodeableConcept43_50.convertCodeableConcept(cd));
}
if (src.hasPurpose()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.purpose", MarkDown43_50.convertMarkdown(src.getPurposeElement()));
tgt.addExtension(PURPOSE_EXTENSION_URL, MarkDown43_50.convertMarkdown(src.getPurposeElement()));
}
if (src.hasCopyright()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyright", MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
tgt.addExtension(COPYRIGHT_EXTENSION_URL, MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
}
if (src.hasCopyrightLabel()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.copyrightLabel", String43_50.convertString(src.getCopyrightLabelElement()));
tgt.addExtension(COPYRIGHT_LABEL_EXTENSION_URL, String43_50.convertString(src.getCopyrightLabelElement()));
}
for (CanonicalType ref : src.getDerivedFrom()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.derivedFrom", Canonical43_50.convertCanonical(ref));
tgt.addExtension(DERIVED_FROM_EXTENSION_URL, Canonical43_50.convertCanonical(ref));
}
for (CanonicalType ref : src.getActor()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.actor", Canonical43_50.convertCanonical(ref));
tgt.addExtension(ACTOR_EXTENSION_URL, Canonical43_50.convertCanonical(ref));
}
for (RequirementsStatementComponent ref : src.getStatement()) {
org.hl7.fhir.r4b.model.Extension tgte = new org.hl7.fhir.r4b.model.Extension("http://hl7.org/fhir/5.0/StructureDefinition/extension-Requirements.statement");
org.hl7.fhir.r4b.model.Extension tgte = new org.hl7.fhir.r4b.model.Extension(REQUIREMENTS_STATEMENT_EXTENSION_URL);
tgt.addExtension(tgte);
convertRequirementsStatement(ref, tgte);
}

View File

@ -10,6 +10,8 @@ import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Meta43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Narrative43_50;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.Arrays;
public class Resource43_50 {
public final BaseAdvisor_43_50 advisor;
@ -512,7 +514,7 @@ public class Resource43_50 {
}
}
public void copyDomainResource(org.hl7.fhir.r4b.model.DomainResource src, org.hl7.fhir.r5.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(org.hl7.fhir.r4b.model.DomainResource src, org.hl7.fhir.r5.model.DomainResource tgt, String ... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative43_50.convertNarrative(src.getText()));
src.getContained().stream()
@ -523,7 +525,7 @@ public class Resource43_50 {
org.hl7.fhir.r5.model.Extension convertExtension = new org.hl7.fhir.r5.model.Extension();
advisor.handleExtension(ConversionContext43_50.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension43_50.convertExtension(extension));
}
});
@ -533,7 +535,7 @@ public class Resource43_50 {
.forEach(tgt::addModifierExtension);
}
public void copyDomainResource(org.hl7.fhir.r5.model.DomainResource src, org.hl7.fhir.r4b.model.DomainResource tgt) throws FHIRException {
public void copyDomainResource(org.hl7.fhir.r5.model.DomainResource src, org.hl7.fhir.r4b.model.DomainResource tgt, String ... extensionUrlsToIgnore) throws FHIRException {
copyResource(src, tgt);
if (src.hasText()) tgt.setText(Narrative43_50.convertNarrative(src.getText()));
src.getContained().stream()
@ -544,7 +546,7 @@ public class Resource43_50 {
org.hl7.fhir.r4b.model.Extension convertExtension = new org.hl7.fhir.r4b.model.Extension();
advisor.handleExtension(ConversionContext43_50.INSTANCE.path(), extension, convertExtension);
tgt.addExtension(convertExtension);
} else if (!advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension)) {
} else if (!advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
tgt.addExtension(Extension43_50.convertExtension(extension));
}
});

View File

@ -14,6 +14,16 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
public class SubscriptionTopic43_50 {
public static final String NAME_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.name";
public static final String COPYRIGHT_LABEL_EXTENSION_URL = "http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.copyrightLabel";
private static final String[] IGNORED_EXTENSION_URLS = new String[]{
NAME_EXTENSION_URL,
COPYRIGHT_LABEL_EXTENSION_URL
};
public static org.hl7.fhir.r4b.model.SubscriptionTopic convertSubscriptionTopic(org.hl7.fhir.r5.model.SubscriptionTopic src) {
if (src == null)
return null;
@ -55,10 +65,10 @@ public class SubscriptionTopic43_50 {
if (src.hasCopyright())
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
if (src.hasCopyrightLabel()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.copyrightLabel", String43_50.convertString(src.getCopyrightLabelElement()));
tgt.addExtension(COPYRIGHT_LABEL_EXTENSION_URL, String43_50.convertString(src.getCopyrightLabelElement()));
}
if (src.hasName()) {
tgt.addExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.name", String43_50.convertString(src.getNameElement()));
tgt.addExtension(NAME_EXTENSION_URL, String43_50.convertString(src.getNameElement()));
}
if (src.hasApprovalDate())
tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement()));
@ -243,13 +253,14 @@ public class SubscriptionTopic43_50 {
return null;
org.hl7.fhir.r5.model.SubscriptionTopic tgt = new org.hl7.fhir.r5.model.SubscriptionTopic();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt);
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.name")) {
tgt.setNameElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.name").getValue()));
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt, IGNORED_EXTENSION_URLS);
if (src.hasExtension(NAME_EXTENSION_URL)) {
tgt.setNameElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl(NAME_EXTENSION_URL).getValue()));
}
if (src.hasExtension("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.copyrightLabel")) {
tgt.setCopyrightLabelElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl("http://hl7.org/fhir/5.0/StructureDefinition/extension-SubscriptionTopic.copyrightLabel").getValue()));
if (src.hasExtension(COPYRIGHT_LABEL_EXTENSION_URL)) {
tgt.setCopyrightLabelElement(String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src.getExtensionByUrl(COPYRIGHT_LABEL_EXTENSION_URL).getValue()));
}
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));

View File

@ -0,0 +1,29 @@
package org.hl7.fhir.convertors.conv10_30;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_30;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.io.InputStream;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class CapabilityStatement10_30Test {
@Test
@DisplayName("Test dstu3 -> dstu2 CapabilityStatement conversion.")
public void testDstu3_Dstu2() throws IOException {
InputStream dstu3_input = this.getClass().getResourceAsStream("/capability_statement_30.json");
org.hl7.fhir.dstu3.model.CapabilityStatement dstu3 = (org.hl7.fhir.dstu3.model.CapabilityStatement) new org.hl7.fhir.dstu3.formats.JsonParser().parse(dstu3_input);
org.hl7.fhir.dstu2.model.Resource dstu2_conv = VersionConvertorFactory_10_30.convertResource(dstu3);
org.hl7.fhir.dstu2.formats.JsonParser dstu2_parser = new org.hl7.fhir.dstu2.formats.JsonParser();
InputStream dstu2_input = this.getClass().getResourceAsStream("/conformance_30_10.json");
org.hl7.fhir.dstu2.model.Conformance dstu2_actual = (org.hl7.fhir.dstu2.model.Conformance) dstu2_parser.parse(dstu2_input);
assertTrue(dstu2_actual.equalsDeep(dstu2_conv), "should be the same");
}
}

View File

@ -0,0 +1,29 @@
package org.hl7.fhir.convertors.conv10_40;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_40;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.io.InputStream;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class CapabilityStatement10_40Test {
@Test
@DisplayName("Test r4 -> dstu2 CapabilityStatement conversion.")
public void testR4_Dstu2() throws IOException {
InputStream r4_input = this.getClass().getResourceAsStream("/capability_statement_50_with_30_extensions.json");
org.hl7.fhir.r4.model.CapabilityStatement r4_actual = (org.hl7.fhir.r4.model.CapabilityStatement) new org.hl7.fhir.r4.formats.JsonParser().parse(r4_input);
org.hl7.fhir.dstu2.model.Resource dstu2_conv = VersionConvertorFactory_10_40.convertResource(r4_actual);
org.hl7.fhir.dstu2.formats.JsonParser dstu2_parser = new org.hl7.fhir.dstu2.formats.JsonParser();
InputStream dstu2_input = this.getClass().getResourceAsStream("/conformance_40_10.json");
org.hl7.fhir.dstu2.model.Conformance dstu2_actual = (org.hl7.fhir.dstu2.model.Conformance) dstu2_parser.parse(dstu2_input);
assertTrue(dstu2_actual.equalsDeep(dstu2_conv), "should be the same");
}
}

View File

@ -0,0 +1,29 @@
package org.hl7.fhir.convertors.conv10_50;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_50;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.io.InputStream;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class CapabilityStatement10_50Test {
@Test
@DisplayName("Test r5 -> dstu2 CapabilityStatement conversion.")
public void testR5_Dstu2() throws IOException {
InputStream r5_input = this.getClass().getResourceAsStream("/capability_statement_50_with_30_extensions.json");
org.hl7.fhir.r5.model.CapabilityStatement r5_actual = (org.hl7.fhir.r5.model.CapabilityStatement) new org.hl7.fhir.r5.formats.JsonParser().parse(r5_input);
org.hl7.fhir.dstu2.model.Resource dstu2_conv = VersionConvertorFactory_10_50.convertResource(r5_actual);
org.hl7.fhir.dstu2.formats.JsonParser dstu2_parser = new org.hl7.fhir.dstu2.formats.JsonParser();
InputStream dstu2_input = this.getClass().getResourceAsStream("/conformance_50_10.json");
org.hl7.fhir.dstu2.model.Conformance dstu2_actual = (org.hl7.fhir.dstu2.model.Conformance) dstu2_parser.parse(dstu2_input);
assertTrue(dstu2_actual.equalsDeep(dstu2_conv), "should be the same");
}
}

View File

@ -0,0 +1,29 @@
package org.hl7.fhir.convertors.conv14_30;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_14_30;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.io.InputStream;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class CapabilityStatement14_30Test {
@Test
@DisplayName("Test r4 -> dstu2016 CapabilityStatement conversion.")
public void testDstu3_Dstu2016() throws IOException {
InputStream dstu3_input = this.getClass().getResourceAsStream("/capability_statement_30.json");
org.hl7.fhir.dstu3.model.CapabilityStatement dstu3 = (org.hl7.fhir.dstu3.model.CapabilityStatement) new org.hl7.fhir.dstu3.formats.JsonParser().parse(dstu3_input);
org.hl7.fhir.dstu2016may.model.Resource dstu2016_conv = VersionConvertorFactory_14_30.convertResource(dstu3);
org.hl7.fhir.dstu2016may.formats.JsonParser dstu2016_parser = new org.hl7.fhir.dstu2016may.formats.JsonParser();
InputStream dstu2016_input = this.getClass().getResourceAsStream("/conformance_30_14.json");
org.hl7.fhir.dstu2016may.model.Conformance dstu2016_actual = (org.hl7.fhir.dstu2016may.model.Conformance) dstu2016_parser.parse(dstu2016_input);
assertTrue(dstu2016_actual.equalsDeep(dstu2016_conv), "should be the same");
}
}

View File

@ -0,0 +1,28 @@
package org.hl7.fhir.convertors.conv14_40;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_14_40;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.io.InputStream;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class CapabilityStatement14_40Test {
@Test
@DisplayName("Test r4 -> dstu2016 CapabilityStatement conversion.")
public void testR4_Dstu3() throws IOException {
InputStream r4_input = this.getClass().getResourceAsStream("/capability_statement_40_with_30_extensions.json");
org.hl7.fhir.r4.model.CapabilityStatement r4_actual = (org.hl7.fhir.r4.model.CapabilityStatement) new org.hl7.fhir.r4.formats.JsonParser().parse(r4_input);
org.hl7.fhir.dstu2016may.model.Resource dstu2016_conv = VersionConvertorFactory_14_40.convertResource(r4_actual);
org.hl7.fhir.dstu2016may.formats.JsonParser dstu2016_parser = new org.hl7.fhir.dstu2016may.formats.JsonParser();
InputStream dstu2016_input = this.getClass().getResourceAsStream("/conformance_40_14.json");
org.hl7.fhir.dstu2016may.model.Conformance dstu2016_actual = (org.hl7.fhir.dstu2016may.model.Conformance) dstu2016_parser.parse(dstu2016_input);
assertTrue(dstu2016_actual.equalsDeep(dstu2016_conv), "should be the same");
}
}

View File

@ -0,0 +1,29 @@
package org.hl7.fhir.convertors.conv14_50;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_14_50;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.io.InputStream;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class CapabilityStatement14_50Test {
@Test
@DisplayName("Test r5 -> dstu2016 CapabilityStatement conversion.")
public void testR5_Dstu2016() throws IOException {
InputStream r5_input = this.getClass().getResourceAsStream("/capability_statement_50_with_30_extensions.json");
org.hl7.fhir.r5.model.CapabilityStatement r5_actual = (org.hl7.fhir.r5.model.CapabilityStatement) new org.hl7.fhir.r5.formats.JsonParser().parse(r5_input);
org.hl7.fhir.dstu2016may.model.Resource dstu2016_conv = VersionConvertorFactory_14_50.convertResource(r5_actual);
org.hl7.fhir.dstu2016may.formats.JsonParser dstu2016_parser = new org.hl7.fhir.dstu2016may.formats.JsonParser();
InputStream dstu2016_input = this.getClass().getResourceAsStream("/conformance_50_14.json");
org.hl7.fhir.dstu2016may.model.Conformance dstu2016_actual = (org.hl7.fhir.dstu2016may.model.Conformance) dstu2016_parser.parse(dstu2016_input);
assertTrue(dstu2016_actual.equalsDeep(dstu2016_conv), "should be the same");
}
}

View File

@ -0,0 +1,28 @@
package org.hl7.fhir.convertors.conv30_40;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_40;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.io.InputStream;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class CapabilityStatement30_40Test {
@Test
@DisplayName("Test r4 -> dstu3 CapabilityStatement conversion.")
public void testR4_Dstu3() throws IOException {
InputStream r4_input = this.getClass().getResourceAsStream("/capability_statement_40_with_30_extensions.json");
org.hl7.fhir.r4.model.CapabilityStatement r5_actual = (org.hl7.fhir.r4.model.CapabilityStatement) new org.hl7.fhir.r4.formats.JsonParser().parse(r4_input);
org.hl7.fhir.dstu3.model.Resource dstu3_conv = VersionConvertorFactory_30_40.convertResource(r5_actual);
org.hl7.fhir.dstu3.formats.JsonParser dstu3_parser = new org.hl7.fhir.dstu3.formats.JsonParser();
InputStream dstu3_input = this.getClass().getResourceAsStream("/capability_statement_40_30.json");
org.hl7.fhir.dstu3.model.CapabilityStatement dstu3_actual = (org.hl7.fhir.dstu3.model.CapabilityStatement) dstu3_parser.parse(dstu3_input);
assertTrue(dstu3_actual.equalsDeep(dstu3_conv), "should be the same");
}
}

View File

@ -15,17 +15,17 @@ public class ActorDefinition30_50Test {
@Test
@DisplayName("Test r5 -> r4 ActorDefinition conversion.")
public void testR5_R4() throws IOException {
@DisplayName("Test r5 -> dstu3 ActorDefinition conversion.")
public void testR5_dstu3() throws IOException {
InputStream r5_input = this.getClass().getResourceAsStream("/actordefinition_50_example.json");
org.hl7.fhir.r5.model.ActorDefinition r5_actual = (org.hl7.fhir.r5.model.ActorDefinition) new org.hl7.fhir.r5.formats.JsonParser().parse(r5_input);
org.hl7.fhir.dstu3.model.Resource r4_conv = VersionConvertorFactory_30_50.convertResource(r5_actual);
org.hl7.fhir.dstu3.model.Resource dstu3_conv = VersionConvertorFactory_30_50.convertResource(r5_actual);
org.hl7.fhir.dstu3.formats.XmlParser r4_parser = new org.hl7.fhir.dstu3.formats.XmlParser();
org.hl7.fhir.dstu3.formats.XmlParser dstu3_parser = new org.hl7.fhir.dstu3.formats.XmlParser();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
r4_parser.compose(stream, r4_conv);
dstu3_parser.compose(stream, dstu3_conv);
org.hl7.fhir.dstu3.model.Resource r4_streamed = (org.hl7.fhir.dstu3.model.Basic) new org.hl7.fhir.dstu3.formats.XmlParser().parse(new ByteArrayInputStream(stream.toByteArray()));
org.hl7.fhir.r5.model.Resource r5_conv = VersionConvertorFactory_30_50.convertResource(r4_streamed);

View File

@ -0,0 +1,28 @@
package org.hl7.fhir.convertors.conv30_50;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_50;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.io.InputStream;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class CapabilityStatement30_50Test {
@Test
@DisplayName("Test r5 -> dstu3 CapabilityStatement conversion.")
public void testR5_Dstu3() throws IOException {
InputStream r5_input = this.getClass().getResourceAsStream("/capability_statement_50_with_30_extensions.json");
org.hl7.fhir.r5.model.CapabilityStatement r5_actual = (org.hl7.fhir.r5.model.CapabilityStatement) new org.hl7.fhir.r5.formats.JsonParser().parse(r5_input);
org.hl7.fhir.dstu3.model.Resource dstu3_conv = VersionConvertorFactory_30_50.convertResource(r5_actual);
org.hl7.fhir.dstu3.formats.JsonParser dstu3_parser = new org.hl7.fhir.dstu3.formats.JsonParser();
InputStream dstu3_input = this.getClass().getResourceAsStream("/capability_statement_50_30.json");
org.hl7.fhir.dstu3.model.CapabilityStatement dstu3_actual = (org.hl7.fhir.dstu3.model.CapabilityStatement) dstu3_parser.parse(dstu3_input);
assertTrue(dstu3_actual.equalsDeep(dstu3_conv), "should be the same");
}
}

View File

@ -0,0 +1,34 @@
package org.hl7.fhir.convertors.conv30_50;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_50;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class ValueSet30_50Test {
@Test
@DisplayName("Test r5 -> dstu3 ValueSet conversion.")
public void testR5_Dstu3() throws IOException {
InputStream dstu3_input = this.getClass().getResourceAsStream("/valueset_30.json");
org.hl7.fhir.dstu3.model.ValueSet dstu3_actual = (org.hl7.fhir.dstu3.model.ValueSet) new org.hl7.fhir.dstu3.formats.JsonParser().parse(dstu3_input);
org.hl7.fhir.r5.model.Resource r5_conv = VersionConvertorFactory_30_50.convertResource(dstu3_actual);
org.hl7.fhir.r5.formats.JsonParser r5_parser = new org.hl7.fhir.r5.formats.JsonParser();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
r5_parser.compose(stream, r5_conv);
org.hl7.fhir.r5.model.Resource r5 = new org.hl7.fhir.r5.formats.JsonParser().parse(new ByteArrayInputStream(stream.toByteArray()));
org.hl7.fhir.dstu3.model.Resource dstu3_conv = VersionConvertorFactory_30_50.convertResource(r5);
assertTrue(dstu3_actual.equalsDeep(dstu3_conv), "should be the same");
}
}

View File

@ -0,0 +1,223 @@
{
"resourceType": "CapabilityStatement",
"id": "example",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t<p>The EHR Server supports the following transactions for the resource Person: read, vread, \n update, history, search(name,gender), create and updates.</p>\n\t\t\t<p>The EHR System supports the following message: admin-notify::Person.</p>\n\t\t\t<p>The EHR Application has a \n <a href=\"http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796\">general document profile</a>.\n </p>\n\t\t</div>"
},
"url": "urn:uuid:68D043B5-9ECF-4559-A57A-396E0D452311",
"version": "20130510",
"name": "ACME-EHR",
"title": "ACME EHR capability statement",
"status": "draft",
"experimental": true,
"date": "2012-01-04",
"publisher": "ACME Corporation",
"contact": [
{
"name": "System Administrator",
"telecom": [
{
"system": "email",
"value": "wile@acme.org"
}
]
}
],
"description": "This is the FHIR capability statement for the main EHR at ACME for the private interface - it does not describe the public interface",
"useContext": [
{
"code": {
"system": "http://hl7.org/fhir/usage-context-type",
"code": "focus"
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://hl7.org/fhir/variant-state",
"code": "positive"
}
]
}
}
],
"jurisdiction": [
{
"coding": [
{
"system": "urn:iso:std:iso:3166",
"code": "US",
"display": "United States of America (the)"
}
]
}
],
"purpose": "Main EHR capability statement, published for contracting and operational support",
"copyright": "Copyright © Acme Healthcare and GoodCorp EHR Systems",
"kind": "instance",
"instantiates": [
"http://ihe.org/fhir/CapabilityStatement/pixm-client"
],
"software": {
"name": "EHR",
"version": "0.00.020.2134",
"releaseDate": "2012-01-04"
},
"implementation": {
"description": "main EHR at ACME",
"url": "http://10.2.3.4/fhir"
},
"fhirVersion": "1.0.0",
"acceptUnknown": "both",
"format": [
"xml",
"json"
],
"patchFormat": [
"application/xml-patch+xml",
"application/json-patch+json"
],
"implementationGuide": [
"http://hl7.org/fhir/us/lab"
],
"profile": [
{
"reference": "http://hl7.org/fhir/us/core/StructureDefinition/familymemberhistory-genetic"
}
],
"rest": [
{
"mode": "server",
"documentation": "Main FHIR endpoint for acem health",
"security": {
"cors": true,
"service": [
{
"coding": [
{
"system": "http://hl7.org/fhir/restful-security-service",
"code": "SMART-on-FHIR"
}
]
}
],
"description": "See Smart on FHIR documentation",
"certificate": [
{
"type": "application/jwt",
"blob": "IHRoaXMgYmxvYiBpcyBub3QgdmFsaWQ="
}
]
},
"resource": [
{
"type": "Patient",
"profile": {
"reference": "http://fhir.hl7.org/base/StructureDefinition/7896271d-57f6-4231-89dc-dcc91eab2416"
},
"documentation": "This server does not let the clients create identities.",
"interaction": [
{
"code": "read"
},
{
"code": "vread",
"documentation": "Only supported for patient records since 12-Dec 2012"
},
{
"code": "update"
},
{
"code": "history-instance"
},
{
"code": "create"
},
{
"code": "history-type"
}
],
"versioning": "versioned-update",
"readHistory": true,
"updateCreate": false,
"conditionalCreate": true,
"conditionalRead": "full-support",
"conditionalUpdate": false,
"conditionalDelete": "not-supported",
"searchInclude": [
"Organization"
],
"searchRevInclude": [
"Person"
],
"searchParam": [
{
"name": "identifier",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-identifier",
"type": "token",
"documentation": "Only supports search by institution MRN"
},
{
"name": "general-practitioner",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-general-practitioner",
"type": "reference"
}
]
}
],
"interaction": [
{
"code": "transaction"
},
{
"code": "history-system"
}
],
"compartment": [
"http://hl7.org/fhir/CompartmentDefinition/patient"
]
}
],
"messaging": [
{
"endpoint": [
{
"protocol": {
"system": "http://hl7.org/fhir/message-transport",
"code": "mllp"
},
"address": "mllp:10.1.1.10:9234"
}
],
"reliableCache": 30,
"documentation": "ADT A08 equivalent for external system notifications",
"event": [
{
"code": {
"system": "http://hl7.org/fhir/message-events",
"code": "admin-notify"
},
"category": "Consequence",
"mode": "receiver",
"focus": "Patient",
"request": {
"reference": "StructureDefinition/Patient"
},
"response": {
"reference": "StructureDefinition/MessageHeader"
},
"documentation": "Notification of an update to a patient resource. changing the links is not supported"
}
]
}
],
"document": [
{
"mode": "consumer",
"documentation": "Basic rules for all documents in the EHR system",
"profile": {
"reference": "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"
}
}
]
}

View File

@ -0,0 +1,207 @@
{
"resourceType": "CapabilityStatement",
"id": "example",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t<p>The EHR Server supports the following transactions for the resource Person: read, vread, update, history, search(name,gender), create and updates.</p>\n\t\t\t<p>The EHR System supports the following message: admin-notify::Person.</p>\n\t\t\t<p>The EHR Application has a <a href=\"http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796\">general document profile</a>.\n </p>\n\t\t</div>"
},
"url": "urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311",
"version": "20130510",
"name": "ACMEEHR",
"title": "ACME EHR capability statement",
"status": "draft",
"experimental": true,
"date": "2012-01-04",
"publisher": "ACME Corporation",
"contact": [
{
"name": "System Administrator",
"telecom": [
{
"system": "email",
"value": "wile@acme.org"
}
]
}
],
"description": "This is the FHIR capability statement for the main EHR at ACME for the private interface - it does not describe the public interface",
"useContext": [
{
"code": {
"system": "http://terminology.hl7.org/CodeSystem/usage-context-type",
"code": "focus"
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/variant-state",
"code": "positive"
}
]
}
}
],
"jurisdiction": [
{
"coding": [
{
"system": "urn:iso:std:iso:3166",
"code": "US",
"display": "United States of America (the)"
}
]
}
],
"purpose": "Main EHR capability statement, published for contracting and operational support",
"copyright": "Copyright © Acme Healthcare and GoodCorp EHR Systems",
"kind": "instance",
"instantiates": [
"http://ihe.org/fhir/CapabilityStatement/pixm-client"
],
"software": {
"name": "EHR",
"version": "0.00.020.2134",
"releaseDate": "2012-01-04"
},
"implementation": {
"description": "main EHR at ACME",
"url": "http://10.2.3.4/fhir"
},
"fhirVersion": "4.0.1",
"acceptUnknown": "both",
"format": [
"xml",
"json"
],
"patchFormat": [
"application/xml-patch+xml",
"application/json-patch+json"
],
"implementationGuide": [
"http://hl7.org/fhir/us/lab"
],
"profile": [
{
"reference": "http://registry.fhir.org/r4/StructureDefinition/00ab9e7a-06c7-4f77-9234-4154ca1e3347"
}
],
"rest": [
{
"mode": "server",
"documentation": "Main FHIR endpoint for acem health",
"security": {
"cors": true,
"service": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/restful-security-service",
"code": "SMART-on-FHIR"
}
]
}
],
"description": "See Smart on FHIR documentation"
},
"resource": [
{
"type": "Patient",
"profile": {
"reference": "http://registry.fhir.org/r4/StructureDefinition/7896271d-57f6-4231-89dc-dcc91eab2416"
},
"documentation": "This server does not let the clients create identities.",
"interaction": [
{
"code": "read"
},
{
"code": "vread",
"documentation": "Only supported for patient records since 12-Dec 2012"
},
{
"code": "update"
},
{
"code": "history-instance"
},
{
"code": "create"
},
{
"code": "history-type"
}
],
"versioning": "versioned-update",
"readHistory": true,
"updateCreate": false,
"conditionalCreate": true,
"conditionalRead": "full-support",
"conditionalUpdate": false,
"conditionalDelete": "not-supported",
"searchInclude": [
"Organization"
],
"searchRevInclude": [
"Person"
],
"searchParam": [
{
"name": "identifier",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-identifier",
"type": "token",
"documentation": "Only supports search by institution MRN"
},
{
"name": "general-practitioner",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-general-practitioner",
"type": "reference"
}
]
}
],
"interaction": [
{
"code": "transaction"
},
{
"code": "history-system"
}
],
"compartment": [
"http://hl7.org/fhir/CompartmentDefinition/patient"
]
}
],
"messaging": [
{
"endpoint": [
{
"protocol": {
"system": "http://terminology.hl7.org/CodeSystem/message-transport",
"code": "mllp"
},
"address": "mllp:10.1.1.10:9234"
}
],
"reliableCache": 30,
"documentation": "ADT A08 equivalent for external system notifications",
"supportedMessage": [
{
"mode": "receiver",
"definition": {
"reference": "http://hl7.org/fhir/MessageDefinition/example"
}
}
]
}
],
"document": [
{
"mode": "consumer",
"documentation": "Basic rules for all documents in the EHR system",
"profile": {
"reference": "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"
}
}
]
}

View File

@ -0,0 +1,204 @@
{
"resourceType": "CapabilityStatement",
"id": "example",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t<p>The EHR Server supports the following transactions for the resource Person: read, vread, update, history, search(name,gender), create and updates.</p>\n\t\t\t<p>The EHR System supports the following message: admin-notify::Person.</p>\n\t\t\t<p>The EHR Application has a <a href=\"http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796\">general document profile</a>.\n </p>\n\t\t</div>"
},
"extension": [
{
"url": "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown",
"valueCode": "both"
}
],
"url": "urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311",
"version": "20130510",
"name": "ACMEEHR",
"title": "ACME EHR capability statement",
"status": "draft",
"experimental": true,
"date": "2012-01-04",
"publisher": "ACME Corporation",
"contact": [
{
"name": "System Administrator",
"telecom": [
{
"system": "email",
"value": "wile@acme.org"
}
]
}
],
"description": "This is the FHIR capability statement for the main EHR at ACME for the private interface - it does not describe the public interface",
"useContext": [
{
"code": {
"system": "http://terminology.hl7.org/CodeSystem/usage-context-type",
"code": "focus"
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/variant-state",
"code": "positive"
}
]
}
}
],
"jurisdiction": [
{
"coding": [
{
"system": "urn:iso:std:iso:3166",
"code": "US",
"display": "United States of America (the)"
}
]
}
],
"purpose": "Main EHR capability statement, published for contracting and operational support",
"copyright": "Copyright © Acme Healthcare and GoodCorp EHR Systems",
"kind": "instance",
"instantiates": [
"http://ihe.org/fhir/CapabilityStatement/pixm-client"
],
"software": {
"name": "EHR",
"version": "0.00.020.2134",
"releaseDate": "2012-01-04"
},
"implementation": {
"description": "main EHR at ACME",
"url": "http://10.2.3.4/fhir"
},
"fhirVersion": "4.0.1",
"format": [
"xml",
"json"
],
"patchFormat": [
"application/xml-patch+xml",
"application/json-patch+json"
],
"implementationGuide": [
"http://hl7.org/fhir/us/lab"
],
"rest": [
{
"mode": "server",
"documentation": "Main FHIR endpoint for acem health",
"security": {
"cors": true,
"service": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/restful-security-service",
"code": "SMART-on-FHIR"
}
]
}
],
"description": "See Smart on FHIR documentation"
},
"resource": [
{
"type": "Patient",
"profile": "http://registry.fhir.org/r4/StructureDefinition/7896271d-57f6-4231-89dc-dcc91eab2416",
"supportedProfile": [
"http://registry.fhir.org/r4/StructureDefinition/00ab9e7a-06c7-4f77-9234-4154ca1e3347"
],
"documentation": "This server does not let the clients create identities.",
"interaction": [
{
"code": "read"
},
{
"code": "vread",
"documentation": "Only supported for patient records since 12-Dec 2012"
},
{
"code": "update"
},
{
"code": "history-instance"
},
{
"code": "create"
},
{
"code": "history-type"
}
],
"versioning": "versioned-update",
"readHistory": true,
"updateCreate": false,
"conditionalCreate": true,
"conditionalRead": "full-support",
"conditionalUpdate": false,
"conditionalDelete": "not-supported",
"searchInclude": [
"Organization"
],
"searchRevInclude": [
"Person"
],
"searchParam": [
{
"name": "identifier",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-identifier",
"type": "token",
"documentation": "Only supports search by institution MRN"
},
{
"name": "general-practitioner",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-general-practitioner",
"type": "reference"
}
]
}
],
"interaction": [
{
"code": "transaction"
},
{
"code": "history-system"
}
],
"compartment": [
"http://hl7.org/fhir/CompartmentDefinition/patient"
]
}
],
"messaging": [
{
"endpoint": [
{
"protocol": {
"system": "http://terminology.hl7.org/CodeSystem/message-transport",
"code": "mllp"
},
"address": "mllp:10.1.1.10:9234"
}
],
"reliableCache": 30,
"documentation": "ADT A08 equivalent for external system notifications",
"supportedMessage": [
{
"mode": "receiver",
"definition": "http://hl7.org/fhir/MessageDefinition/example"
}
]
}
],
"document": [
{
"mode": "consumer",
"documentation": "Basic rules for all documents in the EHR system",
"profile": "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"
}
]
}

View File

@ -0,0 +1,210 @@
{
"resourceType": "CapabilityStatement",
"id": "example",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t<p>The EHR Server supports the following transactions for the resource Person: read, vread, \n update, history, search(name,gender), create and updates.</p>\n\t\t\t\n <p>The EHR System supports the following message: admin-notify::Person.</p>\n\t\t\t\n <p>The EHR Application has a \n \n <a href=\"http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796\">general document profile</a>.\n \n </p>\n\t\t\n </div>"
},
"url": "urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311",
"version": "20130510",
"name": "ACMEEHR",
"title": "ACME EHR capability statement",
"status": "draft",
"experimental": true,
"date": "2012-01-04",
"publisher": "ACME Corporation",
"contact": [
{
"name": "System Administrator",
"telecom": [
{
"system": "email",
"value": "wile@acme.org"
}
]
}
],
"description": "This is the FHIR capability statement for the main EHR at ACME for the private interface - it does not describe the public interface",
"useContext": [
{
"code": {
"system": "http://terminology.hl7.org/CodeSystem/usage-context-type",
"code": "focus"
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/variant-state",
"code": "positive"
}
]
}
}
],
"jurisdiction": [
{
"coding": [
{
"system": "urn:iso:std:iso:3166",
"code": "US",
"display": "United States of America (the)"
}
]
}
],
"purpose": "Main EHR capability statement, published for contracting and operational support",
"copyright": "Copyright © Acme Healthcare and GoodCorp EHR Systems",
"kind": "instance",
"instantiates": [
"http://ihe.org/fhir/CapabilityStatement/pixm-client"
],
"software": {
"name": "EHR",
"version": "0.00.020.2134",
"releaseDate": "2012-01-04"
},
"implementation": {
"description": "main EHR at ACME",
"url": "http://10.2.3.4/fhir"
},
"fhirVersion": "5.0.0",
"acceptUnknown": "both",
"format": [
"xml",
"json"
],
"patchFormat": [
"application/xml-patch+xml",
"application/json-patch+json"
],
"implementationGuide": [
"http://example.org/fhir/us/lab"
],
"profile": [
{
"reference": "http://registry.fhir.org/r5/StructureDefinition/00ab9e7a-06c7-4f77-9234-4154ca1e3347"
},
{
"reference": "http://hl7.org/fhir/us/core/StructureDefinition/familymemberhistory-genetic"
}
],
"rest": [
{
"mode": "server",
"documentation": "Main FHIR endpoint for acem health",
"security": {
"cors": true,
"service": [
{
"coding": [
{
"system": "http://hl7.org/fhir/restful-security-service",
"code": "SMART-on-FHIR"
}
]
}
],
"description": "See Smart on FHIR documentation"
},
"resource": [
{
"type": "Patient",
"profile": {
"reference": "http://registry.fhir.org/r5/StructureDefinition/7896271d-57f6-4231-89dc-dcc91eab2416"
},
"documentation": "This server does not let the clients create identities.",
"interaction": [
{
"code": "read"
},
{
"code": "vread",
"documentation": "Only supported for patient records since 12-Dec 2012"
},
{
"code": "update"
},
{
"code": "history-instance"
},
{
"code": "create"
},
{
"code": "history-type"
}
],
"versioning": "versioned-update",
"readHistory": true,
"updateCreate": false,
"conditionalCreate": true,
"conditionalRead": "full-support",
"conditionalUpdate": false,
"conditionalDelete": "not-supported",
"searchInclude": [
"Patient:organization"
],
"searchRevInclude": [
"Person:patient"
],
"searchParam": [
{
"name": "identifier",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-identifier",
"type": "token",
"documentation": "Only supports search by institution MRN"
},
{
"name": "general-practitioner",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-general-practitioner",
"type": "reference"
}
]
}
],
"interaction": [
{
"code": "transaction"
},
{
"code": "history-system"
}
],
"compartment": [
"http://hl7.org/fhir/CompartmentDefinition/patient"
]
}
],
"messaging": [
{
"endpoint": [
{
"protocol": {
"system": "http://hl7.org/fhir/message-transport",
"code": "mllp"
},
"address": "mllp:10.1.1.10:9234"
}
],
"reliableCache": 30,
"documentation": "ADT A08 equivalent for external system notifications",
"supportedMessage": [
{
"mode": "receiver",
"definition": {
"reference": "http://hl7.org/fhir/MessageDefinition/example"
}
}
]
}
],
"document": [
{
"mode": "consumer",
"documentation": "Basic rules for all documents in the EHR system",
"profile": {
"reference": "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"
}
}
]
}

View File

@ -0,0 +1,215 @@
{
"resourceType": "CapabilityStatement",
"id": "example",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t<p>The EHR Server supports the following transactions for the resource Person: read, vread, \n update, history, search(name,gender), create and updates.</p>\n\t\t\t\n <p>The EHR System supports the following message: admin-notify::Person.</p>\n\t\t\t\n <p>The EHR Application has a \n \n <a href=\"http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796\">general document profile</a>.\n \n </p>\n\t\t\n </div>"
},
"extension": [
{
"url": "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown",
"valueCode": "both"
},
{
"url": "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile",
"valueReference": {
"reference": "http://hl7.org/fhir/us/core/StructureDefinition/familymemberhistory-genetic"
}
}
],
"url": "urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311",
"version": "20130510",
"name": "ACMEEHR",
"title": "ACME EHR capability statement",
"status": "draft",
"experimental": true,
"date": "2012-01-04",
"publisher": "ACME Corporation",
"contact": [
{
"name": "System Administrator",
"telecom": [
{
"system": "email",
"value": "wile@acme.org"
}
]
}
],
"description": "This is the FHIR capability statement for the main EHR at ACME for the private interface - it does not describe the public interface",
"useContext": [
{
"code": {
"system": "http://terminology.hl7.org/CodeSystem/usage-context-type",
"code": "focus"
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/variant-state",
"code": "positive"
}
]
}
}
],
"jurisdiction": [
{
"coding": [
{
"system": "urn:iso:std:iso:3166",
"code": "US",
"display": "United States of America (the)"
}
]
}
],
"purpose": "Main EHR capability statement, published for contracting and operational support",
"copyright": "Copyright © Acme Healthcare and GoodCorp EHR Systems",
"kind": "instance",
"instantiates": [
"http://ihe.org/fhir/CapabilityStatement/pixm-client"
],
"software": {
"name": "EHR",
"version": "0.00.020.2134",
"releaseDate": "2012-01-04"
},
"implementation": {
"description": "main EHR at ACME",
"url": "http://10.2.3.4/fhir"
},
"fhirVersion": "5.0.0",
"format": [
"xml",
"json"
],
"patchFormat": [
"application/xml-patch+xml",
"application/json-patch+json"
],
"acceptLanguage": [
"en",
"es"
],
"implementationGuide": [
"http://example.org/fhir/us/lab"
],
"rest": [
{
"mode": "server",
"documentation": "Main FHIR endpoint for acem health",
"security": {
"cors": true,
"service": [
{
"coding": [
{
"system": "http://hl7.org/fhir/restful-security-service",
"code": "SMART-on-FHIR"
}
]
}
],
"description": "See Smart on FHIR documentation"
},
"resource": [
{
"type": "Patient",
"profile": "http://registry.fhir.org/r5/StructureDefinition/7896271d-57f6-4231-89dc-dcc91eab2416",
"supportedProfile": [
"http://registry.fhir.org/r5/StructureDefinition/00ab9e7a-06c7-4f77-9234-4154ca1e3347"
],
"documentation": "This server does not let the clients create identities.",
"interaction": [
{
"code": "read"
},
{
"code": "vread",
"documentation": "Only supported for patient records since 12-Dec 2012"
},
{
"code": "update"
},
{
"code": "history-instance"
},
{
"code": "create"
},
{
"code": "history-type"
}
],
"versioning": "versioned-update",
"readHistory": true,
"updateCreate": false,
"conditionalCreate": true,
"conditionalRead": "full-support",
"conditionalUpdate": false,
"conditionalPatch": false,
"conditionalDelete": "not-supported",
"searchInclude": [
"Patient:organization"
],
"searchRevInclude": [
"Person:patient"
],
"searchParam": [
{
"name": "identifier",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-identifier",
"type": "token",
"documentation": "Only supports search by institution MRN"
},
{
"name": "general-practitioner",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-general-practitioner",
"type": "reference"
}
]
}
],
"interaction": [
{
"code": "transaction"
},
{
"code": "history-system"
}
],
"compartment": [
"http://hl7.org/fhir/CompartmentDefinition/patient"
]
}
],
"messaging": [
{
"endpoint": [
{
"protocol": {
"system": "http://hl7.org/fhir/message-transport",
"code": "mllp"
},
"address": "mllp:10.1.1.10:9234"
}
],
"reliableCache": 30,
"documentation": "ADT A08 equivalent for external system notifications",
"supportedMessage": [
{
"mode": "receiver",
"definition": "http://hl7.org/fhir/MessageDefinition/example"
}
]
}
],
"document": [
{
"mode": "consumer",
"documentation": "Basic rules for all documents in the EHR system",
"profile": "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"
}
]
}

View File

@ -0,0 +1,184 @@
{
"resourceType": "Conformance",
"id": "example",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t<p>The EHR Server supports the following transactions for the resource Person: read, vread, \n update, history, search(name,gender), create and updates.</p>\n\t\t\t<p>The EHR System supports the following message: admin-notify::Person.</p>\n\t\t\t<p>The EHR Application has a \n <a href=\"http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796\">general document profile</a>.\n </p>\n\t\t</div>"
},
"url": "urn:uuid:68D043B5-9ECF-4559-A57A-396E0D452311",
"version": "20130510",
"name": "ACME-EHR",
"status": "draft",
"experimental": true,
"publisher": "ACME Corporation",
"contact": [
{
"name": "System Administrator",
"telecom": [
{
"system": "email",
"value": "wile@acme.org"
}
]
}
],
"date": "2012-01-04",
"description": "This is the FHIR capability statement for the main EHR at ACME for the private interface - it does not describe the public interface",
"requirements": "Main EHR capability statement, published for contracting and operational support",
"copyright": "Copyright © Acme Healthcare and GoodCorp EHR Systems",
"kind": "instance",
"software": {
"name": "EHR",
"version": "0.00.020.2134",
"releaseDate": "2012-01-04"
},
"implementation": {
"description": "main EHR at ACME",
"url": "http://10.2.3.4/fhir"
},
"fhirVersion": "1.0.0",
"acceptUnknown": "both",
"format": [
"xml",
"json"
],
"profile": [
{
"reference": "http://hl7.org/fhir/us/core/StructureDefinition/familymemberhistory-genetic"
}
],
"rest": [
{
"mode": "server",
"documentation": "Main FHIR endpoint for acem health",
"security": {
"cors": true,
"service": [
{
"coding": [
{
"system": "http://hl7.org/fhir/restful-security-service",
"code": "SMART-on-FHIR"
}
]
}
],
"description": "See Smart on FHIR documentation",
"certificate": [
{
"type": "application/jwt",
"blob": "IHRoaXMgYmxvYiBpcyBub3QgdmFsaWQ="
}
]
},
"resource": [
{
"type": "Patient",
"profile": {
"reference": "http://fhir.hl7.org/base/StructureDefinition/7896271d-57f6-4231-89dc-dcc91eab2416"
},
"interaction": [
{
"code": "read"
},
{
"code": "vread",
"documentation": "Only supported for patient records since 12-Dec 2012"
},
{
"code": "update"
},
{
"code": "history-instance"
},
{
"code": "create"
},
{
"code": "history-type"
}
],
"versioning": "versioned-update",
"readHistory": true,
"updateCreate": false,
"conditionalCreate": true,
"conditionalUpdate": false,
"conditionalDelete": "not-supported",
"searchInclude": [
"Organization"
],
"searchRevInclude": [
"Person"
],
"searchParam": [
{
"name": "identifier",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-identifier",
"type": "token",
"documentation": "Only supports search by institution MRN"
},
{
"name": "general-practitioner",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-general-practitioner",
"type": "reference"
}
]
}
],
"interaction": [
{
"code": "transaction"
},
{
"code": "history-system"
}
],
"transactionMode": "transaction",
"compartment": [
"http://hl7.org/fhir/CompartmentDefinition/patient"
]
}
],
"messaging": [
{
"endpoint": [
{
"protocol": {
"system": "http://hl7.org/fhir/message-transport",
"code": "mllp"
},
"address": "mllp:10.1.1.10:9234"
}
],
"reliableCache": 30,
"documentation": "ADT A08 equivalent for external system notifications",
"event": [
{
"code": {
"system": "http://hl7.org/fhir/message-events",
"code": "admin-notify"
},
"category": "Consequence",
"mode": "receiver",
"focus": "Patient",
"request": {
"reference": "StructureDefinition/Patient"
},
"response": {
"reference": "StructureDefinition/MessageHeader"
},
"documentation": "Notification of an update to a patient resource. changing the links is not supported"
}
]
}
],
"document": [
{
"mode": "consumer",
"documentation": "Basic rules for all documents in the EHR system",
"profile": {
"reference": "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"
}
}
]
}

View File

@ -0,0 +1,202 @@
{
"resourceType": "Conformance",
"id": "example",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t<p>The EHR Server supports the following transactions for the resource Person: read, vread, \n update, history, search(name,gender), create and updates.</p>\n\t\t\t<p>The EHR System supports the following message: admin-notify::Person.</p>\n\t\t\t<p>The EHR Application has a \n <a href=\"http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796\">general document profile</a>.\n </p>\n\t\t</div>"
},
"url": "urn:uuid:68D043B5-9ECF-4559-A57A-396E0D452311",
"version": "20130510",
"name": "ACME-EHR",
"status": "draft",
"experimental": true,
"date": "2012-01-04",
"publisher": "ACME Corporation",
"contact": [
{
"name": "System Administrator",
"telecom": [
{
"system": "email",
"value": "wile@acme.org"
}
]
}
],
"description": "This is the FHIR capability statement for the main EHR at ACME for the private interface - it does not describe the public interface",
"useContext": [
{
"coding": [
{
"system": "http://hl7.org/fhir/variant-state",
"code": "positive"
}
]
},
{
"coding": [
{
"system": "urn:iso:std:iso:3166",
"code": "US",
"display": "United States of America (the)"
}
]
}
],
"requirements": "Main EHR capability statement, published for contracting and operational support",
"copyright": "Copyright © Acme Healthcare and GoodCorp EHR Systems",
"kind": "instance",
"software": {
"name": "EHR",
"version": "0.00.020.2134",
"releaseDate": "2012-01-04"
},
"implementation": {
"description": "main EHR at ACME",
"url": "http://10.2.3.4/fhir"
},
"fhirVersion": "1.0.0",
"acceptUnknown": "both",
"format": [
"xml",
"json"
],
"profile": [
{
"reference": "http://hl7.org/fhir/us/core/StructureDefinition/familymemberhistory-genetic"
}
],
"rest": [
{
"mode": "server",
"documentation": "Main FHIR endpoint for acem health",
"security": {
"cors": true,
"service": [
{
"coding": [
{
"system": "http://hl7.org/fhir/restful-security-service",
"code": "SMART-on-FHIR"
}
]
}
],
"description": "See Smart on FHIR documentation",
"certificate": [
{
"type": "application/jwt",
"blob": "IHRoaXMgYmxvYiBpcyBub3QgdmFsaWQ="
}
]
},
"resource": [
{
"type": "Patient",
"profile": {
"reference": "http://fhir.hl7.org/base/StructureDefinition/7896271d-57f6-4231-89dc-dcc91eab2416"
},
"interaction": [
{
"code": "read"
},
{
"code": "vread",
"documentation": "Only supported for patient records since 12-Dec 2012"
},
{
"code": "update"
},
{
"code": "history-instance"
},
{
"code": "create"
},
{
"code": "history-type"
}
],
"versioning": "versioned-update",
"readHistory": true,
"updateCreate": false,
"conditionalCreate": true,
"conditionalUpdate": false,
"conditionalDelete": "not-supported",
"searchInclude": [
"Organization"
],
"searchRevInclude": [
"Person"
],
"searchParam": [
{
"name": "identifier",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-identifier",
"type": "token",
"documentation": "Only supports search by institution MRN"
},
{
"name": "general-practitioner",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-general-practitioner",
"type": "reference"
}
]
}
],
"interaction": [
{
"code": "transaction"
},
{
"code": "history-system"
}
],
"compartment": [
"http://hl7.org/fhir/CompartmentDefinition/patient"
]
}
],
"messaging": [
{
"endpoint": [
{
"protocol": {
"system": "http://hl7.org/fhir/message-transport",
"code": "mllp"
},
"address": "mllp:10.1.1.10:9234"
}
],
"reliableCache": 30,
"documentation": "ADT A08 equivalent for external system notifications",
"event": [
{
"code": {
"system": "http://hl7.org/fhir/message-events",
"code": "admin-notify"
},
"category": "Consequence",
"mode": "receiver",
"focus": "Patient",
"request": {
"reference": "StructureDefinition/Patient"
},
"response": {
"reference": "StructureDefinition/MessageHeader"
},
"documentation": "Notification of an update to a patient resource. changing the links is not supported"
}
]
}
],
"document": [
{
"mode": "consumer",
"documentation": "Basic rules for all documents in the EHR system",
"profile": {
"reference": "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"
}
}
]
}

View File

@ -0,0 +1,168 @@
{
"resourceType": "Conformance",
"id": "example",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t<p>The EHR Server supports the following transactions for the resource Person: read, vread, \n update, history, search(name,gender), create and updates.</p>\n\t\t\t\n <p>The EHR System supports the following message: admin-notify::Person.</p>\n\t\t\t\n <p>The EHR Application has a \n \n <a href=\"http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796\">general document profile</a>.\n \n </p>\n\t\t\n </div>"
},
"extension": [
{
"url": "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile",
"valueReference": {
"reference": "http://hl7.org/fhir/us/core/StructureDefinition/familymemberhistory-genetic"
}
}
],
"url": "urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311",
"version": "20130510",
"name": "ACMEEHR",
"status": "draft",
"experimental": true,
"publisher": "ACME Corporation",
"contact": [
{
"name": "System Administrator",
"telecom": [
{
"system": "email",
"value": "wile@acme.org"
}
]
}
],
"date": "2012-01-04",
"description": "This is the FHIR capability statement for the main EHR at ACME for the private interface - it does not describe the public interface",
"requirements": "Main EHR capability statement, published for contracting and operational support",
"copyright": "Copyright © Acme Healthcare and GoodCorp EHR Systems",
"kind": "instance",
"software": {
"name": "EHR",
"version": "0.00.020.2134",
"releaseDate": "2012-01-04"
},
"implementation": {
"description": "main EHR at ACME",
"url": "http://10.2.3.4/fhir"
},
"fhirVersion": "5.0.0",
"acceptUnknown": "both",
"format": [
"xml",
"json"
],
"profile": [
{
"reference": "http://registry.fhir.org/r5/StructureDefinition/00ab9e7a-06c7-4f77-9234-4154ca1e3347"
}
],
"rest": [
{
"mode": "server",
"documentation": "Main FHIR endpoint for acem health",
"security": {
"cors": true,
"service": [
{
"coding": [
{
"system": "http://hl7.org/fhir/restful-security-service",
"code": "SMART-on-FHIR"
}
]
}
],
"description": "See Smart on FHIR documentation"
},
"resource": [
{
"type": "Patient",
"profile": {
"reference": "http://registry.fhir.org/r5/StructureDefinition/7896271d-57f6-4231-89dc-dcc91eab2416"
},
"interaction": [
{
"code": "read"
},
{
"code": "vread",
"documentation": "Only supported for patient records since 12-Dec 2012"
},
{
"code": "update"
},
{
"code": "history-instance"
},
{
"code": "create"
},
{
"code": "history-type"
}
],
"versioning": "versioned-update",
"readHistory": true,
"updateCreate": false,
"conditionalCreate": true,
"conditionalUpdate": false,
"conditionalDelete": "not-supported",
"searchInclude": [
"Patient:organization"
],
"searchRevInclude": [
"Person:patient"
],
"searchParam": [
{
"name": "identifier",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-identifier",
"type": "token",
"documentation": "Only supports search by institution MRN"
},
{
"name": "general-practitioner",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-general-practitioner",
"type": "reference"
}
]
}
],
"interaction": [
{
"code": "transaction"
},
{
"code": "history-system"
}
],
"transactionMode": "transaction",
"compartment": [
"http://hl7.org/fhir/CompartmentDefinition/patient"
]
}
],
"messaging": [
{
"endpoint": [
{
"protocol": {
"system": "http://hl7.org/fhir/message-transport",
"code": "mllp"
},
"address": "mllp:10.1.1.10:9234"
}
],
"reliableCache": 30,
"documentation": "ADT A08 equivalent for external system notifications"
}
],
"document": [
{
"mode": "consumer",
"documentation": "Basic rules for all documents in the EHR system",
"profile": {
"reference": "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"
}
}
]
}

View File

@ -0,0 +1,178 @@
{
"resourceType": "Conformance",
"id": "example",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t<p>The EHR Server supports the following transactions for the resource Person: read, vread, update, history, search(name,gender), create and updates.</p>\n\t\t\t<p>The EHR System supports the following message: admin-notify::Person.</p>\n\t\t\t<p>The EHR Application has a <a href=\"http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796\">general document profile</a>.\n </p>\n\t\t</div>"
},
"url": "urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311",
"version": "20130510",
"name": "ACMEEHR",
"status": "draft",
"experimental": true,
"date": "2012-01-04",
"publisher": "ACME Corporation",
"contact": [
{
"name": "System Administrator",
"telecom": [
{
"system": "email",
"value": "wile@acme.org"
}
]
}
],
"description": "This is the FHIR capability statement for the main EHR at ACME for the private interface - it does not describe the public interface",
"useContext": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/variant-state",
"code": "positive"
}
]
},
{
"coding": [
{
"system": "urn:iso:std:iso:3166",
"code": "US",
"display": "United States of America (the)"
}
]
}
],
"requirements": "Main EHR capability statement, published for contracting and operational support",
"copyright": "Copyright © Acme Healthcare and GoodCorp EHR Systems",
"kind": "instance",
"software": {
"name": "EHR",
"version": "0.00.020.2134",
"releaseDate": "2012-01-04"
},
"implementation": {
"description": "main EHR at ACME",
"url": "http://10.2.3.4/fhir"
},
"fhirVersion": "4.0.1",
"acceptUnknown": "both",
"format": [
"xml",
"json"
],
"profile": [
{
"reference": "http://registry.fhir.org/r4/StructureDefinition/00ab9e7a-06c7-4f77-9234-4154ca1e3347"
}
],
"rest": [
{
"mode": "server",
"documentation": "Main FHIR endpoint for acem health",
"security": {
"cors": true,
"service": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/restful-security-service",
"code": "SMART-on-FHIR"
}
]
}
],
"description": "See Smart on FHIR documentation"
},
"resource": [
{
"type": "Patient",
"profile": {
"reference": "http://registry.fhir.org/r4/StructureDefinition/7896271d-57f6-4231-89dc-dcc91eab2416"
},
"interaction": [
{
"code": "read"
},
{
"code": "vread",
"documentation": "Only supported for patient records since 12-Dec 2012"
},
{
"code": "update"
},
{
"code": "history-instance"
},
{
"code": "create"
},
{
"code": "history-type"
}
],
"versioning": "versioned-update",
"readHistory": true,
"updateCreate": false,
"conditionalCreate": true,
"conditionalUpdate": false,
"conditionalDelete": "not-supported",
"searchInclude": [
"Organization"
],
"searchRevInclude": [
"Person"
],
"searchParam": [
{
"name": "identifier",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-identifier",
"type": "token",
"documentation": "Only supports search by institution MRN"
},
{
"name": "general-practitioner",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-general-practitioner",
"type": "reference"
}
]
}
],
"interaction": [
{
"code": "transaction"
},
{
"code": "history-system"
}
],
"compartment": [
"http://hl7.org/fhir/CompartmentDefinition/patient"
]
}
],
"messaging": [
{
"endpoint": [
{
"protocol": {
"system": "http://terminology.hl7.org/CodeSystem/message-transport",
"code": "mllp"
},
"address": "mllp:10.1.1.10:9234"
}
],
"reliableCache": 30,
"documentation": "ADT A08 equivalent for external system notifications"
}
],
"document": [
{
"mode": "consumer",
"documentation": "Basic rules for all documents in the EHR system",
"profile": {
"reference": "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"
}
}
]
}

View File

@ -0,0 +1,168 @@
{
"resourceType": "Conformance",
"id": "example",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t<p>The EHR Server supports the following transactions for the resource Person: read, vread, \n update, history, search(name,gender), create and updates.</p>\n\t\t\t\n <p>The EHR System supports the following message: admin-notify::Person.</p>\n\t\t\t\n <p>The EHR Application has a \n \n <a href=\"http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796\">general document profile</a>.\n \n </p>\n\t\t\n </div>"
},
"extension": [
{
"url": "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile",
"valueReference": {
"reference": "http://hl7.org/fhir/us/core/StructureDefinition/familymemberhistory-genetic"
}
}
],
"url": "urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311",
"version": "20130510",
"name": "ACMEEHR",
"status": "draft",
"experimental": true,
"publisher": "ACME Corporation",
"contact": [
{
"name": "System Administrator",
"telecom": [
{
"system": "email",
"value": "wile@acme.org"
}
]
}
],
"date": "2012-01-04",
"description": "This is the FHIR capability statement for the main EHR at ACME for the private interface - it does not describe the public interface",
"requirements": "Main EHR capability statement, published for contracting and operational support",
"copyright": "Copyright © Acme Healthcare and GoodCorp EHR Systems",
"kind": "instance",
"software": {
"name": "EHR",
"version": "0.00.020.2134",
"releaseDate": "2012-01-04"
},
"implementation": {
"description": "main EHR at ACME",
"url": "http://10.2.3.4/fhir"
},
"fhirVersion": "5.0.0",
"acceptUnknown": "both",
"format": [
"xml",
"json"
],
"profile": [
{
"reference": "http://registry.fhir.org/r5/StructureDefinition/00ab9e7a-06c7-4f77-9234-4154ca1e3347"
}
],
"rest": [
{
"mode": "server",
"documentation": "Main FHIR endpoint for acem health",
"security": {
"cors": true,
"service": [
{
"coding": [
{
"system": "http://hl7.org/fhir/restful-security-service",
"code": "SMART-on-FHIR"
}
]
}
],
"description": "See Smart on FHIR documentation"
},
"resource": [
{
"type": "Patient",
"profile": {
"reference": "http://registry.fhir.org/r5/StructureDefinition/7896271d-57f6-4231-89dc-dcc91eab2416"
},
"interaction": [
{
"code": "read"
},
{
"code": "vread",
"documentation": "Only supported for patient records since 12-Dec 2012"
},
{
"code": "update"
},
{
"code": "history-instance"
},
{
"code": "create"
},
{
"code": "history-type"
}
],
"versioning": "versioned-update",
"readHistory": true,
"updateCreate": false,
"conditionalCreate": true,
"conditionalUpdate": false,
"conditionalDelete": "not-supported",
"searchInclude": [
"Patient:organization"
],
"searchRevInclude": [
"Person:patient"
],
"searchParam": [
{
"name": "identifier",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-identifier",
"type": "token",
"documentation": "Only supports search by institution MRN"
},
{
"name": "general-practitioner",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-general-practitioner",
"type": "reference"
}
]
}
],
"interaction": [
{
"code": "transaction"
},
{
"code": "history-system"
}
],
"transactionMode": "transaction",
"compartment": [
"http://hl7.org/fhir/CompartmentDefinition/patient"
]
}
],
"messaging": [
{
"endpoint": [
{
"protocol": {
"system": "http://hl7.org/fhir/message-transport",
"code": "mllp"
},
"address": "mllp:10.1.1.10:9234"
}
],
"reliableCache": 30,
"documentation": "ADT A08 equivalent for external system notifications"
}
],
"document": [
{
"mode": "consumer",
"documentation": "Basic rules for all documents in the EHR system",
"profile": {
"reference": "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"
}
}
]
}

View File

@ -0,0 +1,186 @@
{
"resourceType": "Conformance",
"id": "example",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t<p>The EHR Server supports the following transactions for the resource Person: read, vread, \n update, history, search(name,gender), create and updates.</p>\n\t\t\t\n <p>The EHR System supports the following message: admin-notify::Person.</p>\n\t\t\t\n <p>The EHR Application has a \n \n <a href=\"http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796\">general document profile</a>.\n \n </p>\n\t\t\n </div>"
},
"extension": [
{
"url": "http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile",
"valueReference": {
"reference": "http://hl7.org/fhir/us/core/StructureDefinition/familymemberhistory-genetic"
}
}
],
"url": "urn:uuid:68d043b5-9ecf-4559-a57a-396e0d452311",
"version": "20130510",
"name": "ACMEEHR",
"status": "draft",
"experimental": true,
"date": "2012-01-04",
"publisher": "ACME Corporation",
"contact": [
{
"name": "System Administrator",
"telecom": [
{
"system": "email",
"value": "wile@acme.org"
}
]
}
],
"description": "This is the FHIR capability statement for the main EHR at ACME for the private interface - it does not describe the public interface",
"useContext": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/variant-state",
"code": "positive"
}
]
},
{
"coding": [
{
"system": "urn:iso:std:iso:3166",
"code": "US",
"display": "United States of America (the)"
}
]
}
],
"requirements": "Main EHR capability statement, published for contracting and operational support",
"copyright": "Copyright © Acme Healthcare and GoodCorp EHR Systems",
"kind": "instance",
"software": {
"name": "EHR",
"version": "0.00.020.2134",
"releaseDate": "2012-01-04"
},
"implementation": {
"description": "main EHR at ACME",
"url": "http://10.2.3.4/fhir"
},
"fhirVersion": "5.0.0",
"acceptUnknown": "both",
"format": [
"xml",
"json"
],
"profile": [
{
"reference": "http://registry.fhir.org/r5/StructureDefinition/00ab9e7a-06c7-4f77-9234-4154ca1e3347"
}
],
"rest": [
{
"mode": "server",
"documentation": "Main FHIR endpoint for acem health",
"security": {
"cors": true,
"service": [
{
"coding": [
{
"system": "http://hl7.org/fhir/restful-security-service",
"code": "SMART-on-FHIR"
}
]
}
],
"description": "See Smart on FHIR documentation"
},
"resource": [
{
"type": "Patient",
"profile": {
"reference": "http://registry.fhir.org/r5/StructureDefinition/7896271d-57f6-4231-89dc-dcc91eab2416"
},
"interaction": [
{
"code": "read"
},
{
"code": "vread",
"documentation": "Only supported for patient records since 12-Dec 2012"
},
{
"code": "update"
},
{
"code": "history-instance"
},
{
"code": "create"
},
{
"code": "history-type"
}
],
"versioning": "versioned-update",
"readHistory": true,
"updateCreate": false,
"conditionalCreate": true,
"conditionalUpdate": false,
"conditionalDelete": "not-supported",
"searchInclude": [
"Patient:organization"
],
"searchRevInclude": [
"Person:patient"
],
"searchParam": [
{
"name": "identifier",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-identifier",
"type": "token",
"documentation": "Only supports search by institution MRN"
},
{
"name": "general-practitioner",
"definition": "http://hl7.org/fhir/SearchParameter/Patient-general-practitioner",
"type": "reference"
}
]
}
],
"interaction": [
{
"code": "transaction"
},
{
"code": "history-system"
}
],
"compartment": [
"http://hl7.org/fhir/CompartmentDefinition/patient"
]
}
],
"messaging": [
{
"endpoint": [
{
"protocol": {
"system": "http://hl7.org/fhir/message-transport",
"code": "mllp"
},
"address": "mllp:10.1.1.10:9234"
}
],
"reliableCache": 30,
"documentation": "ADT A08 equivalent for external system notifications"
}
],
"document": [
{
"mode": "consumer",
"documentation": "Basic rules for all documents in the EHR system",
"profile": {
"reference": "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796"
}
}
]
}

View File

@ -0,0 +1,52 @@
{
"resourceType": "ValueSet",
"id": "yesnodontknow",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <h3>Value Set Contents</h3>\n <p>This value set contains 3 concepts</p>\n <table class=\"codes\">\n <tr>\n <td>\n <b>Code</b>\n </td>\n <td>\n <b>System</b>\n </td>\n <td>\n <b>Display</b>\n </td>\n <td>\n <b>Definition</b>\n </td>\n </tr>\n <tr>\n <td>\n <a name=\"http---hl7.org-fhir-v2-0136-Y\"> </a>\n <a href=\"v2/0136/index.html#v2-0136-Y\">Y</a>\n </td>\n <td>http://hl7.org/fhir/v2/0136</td>\n <td>Yes</td>\n <td/>\n </tr>\n <tr>\n <td>\n <a name=\"http---hl7.org-fhir-v2-0136-N\"> </a>\n <a href=\"v2/0136/index.html#v2-0136-N\">N</a>\n </td>\n <td>http://hl7.org/fhir/v2/0136</td>\n <td>No</td>\n <td/>\n </tr>\n <tr>\n <td>\n <a name=\"http---hl7.org-fhir-data-absent-reason-asked\"> </a>\n <a href=\"codesystem-data-absent-reason.html#data-absent-reason-asked\">asked</a>\n </td>\n <td>http://hl7.org/fhir/data-absent-reason</td>\n <td>Don't know</td>\n <td>The source human does not know the value.</td>\n </tr>\n </table>\n </div>"
},
"url": "http://hl7.org/fhir/ValueSet/yesnodontknow",
"name": "Yes/No/Don't Know",
"status": "draft",
"description": "For Capturing simple yes-no-don't know answers",
"extensible": true,
"compose": {
"include": [
{
"valueSet": [
"http://hl7.org/fhir/ValueSet/v2-0136"
]
},
{
"system": "http://hl7.org/fhir/data-absent-reason",
"concept": [
{
"code": "asked",
"display": "Don't know"
}
]
}
]
},
"expansion": {
"identifier": "urn:uuid:bf99fe50-2c2b-41ad-bd63-bee6919810b4",
"timestamp": "2015-07-14T10:00:00Z",
"contains": [
{
"system": "http://hl7.org/fhir/v2/0136",
"code": "Y",
"display": "Yes"
},
{
"system": "http://hl7.org/fhir/v2/0136",
"code": "N",
"display": "No"
},
{
"system": "http://hl7.org/fhir/data-absent-reason",
"code": "asked",
"display": "Don't know"
}
]
}
}