Merge pull request #887 from hapifhir/gg-202207-r4b-conv

Gg 202207 r4b conv
This commit is contained in:
Grahame Grieve 2022-07-28 22:45:02 +10:00 committed by GitHub
commit db59157790
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
203 changed files with 46049 additions and 92 deletions

View File

@ -0,0 +1,33 @@
package org.hl7.fhir.convertors.advisors.impl;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Nonnull;
import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor50;
import org.hl7.fhir.exceptions.FHIRException;
public class BaseAdvisor_43_50 extends BaseAdvisor50<org.hl7.fhir.r4b.model.Extension> {
private static final List<String> TestScriptIgnoredUrls = Arrays.asList("http://hl7.org/fhir/5.0/StructureDefinition/extension-TestScript.scope");
public BaseAdvisor_43_50() {
}
public BaseAdvisor_43_50(Boolean failFast) {
this.failFast = failFast;
}
@Override
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) throws FHIRException {
List<String> paths = Arrays.asList(path.split(","));
if ((paths.get(paths.size() - 1).equals("TestScript")) && (TestScriptIgnoredUrls.contains(url))) {
return true;
} else
return false;
}
}

View File

@ -0,0 +1,81 @@
package org.hl7.fhir.convertors.advisors.interfaces;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.instance.model.api.IBaseExtension;
import org.hl7.fhir.r4b.model.*;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
public abstract class BaseAdvisor43<T extends IBaseExtension> extends BaseAdvisor {
private final List<CodeSystem> cslist = new ArrayList<>();
public final List<CodeSystem> getCslist() {
return this.cslist;
}
public void handleCodeSystem(@Nonnull CodeSystem tgtcs,
@Nonnull ValueSet source) {
tgtcs.setId(source.getId());
tgtcs.setValueSet(source.getUrl());
this.cslist.add(tgtcs);
}
public boolean ignoreEntry(@Nonnull Bundle.BundleEntryComponent src,
@Nonnull org.hl7.fhir.utilities.FhirPublication targetVersion) {
return false;
}
public CodeSystem getCodeSystem(@Nonnull ValueSet src) throws FHIRException {
return null;
}
public boolean ignoreExtension(@Nonnull String path,
@Nonnull Extension ext) throws FHIRException {
return ((ext.getUrl() != null) && (this.ignoreExtension(path, ext.getUrl()))
|| (this.ignoreType(path, ext.getValue())));
}
public boolean ignoreExtension(@Nonnull String path,
@Nonnull T ext) throws FHIRException {
return ((ext.getUrl() != null) && this.ignoreExtension(path, ext.getUrl()))
|| (this.ignoreType(path, ext.getValue()));
}
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) throws FHIRException {
return false;
}
public boolean ignoreType(@Nonnull String path,
@Nonnull DataType type) throws FHIRException {
return false;
}
public boolean ignoreType(@Nonnull String path,
@Nonnull Object type) throws FHIRException {
return false;
}
public boolean useAdvisorForExtension(@Nonnull String path,
@Nonnull Extension ext) throws FHIRException {
return false;
}
public boolean useAdvisorForExtension(@Nonnull String path,
@Nonnull T ext) throws FHIRException {
return false;
}
public void handleExtension(@Nonnull String path,
@Nonnull Extension src,
@Nonnull T tgt) throws FHIRException {
}
public void handleExtension(@Nonnull String path,
@Nonnull T src,
@Nonnull Extension tgt) throws FHIRException {
}
}

View File

@ -0,0 +1,53 @@
package org.hl7.fhir.convertors.context;
import org.hl7.fhir.convertors.conv43_50.VersionConvertor_43_50;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
public enum ConversionContext43_50 {
INSTANCE;
private final VersionConvertorContext<VersionConvertor_43_50> context = new VersionConvertorContext<>();
public void init(VersionConvertor_43_50 versionConvertor_43_50, String path) {
context.init(versionConvertor_43_50, path);
}
public void close(String path) {
context.close(path);
}
public String path() {
return context.getPath();
}
public VersionConvertor_43_50 getVersionConvertor_43_50() {
return context.getVersionConvertor();
}
}

View File

@ -0,0 +1,143 @@
package org.hl7.fhir.convertors.conv43_50;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneElement43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.Element43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.Type43_50;
import org.hl7.fhir.convertors.conv43_50.resources43_50.Resource43_50;
import org.hl7.fhir.exceptions.FHIRException;
import javax.annotation.Nonnull;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/**
* Our conversion class needs to be able to handle all the base data-types in FHIR; Resources, DomainResource, Element
*/
public class VersionConvertor_43_50 {
private final BaseAdvisor_43_50 advisor;
private final Element43_50 elementConvertor;
private final BackboneElement43_50 backboneElementConvertor;
private final Resource43_50 resourceConvertor;
private final Type43_50 typeConvertor;
public VersionConvertor_43_50(@Nonnull BaseAdvisor_43_50 advisor) {
this.advisor = advisor;
this.elementConvertor = new Element43_50(advisor);
this.backboneElementConvertor = new BackboneElement43_50();
this.resourceConvertor = new Resource43_50(advisor);
this.typeConvertor = new Type43_50(advisor);
}
public BaseAdvisor_43_50 advisor() {
return advisor;
}
public void copyResource(@Nonnull org.hl7.fhir.r4b.model.Resource src,
@Nonnull org.hl7.fhir.r5.model.Resource tgt) throws FHIRException {
resourceConvertor.copyResource(src, tgt);
}
public void copyResource(@Nonnull org.hl7.fhir.r5.model.Resource src,
@Nonnull org.hl7.fhir.r4b.model.Resource tgt) throws FHIRException {
resourceConvertor.copyResource(src, tgt);
}
public org.hl7.fhir.r5.model.Resource convertResource(@Nonnull org.hl7.fhir.r4b.model.Resource src) throws FHIRException {
ConversionContext43_50.INSTANCE.init(this, src.fhirType());
try {
return resourceConvertor.convertResource(src);
} finally {
ConversionContext43_50.INSTANCE.close(src.fhirType());
}
}
public org.hl7.fhir.r4b.model.Resource convertResource(@Nonnull org.hl7.fhir.r5.model.Resource src) throws FHIRException {
ConversionContext43_50.INSTANCE.init(this, src.fhirType());
try {
return resourceConvertor.convertResource(src);
} finally {
ConversionContext43_50.INSTANCE.close(src.fhirType());
}
}
public org.hl7.fhir.r5.model.DataType convertType(@Nonnull org.hl7.fhir.r4b.model.DataType src) throws FHIRException {
ConversionContext43_50.INSTANCE.init(this, src.fhirType());
try {
return typeConvertor.convertType(src);
} finally {
ConversionContext43_50.INSTANCE.close(src.fhirType());
}
}
public org.hl7.fhir.r4b.model.DataType convertType(@Nonnull org.hl7.fhir.r5.model.DataType src) throws FHIRException {
ConversionContext43_50.INSTANCE.init(this, src.fhirType());
try {
return typeConvertor.convertType(src);
} finally {
ConversionContext43_50.INSTANCE.close(src.fhirType());
}
}
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.r5.model.DomainResource src,
@Nonnull org.hl7.fhir.r4b.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
}
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);
}
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);
}
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);
}
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);
}
}

View File

@ -0,0 +1,35 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Extension43_50;
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);
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);
for (org.hl7.fhir.r5.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension43_50.convertExtension(e));
}
}
public static void copyBackboneElement(org.hl7.fhir.r5.model.BackboneType src, org.hl7.fhir.r4b.model.BackboneType tgt, String... var) throws FHIRException {
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, var);
for (org.hl7.fhir.r5.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension43_50.convertExtension(e));
}
}
public static void copyBackboneElement(org.hl7.fhir.r4b.model.BackboneType src, org.hl7.fhir.r5.model.BackboneType tgt, String... var) throws FHIRException {
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, var);
for (org.hl7.fhir.r4b.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension43_50.convertExtension(e));
}
}
}

View File

@ -0,0 +1,35 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Extension43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class BackboneType43_50 {
// public static void copyBackboneType(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);
// for (org.hl7.fhir.r4b.model.Extension e : src.getModifierExtension()) {
// tgt.addModifierExtension(Extension43_50.convertExtension(e));
// }
// }
//
// public static void copyBackboneType(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);
// for (org.hl7.fhir.r5.model.Extension e : src.getModifierExtension()) {
// tgt.addModifierExtension(Extension43_50.convertExtension(e));
// }
// }
public static void copyBackboneType(org.hl7.fhir.r5.model.BackboneType src, org.hl7.fhir.r4b.model.BackboneType tgt, String... var) throws FHIRException {
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, var);
for (org.hl7.fhir.r5.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension43_50.convertExtension(e));
}
}
public static void copyBackboneType(org.hl7.fhir.r4b.model.BackboneType src, org.hl7.fhir.r5.model.BackboneType tgt, String... var) throws FHIRException {
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, var);
for (org.hl7.fhir.r4b.model.Extension e : src.getModifierExtension()) {
tgt.addModifierExtension(Extension43_50.convertExtension(e));
}
}
}

View File

@ -0,0 +1,56 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Extension43_50;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.Arrays;
public class Element43_50 {
public final BaseAdvisor_43_50 advisor;
public Element43_50(BaseAdvisor_43_50 advisor) {
this.advisor = advisor;
}
public static boolean isExemptExtension(String url, String[] extensionsToIgnore) {
return Arrays.asList(extensionsToIgnore).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 {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.r5.model.Extension convertedExtension = new org.hl7.fhir.r5.model.Extension();
advisor.handleExtension(path, e, convertedExtension);
tgt.addExtension(convertedExtension);
} else {
tgt.addExtension(Extension43_50.convertExtension(e));
}
});
}
public void copyElement(org.hl7.fhir.r5.model.Element src,
org.hl7.fhir.r4b.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.r4b.model.Extension convertedExtension = new org.hl7.fhir.r4b.model.Extension();
advisor.handleExtension(path, e, convertedExtension);
tgt.addExtension(convertedExtension);
} else {
tgt.addExtension(Extension43_50.convertExtension(e));
}
});
}
}

View File

@ -0,0 +1,256 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.*;
import org.hl7.fhir.convertors.conv43_50.resources43_50.*;
import org.hl7.fhir.exceptions.FHIRException;
public class Type43_50 {
private final BaseAdvisor_43_50 advisor;
public Type43_50(BaseAdvisor_43_50 advisor) {
this.advisor = advisor;
}
public org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.r4b.model.DataType src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
if (src instanceof org.hl7.fhir.r4b.model.Base64BinaryType)
return Base64Binary43_50.convertBase64Binary((org.hl7.fhir.r4b.model.Base64BinaryType) src);
if (src instanceof org.hl7.fhir.r4b.model.BooleanType)
return Boolean43_50.convertBoolean((org.hl7.fhir.r4b.model.BooleanType) src);
if (src instanceof org.hl7.fhir.r4b.model.CanonicalType)
return Canonical43_50.convertCanonical((org.hl7.fhir.r4b.model.CanonicalType) src);
if (src instanceof org.hl7.fhir.r4b.model.CodeType)
return Code43_50.convertCode((org.hl7.fhir.r4b.model.CodeType) src);
if (src instanceof org.hl7.fhir.r4b.model.DateType)
return Date43_50.convertDate((org.hl7.fhir.r4b.model.DateType) src);
if (src instanceof org.hl7.fhir.r4b.model.DateTimeType)
return DateTime43_50.convertDateTime((org.hl7.fhir.r4b.model.DateTimeType) src);
if (src instanceof org.hl7.fhir.r4b.model.DecimalType)
return Decimal43_50.convertDecimal((org.hl7.fhir.r4b.model.DecimalType) src);
if (src instanceof org.hl7.fhir.r4b.model.IdType) return Id43_50.convertId((org.hl7.fhir.r4b.model.IdType) src);
if (src instanceof org.hl7.fhir.r4b.model.InstantType)
return Instant43_50.convertInstant((org.hl7.fhir.r4b.model.InstantType) src);
if (src instanceof org.hl7.fhir.r4b.model.UnsignedIntType)
return UnsignedInt43_50.convertUnsignedInt((org.hl7.fhir.r4b.model.UnsignedIntType) src);
if (src instanceof org.hl7.fhir.r4b.model.PositiveIntType)
return PositiveInt43_50.convertPositiveInt((org.hl7.fhir.r4b.model.PositiveIntType) src);
if (src instanceof org.hl7.fhir.r4b.model.IntegerType)
return Integer43_50.convertInteger((org.hl7.fhir.r4b.model.IntegerType) src);
if (src instanceof org.hl7.fhir.r4b.model.MarkdownType)
return MarkDown43_50.convertMarkdown((org.hl7.fhir.r4b.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.r4b.model.OidType) return Oid43_50.convertOid((org.hl7.fhir.r4b.model.OidType) src);
if (src instanceof org.hl7.fhir.r4b.model.TimeType)
return Time43_50.convertTime((org.hl7.fhir.r4b.model.TimeType) src);
if (src instanceof org.hl7.fhir.r4b.model.UrlType) return Url43_50.convertUrl((org.hl7.fhir.r4b.model.UrlType) src);
if (src instanceof org.hl7.fhir.r4b.model.UuidType)
return Uuid43_50.convertUuid((org.hl7.fhir.r4b.model.UuidType) src);
if (src instanceof org.hl7.fhir.r4b.model.UriType) return Uri43_50.convertUri((org.hl7.fhir.r4b.model.UriType) src);
if (src instanceof org.hl7.fhir.r4b.model.StringType)
return String43_50.convertString((org.hl7.fhir.r4b.model.StringType) src);
if (src instanceof org.hl7.fhir.r4b.model.Extension)
return Extension43_50.convertExtension((org.hl7.fhir.r4b.model.Extension) src);
if (src instanceof org.hl7.fhir.r4b.model.Narrative)
return Narrative43_50.convertNarrative((org.hl7.fhir.r4b.model.Narrative) src);
if (src instanceof org.hl7.fhir.r4b.model.Address)
return Address43_50.convertAddress((org.hl7.fhir.r4b.model.Address) src);
if (src instanceof org.hl7.fhir.r4b.model.Age) return Age43_50.convertAge((org.hl7.fhir.r4b.model.Age) src);
if (src instanceof org.hl7.fhir.r4b.model.Annotation)
return Annotation43_50.convertAnnotation((org.hl7.fhir.r4b.model.Annotation) src);
if (src instanceof org.hl7.fhir.r4b.model.Attachment)
return Attachment43_50.convertAttachment((org.hl7.fhir.r4b.model.Attachment) src);
if (src instanceof org.hl7.fhir.r4b.model.CodeableConcept)
return CodeableConcept43_50.convertCodeableConcept((org.hl7.fhir.r4b.model.CodeableConcept) src);
if (src instanceof org.hl7.fhir.r4b.model.Coding)
return Coding43_50.convertCoding((org.hl7.fhir.r4b.model.Coding) src);
if (src instanceof org.hl7.fhir.r4b.model.ContactDetail)
return ContactDetail43_50.convertContactDetail((org.hl7.fhir.r4b.model.ContactDetail) src);
if (src instanceof org.hl7.fhir.r4b.model.ContactPoint)
return ContactPoint43_50.convertContactPoint((org.hl7.fhir.r4b.model.ContactPoint) src);
if (src instanceof org.hl7.fhir.r4b.model.Contributor)
return Contributor43_50.convertContributor((org.hl7.fhir.r4b.model.Contributor) src);
if (src instanceof org.hl7.fhir.r4b.model.Count) return Count43_50.convertCount((org.hl7.fhir.r4b.model.Count) src);
if (src instanceof org.hl7.fhir.r4b.model.DataRequirement)
return DataRequirement43_50.convertDataRequirement((org.hl7.fhir.r4b.model.DataRequirement) src);
if (src instanceof org.hl7.fhir.r4b.model.Distance)
return Distance43_50.convertDistance((org.hl7.fhir.r4b.model.Distance) src);
if (src instanceof org.hl7.fhir.r4b.model.Dosage)
return Dosage43_50.convertDosage((org.hl7.fhir.r4b.model.Dosage) src);
if (src instanceof org.hl7.fhir.r4b.model.Duration)
return Duration43_50.convertDuration((org.hl7.fhir.r4b.model.Duration) src);
if (src instanceof org.hl7.fhir.r4b.model.Expression)
return Expression43_50.convertExpression((org.hl7.fhir.r4b.model.Expression) src);
if (src instanceof org.hl7.fhir.r4b.model.HumanName)
return HumanName43_50.convertHumanName((org.hl7.fhir.r4b.model.HumanName) src);
if (src instanceof org.hl7.fhir.r4b.model.Identifier)
return Identifier43_50.convertIdentifier((org.hl7.fhir.r4b.model.Identifier) src);
if (src instanceof org.hl7.fhir.r4b.model.MarketingStatus)
return MarketingStatus43_50.convertMarketingStatus((org.hl7.fhir.r4b.model.MarketingStatus) src);
if (src instanceof org.hl7.fhir.r4b.model.Meta) return Meta43_50.convertMeta((org.hl7.fhir.r4b.model.Meta) src);
if (src instanceof org.hl7.fhir.r4b.model.Money) return Money43_50.convertMoney((org.hl7.fhir.r4b.model.Money) src);
if (src instanceof org.hl7.fhir.r4b.model.ParameterDefinition)
return ParameterDefinition43_50.convertParameterDefinition((org.hl7.fhir.r4b.model.ParameterDefinition) src);
if (src instanceof org.hl7.fhir.r4b.model.Period)
return Period43_50.convertPeriod((org.hl7.fhir.r4b.model.Period) src);
if (src instanceof org.hl7.fhir.r4b.model.Population)
return Population43_50.convertPopulation((org.hl7.fhir.r4b.model.Population) src);
if (src instanceof org.hl7.fhir.r4b.model.ProdCharacteristic)
return ProdCharacteristic43_50.convertProdCharacteristic((org.hl7.fhir.r4b.model.ProdCharacteristic) src);
if (src instanceof org.hl7.fhir.r4b.model.ProductShelfLife)
return ProductShelfLife43_50.convertProductShelfLife((org.hl7.fhir.r4b.model.ProductShelfLife) src);
if (src instanceof org.hl7.fhir.r4b.model.MoneyQuantity)
return MoneyQuantity43_50.convertMoneyQuantity((org.hl7.fhir.r4b.model.MoneyQuantity) src);
if (src instanceof org.hl7.fhir.r4b.model.SimpleQuantity)
return SimpleQuantity43_50.convertSimpleQuantity((org.hl7.fhir.r4b.model.SimpleQuantity) src);
if (src instanceof org.hl7.fhir.r4b.model.Quantity)
return Quantity43_50.convertQuantity((org.hl7.fhir.r4b.model.Quantity) src);
if (src instanceof org.hl7.fhir.r4b.model.Range) return Range43_50.convertRange((org.hl7.fhir.r4b.model.Range) src);
if (src instanceof org.hl7.fhir.r4b.model.Ratio) return Ratio43_50.convertRatio((org.hl7.fhir.r4b.model.Ratio) src);
if (src instanceof org.hl7.fhir.r4b.model.Reference)
return Reference43_50.convertReference((org.hl7.fhir.r4b.model.Reference) src);
if (src instanceof org.hl7.fhir.r4b.model.RelatedArtifact)
return RelatedArtifact43_50.convertRelatedArtifact((org.hl7.fhir.r4b.model.RelatedArtifact) src);
if (src instanceof org.hl7.fhir.r4b.model.SampledData)
return SampledData43_50.convertSampledData((org.hl7.fhir.r4b.model.SampledData) src);
if (src instanceof org.hl7.fhir.r4b.model.Signature)
return Signature43_50.convertSignature((org.hl7.fhir.r4b.model.Signature) src);
if (src instanceof org.hl7.fhir.r4b.model.SubstanceAmount)
return SubstanceAmount43_50.convertSubstanceAmount((org.hl7.fhir.r4b.model.SubstanceAmount) src);
if (src instanceof org.hl7.fhir.r4b.model.Timing)
return Timing43_50.convertTiming((org.hl7.fhir.r4b.model.Timing) src);
if (src instanceof org.hl7.fhir.r4b.model.TriggerDefinition)
return TriggerDefinition43_50.convertTriggerDefinition((org.hl7.fhir.r4b.model.TriggerDefinition) src);
if (src instanceof org.hl7.fhir.r4b.model.UsageContext)
return UsageContext43_50.convertUsageContext((org.hl7.fhir.r4b.model.UsageContext) src);
if (src instanceof org.hl7.fhir.r4b.model.ElementDefinition)
return ElementDefinition43_50.convertElementDefinition((org.hl7.fhir.r4b.model.ElementDefinition) src);
if (advisor.failFastOnNullOrUnknownEntry()) {
throw new FHIRException("Unknown type " + src.fhirType());
} else {
return null;
}
}
public org.hl7.fhir.r4b.model.DataType convertType(org.hl7.fhir.r5.model.DataType src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
if (src instanceof org.hl7.fhir.r5.model.Base64BinaryType)
return Base64Binary43_50.convertBase64Binary((org.hl7.fhir.r5.model.Base64BinaryType) src);
if (src instanceof org.hl7.fhir.r5.model.BooleanType)
return Boolean43_50.convertBoolean((org.hl7.fhir.r5.model.BooleanType) src);
if (src instanceof org.hl7.fhir.r5.model.CanonicalType)
return Canonical43_50.convertCanonical((org.hl7.fhir.r5.model.CanonicalType) src);
if (src instanceof org.hl7.fhir.r5.model.CodeType)
return Code43_50.convertCode((org.hl7.fhir.r5.model.CodeType) src);
if (src instanceof org.hl7.fhir.r5.model.DateType)
return Date43_50.convertDate((org.hl7.fhir.r5.model.DateType) src);
if (src instanceof org.hl7.fhir.r5.model.DateTimeType)
return DateTime43_50.convertDateTime((org.hl7.fhir.r5.model.DateTimeType) src);
if (src instanceof org.hl7.fhir.r5.model.DecimalType)
return Decimal43_50.convertDecimal((org.hl7.fhir.r5.model.DecimalType) src);
if (src instanceof org.hl7.fhir.r5.model.IdType) return Id43_50.convertId((org.hl7.fhir.r5.model.IdType) src);
if (src instanceof org.hl7.fhir.r5.model.InstantType)
return Instant43_50.convertInstant((org.hl7.fhir.r5.model.InstantType) src);
if (src instanceof org.hl7.fhir.r5.model.MarkdownType)
return MarkDown43_50.convertMarkdown((org.hl7.fhir.r5.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.r5.model.OidType) return Oid43_50.convertOid((org.hl7.fhir.r5.model.OidType) src);
if (src instanceof org.hl7.fhir.r5.model.PositiveIntType)
return PositiveInt43_50.convertPositiveInt((org.hl7.fhir.r5.model.PositiveIntType) src);
if (src instanceof org.hl7.fhir.r5.model.StringType)
return String43_50.convertString((org.hl7.fhir.r5.model.StringType) src);
if (src instanceof org.hl7.fhir.r5.model.TimeType)
return Time43_50.convertTime((org.hl7.fhir.r5.model.TimeType) src);
if (src instanceof org.hl7.fhir.r5.model.UnsignedIntType)
return UnsignedInt43_50.convertUnsignedInt((org.hl7.fhir.r5.model.UnsignedIntType) src);
if (src instanceof org.hl7.fhir.r5.model.IntegerType)
return Integer43_50.convertInteger((org.hl7.fhir.r5.model.IntegerType) src);
if (src instanceof org.hl7.fhir.r5.model.UrlType) return Url43_50.convertUrl((org.hl7.fhir.r5.model.UrlType) src);
if (src instanceof org.hl7.fhir.r5.model.UuidType)
return Uuid43_50.convertUuid((org.hl7.fhir.r5.model.UuidType) src);
if (src instanceof org.hl7.fhir.r5.model.UriType) return Uri43_50.convertUri((org.hl7.fhir.r5.model.UriType) src);
if (src instanceof org.hl7.fhir.r5.model.Extension)
return Extension43_50.convertExtension((org.hl7.fhir.r5.model.Extension) src);
if (src instanceof org.hl7.fhir.r5.model.Narrative)
return Narrative43_50.convertNarrative((org.hl7.fhir.r5.model.Narrative) src);
if (src instanceof org.hl7.fhir.r5.model.Address)
return Address43_50.convertAddress((org.hl7.fhir.r5.model.Address) src);
if (src instanceof org.hl7.fhir.r5.model.Age) return Age43_50.convertAge((org.hl7.fhir.r5.model.Age) src);
if (src instanceof org.hl7.fhir.r5.model.Annotation)
return Annotation43_50.convertAnnotation((org.hl7.fhir.r5.model.Annotation) src);
if (src instanceof org.hl7.fhir.r5.model.Attachment)
return Attachment43_50.convertAttachment((org.hl7.fhir.r5.model.Attachment) src);
if (src instanceof org.hl7.fhir.r5.model.CodeableConcept)
return CodeableConcept43_50.convertCodeableConcept((org.hl7.fhir.r5.model.CodeableConcept) src);
if (src instanceof org.hl7.fhir.r5.model.Coding)
return Coding43_50.convertCoding((org.hl7.fhir.r5.model.Coding) src);
if (src instanceof org.hl7.fhir.r5.model.ContactDetail)
return ContactDetail43_50.convertContactDetail((org.hl7.fhir.r5.model.ContactDetail) src);
if (src instanceof org.hl7.fhir.r5.model.ContactPoint)
return ContactPoint43_50.convertContactPoint((org.hl7.fhir.r5.model.ContactPoint) src);
if (src instanceof org.hl7.fhir.r5.model.Contributor)
return Contributor43_50.convertContributor((org.hl7.fhir.r5.model.Contributor) src);
if (src instanceof org.hl7.fhir.r5.model.Count) return Count43_50.convertCount((org.hl7.fhir.r5.model.Count) src);
if (src instanceof org.hl7.fhir.r5.model.DataRequirement)
return DataRequirement43_50.convertDataRequirement((org.hl7.fhir.r5.model.DataRequirement) src);
if (src instanceof org.hl7.fhir.r5.model.Distance)
return Distance43_50.convertDistance((org.hl7.fhir.r5.model.Distance) src);
if (src instanceof org.hl7.fhir.r5.model.Dosage)
return Dosage43_50.convertDosage((org.hl7.fhir.r5.model.Dosage) src);
if (src instanceof org.hl7.fhir.r5.model.Duration)
return Duration43_50.convertDuration((org.hl7.fhir.r5.model.Duration) src);
if (src instanceof org.hl7.fhir.r5.model.Expression)
return Expression43_50.convertExpression((org.hl7.fhir.r5.model.Expression) src);
if (src instanceof org.hl7.fhir.r5.model.HumanName)
return HumanName43_50.convertHumanName((org.hl7.fhir.r5.model.HumanName) src);
if (src instanceof org.hl7.fhir.r5.model.Identifier)
return Identifier43_50.convertIdentifier((org.hl7.fhir.r5.model.Identifier) src);
if (src instanceof org.hl7.fhir.r5.model.MarketingStatus)
return MarketingStatus43_50.convertMarketingStatus((org.hl7.fhir.r5.model.MarketingStatus) src);
if (src instanceof org.hl7.fhir.r5.model.Meta) return Meta43_50.convertMeta((org.hl7.fhir.r5.model.Meta) src);
if (src instanceof org.hl7.fhir.r5.model.Money) return Money43_50.convertMoney((org.hl7.fhir.r5.model.Money) src);
if (src instanceof org.hl7.fhir.r5.model.ParameterDefinition)
return ParameterDefinition43_50.convertParameterDefinition((org.hl7.fhir.r5.model.ParameterDefinition) src);
if (src instanceof org.hl7.fhir.r5.model.Period)
return Period43_50.convertPeriod((org.hl7.fhir.r5.model.Period) src);
if (src instanceof org.hl7.fhir.r5.model.Population)
return Population43_50.convertPopulation((org.hl7.fhir.r5.model.Population) src);
if (src instanceof org.hl7.fhir.r5.model.ProdCharacteristic)
return ProdCharacteristic43_50.convertProdCharacteristic((org.hl7.fhir.r5.model.ProdCharacteristic) src);
if (src instanceof org.hl7.fhir.r5.model.ProductShelfLife)
return ProductShelfLife43_50.convertProductShelfLife((org.hl7.fhir.r5.model.ProductShelfLife) src);
if (src instanceof org.hl7.fhir.r5.model.MoneyQuantity)
return MoneyQuantity43_50.convertMoneyQuantity((org.hl7.fhir.r5.model.MoneyQuantity) src);
if (src instanceof org.hl7.fhir.r5.model.SimpleQuantity)
return SimpleQuantity43_50.convertSimpleQuantity((org.hl7.fhir.r5.model.SimpleQuantity) src);
if (src instanceof org.hl7.fhir.r5.model.Quantity)
return Quantity43_50.convertQuantity((org.hl7.fhir.r5.model.Quantity) src);
if (src instanceof org.hl7.fhir.r5.model.Range) return Range43_50.convertRange((org.hl7.fhir.r5.model.Range) src);
if (src instanceof org.hl7.fhir.r5.model.Ratio) return Ratio43_50.convertRatio((org.hl7.fhir.r5.model.Ratio) src);
if (src instanceof org.hl7.fhir.r5.model.Reference)
return Reference43_50.convertReference((org.hl7.fhir.r5.model.Reference) src);
if (src instanceof org.hl7.fhir.r5.model.RelatedArtifact)
return RelatedArtifact43_50.convertRelatedArtifact((org.hl7.fhir.r5.model.RelatedArtifact) src);
if (src instanceof org.hl7.fhir.r5.model.SampledData)
return SampledData43_50.convertSampledData((org.hl7.fhir.r5.model.SampledData) src);
if (src instanceof org.hl7.fhir.r5.model.Signature)
return Signature43_50.convertSignature((org.hl7.fhir.r5.model.Signature) src);
if (src instanceof org.hl7.fhir.r5.model.SubstanceAmount)
return SubstanceAmount43_50.convertSubstanceAmount((org.hl7.fhir.r5.model.SubstanceAmount) src);
if (src instanceof org.hl7.fhir.r5.model.Timing)
return Timing43_50.convertTiming((org.hl7.fhir.r5.model.Timing) src);
if (src instanceof org.hl7.fhir.r5.model.TriggerDefinition)
return TriggerDefinition43_50.convertTriggerDefinition((org.hl7.fhir.r5.model.TriggerDefinition) src);
if (src instanceof org.hl7.fhir.r5.model.UsageContext)
return UsageContext43_50.convertUsageContext((org.hl7.fhir.r5.model.UsageContext) src);
if (src instanceof org.hl7.fhir.r5.model.ElementDefinition)
return ElementDefinition43_50.convertElementDefinition((org.hl7.fhir.r5.model.ElementDefinition) src);
if (advisor.failFastOnNullOrUnknownEntry()) {
throw new FHIRException("Unknown type " + src.fhirType());
} else {
return null;
}
}
}

View File

@ -0,0 +1,153 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Address43_50 {
public static org.hl7.fhir.r5.model.Address convertAddress(org.hl7.fhir.r4b.model.Address src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Address tgt = new org.hl7.fhir.r5.model.Address();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertAddressUse(src.getUseElement()));
if (src.hasType()) tgt.setTypeElement(convertAddressType(src.getTypeElement()));
if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement()));
for (org.hl7.fhir.r4b.model.StringType t : src.getLine()) tgt.getLine().add(String43_50.convertString(t));
if (src.hasCity()) tgt.setCityElement(String43_50.convertString(src.getCityElement()));
if (src.hasDistrict()) tgt.setDistrictElement(String43_50.convertString(src.getDistrictElement()));
if (src.hasState()) tgt.setStateElement(String43_50.convertString(src.getStateElement()));
if (src.hasPostalCode()) tgt.setPostalCodeElement(String43_50.convertString(src.getPostalCodeElement()));
if (src.hasCountry()) tgt.setCountryElement(String43_50.convertString(src.getCountryElement()));
if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Address convertAddress(org.hl7.fhir.r5.model.Address src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Address tgt = new org.hl7.fhir.r4b.model.Address();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertAddressUse(src.getUseElement()));
if (src.hasType()) tgt.setTypeElement(convertAddressType(src.getTypeElement()));
if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getLine()) tgt.getLine().add(String43_50.convertString(t));
if (src.hasCity()) tgt.setCityElement(String43_50.convertString(src.getCityElement()));
if (src.hasDistrict()) tgt.setDistrictElement(String43_50.convertString(src.getDistrictElement()));
if (src.hasState()) tgt.setStateElement(String43_50.convertString(src.getStateElement()));
if (src.hasPostalCode()) tgt.setPostalCodeElement(String43_50.convertString(src.getPostalCodeElement()));
if (src.hasCountry()) tgt.setCountryElement(String43_50.convertString(src.getCountryElement()));
if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Address.AddressUse> convertAddressUse(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Address.AddressUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Address.AddressUse> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Address.AddressUseEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.NULL);
} else {
switch (src.getValue()) {
case HOME:
tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.HOME);
break;
case WORK:
tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.WORK);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.TEMP);
break;
case OLD:
tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.OLD);
break;
case BILLING:
tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.BILLING);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Address.AddressUse.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Address.AddressUse> convertAddressUse(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Address.AddressUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Address.AddressUse> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Address.AddressUseEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.NULL);
} else {
switch (src.getValue()) {
case HOME:
tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.HOME);
break;
case WORK:
tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.WORK);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.TEMP);
break;
case OLD:
tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.OLD);
break;
case BILLING:
tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.BILLING);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressUse.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Address.AddressType> convertAddressType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Address.AddressType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Address.AddressType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Address.AddressTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.NULL);
} else {
switch (src.getValue()) {
case POSTAL:
tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.POSTAL);
break;
case PHYSICAL:
tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.PHYSICAL);
break;
case BOTH:
tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.BOTH);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Address.AddressType.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Address.AddressType> convertAddressType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Address.AddressType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Address.AddressType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Address.AddressTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressType.NULL);
} else {
switch (src.getValue()) {
case POSTAL:
tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressType.POSTAL);
break;
case PHYSICAL:
tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressType.PHYSICAL);
break;
case BOTH:
tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressType.BOTH);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Address.AddressType.NULL);
break;
}
}
return tgt;
}
}

View File

@ -0,0 +1,19 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Age43_50 {
public static org.hl7.fhir.r5.model.Age convertAge(org.hl7.fhir.r4b.model.Age src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Age tgt = new org.hl7.fhir.r5.model.Age();
Quantity43_50.copyQuantity(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.Age convertAge(org.hl7.fhir.r5.model.Age src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Age tgt = new org.hl7.fhir.r4b.model.Age();
Quantity43_50.copyQuantity(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,30 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.MarkDown43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Annotation43_50 {
public static org.hl7.fhir.r5.model.Annotation convertAnnotation(org.hl7.fhir.r4b.model.Annotation src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Annotation tgt = new org.hl7.fhir.r5.model.Annotation();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasAuthor())
tgt.setAuthor(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAuthor()));
if (src.hasTime()) tgt.setTimeElement(DateTime43_50.convertDateTime(src.getTimeElement()));
if (src.hasText()) tgt.setTextElement(MarkDown43_50.convertMarkdown(src.getTextElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Annotation convertAnnotation(org.hl7.fhir.r5.model.Annotation src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Annotation tgt = new org.hl7.fhir.r4b.model.Annotation();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasAuthor())
tgt.setAuthor(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAuthor()));
if (src.hasTime()) tgt.setTimeElement(DateTime43_50.convertDateTime(src.getTimeElement()));
if (src.hasText()) tgt.setTextElement(MarkDown43_50.convertMarkdown(src.getTextElement()));
return tgt;
}
}

View File

@ -0,0 +1,37 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.exceptions.FHIRException;
public class Attachment43_50 {
public static org.hl7.fhir.r5.model.Attachment convertAttachment(org.hl7.fhir.r4b.model.Attachment src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Attachment tgt = new org.hl7.fhir.r5.model.Attachment();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasContentType()) tgt.setContentTypeElement(Code43_50.convertCode(src.getContentTypeElement()));
if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement()));
if (src.hasData()) tgt.setDataElement(Base64Binary43_50.convertBase64Binary(src.getDataElement()));
if (src.hasUrl()) tgt.setUrlElement(Url43_50.convertUrl(src.getUrlElement()));
if (src.hasSize()) tgt.setSizeElement(UnsignedInt43_50.convertUnsignedIntToInteger64(src.getSizeElement()));
if (src.hasHash()) tgt.setHashElement(Base64Binary43_50.convertBase64Binary(src.getHashElement()));
if (src.hasTitle()) tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasCreation()) tgt.setCreationElement(DateTime43_50.convertDateTime(src.getCreationElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Attachment convertAttachment(org.hl7.fhir.r5.model.Attachment src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Attachment tgt = new org.hl7.fhir.r4b.model.Attachment();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasContentType()) tgt.setContentTypeElement(Code43_50.convertCode(src.getContentTypeElement()));
if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement()));
if (src.hasData()) tgt.setDataElement(Base64Binary43_50.convertBase64Binary(src.getDataElement()));
if (src.hasUrl()) tgt.setUrlElement(Url43_50.convertUrl(src.getUrlElement()));
if (src.hasSize()) tgt.setSizeElement(UnsignedInt43_50.convertInteger64ToUnsignedInt(src.getSizeElement()));
if (src.hasHash()) tgt.setHashElement(Base64Binary43_50.convertBase64Binary(src.getHashElement()));
if (src.hasTitle()) tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasCreation()) tgt.setCreationElement(DateTime43_50.convertDateTime(src.getCreationElement()));
return tgt;
}
}

View File

@ -0,0 +1,32 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeableReference;
public class CodeableConcept43_50 {
public static org.hl7.fhir.r5.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.r4b.model.CodeableConcept src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
for (org.hl7.fhir.r4b.model.Coding t : src.getCoding()) tgt.addCoding(Coding43_50.convertCoding(t));
if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.CodeableConcept tgt = new org.hl7.fhir.r4b.model.CodeableConcept();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
for (org.hl7.fhir.r5.model.Coding t : src.getCoding()) tgt.addCoding(Coding43_50.convertCoding(t));
if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement()));
return tgt;
}
public static CodeableReference convertCodeableConceptToCodeableReference(org.hl7.fhir.r4b.model.CodeableConcept src) {
CodeableReference tgt = new CodeableReference();
tgt.setConcept(convertCodeableConcept(src));
return tgt;
}
}

View File

@ -0,0 +1,34 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Coding43_50 {
public static org.hl7.fhir.r5.model.Coding convertCoding(org.hl7.fhir.r4b.model.Coding src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Coding tgt = new org.hl7.fhir.r5.model.Coding();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasSystem()) tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement()));
if (src.hasVersion()) tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
if (src.hasCode()) tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasDisplay()) tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
if (src.hasUserSelected()) tgt.setUserSelectedElement(Boolean43_50.convertBoolean(src.getUserSelectedElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Coding convertCoding(org.hl7.fhir.r5.model.Coding src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Coding tgt = new org.hl7.fhir.r4b.model.Coding();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasSystem()) tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement()));
if (src.hasVersion()) tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
if (src.hasCode()) tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasDisplay()) tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
if (src.hasUserSelected()) tgt.setUserSelectedElement(Boolean43_50.convertBoolean(src.getUserSelectedElement()));
return tgt;
}
}

View File

@ -0,0 +1,168 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.PositiveInt43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class ContactPoint43_50 {
public static org.hl7.fhir.r5.model.ContactPoint convertContactPoint(org.hl7.fhir.r4b.model.ContactPoint src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.ContactPoint tgt = new org.hl7.fhir.r5.model.ContactPoint();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasSystem()) tgt.setSystemElement(convertContactPointSystem(src.getSystemElement()));
if (src.hasValue()) tgt.setValueElement(String43_50.convertString(src.getValueElement()));
if (src.hasUse()) tgt.setUseElement(convertContactPointUse(src.getUseElement()));
if (src.hasRank()) tgt.setRankElement(PositiveInt43_50.convertPositiveInt(src.getRankElement()));
if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ContactPoint convertContactPoint(org.hl7.fhir.r5.model.ContactPoint src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.ContactPoint tgt = new org.hl7.fhir.r4b.model.ContactPoint();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasSystem()) tgt.setSystemElement(convertContactPointSystem(src.getSystemElement()));
if (src.hasValue()) tgt.setValueElement(String43_50.convertString(src.getValueElement()));
if (src.hasUse()) tgt.setUseElement(convertContactPointUse(src.getUseElement()));
if (src.hasRank()) tgt.setRankElement(PositiveInt43_50.convertPositiveInt(src.getRankElement()));
if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem> convertContactPointSystem(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ContactPoint.ContactPointSystemEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.NULL);
} else {
switch (src.getValue()) {
case PHONE:
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.PHONE);
break;
case FAX:
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.FAX);
break;
case EMAIL:
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.EMAIL);
break;
case PAGER:
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.PAGER);
break;
case URL:
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.URL);
break;
case SMS:
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.SMS);
break;
case OTHER:
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.OTHER);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem> convertContactPointSystem(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystemEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.NULL);
} else {
switch (src.getValue()) {
case PHONE:
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.PHONE);
break;
case FAX:
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.FAX);
break;
case EMAIL:
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.EMAIL);
break;
case PAGER:
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.PAGER);
break;
case URL:
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.URL);
break;
case SMS:
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.SMS);
break;
case OTHER:
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.OTHER);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointSystem.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ContactPoint.ContactPointUse> convertContactPointUse(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ContactPoint.ContactPointUse> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ContactPoint.ContactPointUseEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.NULL);
} else {
switch (src.getValue()) {
case HOME:
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.HOME);
break;
case WORK:
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.WORK);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.TEMP);
break;
case OLD:
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.OLD);
break;
case MOBILE:
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.MOBILE);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.ContactPoint.ContactPointUse.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse> convertContactPointUse(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ContactPoint.ContactPointUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ContactPoint.ContactPointUseEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.NULL);
} else {
switch (src.getValue()) {
case HOME:
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.HOME);
break;
case WORK:
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.WORK);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.TEMP);
break;
case OLD:
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.OLD);
break;
case MOBILE:
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.MOBILE);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.ContactPoint.ContactPointUse.NULL);
break;
}
}
return tgt;
}
}

View File

@ -0,0 +1,19 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Count43_50 {
public static org.hl7.fhir.r5.model.Count convertCount(org.hl7.fhir.r4b.model.Count src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Count tgt = new org.hl7.fhir.r5.model.Count();
Quantity43_50.copyQuantity(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.Count convertCount(org.hl7.fhir.r5.model.Count src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Count tgt = new org.hl7.fhir.r4b.model.Count();
Quantity43_50.copyQuantity(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,19 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Distance43_50 {
public static org.hl7.fhir.r5.model.Distance convertDistance(org.hl7.fhir.r4b.model.Distance src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Distance tgt = new org.hl7.fhir.r5.model.Distance();
Quantity43_50.copyQuantity(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.Distance convertDistance(org.hl7.fhir.r5.model.Distance src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Distance tgt = new org.hl7.fhir.r4b.model.Distance();
Quantity43_50.copyQuantity(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,19 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Duration43_50 {
public static org.hl7.fhir.r5.model.Duration convertDuration(org.hl7.fhir.r4b.model.Duration src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Duration tgt = new org.hl7.fhir.r5.model.Duration();
Quantity43_50.copyQuantity(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.Duration convertDuration(org.hl7.fhir.r5.model.Duration src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Duration tgt = new org.hl7.fhir.r4b.model.Duration();
Quantity43_50.copyQuantity(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,109 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class HumanName43_50 {
public static org.hl7.fhir.r5.model.HumanName convertHumanName(org.hl7.fhir.r4b.model.HumanName src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.HumanName tgt = new org.hl7.fhir.r5.model.HumanName();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertNameUse(src.getUseElement()));
if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement()));
if (src.hasFamily()) tgt.setFamilyElement(String43_50.convertString(src.getFamilyElement()));
for (org.hl7.fhir.r4b.model.StringType t : src.getGiven()) tgt.getGiven().add(String43_50.convertString(t));
for (org.hl7.fhir.r4b.model.StringType t : src.getPrefix()) tgt.getPrefix().add(String43_50.convertString(t));
for (org.hl7.fhir.r4b.model.StringType t : src.getSuffix()) tgt.getSuffix().add(String43_50.convertString(t));
if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4b.model.HumanName convertHumanName(org.hl7.fhir.r5.model.HumanName src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.HumanName tgt = new org.hl7.fhir.r4b.model.HumanName();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertNameUse(src.getUseElement()));
if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement()));
if (src.hasFamily()) tgt.setFamilyElement(String43_50.convertString(src.getFamilyElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getGiven()) tgt.getGiven().add(String43_50.convertString(t));
for (org.hl7.fhir.r5.model.StringType t : src.getPrefix()) tgt.getPrefix().add(String43_50.convertString(t));
for (org.hl7.fhir.r5.model.StringType t : src.getSuffix()) tgt.getSuffix().add(String43_50.convertString(t));
if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.HumanName.NameUse> convertNameUse(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.HumanName.NameUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.HumanName.NameUse> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.HumanName.NameUseEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NULL);
} else {
switch (src.getValue()) {
case USUAL:
tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.USUAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.OFFICIAL);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.TEMP);
break;
case NICKNAME:
tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NICKNAME);
break;
case ANONYMOUS:
tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.ANONYMOUS);
break;
case OLD:
tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.OLD);
break;
case MAIDEN:
tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.MAIDEN);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.HumanName.NameUse.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.HumanName.NameUse> convertNameUse(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.HumanName.NameUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.HumanName.NameUse> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.HumanName.NameUseEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.NULL);
} else {
switch (src.getValue()) {
case USUAL:
tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.USUAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.OFFICIAL);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.TEMP);
break;
case NICKNAME:
tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.NICKNAME);
break;
case ANONYMOUS:
tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.ANONYMOUS);
break;
case OLD:
tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.OLD);
break;
case MAIDEN:
tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.MAIDEN);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.HumanName.NameUse.NULL);
break;
}
}
return tgt;
}
}

View File

@ -0,0 +1,97 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Identifier43_50 {
public static org.hl7.fhir.r5.model.Identifier convertIdentifier(org.hl7.fhir.r4b.model.Identifier src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Identifier tgt = new org.hl7.fhir.r5.model.Identifier();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertIdentifierUse(src.getUseElement()));
if (src.hasType()) tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasSystem()) tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement()));
if (src.hasValue()) tgt.setValueElement(String43_50.convertString(src.getValueElement()));
if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
if (src.hasAssigner()) tgt.setAssigner(Reference43_50.convertReference(src.getAssigner()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Identifier convertIdentifier(org.hl7.fhir.r5.model.Identifier src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Identifier tgt = new org.hl7.fhir.r4b.model.Identifier();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertIdentifierUse(src.getUseElement()));
if (src.hasType()) tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasSystem()) tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement()));
if (src.hasValue()) tgt.setValueElement(String43_50.convertString(src.getValueElement()));
if (src.hasPeriod()) tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
if (src.hasAssigner()) tgt.setAssigner(Reference43_50.convertReference(src.getAssigner()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Identifier.IdentifierUse> convertIdentifierUse(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Identifier.IdentifierUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Identifier.IdentifierUse> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Identifier.IdentifierUseEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.NULL);
} else {
switch (src.getValue()) {
case USUAL:
tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.USUAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.OFFICIAL);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.TEMP);
break;
case SECONDARY:
tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.SECONDARY);
break;
case OLD:
tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.OLD);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Identifier.IdentifierUse.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Identifier.IdentifierUse> convertIdentifierUse(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Identifier.IdentifierUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Identifier.IdentifierUse> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Identifier.IdentifierUseEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.NULL);
} else {
switch (src.getValue()) {
case USUAL:
tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.USUAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.OFFICIAL);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.TEMP);
break;
case SECONDARY:
tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.SECONDARY);
break;
case OLD:
tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.OLD);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Identifier.IdentifierUse.NULL);
break;
}
}
return tgt;
}
}

View File

@ -0,0 +1,26 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Decimal43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Money43_50 {
public static org.hl7.fhir.r5.model.Money convertMoney(org.hl7.fhir.r4b.model.Money src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Money tgt = new org.hl7.fhir.r5.model.Money();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasValue()) tgt.setValueElement(Decimal43_50.convertDecimal(src.getValueElement()));
if (src.hasCurrency()) tgt.setCurrencyElement(Code43_50.convertCode(src.getCurrencyElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Money convertMoney(org.hl7.fhir.r5.model.Money src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Money tgt = new org.hl7.fhir.r4b.model.Money();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasValue()) tgt.setValueElement(Decimal43_50.convertDecimal(src.getValueElement()));
if (src.hasCurrency()) tgt.setCurrencyElement(Code43_50.convertCode(src.getCurrencyElement()));
return tgt;
}
}

View File

@ -0,0 +1,13 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class MoneyQuantity43_50 {
public static org.hl7.fhir.r5.model.Quantity convertMoneyQuantity(org.hl7.fhir.r4b.model.Quantity src) throws FHIRException {
return Quantity43_50.convertQuantity(src);
}
public static org.hl7.fhir.r4b.model.Quantity convertMoneyQuantity(org.hl7.fhir.r5.model.Quantity src) throws FHIRException {
return Quantity43_50.convertQuantity(src);
}
}

View File

@ -0,0 +1,25 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Period43_50 {
public static org.hl7.fhir.r5.model.Period convertPeriod(org.hl7.fhir.r4b.model.Period src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Period tgt = new org.hl7.fhir.r5.model.Period();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasStart()) tgt.setStartElement(DateTime43_50.convertDateTime(src.getStartElement()));
if (src.hasEnd()) tgt.setEndElement(DateTime43_50.convertDateTime(src.getEndElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Period convertPeriod(org.hl7.fhir.r5.model.Period src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Period tgt = new org.hl7.fhir.r4b.model.Period();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasStart()) tgt.setStartElement(DateTime43_50.convertDateTime(src.getStartElement()));
if (src.hasEnd()) tgt.setEndElement(DateTime43_50.convertDateTime(src.getEndElement()));
return tgt;
}
}

View File

@ -0,0 +1,110 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Decimal43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Quantity43_50 {
public static org.hl7.fhir.r5.model.Quantity convertQuantity(org.hl7.fhir.r4b.model.Quantity src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Quantity tgt = new org.hl7.fhir.r5.model.Quantity();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasValue()) tgt.setValueElement(Decimal43_50.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnit()) tgt.setUnitElement(String43_50.convertString(src.getUnitElement()));
if (src.hasSystem()) tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement()));
if (src.hasCode()) tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Quantity convertQuantity(org.hl7.fhir.r5.model.Quantity src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Quantity tgt = new org.hl7.fhir.r4b.model.Quantity();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasValue()) tgt.setValueElement(Decimal43_50.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnit()) tgt.setUnitElement(String43_50.convertString(src.getUnitElement()));
if (src.hasSystem()) tgt.setSystemElement(Uri43_50.convertUri(src.getSystemElement()));
if (src.hasCode()) tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.QuantityComparator> convertQuantityComparator(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.QuantityComparator> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.QuantityComparator> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.QuantityComparatorEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.NULL);
} else {
switch (src.getValue()) {
case LESS_THAN:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.LESS_THAN);
break;
case LESS_OR_EQUAL:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.LESS_OR_EQUAL);
break;
case GREATER_OR_EQUAL:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.GREATER_OR_EQUAL);
break;
case GREATER_THAN:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.GREATER_THAN);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.QuantityComparator.NULL);
break;
}
}
return tgt;
}
public static org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.QuantityComparator> convertQuantityComparator(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.QuantityComparator> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.QuantityComparator> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.QuantityComparatorEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.NULL);
} else {
switch (src.getValue()) {
case LESS_THAN:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.LESS_THAN);
break;
case LESS_OR_EQUAL:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.LESS_OR_EQUAL);
break;
case GREATER_OR_EQUAL:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.GREATER_OR_EQUAL);
break;
case GREATER_THAN:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.GREATER_THAN);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.QuantityComparator.NULL);
break;
}
}
return tgt;
}
public static void copyQuantity(org.hl7.fhir.r4b.model.Quantity src, org.hl7.fhir.r5.model.Quantity tgt) throws FHIRException {
if (src == null || tgt == null) return;
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasValue()) tgt.setValue(src.getValue());
if (src.hasComparator()) tgt.setComparatorElement(convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnit()) tgt.setUnit(src.getUnit());
if (src.hasSystem()) tgt.setSystem(src.getSystem());
if (src.hasCode()) tgt.setCode(src.getCode());
}
public static void copyQuantity(org.hl7.fhir.r5.model.Quantity src, org.hl7.fhir.r4b.model.Quantity tgt) throws FHIRException {
if (src == null || tgt == null) return;
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasValue()) tgt.setValue(src.getValue());
if (src.hasComparator()) tgt.setComparatorElement(convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnit()) tgt.setUnit(src.getUnit());
if (src.hasSystem()) tgt.setSystem(src.getSystem());
if (src.hasCode()) tgt.setCode(src.getCode());
}
}

View File

@ -0,0 +1,24 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Range43_50 {
public static org.hl7.fhir.r5.model.Range convertRange(org.hl7.fhir.r4b.model.Range src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Range tgt = new org.hl7.fhir.r5.model.Range();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasLow()) tgt.setLow(SimpleQuantity43_50.convertSimpleQuantity(src.getLow()));
if (src.hasHigh()) tgt.setHigh(SimpleQuantity43_50.convertSimpleQuantity(src.getHigh()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Range convertRange(org.hl7.fhir.r5.model.Range src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Range tgt = new org.hl7.fhir.r4b.model.Range();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasLow()) tgt.setLow(SimpleQuantity43_50.convertSimpleQuantity(src.getLow()));
if (src.hasHigh()) tgt.setHigh(SimpleQuantity43_50.convertSimpleQuantity(src.getHigh()));
return tgt;
}
}

View File

@ -0,0 +1,24 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Ratio43_50 {
public static org.hl7.fhir.r5.model.Ratio convertRatio(org.hl7.fhir.r4b.model.Ratio src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Ratio tgt = new org.hl7.fhir.r5.model.Ratio();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasNumerator()) tgt.setNumerator(Quantity43_50.convertQuantity(src.getNumerator()));
if (src.hasDenominator()) tgt.setDenominator(Quantity43_50.convertQuantity(src.getDenominator()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Ratio convertRatio(org.hl7.fhir.r5.model.Ratio src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Ratio tgt = new org.hl7.fhir.r4b.model.Ratio();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasNumerator()) tgt.setNumerator(Quantity43_50.convertQuantity(src.getNumerator()));
if (src.hasDenominator()) tgt.setDenominator(Quantity43_50.convertQuantity(src.getDenominator()));
return tgt;
}
}

View File

@ -0,0 +1,37 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Decimal43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.PositiveInt43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class SampledData43_50 {
public static org.hl7.fhir.r5.model.SampledData convertSampledData(org.hl7.fhir.r4b.model.SampledData src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.SampledData tgt = new org.hl7.fhir.r5.model.SampledData();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasOrigin()) tgt.setOrigin(SimpleQuantity43_50.convertSimpleQuantity(src.getOrigin()));
if (src.hasPeriod()) tgt.setPeriodElement(Decimal43_50.convertDecimal(src.getPeriodElement()));
if (src.hasFactor()) tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasLowerLimit()) tgt.setLowerLimitElement(Decimal43_50.convertDecimal(src.getLowerLimitElement()));
if (src.hasUpperLimit()) tgt.setUpperLimitElement(Decimal43_50.convertDecimal(src.getUpperLimitElement()));
if (src.hasDimensions()) tgt.setDimensionsElement(PositiveInt43_50.convertPositiveInt(src.getDimensionsElement()));
if (src.hasData()) tgt.setDataElement(String43_50.convertString(src.getDataElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.SampledData convertSampledData(org.hl7.fhir.r5.model.SampledData src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.SampledData tgt = new org.hl7.fhir.r4b.model.SampledData();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasOrigin()) tgt.setOrigin(SimpleQuantity43_50.convertSimpleQuantity(src.getOrigin()));
if (src.hasPeriod()) tgt.setPeriodElement(Decimal43_50.convertDecimal(src.getPeriodElement()));
if (src.hasFactor()) tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasLowerLimit()) tgt.setLowerLimitElement(Decimal43_50.convertDecimal(src.getLowerLimitElement()));
if (src.hasUpperLimit()) tgt.setUpperLimitElement(Decimal43_50.convertDecimal(src.getUpperLimitElement()));
if (src.hasDimensions()) tgt.setDimensionsElement(PositiveInt43_50.convertPositiveInt(src.getDimensionsElement()));
if (src.hasData()) tgt.setDataElement(String43_50.convertString(src.getDataElement()));
return tgt;
}
}

View File

@ -0,0 +1,38 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Base64Binary43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Signature43_50 {
public static org.hl7.fhir.r5.model.Signature convertSignature(org.hl7.fhir.r4b.model.Signature src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Signature tgt = new org.hl7.fhir.r5.model.Signature();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
for (org.hl7.fhir.r4b.model.Coding t : src.getType()) tgt.addType(Coding43_50.convertCoding(t));
if (src.hasWhen()) tgt.setWhenElement(Instant43_50.convertInstant(src.getWhenElement()));
if (src.hasWho()) tgt.setWho(Reference43_50.convertReference(src.getWho()));
if (src.hasOnBehalfOf()) tgt.setOnBehalfOf(Reference43_50.convertReference(src.getOnBehalfOf()));
if (src.hasTargetFormat()) tgt.setTargetFormatElement(Code43_50.convertCode(src.getTargetFormatElement()));
if (src.hasSigFormat()) tgt.setSigFormatElement(Code43_50.convertCode(src.getSigFormatElement()));
if (src.hasData()) tgt.setDataElement(Base64Binary43_50.convertBase64Binary(src.getDataElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Signature convertSignature(org.hl7.fhir.r5.model.Signature src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Signature tgt = new org.hl7.fhir.r4b.model.Signature();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
for (org.hl7.fhir.r5.model.Coding t : src.getType()) tgt.addType(Coding43_50.convertCoding(t));
if (src.hasWhen()) tgt.setWhenElement(Instant43_50.convertInstant(src.getWhenElement()));
if (src.hasWho()) tgt.setWho(Reference43_50.convertReference(src.getWho()));
if (src.hasOnBehalfOf()) tgt.setOnBehalfOf(Reference43_50.convertReference(src.getOnBehalfOf()));
if (src.hasTargetFormat()) tgt.setTargetFormatElement(Code43_50.convertCode(src.getTargetFormatElement()));
if (src.hasSigFormat()) tgt.setSigFormatElement(Code43_50.convertCode(src.getSigFormatElement()));
if (src.hasData()) tgt.setDataElement(Base64Binary43_50.convertBase64Binary(src.getDataElement()));
return tgt;
}
}

View File

@ -0,0 +1,13 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class SimpleQuantity43_50 {
public static org.hl7.fhir.r5.model.Quantity convertSimpleQuantity(org.hl7.fhir.r4b.model.Quantity src) throws FHIRException {
return Quantity43_50.convertQuantity(src);
}
public static org.hl7.fhir.r4b.model.Quantity convertSimpleQuantity(org.hl7.fhir.r5.model.Quantity src) throws FHIRException {
return Quantity43_50.convertQuantity(src);
}
}

View File

@ -0,0 +1,417 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneElement43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneType43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.stream.Collectors;
public class Timing43_50 {
public static org.hl7.fhir.r4b.model.Timing convertTiming(org.hl7.fhir.r5.model.Timing src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Timing tgt = new org.hl7.fhir.r4b.model.Timing();
BackboneType43_50.copyBackboneType(src, tgt);
for (org.hl7.fhir.r5.model.DateTimeType t : src.getEvent()) tgt.getEvent().add(DateTime43_50.convertDateTime(t));
if (src.hasRepeat()) tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat()));
if (src.hasCode()) tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
return tgt;
}
public static org.hl7.fhir.r5.model.Timing convertTiming(org.hl7.fhir.r4b.model.Timing src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Timing tgt = new org.hl7.fhir.r5.model.Timing();
BackboneElement43_50.copyBackboneElement(src, tgt);
for (org.hl7.fhir.r4b.model.DateTimeType t : src.getEvent()) tgt.getEvent().add(DateTime43_50.convertDateTime(t));
if (src.hasRepeat()) tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat()));
if (src.hasCode()) tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
return tgt;
}
public static org.hl7.fhir.r5.model.Timing.TimingRepeatComponent convertTimingRepeatComponent(org.hl7.fhir.r4b.model.Timing.TimingRepeatComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Timing.TimingRepeatComponent tgt = new org.hl7.fhir.r5.model.Timing.TimingRepeatComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasBounds())
tgt.setBounds(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getBounds()));
if (src.hasCount()) tgt.setCountElement(PositiveInt43_50.convertPositiveInt(src.getCountElement()));
if (src.hasCountMax()) tgt.setCountMaxElement(PositiveInt43_50.convertPositiveInt(src.getCountMaxElement()));
if (src.hasDuration()) tgt.setDurationElement(Decimal43_50.convertDecimal(src.getDurationElement()));
if (src.hasDurationMax()) tgt.setDurationMaxElement(Decimal43_50.convertDecimal(src.getDurationMaxElement()));
if (src.hasDurationUnit()) tgt.setDurationUnitElement(convertUnitsOfTime(src.getDurationUnitElement()));
if (src.hasFrequency()) tgt.setFrequencyElement(PositiveInt43_50.convertPositiveInt(src.getFrequencyElement()));
if (src.hasFrequencyMax())
tgt.setFrequencyMaxElement(PositiveInt43_50.convertPositiveInt(src.getFrequencyMaxElement()));
if (src.hasPeriod()) tgt.setPeriodElement(Decimal43_50.convertDecimal(src.getPeriodElement()));
if (src.hasPeriodMax()) tgt.setPeriodMaxElement(Decimal43_50.convertDecimal(src.getPeriodMaxElement()));
if (src.hasPeriodUnit()) tgt.setPeriodUnitElement(convertUnitsOfTime(src.getPeriodUnitElement()));
tgt.setDayOfWeek(src.getDayOfWeek().stream().map(Timing43_50::convertDayOfWeek).collect(Collectors.toList()));
if (src.hasWhen())
tgt.setWhen(src.getWhen().stream().map(Timing43_50::convertEventTiming).collect(Collectors.toList()));
for (org.hl7.fhir.r4b.model.TimeType t : src.getTimeOfDay()) tgt.getTimeOfDay().add(Time43_50.convertTime(t));
if (src.hasOffset()) tgt.setOffsetElement(UnsignedInt43_50.convertUnsignedInt(src.getOffsetElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Timing.TimingRepeatComponent convertTimingRepeatComponent(org.hl7.fhir.r5.model.Timing.TimingRepeatComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Timing.TimingRepeatComponent tgt = new org.hl7.fhir.r4b.model.Timing.TimingRepeatComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasBounds())
tgt.setBounds(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getBounds()));
if (src.hasCount()) tgt.setCountElement(PositiveInt43_50.convertPositiveInt(src.getCountElement()));
if (src.hasCountMax()) tgt.setCountMaxElement(PositiveInt43_50.convertPositiveInt(src.getCountMaxElement()));
if (src.hasDuration()) tgt.setDurationElement(Decimal43_50.convertDecimal(src.getDurationElement()));
if (src.hasDurationMax()) tgt.setDurationMaxElement(Decimal43_50.convertDecimal(src.getDurationMaxElement()));
if (src.hasDurationUnit()) tgt.setDurationUnitElement(convertUnitsOfTime(src.getDurationUnitElement()));
if (src.hasFrequency()) tgt.setFrequencyElement(PositiveInt43_50.convertPositiveInt(src.getFrequencyElement()));
if (src.hasFrequencyMax())
tgt.setFrequencyMaxElement(PositiveInt43_50.convertPositiveInt(src.getFrequencyMaxElement()));
if (src.hasPeriod()) tgt.setPeriodElement(Decimal43_50.convertDecimal(src.getPeriodElement()));
if (src.hasPeriodMax()) tgt.setPeriodMaxElement(Decimal43_50.convertDecimal(src.getPeriodMaxElement()));
if (src.hasPeriodUnit()) tgt.setPeriodUnitElement(convertUnitsOfTime(src.getPeriodUnitElement()));
tgt.setDayOfWeek(src.getDayOfWeek().stream().map(Timing43_50::convertDayOfWeek).collect(Collectors.toList()));
if (src.hasWhen())
tgt.setWhen(src.getWhen().stream().map(Timing43_50::convertEventTiming).collect(Collectors.toList()));
for (org.hl7.fhir.r5.model.TimeType t : src.getTimeOfDay()) tgt.getTimeOfDay().add(Time43_50.convertTime(t));
if (src.hasOffset()) tgt.setOffsetElement(UnsignedInt43_50.convertUnsignedInt(src.getOffsetElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Timing.UnitsOfTime> convertUnitsOfTime(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Timing.UnitsOfTime> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Timing.UnitsOfTime> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Timing.UnitsOfTimeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.NULL);
} else {
switch (src.getValue()) {
case S:
tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.S);
break;
case MIN:
tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.MIN);
break;
case H:
tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.H);
break;
case D:
tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.D);
break;
case WK:
tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.WK);
break;
case MO:
tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.MO);
break;
case A:
tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.A);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Timing.UnitsOfTime.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Timing.UnitsOfTime> convertUnitsOfTime(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Timing.UnitsOfTime> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Timing.UnitsOfTime> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Timing.UnitsOfTimeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.NULL);
} else {
switch (src.getValue()) {
case S:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.S);
break;
case MIN:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.MIN);
break;
case H:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.H);
break;
case D:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.D);
break;
case WK:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.WK);
break;
case MO:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.MO);
break;
case A:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.A);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.UnitsOfTime.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DaysOfWeek> convertDayOfWeek(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DaysOfWeek> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DaysOfWeekEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL);
} else {
switch (src.getValue()) {
case MON:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.MON);
break;
case TUE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.TUE);
break;
case WED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.WED);
break;
case THU:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.THU);
break;
case FRI:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.FRI);
break;
case SAT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SAT);
break;
case SUN:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.SUN);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DaysOfWeek.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek> convertDayOfWeek(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DaysOfWeek> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DaysOfWeekEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.NULL);
} else {
switch (src.getValue()) {
case MON:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.MON);
break;
case TUE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.TUE);
break;
case WED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.WED);
break;
case THU:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.THU);
break;
case FRI:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.FRI);
break;
case SAT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.SAT);
break;
case SUN:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.SUN);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DaysOfWeek.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Timing.EventTiming> convertEventTiming(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Timing.EventTiming> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Timing.EventTiming> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Timing.EventTimingEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NULL);
} else {
switch (src.getValue()) {
case MORN:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.MORN);
break;
case MORN_EARLY:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.MORN_EARLY);
break;
case MORN_LATE:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.MORN_LATE);
break;
case NOON:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NOON);
break;
case AFT:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AFT);
break;
case AFT_EARLY:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AFT_EARLY);
break;
case AFT_LATE:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AFT_LATE);
break;
case EVE:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.EVE);
break;
case EVE_EARLY:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.EVE_EARLY);
break;
case EVE_LATE:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.EVE_LATE);
break;
case NIGHT:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NIGHT);
break;
case PHS:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PHS);
break;
case HS:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.HS);
break;
case WAKE:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.WAKE);
break;
case C:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.C);
break;
case CM:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CM);
break;
case CD:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CD);
break;
case CV:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.CV);
break;
case AC:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.AC);
break;
case ACM:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACM);
break;
case ACD:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACD);
break;
case ACV:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.ACV);
break;
case PC:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PC);
break;
case PCM:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCM);
break;
case PCD:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCD);
break;
case PCV:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.PCV);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Timing.EventTiming.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Timing.EventTiming> convertEventTiming(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Timing.EventTiming> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Timing.EventTiming> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Timing.EventTimingEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.NULL);
} else {
switch (src.getValue()) {
case MORN:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.MORN);
break;
case MORN_EARLY:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.MORN_EARLY);
break;
case MORN_LATE:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.MORN_LATE);
break;
case NOON:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.NOON);
break;
case AFT:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.AFT);
break;
case AFT_EARLY:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.AFT_EARLY);
break;
case AFT_LATE:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.AFT_LATE);
break;
case EVE:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.EVE);
break;
case EVE_EARLY:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.EVE_EARLY);
break;
case EVE_LATE:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.EVE_LATE);
break;
case NIGHT:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.NIGHT);
break;
case PHS:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PHS);
break;
case HS:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.HS);
break;
case WAKE:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.WAKE);
break;
case C:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.C);
break;
case CM:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.CM);
break;
case CD:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.CD);
break;
case CV:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.CV);
break;
case AC:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.AC);
break;
case ACM:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.ACM);
break;
case ACD:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.ACD);
break;
case ACV:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.ACV);
break;
case PC:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PC);
break;
case PCM:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PCM);
break;
case PCD:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PCD);
break;
case PCV:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.PCV);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Timing.EventTiming.NULL);
break;
}
}
return tgt;
}
}

View File

@ -0,0 +1,28 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.ContactPoint43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class ContactDetail43_50 {
public static org.hl7.fhir.r5.model.ContactDetail convertContactDetail(org.hl7.fhir.r4b.model.ContactDetail src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.ContactDetail tgt = new org.hl7.fhir.r5.model.ContactDetail();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasName()) tgt.setNameElement(String43_50.convertString(src.getNameElement()));
for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(ContactPoint43_50.convertContactPoint(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ContactDetail convertContactDetail(org.hl7.fhir.r5.model.ContactDetail src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.ContactDetail tgt = new org.hl7.fhir.r4b.model.ContactDetail();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasName()) tgt.setNameElement(String43_50.convertString(src.getNameElement()));
for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(ContactPoint43_50.convertContactPoint(t));
return tgt;
}
}

View File

@ -0,0 +1,85 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Contributor43_50 {
public static org.hl7.fhir.r5.model.Contributor convertContributor(org.hl7.fhir.r4b.model.Contributor src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Contributor tgt = new org.hl7.fhir.r5.model.Contributor();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasType()) tgt.setTypeElement(convertContributorType(src.getTypeElement()));
if (src.hasName()) tgt.setNameElement(String43_50.convertString(src.getNameElement()));
for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact())
tgt.addContact(ContactDetail43_50.convertContactDetail(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contributor convertContributor(org.hl7.fhir.r5.model.Contributor src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Contributor tgt = new org.hl7.fhir.r4b.model.Contributor();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasType()) tgt.setTypeElement(convertContributorType(src.getTypeElement()));
if (src.hasName()) tgt.setNameElement(String43_50.convertString(src.getNameElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(ContactDetail43_50.convertContactDetail(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Contributor.ContributorType> convertContributorType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Contributor.ContributorType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Contributor.ContributorType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Contributor.ContributorTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.NULL);
} else {
switch (src.getValue()) {
case AUTHOR:
tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.AUTHOR);
break;
case EDITOR:
tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.EDITOR);
break;
case REVIEWER:
tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.REVIEWER);
break;
case ENDORSER:
tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.ENDORSER);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Contributor.ContributorType.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Contributor.ContributorType> convertContributorType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Contributor.ContributorType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Contributor.ContributorType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Contributor.ContributorTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.NULL);
} else {
switch (src.getValue()) {
case AUTHOR:
tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.AUTHOR);
break;
case EDITOR:
tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.EDITOR);
break;
case REVIEWER:
tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.REVIEWER);
break;
case ENDORSER:
tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.ENDORSER);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Contributor.ContributorType.NULL);
break;
}
}
return tgt;
}
}

View File

@ -0,0 +1,181 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.PositiveInt43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class DataRequirement43_50 {
public static org.hl7.fhir.r5.model.DataRequirement convertDataRequirement(org.hl7.fhir.r4b.model.DataRequirement src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.DataRequirement tgt = new org.hl7.fhir.r5.model.DataRequirement();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasType())
tgt.setType(org.hl7.fhir.r5.model.Enumerations.FHIRAllTypes.fromCode(convertResourceName4to5(src.getType().toCode())));
for (org.hl7.fhir.r4b.model.CanonicalType t : src.getProfile())
tgt.getProfile().add(Canonical43_50.convertCanonical(t));
if (src.hasSubject())
tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject()));
for (org.hl7.fhir.r4b.model.StringType t : src.getMustSupport())
tgt.getMustSupport().add(String43_50.convertString(t));
for (org.hl7.fhir.r4b.model.DataRequirement.DataRequirementCodeFilterComponent t : src.getCodeFilter())
tgt.addCodeFilter(convertDataRequirementCodeFilterComponent(t));
for (org.hl7.fhir.r4b.model.DataRequirement.DataRequirementDateFilterComponent t : src.getDateFilter())
tgt.addDateFilter(convertDataRequirementDateFilterComponent(t));
if (src.hasLimit()) tgt.setLimitElement(PositiveInt43_50.convertPositiveInt(src.getLimitElement()));
for (org.hl7.fhir.r4b.model.DataRequirement.DataRequirementSortComponent t : src.getSort())
tgt.addSort(convertDataRequirementSortComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.DataRequirement convertDataRequirement(org.hl7.fhir.r5.model.DataRequirement src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.DataRequirement tgt = new org.hl7.fhir.r4b.model.DataRequirement();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasType()) tgt.getTypeElement().setValueAsString(convertResourceName5to4(src.getType().toCode()));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getProfile())
tgt.getProfile().add(Canonical43_50.convertCanonical(t));
if (src.hasSubject())
tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject()));
for (org.hl7.fhir.r5.model.StringType t : src.getMustSupport())
tgt.getMustSupport().add(String43_50.convertString(t));
for (org.hl7.fhir.r5.model.DataRequirement.DataRequirementCodeFilterComponent t : src.getCodeFilter())
tgt.addCodeFilter(convertDataRequirementCodeFilterComponent(t));
for (org.hl7.fhir.r5.model.DataRequirement.DataRequirementDateFilterComponent t : src.getDateFilter())
tgt.addDateFilter(convertDataRequirementDateFilterComponent(t));
if (src.hasLimit()) tgt.setLimitElement(PositiveInt43_50.convertPositiveInt(src.getLimitElement()));
for (org.hl7.fhir.r5.model.DataRequirement.DataRequirementSortComponent t : src.getSort())
tgt.addSort(convertDataRequirementSortComponent(t));
return tgt;
}
private static String convertResourceName4to5(String name) {
if (name == null) return null;
if (name.equals("MedicationStatement")) {
return "MedicationUsage";
}
if (name.equals("DeviceUseStatement")) {
return "DeviceUsage";
}
return name;
}
private static String convertResourceName5to4(String name) {
if (name == null) return null;
if (name.equals("MedicationUsage")) {
return "MedicationStatement";
}
if (name.equals("DeviceUsage")) {
return "DeviceUseStatement";
}
return name;
}
public static org.hl7.fhir.r5.model.DataRequirement.DataRequirementCodeFilterComponent convertDataRequirementCodeFilterComponent(org.hl7.fhir.r4b.model.DataRequirement.DataRequirementCodeFilterComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.DataRequirement.DataRequirementCodeFilterComponent tgt = new org.hl7.fhir.r5.model.DataRequirement.DataRequirementCodeFilterComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement()));
if (src.hasSearchParam()) tgt.setSearchParamElement(String43_50.convertString(src.getSearchParamElement()));
if (src.hasValueSet()) tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement()));
for (org.hl7.fhir.r4b.model.Coding t : src.getCode()) tgt.addCode(Coding43_50.convertCoding(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.DataRequirement.DataRequirementCodeFilterComponent convertDataRequirementCodeFilterComponent(org.hl7.fhir.r5.model.DataRequirement.DataRequirementCodeFilterComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.DataRequirement.DataRequirementCodeFilterComponent tgt = new org.hl7.fhir.r4b.model.DataRequirement.DataRequirementCodeFilterComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement()));
if (src.hasSearchParam()) tgt.setSearchParamElement(String43_50.convertString(src.getSearchParamElement()));
if (src.hasValueSet()) tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement()));
for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addCode(Coding43_50.convertCoding(t));
return tgt;
}
public static org.hl7.fhir.r5.model.DataRequirement.DataRequirementDateFilterComponent convertDataRequirementDateFilterComponent(org.hl7.fhir.r4b.model.DataRequirement.DataRequirementDateFilterComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.DataRequirement.DataRequirementDateFilterComponent tgt = new org.hl7.fhir.r5.model.DataRequirement.DataRequirementDateFilterComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement()));
if (src.hasSearchParam()) tgt.setSearchParamElement(String43_50.convertString(src.getSearchParamElement()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4b.model.DataRequirement.DataRequirementDateFilterComponent convertDataRequirementDateFilterComponent(org.hl7.fhir.r5.model.DataRequirement.DataRequirementDateFilterComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.DataRequirement.DataRequirementDateFilterComponent tgt = new org.hl7.fhir.r4b.model.DataRequirement.DataRequirementDateFilterComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement()));
if (src.hasSearchParam()) tgt.setSearchParamElement(String43_50.convertString(src.getSearchParamElement()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r5.model.DataRequirement.DataRequirementSortComponent convertDataRequirementSortComponent(org.hl7.fhir.r4b.model.DataRequirement.DataRequirementSortComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.DataRequirement.DataRequirementSortComponent tgt = new org.hl7.fhir.r5.model.DataRequirement.DataRequirementSortComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement()));
if (src.hasDirection()) tgt.setDirectionElement(convertSortDirection(src.getDirectionElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.DataRequirement.DataRequirementSortComponent convertDataRequirementSortComponent(org.hl7.fhir.r5.model.DataRequirement.DataRequirementSortComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.DataRequirement.DataRequirementSortComponent tgt = new org.hl7.fhir.r4b.model.DataRequirement.DataRequirementSortComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement()));
if (src.hasDirection()) tgt.setDirectionElement(convertSortDirection(src.getDirectionElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DataRequirement.SortDirection> convertSortDirection(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DataRequirement.SortDirection> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DataRequirement.SortDirection> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DataRequirement.SortDirectionEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.DataRequirement.SortDirection.NULL);
} else {
switch (src.getValue()) {
case ASCENDING:
tgt.setValue(org.hl7.fhir.r5.model.DataRequirement.SortDirection.ASCENDING);
break;
case DESCENDING:
tgt.setValue(org.hl7.fhir.r5.model.DataRequirement.SortDirection.DESCENDING);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.DataRequirement.SortDirection.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DataRequirement.SortDirection> convertSortDirection(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DataRequirement.SortDirection> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DataRequirement.SortDirection> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DataRequirement.SortDirectionEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.DataRequirement.SortDirection.NULL);
} else {
switch (src.getValue()) {
case ASCENDING:
tgt.setValue(org.hl7.fhir.r4b.model.DataRequirement.SortDirection.ASCENDING);
break;
case DESCENDING:
tgt.setValue(org.hl7.fhir.r4b.model.DataRequirement.SortDirection.DESCENDING);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.DataRequirement.SortDirection.NULL);
break;
}
}
return tgt;
}
}

View File

@ -0,0 +1,34 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Id43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Expression43_50 {
public static org.hl7.fhir.r5.model.Expression convertExpression(org.hl7.fhir.r4b.model.Expression src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Expression tgt = new org.hl7.fhir.r5.model.Expression();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasDescription()) tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasName()) tgt.setNameElement(Id43_50.convertId(src.getNameElement()));
if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement()));
if (src.hasExpression()) tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement()));
if (src.hasReference()) tgt.setReferenceElement(Uri43_50.convertUri(src.getReferenceElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Expression convertExpression(org.hl7.fhir.r5.model.Expression src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Expression tgt = new org.hl7.fhir.r4b.model.Expression();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasDescription()) tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasName()) tgt.setNameElement(Id43_50.convertId(src.getNameElement()));
if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement()));
if (src.hasExpression()) tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement()));
if (src.hasReference()) tgt.setReferenceElement(Uri43_50.convertUri(src.getReferenceElement()));
return tgt;
}
}

View File

@ -0,0 +1,82 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Integer43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class ParameterDefinition43_50 {
public static org.hl7.fhir.r5.model.ParameterDefinition convertParameterDefinition(org.hl7.fhir.r4b.model.ParameterDefinition src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.ParameterDefinition tgt = new org.hl7.fhir.r5.model.ParameterDefinition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasName()) tgt.setNameElement(Code43_50.convertCode(src.getNameElement()));
if (src.hasUse()) tgt.setUseElement(convertParameterUse(src.getUseElement()));
if (src.hasMin()) tgt.setMinElement(Integer43_50.convertInteger(src.getMinElement()));
if (src.hasMax()) tgt.setMaxElement(String43_50.convertString(src.getMaxElement()));
if (src.hasDocumentation()) tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement()));
if (src.hasType()) tgt.setType(org.hl7.fhir.r5.model.Enumerations.FHIRAllTypes.fromCode(src.getType().toCode()));
if (src.hasProfile()) tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ParameterDefinition convertParameterDefinition(org.hl7.fhir.r5.model.ParameterDefinition src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.ParameterDefinition tgt = new org.hl7.fhir.r4b.model.ParameterDefinition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasName()) tgt.setNameElement(Code43_50.convertCode(src.getNameElement()));
if (src.hasUse()) tgt.setUseElement(convertParameterUse(src.getUseElement()));
if (src.hasMin()) tgt.setMinElement(Integer43_50.convertInteger(src.getMinElement()));
if (src.hasMax()) tgt.setMaxElement(String43_50.convertString(src.getMaxElement()));
if (src.hasDocumentation()) tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement()));
if (src.hasType()) tgt.getTypeElement().setValueAsString(src.getType().toCode());
if (src.hasProfile()) tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.OperationParameterUse> convertParameterUse(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.OperationParameterUse> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.OperationParameterUseEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL);
} else {
switch (src.getValue()) {
case IN:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.IN);
break;
case OUT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.OUT);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.OperationParameterUse.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse> convertParameterUse(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.OperationParameterUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.OperationParameterUseEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.NULL);
} else {
switch (src.getValue()) {
case IN:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.IN);
break;
case OUT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.OUT);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.OperationParameterUse.NULL);
break;
}
}
return tgt;
}
}

View File

@ -0,0 +1,119 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Attachment43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.MarkDown43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Url43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class RelatedArtifact43_50 {
public static org.hl7.fhir.r5.model.RelatedArtifact convertRelatedArtifact(org.hl7.fhir.r4b.model.RelatedArtifact src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.RelatedArtifact tgt = new org.hl7.fhir.r5.model.RelatedArtifact();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasType()) tgt.setTypeElement(convertRelatedArtifactType(src.getTypeElement()));
if (src.hasLabel()) tgt.setLabelElement(String43_50.convertString(src.getLabelElement()));
if (src.hasDisplay()) tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
if (src.hasCitation()) tgt.setCitationElement(MarkDown43_50.convertMarkdown(src.getCitationElement()));
if (src.hasUrl()) tgt.getDocument().setUrlElement(Url43_50.convertUrl(src.getUrlElement()));
if (src.hasDocument()) tgt.setDocument(Attachment43_50.convertAttachment(src.getDocument()));
if (src.hasResource()) tgt.setResourceElement(Canonical43_50.convertCanonical(src.getResourceElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.RelatedArtifact convertRelatedArtifact(org.hl7.fhir.r5.model.RelatedArtifact src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.RelatedArtifact tgt = new org.hl7.fhir.r4b.model.RelatedArtifact();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasType()) tgt.setTypeElement(convertRelatedArtifactType(src.getTypeElement()));
if (src.hasLabel()) tgt.setLabelElement(String43_50.convertString(src.getLabelElement()));
if (src.hasDisplay()) tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
if (src.hasCitation()) tgt.setCitationElement(MarkDown43_50.convertMarkdown(src.getCitationElement()));
if (src.getDocument().hasUrl()) tgt.setUrlElement(Url43_50.convertUrl(src.getDocument().getUrlElement()));
if (src.hasDocument()) tgt.setDocument(Attachment43_50.convertAttachment(src.getDocument()));
if (src.hasResource()) tgt.setResourceElement(Canonical43_50.convertCanonical(src.getResourceElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType> convertRelatedArtifactType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.NULL);
} else {
switch (src.getValue()) {
case DOCUMENTATION:
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.DOCUMENTATION);
break;
case JUSTIFICATION:
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.JUSTIFICATION);
break;
case CITATION:
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.CITATION);
break;
case PREDECESSOR:
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.PREDECESSOR);
break;
case SUCCESSOR:
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.SUCCESSOR);
break;
case DERIVEDFROM:
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.DERIVEDFROM);
break;
case DEPENDSON:
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.DEPENDSON);
break;
case COMPOSEDOF:
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.COMPOSEDOF);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType> convertRelatedArtifactType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.NULL);
} else {
switch (src.getValue()) {
case DOCUMENTATION:
tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.DOCUMENTATION);
break;
case JUSTIFICATION:
tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.JUSTIFICATION);
break;
case CITATION:
tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.CITATION);
break;
case PREDECESSOR:
tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.PREDECESSOR);
break;
case SUCCESSOR:
tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.SUCCESSOR);
break;
case DERIVEDFROM:
tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.DERIVEDFROM);
break;
case DEPENDSON:
tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.DEPENDSON);
break;
case COMPOSEDOF:
tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.COMPOSEDOF);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.RelatedArtifact.RelatedArtifactType.NULL);
break;
}
}
return tgt;
}
}

View File

@ -0,0 +1,115 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class TriggerDefinition43_50 {
public static org.hl7.fhir.r5.model.TriggerDefinition convertTriggerDefinition(org.hl7.fhir.r4b.model.TriggerDefinition src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.TriggerDefinition tgt = new org.hl7.fhir.r5.model.TriggerDefinition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasType()) tgt.setTypeElement(convertTriggerType(src.getTypeElement()));
if (src.hasName()) tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasTiming())
tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming()));
for (org.hl7.fhir.r4b.model.DataRequirement t : src.getData())
tgt.addData(DataRequirement43_50.convertDataRequirement(t));
if (src.hasCondition()) tgt.setCondition(Expression43_50.convertExpression(src.getCondition()));
return tgt;
}
public static org.hl7.fhir.r4b.model.TriggerDefinition convertTriggerDefinition(org.hl7.fhir.r5.model.TriggerDefinition src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.TriggerDefinition tgt = new org.hl7.fhir.r4b.model.TriggerDefinition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasType()) tgt.setTypeElement(convertTriggerType(src.getTypeElement()));
if (src.hasName()) tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasTiming())
tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming()));
for (org.hl7.fhir.r5.model.DataRequirement t : src.getData())
tgt.addData(DataRequirement43_50.convertDataRequirement(t));
if (src.hasCondition()) tgt.setCondition(Expression43_50.convertExpression(src.getCondition()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TriggerDefinition.TriggerType> convertTriggerType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TriggerDefinition.TriggerType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.TriggerDefinition.TriggerTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.NULL);
} else {
switch (src.getValue()) {
case NAMEDEVENT:
tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.NAMEDEVENT);
break;
case PERIODIC:
tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.PERIODIC);
break;
case DATACHANGED:
tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATACHANGED);
break;
case DATAADDED:
tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAADDED);
break;
case DATAMODIFIED:
tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAMODIFIED);
break;
case DATAREMOVED:
tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAREMOVED);
break;
case DATAACCESSED:
tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAACCESSED);
break;
case DATAACCESSENDED:
tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.DATAACCESSENDED);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.TriggerDefinition.TriggerType.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType> convertTriggerType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.TriggerDefinition.TriggerType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.TriggerDefinition.TriggerTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.NULL);
} else {
switch (src.getValue()) {
case NAMEDEVENT:
tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.NAMEDEVENT);
break;
case PERIODIC:
tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.PERIODIC);
break;
case DATACHANGED:
tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATACHANGED);
break;
case DATAADDED:
tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAADDED);
break;
case DATAMODIFIED:
tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAMODIFIED);
break;
case DATAREMOVED:
tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAREMOVED);
break;
case DATAACCESSED:
tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAACCESSED);
break;
case DATAACCESSENDED:
tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.DATAACCESSENDED);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.TriggerDefinition.TriggerType.NULL);
break;
}
}
return tgt;
}
}

View File

@ -0,0 +1,27 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class UsageContext43_50 {
public static org.hl7.fhir.r5.model.UsageContext convertUsageContext(org.hl7.fhir.r4b.model.UsageContext src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.UsageContext tgt = new org.hl7.fhir.r5.model.UsageContext();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasCode()) tgt.setCode(Coding43_50.convertCoding(src.getCode()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4b.model.UsageContext convertUsageContext(org.hl7.fhir.r5.model.UsageContext src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.UsageContext tgt = new org.hl7.fhir.r4b.model.UsageContext();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasCode()) tgt.setCode(Coding43_50.convertCoding(src.getCode()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
}

View File

@ -0,0 +1,18 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Base64Binary43_50 {
public static org.hl7.fhir.r5.model.Base64BinaryType convertBase64Binary(org.hl7.fhir.r4b.model.Base64BinaryType src) throws FHIRException {
org.hl7.fhir.r5.model.Base64BinaryType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.Base64BinaryType(src.getValue()) : new org.hl7.fhir.r5.model.Base64BinaryType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.Base64BinaryType convertBase64Binary(org.hl7.fhir.r5.model.Base64BinaryType src) throws FHIRException {
org.hl7.fhir.r4b.model.Base64BinaryType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.Base64BinaryType(src.getValue()) : new org.hl7.fhir.r4b.model.Base64BinaryType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,18 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Boolean43_50 {
public static org.hl7.fhir.r5.model.BooleanType convertBoolean(org.hl7.fhir.r4b.model.BooleanType src) throws FHIRException {
org.hl7.fhir.r5.model.BooleanType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.BooleanType(src.getValue()) : new org.hl7.fhir.r5.model.BooleanType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.BooleanType convertBoolean(org.hl7.fhir.r5.model.BooleanType src) throws FHIRException {
org.hl7.fhir.r4b.model.BooleanType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.BooleanType(src.getValue()) : new org.hl7.fhir.r4b.model.BooleanType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,18 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Canonical43_50 {
public static org.hl7.fhir.r5.model.CanonicalType convertCanonical(org.hl7.fhir.r4b.model.CanonicalType src) throws FHIRException {
org.hl7.fhir.r5.model.CanonicalType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.CanonicalType(src.getValueAsString()) : new org.hl7.fhir.r5.model.CanonicalType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.CanonicalType convertCanonical(org.hl7.fhir.r5.model.CanonicalType src) throws FHIRException {
org.hl7.fhir.r4b.model.CanonicalType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.CanonicalType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.CanonicalType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,26 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Code43_50 {
public static org.hl7.fhir.r5.model.CodeType convertCode(org.hl7.fhir.r4b.model.CodeType src) throws FHIRException {
org.hl7.fhir.r5.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.CodeType(src.getValueAsString()) : new org.hl7.fhir.r5.model.CodeType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.CodeType convertCode(org.hl7.fhir.r5.model.CodeType src) throws FHIRException {
org.hl7.fhir.r4b.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.CodeType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.CodeType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r5.model.CodeType convertResourceEnum(org.hl7.fhir.r4b.model.CodeType src) {
return Code43_50.convertCode(src);
}
public static org.hl7.fhir.r4b.model.CodeType convertResourceEnum(org.hl7.fhir.r5.model.CodeType src) {
return Code43_50.convertCode(src);
}
}

View File

@ -0,0 +1,33 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext10_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4b.model.DateType;
import org.hl7.fhir.r5.model.DateTimeType;
public class Date43_50 {
public static org.hl7.fhir.r5.model.DateType convertDate(org.hl7.fhir.r4b.model.DateType src) throws FHIRException {
org.hl7.fhir.r5.model.DateType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DateType(src.getValueAsString()) : new org.hl7.fhir.r5.model.DateType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.DateType convertDate(org.hl7.fhir.r5.model.DateType src) throws FHIRException {
org.hl7.fhir.r4b.model.DateType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.DateType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.DateType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r5.model.DateTimeType convertDatetoDateTime(org.hl7.fhir.r4b.model.DateType src) {
org.hl7.fhir.r5.model.DateTimeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DateTimeType(src.getValueAsString()) : new org.hl7.fhir.r5.model.DateTimeType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.DateType convertDateTimeToDate(org.hl7.fhir.r5.model.DateTimeType src) {
org.hl7.fhir.r4b.model.DateType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.DateType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.DateType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,18 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class DateTime43_50 {
public static org.hl7.fhir.r5.model.DateTimeType convertDateTime(org.hl7.fhir.r4b.model.DateTimeType src) throws FHIRException {
org.hl7.fhir.r5.model.DateTimeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DateTimeType(src.getValueAsString()) : new org.hl7.fhir.r5.model.DateTimeType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.DateTimeType convertDateTime(org.hl7.fhir.r5.model.DateTimeType src) throws FHIRException {
org.hl7.fhir.r4b.model.DateTimeType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.DateTimeType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.DateTimeType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,18 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Decimal43_50 {
public static org.hl7.fhir.r5.model.DecimalType convertDecimal(org.hl7.fhir.r4b.model.DecimalType src) throws FHIRException {
org.hl7.fhir.r5.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.r5.model.DecimalType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.DecimalType convertDecimal(org.hl7.fhir.r5.model.DecimalType src) throws FHIRException {
org.hl7.fhir.r4b.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.DecimalType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,18 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Id43_50 {
public static org.hl7.fhir.r5.model.IdType convertId(org.hl7.fhir.r4b.model.IdType src) throws FHIRException {
org.hl7.fhir.r5.model.IdType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.IdType(src.getValueAsString()) : new org.hl7.fhir.r5.model.IdType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.IdType convertId(org.hl7.fhir.r5.model.IdType src) throws FHIRException {
org.hl7.fhir.r4b.model.IdType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.IdType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.IdType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,18 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Instant43_50 {
public static org.hl7.fhir.r5.model.InstantType convertInstant(org.hl7.fhir.r4b.model.InstantType src) throws FHIRException {
org.hl7.fhir.r5.model.InstantType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.InstantType(src.getValueAsString()) : new org.hl7.fhir.r5.model.InstantType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.InstantType convertInstant(org.hl7.fhir.r5.model.InstantType src) throws FHIRException {
org.hl7.fhir.r4b.model.InstantType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.InstantType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.InstantType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,18 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Integer43_50 {
public static org.hl7.fhir.r5.model.IntegerType convertInteger(org.hl7.fhir.r4b.model.IntegerType src) throws FHIRException {
org.hl7.fhir.r5.model.IntegerType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.IntegerType(src.getValueAsString()) : new org.hl7.fhir.r5.model.IntegerType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.IntegerType convertInteger(org.hl7.fhir.r5.model.IntegerType src) throws FHIRException {
org.hl7.fhir.r4b.model.IntegerType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.IntegerType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.IntegerType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,24 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class MarkDown43_50 {
public static org.hl7.fhir.r5.model.MarkdownType convertMarkdown(org.hl7.fhir.r4b.model.MarkdownType src) throws FHIRException {
org.hl7.fhir.r5.model.MarkdownType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.MarkdownType(src.getValueAsString()) : new org.hl7.fhir.r5.model.MarkdownType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.MarkdownType convertMarkdown(org.hl7.fhir.r5.model.MarkdownType src) throws FHIRException {
org.hl7.fhir.r4b.model.MarkdownType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.MarkdownType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.MarkdownType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r5.model.MarkdownType convertStringToMarkdown(org.hl7.fhir.r4b.model.StringType src) throws FHIRException {
org.hl7.fhir.r5.model.MarkdownType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.MarkdownType(src.getValueAsString()) : new org.hl7.fhir.r5.model.MarkdownType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,18 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Oid43_50 {
public static org.hl7.fhir.r5.model.OidType convertOid(org.hl7.fhir.r4b.model.OidType src) throws FHIRException {
org.hl7.fhir.r5.model.OidType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.OidType(src.getValueAsString()) : new org.hl7.fhir.r5.model.OidType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.OidType convertOid(org.hl7.fhir.r5.model.OidType src) throws FHIRException {
org.hl7.fhir.r4b.model.OidType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.OidType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.OidType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,18 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class PositiveInt43_50 {
public static org.hl7.fhir.r5.model.PositiveIntType convertPositiveInt(org.hl7.fhir.r4b.model.PositiveIntType src) throws FHIRException {
org.hl7.fhir.r5.model.PositiveIntType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.PositiveIntType(src.getValueAsString()) : new org.hl7.fhir.r5.model.PositiveIntType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.PositiveIntType convertPositiveInt(org.hl7.fhir.r5.model.PositiveIntType src) throws FHIRException {
org.hl7.fhir.r4b.model.PositiveIntType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.PositiveIntType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.PositiveIntType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,34 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext30_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class String43_50 {
public static org.hl7.fhir.r5.model.StringType convertString(org.hl7.fhir.r4b.model.StringType src) throws FHIRException {
org.hl7.fhir.r5.model.StringType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.StringType(src.getValueAsString()) : new org.hl7.fhir.r5.model.StringType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.StringType convertString(org.hl7.fhir.r5.model.StringType src) throws FHIRException {
org.hl7.fhir.r4b.model.StringType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.StringType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.StringType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r5.model.MarkdownType convertStringToMarkdown(org.hl7.fhir.r4b.model.StringType src) throws FHIRException {
org.hl7.fhir.r5.model.MarkdownType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.MarkdownType(src.getValueAsString()) : new org.hl7.fhir.r5.model.MarkdownType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.StringType convertMarkdownToString(org.hl7.fhir.r5.model.MarkdownType src) throws FHIRException {
org.hl7.fhir.r4b.model.StringType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.StringType(src.getValue()) : new org.hl7.fhir.r4b.model.StringType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,18 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Time43_50 {
public static org.hl7.fhir.r5.model.TimeType convertTime(org.hl7.fhir.r4b.model.TimeType src) throws FHIRException {
org.hl7.fhir.r5.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.TimeType(src.getValue()) : new org.hl7.fhir.r5.model.TimeType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.TimeType convertTime(org.hl7.fhir.r5.model.TimeType src) throws FHIRException {
org.hl7.fhir.r4b.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.TimeType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,30 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class UnsignedInt43_50 {
public static org.hl7.fhir.r5.model.Integer64Type convertUnsignedIntToInteger64(org.hl7.fhir.r4b.model.UnsignedIntType src) throws FHIRException {
org.hl7.fhir.r5.model.Integer64Type tgt = src.hasValue() ? new org.hl7.fhir.r5.model.Integer64Type(src.getValueAsString()) : new org.hl7.fhir.r5.model.Integer64Type();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.UnsignedIntType convertInteger64ToUnsignedInt(org.hl7.fhir.r5.model.Integer64Type src) throws FHIRException {
org.hl7.fhir.r4b.model.UnsignedIntType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.UnsignedIntType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.UnsignedIntType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r5.model.UnsignedIntType convertUnsignedInt(org.hl7.fhir.r4b.model.UnsignedIntType src) throws FHIRException {
org.hl7.fhir.r5.model.UnsignedIntType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UnsignedIntType(src.getValueAsString()) : new org.hl7.fhir.r5.model.UnsignedIntType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.UnsignedIntType convertUnsignedInt(org.hl7.fhir.r5.model.UnsignedIntType src) throws FHIRException {
org.hl7.fhir.r4b.model.UnsignedIntType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.UnsignedIntType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.UnsignedIntType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,18 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Uri43_50 {
public static org.hl7.fhir.r5.model.UriType convertUri(org.hl7.fhir.r4b.model.UriType src) throws FHIRException {
org.hl7.fhir.r5.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UriType(src.getValueAsString()) : new org.hl7.fhir.r5.model.UriType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.UriType convertUri(org.hl7.fhir.r5.model.UriType src) throws FHIRException {
org.hl7.fhir.r4b.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.UriType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.UriType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,18 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Url43_50 {
public static org.hl7.fhir.r5.model.UrlType convertUrl(org.hl7.fhir.r4b.model.UrlType src) throws FHIRException {
org.hl7.fhir.r5.model.UrlType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UrlType(src.getValueAsString()) : new org.hl7.fhir.r5.model.UrlType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.UrlType convertUrl(org.hl7.fhir.r5.model.UrlType src) throws FHIRException {
org.hl7.fhir.r4b.model.UrlType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.UrlType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.UrlType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,18 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Uuid43_50 {
public static org.hl7.fhir.r5.model.UuidType convertUuid(org.hl7.fhir.r4b.model.UuidType src) throws FHIRException {
org.hl7.fhir.r5.model.UuidType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UuidType(src.getValueAsString()) : new org.hl7.fhir.r5.model.UuidType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r4b.model.UuidType convertUuid(org.hl7.fhir.r5.model.UuidType src) throws FHIRException {
org.hl7.fhir.r4b.model.UuidType tgt = src.hasValue() ? new org.hl7.fhir.r4b.model.UuidType(src.getValueAsString()) : new org.hl7.fhir.r4b.model.UuidType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
}

View File

@ -0,0 +1,95 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneElement43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Ratio43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.SimpleQuantity43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Timing43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Integer43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Dosage43_50 {
public static org.hl7.fhir.r5.model.Dosage convertDosage(org.hl7.fhir.r4b.model.Dosage src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Dosage tgt = new org.hl7.fhir.r5.model.Dosage();
BackboneElement43_50.copyBackboneElement(src, tgt);
if (src.hasSequence()) tgt.setSequenceElement(Integer43_50.convertInteger(src.getSequenceElement()));
if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getAdditionalInstruction())
tgt.addAdditionalInstruction(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPatientInstruction())
tgt.setPatientInstructionElement(String43_50.convertString(src.getPatientInstructionElement()));
if (src.hasTiming()) tgt.setTiming(Timing43_50.convertTiming(src.getTiming()));
if (src.hasAsNeededBooleanType())
tgt.setAsNeededElement(Boolean43_50.convertBoolean(src.getAsNeededBooleanType()));
if (src.hasAsNeededCodeableConcept()) {
tgt.addAsNeededFor(CodeableConcept43_50.convertCodeableConcept(src.getAsNeededCodeableConcept()));
}
if (src.hasSite()) tgt.setSite(CodeableConcept43_50.convertCodeableConcept(src.getSite()));
if (src.hasRoute()) tgt.setRoute(CodeableConcept43_50.convertCodeableConcept(src.getRoute()));
if (src.hasMethod()) tgt.setMethod(CodeableConcept43_50.convertCodeableConcept(src.getMethod()));
for (org.hl7.fhir.r4b.model.Dosage.DosageDoseAndRateComponent t : src.getDoseAndRate())
tgt.addDoseAndRate(convertDosageDoseAndRateComponent(t));
if (src.hasMaxDosePerPeriod()) tgt.addMaxDosePerPeriod(Ratio43_50.convertRatio(src.getMaxDosePerPeriod()));
if (src.hasMaxDosePerAdministration())
tgt.setMaxDosePerAdministration(SimpleQuantity43_50.convertSimpleQuantity(src.getMaxDosePerAdministration()));
if (src.hasMaxDosePerLifetime())
tgt.setMaxDosePerLifetime(SimpleQuantity43_50.convertSimpleQuantity(src.getMaxDosePerLifetime()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Dosage convertDosage(org.hl7.fhir.r5.model.Dosage src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Dosage tgt = new org.hl7.fhir.r4b.model.Dosage();
BackboneElement43_50.copyBackboneElement(src, tgt);
if (src.hasSequence()) tgt.setSequenceElement(Integer43_50.convertInteger(src.getSequenceElement()));
if (src.hasText()) tgt.setTextElement(String43_50.convertString(src.getTextElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAdditionalInstruction())
tgt.addAdditionalInstruction(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPatientInstruction())
tgt.setPatientInstructionElement(String43_50.convertString(src.getPatientInstructionElement()));
if (src.hasTiming()) tgt.setTiming(Timing43_50.convertTiming(src.getTiming()));
if (src.hasAsNeeded())
tgt.setAsNeeded(Boolean43_50.convertBoolean(src.getAsNeededElement()));
if (src.hasAsNeededFor())
tgt.setAsNeeded(CodeableConcept43_50.convertCodeableConcept(src.getAsNeededForFirstRep()));
if (src.hasSite()) tgt.setSite(CodeableConcept43_50.convertCodeableConcept(src.getSite()));
if (src.hasRoute()) tgt.setRoute(CodeableConcept43_50.convertCodeableConcept(src.getRoute()));
if (src.hasMethod()) tgt.setMethod(CodeableConcept43_50.convertCodeableConcept(src.getMethod()));
for (org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent t : src.getDoseAndRate())
tgt.addDoseAndRate(convertDosageDoseAndRateComponent(t));
if (src.hasMaxDosePerPeriod()) tgt.setMaxDosePerPeriod(Ratio43_50.convertRatio(src.getMaxDosePerPeriodFirstRep()));
if (src.hasMaxDosePerAdministration())
tgt.setMaxDosePerAdministration(SimpleQuantity43_50.convertSimpleQuantity(src.getMaxDosePerAdministration()));
if (src.hasMaxDosePerLifetime())
tgt.setMaxDosePerLifetime(SimpleQuantity43_50.convertSimpleQuantity(src.getMaxDosePerLifetime()));
return tgt;
}
public static org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent convertDosageDoseAndRateComponent(org.hl7.fhir.r4b.model.Dosage.DosageDoseAndRateComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent tgt = new org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasType()) tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasDose())
tgt.setDose(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDose()));
if (src.hasRate())
tgt.setRate(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getRate()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Dosage.DosageDoseAndRateComponent convertDosageDoseAndRateComponent(org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Dosage.DosageDoseAndRateComponent tgt = new org.hl7.fhir.r4b.model.Dosage.DosageDoseAndRateComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasType()) tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasDose())
tgt.setDose(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDose()));
if (src.hasRate())
tgt.setRate(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getRate()));
return tgt;
}
}

View File

@ -0,0 +1,618 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.BackboneElement43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.convertors.conv43_50.resources43_50.Enumerations43_50;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.stream.Collectors;
public class ElementDefinition43_50 {
public static org.hl7.fhir.r5.model.ElementDefinition convertElementDefinition(org.hl7.fhir.r4b.model.ElementDefinition src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.ElementDefinition tgt = new org.hl7.fhir.r5.model.ElementDefinition();
BackboneElement43_50.copyBackboneElement(src, tgt);
if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement()));
tgt.setRepresentation(src.getRepresentation().stream().map(ElementDefinition43_50::convertPropertyRepresentation).collect(Collectors.toList()));
if (src.hasSliceName()) tgt.setSliceNameElement(String43_50.convertString(src.getSliceNameElement()));
if (src.hasSliceIsConstraining())
tgt.setSliceIsConstrainingElement(Boolean43_50.convertBoolean(src.getSliceIsConstrainingElement()));
if (src.hasLabel()) tgt.setLabelElement(String43_50.convertString(src.getLabelElement()));
for (org.hl7.fhir.r4b.model.Coding t : src.getCode()) tgt.addCode(Coding43_50.convertCoding(t));
if (src.hasSlicing()) tgt.setSlicing(convertElementDefinitionSlicingComponent(src.getSlicing()));
if (src.hasShort()) tgt.setShortElement(String43_50.convertString(src.getShortElement()));
if (src.hasDefinition()) tgt.setDefinitionElement(MarkDown43_50.convertMarkdown(src.getDefinitionElement()));
if (src.hasComment()) tgt.setCommentElement(MarkDown43_50.convertMarkdown(src.getCommentElement()));
if (src.hasRequirements()) tgt.setRequirementsElement(MarkDown43_50.convertMarkdown(src.getRequirementsElement()));
for (org.hl7.fhir.r4b.model.StringType t : src.getAlias()) tgt.getAlias().add(String43_50.convertString(t));
if (src.hasMin()) tgt.setMinElement(UnsignedInt43_50.convertUnsignedInt(src.getMinElement()));
if (src.hasMax()) tgt.setMaxElement(String43_50.convertString(src.getMaxElement()));
if (src.hasBase()) tgt.setBase(convertElementDefinitionBaseComponent(src.getBase()));
if (src.hasContentReference())
tgt.setContentReferenceElement(Uri43_50.convertUri(src.getContentReferenceElement()));
for (org.hl7.fhir.r4b.model.ElementDefinition.TypeRefComponent t : src.getType())
tgt.addType(convertTypeRefComponent(t));
if (src.hasDefaultValue())
tgt.setDefaultValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDefaultValue()));
if (src.hasMeaningWhenMissing())
tgt.setMeaningWhenMissingElement(MarkDown43_50.convertMarkdown(src.getMeaningWhenMissingElement()));
if (src.hasOrderMeaning()) tgt.setOrderMeaningElement(String43_50.convertString(src.getOrderMeaningElement()));
if (src.hasFixed())
tgt.setFixed(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getFixed()));
if (src.hasPattern())
tgt.setPattern(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getPattern()));
for (org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionExampleComponent t : src.getExample())
tgt.addExample(convertElementDefinitionExampleComponent(t));
if (src.hasMinValue())
tgt.setMinValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMinValue()));
if (src.hasMaxValue())
tgt.setMaxValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMaxValue()));
if (src.hasMaxLength()) tgt.setMaxLengthElement(Integer43_50.convertInteger(src.getMaxLengthElement()));
for (org.hl7.fhir.r4b.model.IdType t : src.getCondition()) tgt.getCondition().add(Id43_50.convertId(t));
for (org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionConstraintComponent t : src.getConstraint())
tgt.addConstraint(convertElementDefinitionConstraintComponent(t));
if (src.hasMustSupport()) tgt.setMustSupportElement(Boolean43_50.convertBoolean(src.getMustSupportElement()));
if (src.hasIsModifier()) tgt.setIsModifierElement(Boolean43_50.convertBoolean(src.getIsModifierElement()));
if (src.hasIsModifierReason())
tgt.setIsModifierReasonElement(String43_50.convertString(src.getIsModifierReasonElement()));
if (src.hasIsSummary()) tgt.setIsSummaryElement(Boolean43_50.convertBoolean(src.getIsSummaryElement()));
if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
for (org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
tgt.addMapping(convertElementDefinitionMappingComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ElementDefinition convertElementDefinition(org.hl7.fhir.r5.model.ElementDefinition src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.ElementDefinition tgt = new org.hl7.fhir.r4b.model.ElementDefinition();
BackboneElement43_50.copyBackboneElement(src, tgt);
if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement()));
tgt.setRepresentation(src.getRepresentation().stream().map(ElementDefinition43_50::convertPropertyRepresentation).collect(Collectors.toList()));
if (src.hasSliceName()) tgt.setSliceNameElement(String43_50.convertString(src.getSliceNameElement()));
if (src.hasSliceIsConstraining())
tgt.setSliceIsConstrainingElement(Boolean43_50.convertBoolean(src.getSliceIsConstrainingElement()));
if (src.hasLabel()) tgt.setLabelElement(String43_50.convertString(src.getLabelElement()));
for (org.hl7.fhir.r5.model.Coding t : src.getCode()) tgt.addCode(Coding43_50.convertCoding(t));
if (src.hasSlicing()) tgt.setSlicing(convertElementDefinitionSlicingComponent(src.getSlicing()));
if (src.hasShort()) tgt.setShortElement(String43_50.convertString(src.getShortElement()));
if (src.hasDefinition()) tgt.setDefinitionElement(MarkDown43_50.convertMarkdown(src.getDefinitionElement()));
if (src.hasComment()) tgt.setCommentElement(MarkDown43_50.convertMarkdown(src.getCommentElement()));
if (src.hasRequirements()) tgt.setRequirementsElement(MarkDown43_50.convertMarkdown(src.getRequirementsElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.getAlias().add(String43_50.convertString(t));
if (src.hasMin()) tgt.setMinElement(UnsignedInt43_50.convertUnsignedInt(src.getMinElement()));
if (src.hasMax()) tgt.setMaxElement(String43_50.convertString(src.getMaxElement()));
if (src.hasBase()) tgt.setBase(convertElementDefinitionBaseComponent(src.getBase()));
if (src.hasContentReference())
tgt.setContentReferenceElement(Uri43_50.convertUri(src.getContentReferenceElement()));
for (org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent t : src.getType())
tgt.addType(convertTypeRefComponent(t));
if (src.hasDefaultValue())
tgt.setDefaultValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDefaultValue()));
if (src.hasMeaningWhenMissing())
tgt.setMeaningWhenMissingElement(MarkDown43_50.convertMarkdown(src.getMeaningWhenMissingElement()));
if (src.hasOrderMeaning()) tgt.setOrderMeaningElement(String43_50.convertString(src.getOrderMeaningElement()));
if (src.hasFixed())
tgt.setFixed(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getFixed()));
if (src.hasPattern())
tgt.setPattern(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getPattern()));
for (org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionExampleComponent t : src.getExample())
tgt.addExample(convertElementDefinitionExampleComponent(t));
if (src.hasMinValue())
tgt.setMinValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMinValue()));
if (src.hasMaxValue())
tgt.setMaxValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getMaxValue()));
if (src.hasMaxLength()) tgt.setMaxLengthElement(Integer43_50.convertInteger(src.getMaxLengthElement()));
for (org.hl7.fhir.r5.model.IdType t : src.getCondition()) tgt.getCondition().add(Id43_50.convertId(t));
for (org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionConstraintComponent t : src.getConstraint())
tgt.addConstraint(convertElementDefinitionConstraintComponent(t));
if (src.hasMustSupport()) tgt.setMustSupportElement(Boolean43_50.convertBoolean(src.getMustSupportElement()));
if (src.hasIsModifier()) tgt.setIsModifierElement(Boolean43_50.convertBoolean(src.getIsModifierElement()));
if (src.hasIsModifierReason())
tgt.setIsModifierReasonElement(String43_50.convertString(src.getIsModifierReasonElement()));
if (src.hasIsSummary()) tgt.setIsSummaryElement(Boolean43_50.convertBoolean(src.getIsSummaryElement()));
if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
for (org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
tgt.addMapping(convertElementDefinitionMappingComponent(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation> convertPropertyRepresentation(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentationEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.NULL);
} else {
switch (src.getValue()) {
case XMLATTR:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XMLATTR);
break;
case XMLTEXT:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XMLTEXT);
break;
case TYPEATTR:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.TYPEATTR);
break;
case CDATEXT:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.CDATEXT);
break;
case XHTML:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.XHTML);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation> convertPropertyRepresentation(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.PropertyRepresentation> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentationEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.NULL);
} else {
switch (src.getValue()) {
case XMLATTR:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.XMLATTR);
break;
case XMLTEXT:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.XMLTEXT);
break;
case TYPEATTR:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.TYPEATTR);
break;
case CDATEXT:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.CDATEXT);
break;
case XHTML:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.XHTML);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.PropertyRepresentation.NULL);
break;
}
}
return tgt;
}
public static org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingComponent convertElementDefinitionSlicingComponent(org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
for (org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent t : src.getDiscriminator())
tgt.addDiscriminator(convertElementDefinitionSlicingDiscriminatorComponent(t));
if (src.hasDescription()) tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasOrdered()) tgt.setOrderedElement(Boolean43_50.convertBoolean(src.getOrderedElement()));
if (src.hasRules()) tgt.setRulesElement(convertSlicingRules(src.getRulesElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingComponent convertElementDefinitionSlicingComponent(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
for (org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent t : src.getDiscriminator())
tgt.addDiscriminator(convertElementDefinitionSlicingDiscriminatorComponent(t));
if (src.hasDescription()) tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasOrdered()) tgt.setOrderedElement(Boolean43_50.convertBoolean(src.getOrderedElement()));
if (src.hasRules()) tgt.setRulesElement(convertSlicingRules(src.getRulesElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.SlicingRules> convertSlicingRules(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.SlicingRules> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.SlicingRulesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.NULL);
} else {
switch (src.getValue()) {
case CLOSED:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.CLOSED);
break;
case OPEN:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.OPEN);
break;
case OPENATEND:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.OPENATEND);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.SlicingRules.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules> convertSlicingRules(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.SlicingRules> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ElementDefinition.SlicingRulesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules.NULL);
} else {
switch (src.getValue()) {
case CLOSED:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules.CLOSED);
break;
case OPEN:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules.OPEN);
break;
case OPENATEND:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules.OPENATEND);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.SlicingRules.NULL);
break;
}
}
return tgt;
}
public static org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent convertElementDefinitionSlicingDiscriminatorComponent(org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasType()) tgt.setTypeElement(convertDiscriminatorType(src.getTypeElement()));
if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent convertElementDefinitionSlicingDiscriminatorComponent(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasType()) tgt.setTypeElement(convertDiscriminatorType(src.getTypeElement()));
if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType> convertDiscriminatorType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.NULL);
} else {
switch (src.getValue()) {
case VALUE:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.VALUE);
break;
case EXISTS:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.EXISTS);
break;
case PATTERN:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.PATTERN);
break;
case TYPE:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.TYPE);
break;
case PROFILE:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.PROFILE);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType> convertDiscriminatorType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.DiscriminatorType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.NULL);
} else {
switch (src.getValue()) {
case VALUE:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.VALUE);
break;
case EXISTS:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.EXISTS);
break;
case PATTERN:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.PATTERN);
break;
case TYPE:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.TYPE);
break;
case PROFILE:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.PROFILE);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.DiscriminatorType.NULL);
break;
}
}
return tgt;
}
public static org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBaseComponent convertElementDefinitionBaseComponent(org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBaseComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBaseComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBaseComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement()));
if (src.hasMin()) tgt.setMinElement(UnsignedInt43_50.convertUnsignedInt(src.getMinElement()));
if (src.hasMax()) tgt.setMaxElement(String43_50.convertString(src.getMaxElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBaseComponent convertElementDefinitionBaseComponent(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBaseComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBaseComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBaseComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasPath()) tgt.setPathElement(String43_50.convertString(src.getPathElement()));
if (src.hasMin()) tgt.setMinElement(UnsignedInt43_50.convertUnsignedInt(src.getMinElement()));
if (src.hasMax()) tgt.setMaxElement(String43_50.convertString(src.getMaxElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent convertTypeRefComponent(org.hl7.fhir.r4b.model.ElementDefinition.TypeRefComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasCode()) tgt.setCodeElement(Uri43_50.convertUri(src.getCodeElement()));
for (org.hl7.fhir.r4b.model.CanonicalType t : src.getProfile())
tgt.getProfile().add(Canonical43_50.convertCanonical(t));
for (org.hl7.fhir.r4b.model.CanonicalType t : src.getTargetProfile())
tgt.getTargetProfile().add(Canonical43_50.convertCanonical(t));
tgt.setAggregation(src.getAggregation().stream().map(ElementDefinition43_50::convertAggregationMode).collect(Collectors.toList()));
if (src.hasVersioning()) tgt.setVersioningElement(convertReferenceVersionRules(src.getVersioningElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ElementDefinition.TypeRefComponent convertTypeRefComponent(org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.ElementDefinition.TypeRefComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.TypeRefComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasCode()) tgt.setCodeElement(Uri43_50.convertUri(src.getCodeElement()));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getProfile())
tgt.getProfile().add(Canonical43_50.convertCanonical(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getTargetProfile())
tgt.getTargetProfile().add(Canonical43_50.convertCanonical(t));
tgt.setAggregation(src.getAggregation().stream().map(ElementDefinition43_50::convertAggregationMode).collect(Collectors.toList()));
if (src.hasVersioning()) tgt.setVersioningElement(convertReferenceVersionRules(src.getVersioningElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.AggregationMode> convertAggregationMode(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.AggregationMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.AggregationModeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.NULL);
} else {
switch (src.getValue()) {
case CONTAINED:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.CONTAINED);
break;
case REFERENCED:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.REFERENCED);
break;
case BUNDLED:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.BUNDLED);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.AggregationMode.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode> convertAggregationMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.AggregationMode> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ElementDefinition.AggregationModeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode.NULL);
} else {
switch (src.getValue()) {
case CONTAINED:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode.CONTAINED);
break;
case REFERENCED:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode.REFERENCED);
break;
case BUNDLED:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode.BUNDLED);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.AggregationMode.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules> convertReferenceVersionRules(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRulesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.NULL);
} else {
switch (src.getValue()) {
case EITHER:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.EITHER);
break;
case INDEPENDENT:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT);
break;
case SPECIFIC:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.SPECIFIC);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules> convertReferenceVersionRules(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.ReferenceVersionRules> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRulesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules.NULL);
} else {
switch (src.getValue()) {
case EITHER:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules.EITHER);
break;
case INDEPENDENT:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules.INDEPENDENT);
break;
case SPECIFIC:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules.SPECIFIC);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ReferenceVersionRules.NULL);
break;
}
}
return tgt;
}
public static org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionExampleComponent convertElementDefinitionExampleComponent(org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionExampleComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionExampleComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionExampleComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasLabel()) tgt.setLabelElement(String43_50.convertString(src.getLabelElement()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionExampleComponent convertElementDefinitionExampleComponent(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionExampleComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionExampleComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionExampleComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasLabel()) tgt.setLabelElement(String43_50.convertString(src.getLabelElement()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionConstraintComponent convertElementDefinitionConstraintComponent(org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionConstraintComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionConstraintComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionConstraintComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasKey()) tgt.setKeyElement(Id43_50.convertId(src.getKeyElement()));
if (src.hasRequirements()) tgt.setRequirementsElement(String43_50.convertString(src.getRequirementsElement()));
if (src.hasSeverity()) tgt.setSeverityElement(convertConstraintSeverity(src.getSeverityElement()));
if (src.hasHuman()) tgt.setHumanElement(String43_50.convertString(src.getHumanElement()));
if (src.hasExpression()) tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement()));
if (src.hasXpath()) tgt.setXpathElement(String43_50.convertString(src.getXpathElement()));
if (src.hasSource()) tgt.setSourceElement(Canonical43_50.convertCanonical(src.getSourceElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionConstraintComponent convertElementDefinitionConstraintComponent(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionConstraintComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionConstraintComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionConstraintComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasKey()) tgt.setKeyElement(Id43_50.convertId(src.getKeyElement()));
if (src.hasRequirements()) tgt.setRequirementsElement(String43_50.convertString(src.getRequirementsElement()));
if (src.hasSeverity()) tgt.setSeverityElement(convertConstraintSeverity(src.getSeverityElement()));
if (src.hasHuman()) tgt.setHumanElement(String43_50.convertString(src.getHumanElement()));
if (src.hasExpression()) tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement()));
if (src.hasXpath()) tgt.setXpathElement(String43_50.convertString(src.getXpathElement()));
if (src.hasSource()) tgt.setSourceElement(Canonical43_50.convertCanonical(src.getSourceElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity> convertConstraintSeverity(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverity> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.NULL);
} else {
switch (src.getValue()) {
case ERROR:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.ERROR);
break;
case WARNING:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.WARNING);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverity> convertConstraintSeverity(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ElementDefinition.ConstraintSeverity> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverity> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverity.NULL);
} else {
switch (src.getValue()) {
case ERROR:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverity.ERROR);
break;
case WARNING:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverity.WARNING);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.ElementDefinition.ConstraintSeverity.NULL);
break;
}
}
return tgt;
}
public static org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent convertElementDefinitionBindingComponent(org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBindingComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasStrength()) tgt.setStrengthElement(Enumerations43_50.convertBindingStrength(src.getStrengthElement()));
if (src.hasDescription()) tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasValueSet()) tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBindingComponent convertElementDefinitionBindingComponent(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBindingComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionBindingComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasStrength()) tgt.setStrengthElement(Enumerations43_50.convertBindingStrength(src.getStrengthElement()));
if (src.hasDescription()) tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasValueSet()) tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent convertElementDefinitionMappingComponent(org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionMappingComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent tgt = new org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasIdentity()) tgt.setIdentityElement(Id43_50.convertId(src.getIdentityElement()));
if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement()));
if (src.hasMap()) tgt.setMapElement(String43_50.convertString(src.getMapElement()));
if (src.hasComment()) tgt.setCommentElement(String43_50.convertString(src.getCommentElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionMappingComponent convertElementDefinitionMappingComponent(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionMappingComponent src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionMappingComponent tgt = new org.hl7.fhir.r4b.model.ElementDefinition.ElementDefinitionMappingComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasIdentity()) tgt.setIdentityElement(Id43_50.convertId(src.getIdentityElement()));
if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement()));
if (src.hasMap()) tgt.setMapElement(String43_50.convertString(src.getMapElement()));
if (src.hasComment()) tgt.setCommentElement(String43_50.convertString(src.getCommentElement()));
return tgt;
}
}

View File

@ -0,0 +1,27 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Extension43_50 {
public static org.hl7.fhir.r5.model.Extension convertExtension(org.hl7.fhir.r4b.model.Extension src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Extension tgt = new org.hl7.fhir.r5.model.Extension();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasUrl()) tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Extension convertExtension(org.hl7.fhir.r5.model.Extension src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Extension tgt = new org.hl7.fhir.r4b.model.Extension();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasUrl()) tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
}

View File

@ -0,0 +1,39 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Id43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Meta43_50 {
public static org.hl7.fhir.r5.model.Meta convertMeta(org.hl7.fhir.r4b.model.Meta src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Meta tgt = new org.hl7.fhir.r5.model.Meta();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasVersionId()) tgt.setVersionIdElement(Id43_50.convertId(src.getVersionIdElement()));
if (src.hasLastUpdated()) tgt.setLastUpdatedElement(Instant43_50.convertInstant(src.getLastUpdatedElement()));
if (src.hasSource()) tgt.setSourceElement(Uri43_50.convertUri(src.getSourceElement()));
for (org.hl7.fhir.r4b.model.CanonicalType t : src.getProfile())
tgt.getProfile().add(Canonical43_50.convertCanonical(t));
for (org.hl7.fhir.r4b.model.Coding t : src.getSecurity()) tgt.addSecurity(Coding43_50.convertCoding(t));
for (org.hl7.fhir.r4b.model.Coding t : src.getTag()) tgt.addTag(Coding43_50.convertCoding(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Meta convertMeta(org.hl7.fhir.r5.model.Meta src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Meta tgt = new org.hl7.fhir.r4b.model.Meta();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasVersionId()) tgt.setVersionIdElement(Id43_50.convertId(src.getVersionIdElement()));
if (src.hasLastUpdated()) tgt.setLastUpdatedElement(Instant43_50.convertInstant(src.getLastUpdatedElement()));
if (src.hasSource()) tgt.setSourceElement(Uri43_50.convertUri(src.getSourceElement()));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getProfile())
tgt.getProfile().add(Canonical43_50.convertCanonical(t));
for (org.hl7.fhir.r5.model.Coding t : src.getSecurity()) tgt.addSecurity(Coding43_50.convertCoding(t));
for (org.hl7.fhir.r5.model.Coding t : src.getTag()) tgt.addTag(Coding43_50.convertCoding(t));
return tgt;
}
}

View File

@ -0,0 +1,80 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class Narrative43_50 {
public static org.hl7.fhir.r5.model.Narrative convertNarrative(org.hl7.fhir.r4b.model.Narrative src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Narrative tgt = new org.hl7.fhir.r5.model.Narrative();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasStatus()) tgt.setStatusElement(convertNarrativeStatus(src.getStatusElement()));
if (src.hasDiv()) tgt.setDiv(xhtml43_50.convertXhtml(src.getDiv()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Narrative convertNarrative(org.hl7.fhir.r5.model.Narrative src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Narrative tgt = new org.hl7.fhir.r4b.model.Narrative();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasStatus()) tgt.setStatusElement(convertNarrativeStatus(src.getStatusElement()));
if (src.hasDiv()) tgt.setDiv(xhtml43_50.convertXhtml(src.getDiv()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Narrative.NarrativeStatus> convertNarrativeStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Narrative.NarrativeStatus> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Narrative.NarrativeStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Narrative.NarrativeStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.NULL);
} else {
switch (src.getValue()) {
case GENERATED:
tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.GENERATED);
break;
case EXTENSIONS:
tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.EXTENSIONS);
break;
case ADDITIONAL:
tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.ADDITIONAL);
break;
case EMPTY:
tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.EMPTY);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Narrative.NarrativeStatus.NULL);
break;
}
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Narrative.NarrativeStatus> convertNarrativeStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Narrative.NarrativeStatus> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Narrative.NarrativeStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Narrative.NarrativeStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.NULL);
} else {
switch (src.getValue()) {
case GENERATED:
tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.GENERATED);
break;
case EXTENSIONS:
tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.EXTENSIONS);
break;
case ADDITIONAL:
tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.ADDITIONAL);
break;
case EMPTY:
tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.EMPTY);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Narrative.NarrativeStatus.NULL);
break;
}
}
return tgt;
}
}

View File

@ -0,0 +1,38 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeableReference;
public class Reference43_50 {
public static org.hl7.fhir.r5.model.Reference convertReference(org.hl7.fhir.r4b.model.Reference src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r5.model.Reference tgt = new org.hl7.fhir.r5.model.Reference();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasReference()) tgt.setReferenceElement(String43_50.convertString(src.getReferenceElement_()));
if (src.hasType()) tgt.setTypeElement(Uri43_50.convertUri(src.getTypeElement()));
if (src.hasIdentifier()) tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
if (src.hasDisplay()) tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Reference convertReference(org.hl7.fhir.r5.model.Reference src) throws FHIRException {
if (src == null) return null;
org.hl7.fhir.r4b.model.Reference tgt = new org.hl7.fhir.r4b.model.Reference();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasReference()) tgt.setReferenceElement(String43_50.convertString(src.getReferenceElement_()));
if (src.hasType()) tgt.setTypeElement(Uri43_50.convertUri(src.getTypeElement()));
if (src.hasIdentifier()) tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
if (src.hasDisplay()) tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
return tgt;
}
public static CodeableReference convertReferenceToCodeableReference(org.hl7.fhir.r4b.model.Reference src) {
CodeableReference tgt = new CodeableReference();
tgt.setReference(convertReference(src));
return tgt;
}
}

View File

@ -0,0 +1,9 @@
package org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50;
import org.hl7.fhir.exceptions.FHIRException;
public class xhtml43_50 {
public static org.hl7.fhir.utilities.xhtml.XhtmlNode convertXhtml(org.hl7.fhir.utilities.xhtml.XhtmlNode src) throws FHIRException {
return src;
}
}

View File

@ -0,0 +1,209 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.PositiveInt43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Account43_50 {
public static org.hl7.fhir.r5.model.Account convertAccount(org.hl7.fhir.r4b.model.Account src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Account tgt = new org.hl7.fhir.r5.model.Account();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertAccountStatus(src.getStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
for (org.hl7.fhir.r4b.model.Reference t : src.getSubject()) tgt.addSubject(Reference43_50.convertReference(t));
if (src.hasServicePeriod())
tgt.setServicePeriod(Period43_50.convertPeriod(src.getServicePeriod()));
for (org.hl7.fhir.r4b.model.Account.CoverageComponent t : src.getCoverage())
tgt.addCoverage(convertCoverageComponent(t));
if (src.hasOwner())
tgt.setOwner(Reference43_50.convertReference(src.getOwner()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r4b.model.Account.GuarantorComponent t : src.getGuarantor())
tgt.addGuarantor(convertGuarantorComponent(t));
if (src.hasPartOf())
tgt.setPartOf(Reference43_50.convertReference(src.getPartOf()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Account convertAccount(org.hl7.fhir.r5.model.Account src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Account tgt = new org.hl7.fhir.r4b.model.Account();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertAccountStatus(src.getStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getSubject()) tgt.addSubject(Reference43_50.convertReference(t));
if (src.hasServicePeriod())
tgt.setServicePeriod(Period43_50.convertPeriod(src.getServicePeriod()));
for (org.hl7.fhir.r5.model.Account.CoverageComponent t : src.getCoverage())
tgt.addCoverage(convertCoverageComponent(t));
if (src.hasOwner())
tgt.setOwner(Reference43_50.convertReference(src.getOwner()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.Account.GuarantorComponent t : src.getGuarantor())
tgt.addGuarantor(convertGuarantorComponent(t));
if (src.hasPartOf())
tgt.setPartOf(Reference43_50.convertReference(src.getPartOf()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Account.AccountStatus> convertAccountStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Account.AccountStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Account.AccountStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Account.AccountStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.ACTIVE);
break;
case INACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.INACTIVE);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.ENTEREDINERROR);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.ONHOLD);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Account.AccountStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Account.AccountStatus> convertAccountStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Account.AccountStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Account.AccountStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Account.AccountStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.ACTIVE);
break;
case INACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.INACTIVE);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.ENTEREDINERROR);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.ONHOLD);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Account.AccountStatus.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Account.CoverageComponent convertCoverageComponent(org.hl7.fhir.r4b.model.Account.CoverageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Account.CoverageComponent tgt = new org.hl7.fhir.r5.model.Account.CoverageComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCoverage())
tgt.setCoverage(Reference43_50.convertReference(src.getCoverage()));
if (src.hasPriority())
tgt.setPriorityElement(PositiveInt43_50.convertPositiveInt(src.getPriorityElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Account.CoverageComponent convertCoverageComponent(org.hl7.fhir.r5.model.Account.CoverageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Account.CoverageComponent tgt = new org.hl7.fhir.r4b.model.Account.CoverageComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCoverage())
tgt.setCoverage(Reference43_50.convertReference(src.getCoverage()));
if (src.hasPriority())
tgt.setPriorityElement(PositiveInt43_50.convertPositiveInt(src.getPriorityElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Account.GuarantorComponent convertGuarantorComponent(org.hl7.fhir.r4b.model.Account.GuarantorComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Account.GuarantorComponent tgt = new org.hl7.fhir.r5.model.Account.GuarantorComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasParty())
tgt.setParty(Reference43_50.convertReference(src.getParty()));
if (src.hasOnHold())
tgt.setOnHoldElement(Boolean43_50.convertBoolean(src.getOnHoldElement()));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Account.GuarantorComponent convertGuarantorComponent(org.hl7.fhir.r5.model.Account.GuarantorComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Account.GuarantorComponent tgt = new org.hl7.fhir.r4b.model.Account.GuarantorComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasParty())
tgt.setParty(Reference43_50.convertReference(src.getParty()));
if (src.hasOnHold())
tgt.setOnHoldElement(Boolean43_50.convertBoolean(src.getOnHoldElement()));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
return tgt;
}
}

View File

@ -0,0 +1,590 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.SimpleQuantity43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.Expression43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.RelatedArtifact43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Dosage43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeableReference;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ActivityDefinition43_50 {
public static org.hl7.fhir.r5.model.ActivityDefinition convertActivityDefinition(org.hl7.fhir.r4b.model.ActivityDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ActivityDefinition tgt = new org.hl7.fhir.r5.model.ActivityDefinition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
if (src.hasSubject())
tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact())
tgt.addContact(ContactDetail43_50.convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext())
tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement()));
if (src.hasUsage())
tgt.setUsageElement(String43_50.convertString(src.getUsageElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getTopic())
tgt.addTopic(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(ContactDetail43_50.convertContactDetail(t));
for (org.hl7.fhir.r4b.model.ContactDetail t : src.getEditor())
tgt.addEditor(ContactDetail43_50.convertContactDetail(t));
for (org.hl7.fhir.r4b.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(ContactDetail43_50.convertContactDetail(t));
for (org.hl7.fhir.r4b.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(ContactDetail43_50.convertContactDetail(t));
for (org.hl7.fhir.r4b.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(RelatedArtifact43_50.convertRelatedArtifact(t));
for (org.hl7.fhir.r4b.model.CanonicalType t : src.getLibrary())
tgt.getLibrary().add(Canonical43_50.convertCanonical(t));
if (src.hasKind())
tgt.setKindElement(convertActivityDefinitionKind(src.getKindElement()));
if (src.hasProfile())
tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasIntent())
tgt.setIntentElement(convertRequestIntent(src.getIntentElement()));
if (src.hasPriority())
tgt.setPriorityElement(convertRequestPriority(src.getPriorityElement()));
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement()));
if (src.hasTiming())
tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming()));
if (src.hasLocation())
tgt.setLocation(new CodeableReference(Reference43_50.convertReference(src.getLocation())));
for (org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertActivityDefinitionParticipantComponent(t));
if (src.hasProduct())
tgt.setProduct(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProduct()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
for (org.hl7.fhir.r4b.model.Dosage t : src.getDosage()) tgt.addDosage(Dosage43_50.convertDosage(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getBodySite())
tgt.addBodySite(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getSpecimenRequirement())
tgt.addSpecimenRequirement(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getObservationRequirement())
tgt.addObservationRequirement(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getObservationResultRequirement())
tgt.addObservationResultRequirement(Reference43_50.convertReference(t));
if (src.hasTransform())
tgt.setTransformElement(Canonical43_50.convertCanonical(src.getTransformElement()));
for (org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue())
tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ActivityDefinition convertActivityDefinition(org.hl7.fhir.r5.model.ActivityDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ActivityDefinition tgt = new org.hl7.fhir.r4b.model.ActivityDefinition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
if (src.hasSubject())
tgt.setSubject(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(ContactDetail43_50.convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement()));
if (src.hasUsage())
tgt.setUsageElement(String43_50.convertString(src.getUsageElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic())
tgt.addTopic(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(ContactDetail43_50.convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor())
tgt.addEditor(ContactDetail43_50.convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(ContactDetail43_50.convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(ContactDetail43_50.convertContactDetail(t));
for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(RelatedArtifact43_50.convertRelatedArtifact(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary())
tgt.getLibrary().add(Canonical43_50.convertCanonical(t));
if (src.hasKind())
tgt.setKindElement(convertActivityDefinitionKind(src.getKindElement()));
if (src.hasProfile())
tgt.setProfileElement(Canonical43_50.convertCanonical(src.getProfileElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasIntent())
tgt.setIntentElement(convertRequestIntent(src.getIntentElement()));
if (src.hasPriority())
tgt.setPriorityElement(convertRequestPriority(src.getPriorityElement()));
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement()));
if (src.hasTiming())
tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming()));
if (src.getLocation().hasReference())
tgt.setLocation(Reference43_50.convertReference(src.getLocation().getReference()));
for (org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertActivityDefinitionParticipantComponent(t));
if (src.hasProduct())
tgt.setProduct(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProduct()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
for (org.hl7.fhir.r5.model.Dosage t : src.getDosage()) tgt.addDosage(Dosage43_50.convertDosage(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite())
tgt.addBodySite(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSpecimenRequirement())
tgt.addSpecimenRequirement(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getObservationRequirement())
tgt.addObservationRequirement(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getObservationResultRequirement())
tgt.addObservationResultRequirement(Reference43_50.convertReference(t));
if (src.hasTransform())
tgt.setTransformElement(Canonical43_50.convertCanonical(src.getTransformElement()));
for (org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue())
tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType> convertActivityDefinitionKind(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case APPOINTMENT:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.APPOINTMENT);
break;
case APPOINTMENTRESPONSE:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.APPOINTMENTRESPONSE);
break;
case CAREPLAN:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.CAREPLAN);
break;
case CLAIM:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.CLAIM);
break;
case COMMUNICATIONREQUEST:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.COMMUNICATIONREQUEST);
break;
case CONTRACT:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.CONTRACT);
break;
case DEVICEREQUEST:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.DEVICEREQUEST);
break;
case ENROLLMENTREQUEST:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.ENROLLMENTREQUEST);
break;
case IMMUNIZATIONRECOMMENDATION:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.IMMUNIZATIONRECOMMENDATION);
break;
case MEDICATIONREQUEST:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.MEDICATIONREQUEST);
break;
case NUTRITIONORDER:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.NUTRITIONORDER);
break;
case SERVICEREQUEST:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.SERVICEREQUEST);
break;
case SUPPLYREQUEST:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.SUPPLYREQUEST);
break;
case TASK:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.TASK);
break;
case VISIONPRESCRIPTION:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.VISIONPRESCRIPTION);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType> convertActivityDefinitionKind(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ActivityDefinition.RequestResourceType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case APPOINTMENT:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.APPOINTMENT);
break;
case APPOINTMENTRESPONSE:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.APPOINTMENTRESPONSE);
break;
case CAREPLAN:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.CAREPLAN);
break;
case CLAIM:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.CLAIM);
break;
case COMMUNICATIONREQUEST:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.COMMUNICATIONREQUEST);
break;
case CONTRACT:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.CONTRACT);
break;
case DEVICEREQUEST:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.DEVICEREQUEST);
break;
case ENROLLMENTREQUEST:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.ENROLLMENTREQUEST);
break;
case IMMUNIZATIONRECOMMENDATION:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.IMMUNIZATIONRECOMMENDATION);
break;
case MEDICATIONREQUEST:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.MEDICATIONREQUEST);
break;
case NUTRITIONORDER:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.NUTRITIONORDER);
break;
case SERVICEREQUEST:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.SERVICEREQUEST);
break;
case SUPPLYREQUEST:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.SUPPLYREQUEST);
break;
case TASK:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.TASK);
break;
case VISIONPRESCRIPTION:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.VISIONPRESCRIPTION);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.ActivityDefinition.RequestResourceType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestIntent> convertRequestIntent(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestIntent> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestIntent> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestIntentEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PROPOSAL:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL);
break;
case PLAN:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN);
break;
case DIRECTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE);
break;
case ORDER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER);
break;
case ORIGINALORDER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER);
break;
case REFLEXORDER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER);
break;
case FILLERORDER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER);
break;
case INSTANCEORDER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER);
break;
case OPTION:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestIntent> convertRequestIntent(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestIntent> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestIntent> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestIntentEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PROPOSAL:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PROPOSAL);
break;
case PLAN:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PLAN);
break;
case DIRECTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.DIRECTIVE);
break;
case ORDER:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORDER);
break;
case ORIGINALORDER:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORIGINALORDER);
break;
case REFLEXORDER:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.REFLEXORDER);
break;
case FILLERORDER:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.FILLERORDER);
break;
case INSTANCEORDER:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.INSTANCEORDER);
break;
case OPTION:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.OPTION);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> convertRequestPriority(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestPriority> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ROUTINE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE);
break;
case URGENT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT);
break;
case ASAP:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP);
break;
case STAT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestPriority> convertRequestPriority(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestPriority> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ROUTINE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE);
break;
case URGENT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT);
break;
case ASAP:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP);
break;
case STAT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent convertActivityDefinitionParticipantComponent(org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionParticipantComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent tgt = new org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertActivityParticipantType(src.getTypeElement()));
if (src.hasRole())
tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionParticipantComponent convertActivityDefinitionParticipantComponent(org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionParticipantComponent tgt = new org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionParticipantComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertActivityParticipantType(src.getTypeElement()));
if (src.hasRole())
tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionParticipantType> convertActivityParticipantType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionParticipantType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ActionParticipantTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PATIENT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PATIENT);
break;
case PRACTITIONER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.PRACTITIONER);
break;
case RELATEDPERSON:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.RELATEDPERSON);
break;
case DEVICE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.DEVICE);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ActionParticipantType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType> convertActivityParticipantType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ActionParticipantType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ActionParticipantTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PATIENT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.PATIENT);
break;
case PRACTITIONER:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.PRACTITIONER);
break;
case RELATEDPERSON:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.RELATEDPERSON);
break;
case DEVICE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.DEVICE);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ActionParticipantType.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent convertActivityDefinitionDynamicValueComponent(org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent tgt = new org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasPath())
tgt.setPathElement(String43_50.convertString(src.getPathElement()));
if (src.hasExpression())
tgt.setExpression(Expression43_50.convertExpression(src.getExpression()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent convertActivityDefinitionDynamicValueComponent(org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent tgt = new org.hl7.fhir.r4b.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasPath())
tgt.setPathElement(String43_50.convertString(src.getPathElement()));
if (src.hasExpression())
tgt.setExpression(Expression43_50.convertExpression(src.getExpression()));
return tgt;
}
}

View File

@ -0,0 +1,353 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.Reference30_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeableConcept;
import org.hl7.fhir.r5.model.CodeableReference;
import org.hl7.fhir.r5.model.Coding;
import org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceParticipantComponent;
import java.util.stream.Collectors;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class AllergyIntolerance43_50 {
public static org.hl7.fhir.r5.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.r4b.model.AllergyIntolerance src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.AllergyIntolerance tgt = new org.hl7.fhir.r5.model.AllergyIntolerance();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasClinicalStatus())
tgt.setClinicalStatus(CodeableConcept43_50.convertCodeableConcept(src.getClinicalStatus()));
if (src.hasVerificationStatus())
tgt.setVerificationStatus(CodeableConcept43_50.convertCodeableConcept(src.getVerificationStatus()));
if (src.hasType())
tgt.setTypeElement(convertAllergyIntoleranceType(src.getTypeElement()));
tgt.setCategory(src.getCategory().stream()
.map(AllergyIntolerance43_50::convertAllergyIntoleranceCategory)
.collect(Collectors.toList()));
if (src.hasCriticality())
tgt.setCriticalityElement(convertAllergyIntoleranceCriticality(src.getCriticalityElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasPatient())
tgt.setPatient(Reference43_50.convertReference(src.getPatient()));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
if (src.hasOnset())
tgt.setOnset(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOnset()));
if (src.hasRecordedDate())
tgt.setRecordedDateElement(DateTime43_50.convertDateTime(src.getRecordedDateElement()));
if (src.hasRecorder())
tgt.addParticipant(new AllergyIntoleranceParticipantComponent()
.setFunction(new CodeableConcept().addCoding(new Coding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "author", "Author")))
.setActor(Reference43_50.convertReference(src.getRecorder())));
if (src.hasAsserter())
tgt.addParticipant(new AllergyIntoleranceParticipantComponent()
.setFunction(new CodeableConcept().addCoding(new Coding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "attester", "Attester")))
.setActor(Reference43_50.convertReference(src.getRecorder())));
if (src.hasLastOccurrence())
tgt.setLastOccurrenceElement(DateTime43_50.convertDateTime(src.getLastOccurrenceElement()));
for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
for (org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction())
tgt.addReaction(convertAllergyIntoleranceReactionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.r5.model.AllergyIntolerance src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.AllergyIntolerance tgt = new org.hl7.fhir.r4b.model.AllergyIntolerance();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasClinicalStatus())
tgt.setClinicalStatus(CodeableConcept43_50.convertCodeableConcept(src.getClinicalStatus()));
if (src.hasVerificationStatus())
tgt.setVerificationStatus(CodeableConcept43_50.convertCodeableConcept(src.getVerificationStatus()));
if (src.hasType())
tgt.setTypeElement(convertAllergyIntoleranceType(src.getTypeElement()));
tgt.setCategory(src.getCategory().stream()
.map(AllergyIntolerance43_50::convertAllergyIntoleranceCategory)
.collect(Collectors.toList()));
if (src.hasCriticality())
tgt.setCriticalityElement(convertAllergyIntoleranceCriticality(src.getCriticalityElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasPatient())
tgt.setPatient(Reference43_50.convertReference(src.getPatient()));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
if (src.hasOnset())
tgt.setOnset(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOnset()));
if (src.hasRecordedDate())
tgt.setRecordedDateElement(DateTime43_50.convertDateTime(src.getRecordedDateElement()));
for (AllergyIntoleranceParticipantComponent t : src.getParticipant()) {
if (t.getFunction().hasCoding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "author"))
tgt.setRecorder(Reference43_50.convertReference(t.getActor()));
if (t.getFunction().hasCoding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "attester"))
tgt.setAsserter(Reference43_50.convertReference(t.getActor()));
}
if (src.hasLastOccurrence())
tgt.setLastOccurrenceElement(DateTime43_50.convertDateTime(src.getLastOccurrenceElement()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
for (org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction())
tgt.addReaction(convertAllergyIntoleranceReactionComponent(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType> convertAllergyIntoleranceType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ALLERGY:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY);
break;
case INTOLERANCE:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceType> convertAllergyIntoleranceType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ALLERGY:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY);
break;
case INTOLERANCE:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory> convertAllergyIntoleranceCategory(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case FOOD:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD);
break;
case MEDICATION:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION);
break;
case ENVIRONMENT:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT);
break;
case BIOLOGIC:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory> convertAllergyIntoleranceCategory(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case FOOD:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD);
break;
case MEDICATION:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION);
break;
case ENVIRONMENT:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT);
break;
case BIOLOGIC:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality> convertAllergyIntoleranceCriticality(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case LOW:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW);
break;
case HIGH:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH);
break;
case UNABLETOASSESS:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality> convertAllergyIntoleranceCriticality(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case LOW:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW);
break;
case HIGH:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH);
break;
case UNABLETOASSESS:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt = new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSubstance())
tgt.setSubstance(CodeableConcept43_50.convertCodeableConcept(src.getSubstance()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getManifestation())
tgt.addManifestation(new CodeableReference(CodeableConcept43_50.convertCodeableConcept(t)));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasOnset())
tgt.setOnsetElement(DateTime43_50.convertDateTime(src.getOnsetElement()));
if (src.hasSeverity())
tgt.setSeverityElement(convertAllergyIntoleranceSeverity(src.getSeverityElement()));
if (src.hasExposureRoute())
tgt.setExposureRoute(CodeableConcept43_50.convertCodeableConcept(src.getExposureRoute()));
for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt = new org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceReactionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSubstance())
tgt.setSubstance(CodeableConcept43_50.convertCodeableConcept(src.getSubstance()));
for (CodeableReference t : src.getManifestation())
if (t.hasConcept()) tgt.addManifestation(CodeableConcept43_50.convertCodeableConcept(t.getConcept()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasOnset())
tgt.setOnsetElement(DateTime43_50.convertDateTime(src.getOnsetElement()));
if (src.hasSeverity())
tgt.setSeverityElement(convertAllergyIntoleranceSeverity(src.getSeverityElement()));
if (src.hasExposureRoute())
tgt.setExposureRoute(CodeableConcept43_50.convertCodeableConcept(src.getExposureRoute()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity> convertAllergyIntoleranceSeverity(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case MILD:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD);
break;
case MODERATE:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE);
break;
case SEVERE:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity> convertAllergyIntoleranceSeverity(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case MILD:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD);
break;
case MODERATE:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE);
break;
case SEVERE:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL);
break;
}
return tgt;
}
}

View File

@ -0,0 +1,377 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.MarkDown43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.PositiveInt43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4b.model.UnsignedIntType;
import org.hl7.fhir.r5.model.CodeableConcept;
import org.hl7.fhir.r5.model.CodeableReference;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Appointment43_50 {
public static org.hl7.fhir.r5.model.Appointment convertAppointment(org.hl7.fhir.r4b.model.Appointment src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Appointment tgt = new org.hl7.fhir.r5.model.Appointment();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertAppointmentStatus(src.getStatusElement()));
if (src.hasCancelationReason())
tgt.setCancellationReason(CodeableConcept43_50.convertCodeableConcept(src.getCancelationReason()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getServiceCategory())
tgt.addServiceCategory(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getServiceType())
tgt.addServiceType().setConcept(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSpecialty())
tgt.addSpecialty(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasAppointmentType())
tgt.setAppointmentType(CodeableConcept43_50.convertCodeableConcept(src.getAppointmentType()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode())
tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference())
tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t));
if (src.hasPriority())
tgt.setPriority(convertAppointmentPriority(src.getPriorityElement()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInformation())
tgt.addSupportingInformation(Reference43_50.convertReference(t));
if (src.hasStart())
tgt.setStartElement(Instant43_50.convertInstant(src.getStartElement()));
if (src.hasEnd())
tgt.setEndElement(Instant43_50.convertInstant(src.getEndElement()));
if (src.hasMinutesDuration())
tgt.setMinutesDurationElement(PositiveInt43_50.convertPositiveInt(src.getMinutesDurationElement()));
for (org.hl7.fhir.r4b.model.Reference t : src.getSlot()) tgt.addSlot(Reference43_50.convertReference(t));
if (src.hasCreated())
tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement()));
if (src.hasComment())
tgt.getNoteFirstRep().setTextElement(MarkDown43_50.convertStringToMarkdown(src.getCommentElement()));
// if (src.hasPatientInstruction())
// tgt.setPatientInstructionElement(String43_50.convertString(src.getPatientInstructionElement()));
for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Appointment.AppointmentParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertAppointmentParticipantComponent(t));
for (org.hl7.fhir.r4b.model.Period t : src.getRequestedPeriod())
tgt.addRequestedPeriod(Period43_50.convertPeriod(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Appointment convertAppointment(org.hl7.fhir.r5.model.Appointment src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Appointment tgt = new org.hl7.fhir.r4b.model.Appointment();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertAppointmentStatus(src.getStatusElement()));
if (src.hasCancellationReason())
tgt.setCancelationReason(CodeableConcept43_50.convertCodeableConcept(src.getCancellationReason()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceCategory())
tgt.addServiceCategory(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableReference t : src.getServiceType())
tgt.addServiceType(CodeableConcept43_50.convertCodeableConcept(t.getConcept()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty())
tgt.addSpecialty(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasAppointmentType())
tgt.setAppointmentType(CodeableConcept43_50.convertCodeableConcept(src.getAppointmentType()));
for (CodeableReference t : src.getReason())
if (t.hasConcept())
tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept()));
for (CodeableReference t : src.getReason())
if (t.hasReference())
tgt.addReasonReference(Reference43_50.convertReference(t.getReference()));
if (src.hasPriority())
tgt.setPriorityElement(convertAppointmentPriority(src.getPriority()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation())
tgt.addSupportingInformation(Reference43_50.convertReference(t));
if (src.hasStart())
tgt.setStartElement(Instant43_50.convertInstant(src.getStartElement()));
if (src.hasEnd())
tgt.setEndElement(Instant43_50.convertInstant(src.getEndElement()));
if (src.hasMinutesDuration())
tgt.setMinutesDurationElement(PositiveInt43_50.convertPositiveInt(src.getMinutesDurationElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getSlot()) tgt.addSlot(Reference43_50.convertReference(t));
if (src.hasCreated())
tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement()));
if (src.hasNote())
tgt.setCommentElement(String43_50.convertString(src.getNoteFirstRep().getTextElement()));
// if (src.hasPatientInstruction())
// tgt.setPatientInstructionElement(String43_50.convertString(src.getPatientInstructionElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertAppointmentParticipantComponent(t));
for (org.hl7.fhir.r5.model.Period t : src.getRequestedPeriod())
tgt.addRequestedPeriod(Period43_50.convertPeriod(t));
return tgt;
}
private static UnsignedIntType convertAppointmentPriority(CodeableConcept src) {
UnsignedIntType tgt = new UnsignedIntType(convertAppointmentPriorityFromR5(src));
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
private static CodeableConcept convertAppointmentPriority(UnsignedIntType src) {
CodeableConcept tgt = src.hasValue() ? convertAppointmentPriorityToR5(src.getValue()) : new CodeableConcept();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.r5.model.CodeableConcept convertAppointmentPriorityToR5(int priority) {
return null;
}
public static int convertAppointmentPriorityFromR5(org.hl7.fhir.r5.model.CodeableConcept priority) {
return 0;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Appointment.AppointmentStatus> convertAppointmentStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Appointment.AppointmentStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Appointment.AppointmentStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Appointment.AppointmentStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PROPOSED:
tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PROPOSED);
break;
case PENDING:
tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PENDING);
break;
case BOOKED:
tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.BOOKED);
break;
case ARRIVED:
tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ARRIVED);
break;
case FULFILLED:
tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.FULFILLED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CANCELLED);
break;
case NOSHOW:
tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NOSHOW);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ENTEREDINERROR);
break;
case CHECKEDIN:
tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CHECKEDIN);
break;
case WAITLIST:
tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.WAITLIST);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Appointment.AppointmentStatus> convertAppointmentStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Appointment.AppointmentStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Appointment.AppointmentStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Appointment.AppointmentStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PROPOSED:
tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.PROPOSED);
break;
case PENDING:
tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.PENDING);
break;
case BOOKED:
tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.BOOKED);
break;
case ARRIVED:
tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.ARRIVED);
break;
case FULFILLED:
tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.FULFILLED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.CANCELLED);
break;
case NOSHOW:
tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.NOSHOW);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.ENTEREDINERROR);
break;
case CHECKEDIN:
tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.CHECKEDIN);
break;
case WAITLIST:
tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.WAITLIST);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Appointment.AppointmentStatus.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.r4b.model.Appointment.AppointmentParticipantComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType())
tgt.addType(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(Reference43_50.convertReference(src.getActor()));
if (src.hasRequired())
tgt.setRequiredElement(convertParticipantRequired(src.getRequiredElement()));
if (src.hasStatus())
tgt.setStatusElement(convertParticipationStatus(src.getStatusElement()));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.r4b.model.Appointment.AppointmentParticipantComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(Reference43_50.convertReference(src.getActor()));
if (src.hasRequired())
tgt.setRequiredElement(convertParticipantRequired(src.getRequiredElement()));
if (src.hasStatus())
tgt.setStatusElement(convertParticipationStatus(src.getStatusElement()));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
return tgt;
}
static public org.hl7.fhir.r5.model.BooleanType convertParticipantRequired(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Appointment.ParticipantRequired> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.BooleanType tgt = new org.hl7.fhir.r5.model.BooleanType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case REQUIRED:
tgt.setValue(true);
break;
case OPTIONAL:
tgt.setValue(false);
break;
case INFORMATIONONLY:
tgt.setValue(false);
break;
default:
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Appointment.ParticipantRequired> convertParticipantRequired(org.hl7.fhir.r5.model.BooleanType src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Appointment.ParticipantRequired> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Appointment.ParticipantRequiredEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.getValue()) { // case REQUIRED:
tgt.setValue(org.hl7.fhir.r4b.model.Appointment.ParticipantRequired.REQUIRED);
} else { // case OPTIONAL + others:
tgt.setValue(org.hl7.fhir.r4b.model.Appointment.ParticipantRequired.OPTIONAL);
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ParticipationStatus> convertParticipationStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ParticipationStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ParticipationStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACCEPTED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.ACCEPTED);
break;
case DECLINED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.DECLINED);
break;
case TENTATIVE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.TENTATIVE);
break;
case NEEDSACTION:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.NEEDSACTION);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus> convertParticipationStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ParticipationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ParticipationStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACCEPTED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.ACCEPTED);
break;
case DECLINED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.DECLINED);
break;
case TENTATIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.TENTATIVE);
break;
case NEEDSACTION:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.NEEDSACTION);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.NULL);
break;
}
return tgt;
}
}

View File

@ -0,0 +1,139 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class AppointmentResponse43_50 {
public static org.hl7.fhir.r5.model.AppointmentResponse convertAppointmentResponse(org.hl7.fhir.r4b.model.AppointmentResponse src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.AppointmentResponse tgt = new org.hl7.fhir.r5.model.AppointmentResponse();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasAppointment())
tgt.setAppointment(Reference43_50.convertReference(src.getAppointment()));
if (src.hasStart())
tgt.setStartElement(Instant43_50.convertInstant(src.getStartElement()));
if (src.hasEnd())
tgt.setEndElement(Instant43_50.convertInstant(src.getEndElement()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getParticipantType())
tgt.addParticipantType(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(Reference43_50.convertReference(src.getActor()));
if (src.hasParticipantStatus())
tgt.setParticipantStatusElement(convertParticipantStatus(src.getParticipantStatusElement()));
if (src.hasComment())
tgt.setCommentElement(String43_50.convertString(src.getCommentElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.AppointmentResponse convertAppointmentResponse(org.hl7.fhir.r5.model.AppointmentResponse src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.AppointmentResponse tgt = new org.hl7.fhir.r4b.model.AppointmentResponse();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasAppointment())
tgt.setAppointment(Reference43_50.convertReference(src.getAppointment()));
if (src.hasStart())
tgt.setStartElement(Instant43_50.convertInstant(src.getStartElement()));
if (src.hasEnd())
tgt.setEndElement(Instant43_50.convertInstant(src.getEndElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getParticipantType())
tgt.addParticipantType(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(Reference43_50.convertReference(src.getActor()));
if (src.hasParticipantStatus())
tgt.setParticipantStatusElement(convertParticipantStatus(src.getParticipantStatusElement()));
if (src.hasComment())
tgt.setCommentElement(String43_50.convertString(src.getCommentElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ParticipationStatus> convertParticipantStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ParticipationStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ParticipationStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACCEPTED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.ACCEPTED);
break;
case DECLINED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.DECLINED);
break;
case TENTATIVE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.TENTATIVE);
break;
case NEEDSACTION:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.NEEDSACTION);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ParticipationStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus> convertParticipantStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ParticipationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ParticipationStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACCEPTED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.ACCEPTED);
break;
case DECLINED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.DECLINED);
break;
case TENTATIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.TENTATIVE);
break;
case NEEDSACTION:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.NEEDSACTION);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ParticipationStatus.NULL);
break;
}
return tgt;
}
}

View File

@ -0,0 +1,396 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeableConcept;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class AuditEvent43_50 {
public static org.hl7.fhir.r5.model.AuditEvent convertAuditEvent(org.hl7.fhir.r4b.model.AuditEvent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.AuditEvent tgt = new org.hl7.fhir.r5.model.AuditEvent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.hasType())
tgt.getCategoryFirstRep().addCoding(Coding43_50.convertCoding(src.getType()));
for (org.hl7.fhir.r4b.model.Coding t : src.getSubtype()) tgt.getCode().addCoding(Coding43_50.convertCoding(t));
if (src.hasAction())
tgt.setActionElement(convertAuditEventAction(src.getActionElement()));
if (src.hasPeriod())
tgt.setOccurred(Period43_50.convertPeriod(src.getPeriod()));
if (src.hasRecorded())
tgt.setRecordedElement(Instant43_50.convertInstant(src.getRecordedElement()));
if (src.hasOutcome())
tgt.getOutcome().getCode().setSystem("http://terminology.hl7.org/CodeSystem/audit-event-outcome").setCode(src.getOutcome().toCode());
if (src.hasOutcomeDesc())
tgt.getOutcome().getDetailFirstRep().setTextElement(String43_50.convertString(src.getOutcomeDescElement()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getPurposeOfEvent())
tgt.addAuthorization(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentComponent t : src.getAgent())
tgt.addAgent(convertAuditEventAgentComponent(t));
if (src.hasSource())
tgt.setSource(convertAuditEventSourceComponent(src.getSource()));
for (org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityComponent t : src.getEntity())
tgt.addEntity(convertAuditEventEntityComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.AuditEvent convertAuditEvent(org.hl7.fhir.r5.model.AuditEvent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.AuditEvent tgt = new org.hl7.fhir.r4b.model.AuditEvent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.getCategoryFirstRep().hasCoding()) {
tgt.setType(Coding43_50.convertCoding(src.getCategoryFirstRep().getCodingFirstRep()));
}
for (org.hl7.fhir.r5.model.Coding t : src.getCode().getCoding()) tgt.addSubtype(Coding43_50.convertCoding(t));
if (src.hasAction())
tgt.setActionElement(convertAuditEventAction(src.getActionElement()));
if (src.hasOccurredPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getOccurredPeriod()));
if (src.hasRecorded())
tgt.setRecordedElement(Instant43_50.convertInstant(src.getRecordedElement()));
if (src.hasOutcome() && "http://terminology.hl7.org/CodeSystem/audit-event-outcome".equals(src.getOutcome().getCode().getSystem()))
tgt.getOutcomeElement().setValueAsString(src.getOutcome().getCode().getCode());
if (src.getOutcome().getDetailFirstRep().hasText())
tgt.setOutcomeDescElement(String43_50.convertString(src.getOutcome().getDetailFirstRep().getTextElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorization())
tgt.addPurposeOfEvent(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent t : src.getAgent())
tgt.addAgent(convertAuditEventAgentComponent(t));
if (src.hasSource())
tgt.setSource(convertAuditEventSourceComponent(src.getSource()));
for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent t : src.getEntity())
tgt.addEntity(convertAuditEventEntityComponent(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAction> convertAuditEventAction(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAction> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AuditEvent.AuditEventActionEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case C:
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.C);
break;
case R:
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.R);
break;
case U:
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.U);
break;
case D:
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.D);
break;
case E:
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.E);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction> convertAuditEventAction(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAction> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.AuditEvent.AuditEventActionEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case C:
tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.C);
break;
case R:
tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.R);
break;
case U:
tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.U);
break;
case D:
tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.D);
break;
case E:
tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.E);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAction.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getRole())
tgt.addRole(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasWho())
tgt.setWho(Reference43_50.convertReference(src.getWho()));
// if (src.hasAltId())
// tgt.setAltIdElement(String43_50.convertString(src.getAltIdElement()));
// if (src.hasName())
// tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasRequestor())
tgt.setRequestorElement(Boolean43_50.convertBoolean(src.getRequestorElement()));
if (src.hasLocation())
tgt.setLocation(Reference43_50.convertReference(src.getLocation()));
for (org.hl7.fhir.r4b.model.UriType t : src.getPolicy()) tgt.getPolicy().add(Uri43_50.convertUri(t));
// if (src.hasMedia())
// tgt.setMedia(Coding43_50.convertCoding(src.getMedia()));
// if (src.hasNetwork())
// tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getPurposeOfUse())
tgt.addAuthorization(CodeableConcept43_50.convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRole())
tgt.addRole(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasWho())
tgt.setWho(Reference43_50.convertReference(src.getWho()));
// if (src.hasAltId())
// tgt.setAltIdElement(String43_50.convertString(src.getAltIdElement()));
// if (src.hasName())
// tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasRequestor())
tgt.setRequestorElement(Boolean43_50.convertBoolean(src.getRequestorElement()));
if (src.hasLocation())
tgt.setLocation(Reference43_50.convertReference(src.getLocation()));
for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.getPolicy().add(Uri43_50.convertUri(t));
// if (src.hasMedia())
// tgt.setMedia(Coding43_50.convertCoding(src.getMedia()));
// if (src.hasNetwork())
// tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorization())
tgt.addPurposeOfUse(CodeableConcept43_50.convertCodeableConcept(t));
return tgt;
}
// public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasAddress())
// tgt.setAddressElement(String43_50.convertString(src.getAddressElement()));
// if (src.hasType())
// tgt.setTypeElement(convertAuditEventAgentNetworkType(src.getTypeElement()));
// return tgt;
// }
//
// public static org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasAddress())
// tgt.setAddressElement(String43_50.convertString(src.getAddressElement()));
// if (src.hasType())
// tgt.setTypeElement(convertAuditEventAgentNetworkType(src.getTypeElement()));
// return tgt;
// }
//
// static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> convertAuditEventAgentNetworkType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
// if (src == null || src.isEmpty())
// return null;
// org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// switch (src.getValue()) {
// case _1:
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._1);
// break;
// case _2:
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._2);
// break;
// case _3:
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._3);
// break;
// case _4:
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._4);
// break;
// case _5:
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._5);
// break;
// default:
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType.NULL);
// break;
// }
// return tgt;
// }
//
// static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType> convertAuditEventAgentNetworkType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
// if (src == null || src.isEmpty())
// return null;
// org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// switch (src.getValue()) {
// case _1:
// tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType._1);
// break;
// case _2:
// tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType._2);
// break;
// case _3:
// tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType._3);
// break;
// case _4:
// tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType._4);
// break;
// case _5:
// tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType._5);
// break;
// default:
// tgt.setValue(org.hl7.fhir.r4b.model.AuditEvent.AuditEventAgentNetworkType.NULL);
// break;
// }
// return tgt;
// }
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r4b.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
// if (src.hasSite())
// tgt.setSiteElement(String43_50.convertString(src.getSiteElement()));
if (src.hasObserver())
tgt.setObserver(Reference43_50.convertReference(src.getObserver()));
for (org.hl7.fhir.r4b.model.Coding t : src.getType()) tgt.addType().addCoding(Coding43_50.convertCoding(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r4b.model.AuditEvent.AuditEventSourceComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
// if (src.hasSite())
// tgt.setSiteElement(String43_50.convertString(src.getSiteElement()));
if (src.hasObserver())
tgt.setObserver(Reference43_50.convertReference(src.getObserver()));
for (CodeableConcept t : src.getType()) tgt.addType(Coding43_50.convertCoding(t.getCodingFirstRep()));
return tgt;
}
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasWhat())
tgt.setWhat(Reference43_50.convertReference(src.getWhat()));
// if (src.hasType())
// tgt.setType(Coding43_50.convertCoding(src.getType()));
if (src.hasRole())
tgt.getRole().addCoding(Coding43_50.convertCoding(src.getRole()));
// if (src.hasLifecycle())
// tgt.setLifecycle(Coding43_50.convertCoding(src.getLifecycle()));
for (org.hl7.fhir.r4b.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel().addCoding(Coding43_50.convertCoding(t));
// if (src.hasName())
// tgt.setNameElement(String43_50.convertString(src.getNameElement()));
// if (src.hasDescription())
// tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasQuery())
tgt.setQueryElement(Base64Binary43_50.convertBase64Binary(src.getQueryElement()));
for (org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail())
tgt.addDetail(convertAuditEventEntityDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityComponent tgt = new org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasWhat())
tgt.setWhat(Reference43_50.convertReference(src.getWhat()));
// if (src.hasType())
// tgt.setType(Coding43_50.convertCoding(src.getType()));
if (src.hasRole())
tgt.setRole(Coding43_50.convertCoding(src.getRole().getCodingFirstRep()));
// if (src.hasLifecycle())
// tgt.setLifecycle(Coding43_50.convertCoding(src.getLifecycle()));
for (CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding43_50.convertCoding(t.getCodingFirstRep()));
// if (src.hasName())
// tgt.setNameElement(String43_50.convertString(src.getNameElement()));
// if (src.hasDescription())
// tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasQuery())
tgt.setQueryElement(Base64Binary43_50.convertBase64Binary(src.getQueryElement()));
for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail())
tgt.addDetail(convertAuditEventEntityDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.getType().setTextElement(String43_50.convertString(src.getTypeElement()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r4b.model.AuditEvent.AuditEventEntityDetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.getType().hasTextElement())
tgt.setTypeElement(String43_50.convertString(src.getType().getTextElement()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
}

View File

@ -0,0 +1,76 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Date43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Basic43_50 {
public static org.hl7.fhir.r5.model.Basic convertBasic(org.hl7.fhir.r4b.model.Basic src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Basic tgt = new org.hl7.fhir.r5.model.Basic();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasCreated())
tgt.setCreatedElement(Date43_50.convertDatetoDateTime(src.getCreatedElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference43_50.convertReference(src.getAuthor()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Basic convertBasic(org.hl7.fhir.r5.model.Basic src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Basic tgt = new org.hl7.fhir.r4b.model.Basic();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasCreated())
tgt.setCreatedElement(Date43_50.convertDateTimeToDate(src.getCreatedElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference43_50.convertReference(src.getAuthor()));
return tgt;
}
}

View File

@ -0,0 +1,67 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Base64Binary43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Binary43_50 {
public static org.hl7.fhir.r5.model.Binary convertBinary(org.hl7.fhir.r4b.model.Binary src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Binary tgt = new org.hl7.fhir.r5.model.Binary();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt);
if (src.hasContentType())
tgt.setContentTypeElement(Code43_50.convertCode(src.getContentTypeElement()));
if (src.hasSecurityContext())
tgt.setSecurityContext(Reference43_50.convertReference(src.getSecurityContext()));
if (src.hasData())
tgt.setDataElement(Base64Binary43_50.convertBase64Binary(src.getDataElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Binary convertBinary(org.hl7.fhir.r5.model.Binary src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Binary tgt = new org.hl7.fhir.r4b.model.Binary();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt);
if (src.hasContentType())
tgt.setContentTypeElement(Code43_50.convertCode(src.getContentTypeElement()));
if (src.hasSecurityContext())
tgt.setSecurityContext(Reference43_50.convertReference(src.getSecurityContext()));
if (src.hasData())
tgt.setDataElement(Base64Binary43_50.convertBase64Binary(src.getDataElement()));
return tgt;
}
}

View File

@ -0,0 +1,353 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Decimal43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Integer43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class BiologicallyDerivedProduct43_50 {
public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct convertBiologicallyDerivedProduct(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.BiologicallyDerivedProduct tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
// if (src.hasProductCategory())
// tgt.setProductCategoryElement(convertBiologicallyDerivedProductCategory(src.getProductCategoryElement()));
// if (src.hasProductCode())
// tgt.setProductCode(CodeableConcept43_50.convertCodeableConcept(src.getProductCode()));
// if (src.hasStatus())
// tgt.setStatusElement(convertBiologicallyDerivedProductStatus(src.getStatusElement()));
for (org.hl7.fhir.r4b.model.Reference t : src.getRequest()) tgt.addRequest(Reference43_50.convertReference(t));
// if (src.hasQuantity())
// tgt.setQuantityElement(Integer43_50.convertInteger(src.getQuantityElement()));
for (org.hl7.fhir.r4b.model.Reference t : src.getParent()) tgt.addParent(Reference43_50.convertReference(t));
if (src.hasCollection())
tgt.setCollection(convertBiologicallyDerivedProductCollectionComponent(src.getCollection()));
// for (org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent t : src.getProcessing())
// tgt.addProcessing(convertBiologicallyDerivedProductProcessingComponent(t));
// if (src.hasManipulation())
// tgt.setManipulation(convertBiologicallyDerivedProductManipulationComponent(src.getManipulation()));
// for (org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent t : src.getStorage())
// tgt.addStorage(convertBiologicallyDerivedProductStorageComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.BiologicallyDerivedProduct convertBiologicallyDerivedProduct(org.hl7.fhir.r5.model.BiologicallyDerivedProduct src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.BiologicallyDerivedProduct tgt = new org.hl7.fhir.r4b.model.BiologicallyDerivedProduct();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
// if (src.hasProductCategory())
// tgt.setProductCategoryElement(convertBiologicallyDerivedProductCategory(src.getProductCategoryElement()));
// if (src.hasProductCode())
// tgt.setProductCode(CodeableConcept43_50.convertCodeableConcept(src.getProductCode()));
// if (src.hasStatus())
// tgt.setStatusElement(convertBiologicallyDerivedProductStatus(src.getStatusElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getRequest()) tgt.addRequest(Reference43_50.convertReference(t));
// if (src.hasQuantity())
// tgt.setQuantityElement(Integer43_50.convertInteger(src.getQuantityElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getParent()) tgt.addParent(Reference43_50.convertReference(t));
if (src.hasCollection())
tgt.setCollection(convertBiologicallyDerivedProductCollectionComponent(src.getCollection()));
// for (org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent t : src.getProcessing())
// tgt.addProcessing(convertBiologicallyDerivedProductProcessingComponent(t));
// if (src.hasManipulation())
// tgt.setManipulation(convertBiologicallyDerivedProductManipulationComponent(src.getManipulation()));
// for (org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent t : src.getStorage())
// tgt.addStorage(convertBiologicallyDerivedProductStorageComponent(t));
return tgt;
}
//
// static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory> convertBiologicallyDerivedProductCategory(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory> src) throws FHIRException {
// if (src == null || src.isEmpty())
// return null;
// org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategoryEnumFactory());
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// switch (src.getValue()) {
// case ORGAN:
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.ORGAN);
// break;
// case TISSUE:
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.TISSUE);
// break;
// case FLUID:
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.FLUID);
// break;
// case CELLS:
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.CELLS);
// break;
// case BIOLOGICALAGENT:
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.BIOLOGICALAGENT);
// break;
// default:
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.NULL);
// break;
// }
// return tgt;
// }
//
// static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory> convertBiologicallyDerivedProductCategory(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory> src) throws FHIRException {
// if (src == null || src.isEmpty())
// return null;
// org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategoryEnumFactory());
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// switch (src.getValue()) {
// case ORGAN:
// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.ORGAN);
// break;
// case TISSUE:
// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.TISSUE);
// break;
// case FLUID:
// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.FLUID);
// break;
// case CELLS:
// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.CELLS);
// break;
// case BIOLOGICALAGENT:
// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.BIOLOGICALAGENT);
// break;
// default:
// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.NULL);
// break;
// }
// return tgt;
// }
//
// static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus> convertBiologicallyDerivedProductStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus> src) throws FHIRException {
// if (src == null || src.isEmpty())
// return null;
// org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatusEnumFactory());
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// switch (src.getValue()) {
// case AVAILABLE:
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.AVAILABLE);
// break;
// case UNAVAILABLE:
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.UNAVAILABLE);
// break;
// default:
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.NULL);
// break;
// }
// return tgt;
// }
//
// static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus> convertBiologicallyDerivedProductStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus> src) throws FHIRException {
// if (src == null || src.isEmpty())
// return null;
// org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatusEnumFactory());
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// switch (src.getValue()) {
// case AVAILABLE:
// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.AVAILABLE);
// break;
// case UNAVAILABLE:
// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.UNAVAILABLE);
// break;
// default:
// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.NULL);
// break;
// }
// return tgt;
// }
public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent convertBiologicallyDerivedProductCollectionComponent(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCollector())
tgt.setCollector(Reference43_50.convertReference(src.getCollector()));
if (src.hasSource())
tgt.setSource(Reference43_50.convertReference(src.getSource()));
if (src.hasCollected())
tgt.setCollected(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getCollected()));
return tgt;
}
public static org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent convertBiologicallyDerivedProductCollectionComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent tgt = new org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCollector())
tgt.setCollector(Reference43_50.convertReference(src.getCollector()));
if (src.hasSource())
tgt.setSource(Reference43_50.convertReference(src.getSource()));
if (src.hasCollected())
tgt.setCollected(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getCollected()));
return tgt;
}
// public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent convertBiologicallyDerivedProductProcessingComponent(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasDescription())
// tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
// if (src.hasProcedure())
// tgt.setProcedure(CodeableConcept43_50.convertCodeableConcept(src.getProcedure()));
// if (src.hasAdditive())
// tgt.setAdditive(Reference43_50.convertReference(src.getAdditive()));
// if (src.hasTime())
// tgt.setTime(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTime()));
// return tgt;
// }
//
// public static org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent convertBiologicallyDerivedProductProcessingComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent tgt = new org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasDescription())
// tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
// if (src.hasProcedure())
// tgt.setProcedure(CodeableConcept43_50.convertCodeableConcept(src.getProcedure()));
// if (src.hasAdditive())
// tgt.setAdditive(Reference43_50.convertReference(src.getAdditive()));
// if (src.hasTime())
// tgt.setTime(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTime()));
// return tgt;
// }
//
// public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent convertBiologicallyDerivedProductManipulationComponent(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasDescription())
// tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
// if (src.hasTime())
// tgt.setTime(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTime()));
// return tgt;
// }
//
// public static org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent convertBiologicallyDerivedProductManipulationComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent tgt = new org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasDescription())
// tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
// if (src.hasTime())
// tgt.setTime(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTime()));
// return tgt;
// }
//
// public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent convertBiologicallyDerivedProductStorageComponent(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasDescription())
// tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
// if (src.hasTemperature())
// tgt.setTemperatureElement(Decimal43_50.convertDecimal(src.getTemperatureElement()));
// if (src.hasScale())
// tgt.setScaleElement(convertBiologicallyDerivedProductStorageScale(src.getScaleElement()));
// if (src.hasDuration())
// tgt.setDuration(Period43_50.convertPeriod(src.getDuration()));
// return tgt;
// }
//
// public static org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent convertBiologicallyDerivedProductStorageComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent tgt = new org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasDescription())
// tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
// if (src.hasTemperature())
// tgt.setTemperatureElement(Decimal43_50.convertDecimal(src.getTemperatureElement()));
// if (src.hasScale())
// tgt.setScaleElement(convertBiologicallyDerivedProductStorageScale(src.getScaleElement()));
// if (src.hasDuration())
// tgt.setDuration(Period43_50.convertPeriod(src.getDuration()));
// return tgt;
// }
//
// static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> convertBiologicallyDerivedProductStorageScale(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> src) throws FHIRException {
// if (src == null || src.isEmpty())
// return null;
// org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScaleEnumFactory());
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// switch (src.getValue()) {
// case FARENHEIT:
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.FARENHEIT);
// break;
// case CELSIUS:
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.CELSIUS);
// break;
// case KELVIN:
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.KELVIN);
// break;
// default:
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL);
// break;
// }
// return tgt;
// }
//
// static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> convertBiologicallyDerivedProductStorageScale(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> src) throws FHIRException {
// if (src == null || src.isEmpty())
// return null;
// org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScaleEnumFactory());
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// switch (src.getValue()) {
// case FARENHEIT:
// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.FARENHEIT);
// break;
// case CELSIUS:
// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.CELSIUS);
// break;
// case KELVIN:
// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.KELVIN);
// break;
// default:
// tgt.setValue(org.hl7.fhir.r4b.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL);
// break;
// }
// return tgt;
// }
}

View File

@ -0,0 +1,88 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Attachment43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class BodyStructure43_50 {
public static org.hl7.fhir.r5.model.BodyStructure convertBodyStructure(org.hl7.fhir.r4b.model.BodyStructure src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.BodyStructure tgt = new org.hl7.fhir.r5.model.BodyStructure();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasActive())
tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement()));
if (src.hasMorphology())
tgt.setMorphology(CodeableConcept43_50.convertCodeableConcept(src.getMorphology()));
// if (src.hasLocation())
// tgt.setLocation(CodeableConcept43_50.convertCodeableConcept(src.getLocation()));
// for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getLocationQualifier())
// tgt.addLocationQualifier(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r4b.model.Attachment t : src.getImage()) tgt.addImage(Attachment43_50.convertAttachment(t));
if (src.hasPatient())
tgt.setPatient(Reference43_50.convertReference(src.getPatient()));
return tgt;
}
public static org.hl7.fhir.r4b.model.BodyStructure convertBodyStructure(org.hl7.fhir.r5.model.BodyStructure src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.BodyStructure tgt = new org.hl7.fhir.r4b.model.BodyStructure();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasActive())
tgt.setActiveElement(Boolean43_50.convertBoolean(src.getActiveElement()));
if (src.hasMorphology())
tgt.setMorphology(CodeableConcept43_50.convertCodeableConcept(src.getMorphology()));
// if (src.hasLocation())
// tgt.setLocation(CodeableConcept43_50.convertCodeableConcept(src.getLocation()));
// for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLocationQualifier())
// tgt.addLocationQualifier(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.Attachment t : src.getImage()) tgt.addImage(Attachment43_50.convertAttachment(t));
if (src.hasPatient())
tgt.setPatient(Reference43_50.convertReference(src.getPatient()));
return tgt;
}
}

View File

@ -0,0 +1,429 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Signature43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Bundle43_50 {
public static org.hl7.fhir.r5.model.Bundle convertBundle(org.hl7.fhir.r4b.model.Bundle src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Bundle tgt = new org.hl7.fhir.r5.model.Bundle();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
if (src.hasType())
tgt.setTypeElement(convertBundleType(src.getTypeElement()));
if (src.hasTimestamp())
tgt.setTimestampElement(Instant43_50.convertInstant(src.getTimestampElement()));
if (src.hasTotal())
tgt.setTotalElement(UnsignedInt43_50.convertUnsignedInt(src.getTotalElement()));
for (org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));
for (org.hl7.fhir.r4b.model.Bundle.BundleEntryComponent t : src.getEntry())
tgt.addEntry(convertBundleEntryComponent(t));
if (src.hasSignature())
tgt.setSignature(Signature43_50.convertSignature(src.getSignature()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Bundle convertBundle(org.hl7.fhir.r5.model.Bundle src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Bundle tgt = new org.hl7.fhir.r4b.model.Bundle();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
if (src.hasType())
tgt.setTypeElement(convertBundleType(src.getTypeElement()));
if (src.hasTimestamp())
tgt.setTimestampElement(Instant43_50.convertInstant(src.getTimestampElement()));
if (src.hasTotal())
tgt.setTotalElement(UnsignedInt43_50.convertUnsignedInt(src.getTotalElement()));
for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));
for (org.hl7.fhir.r5.model.Bundle.BundleEntryComponent t : src.getEntry())
tgt.addEntry(convertBundleEntryComponent(t));
if (src.hasSignature())
tgt.setSignature(Signature43_50.convertSignature(src.getSignature()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.BundleType> convertBundleType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Bundle.BundleType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.BundleType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.BundleTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case DOCUMENT:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.DOCUMENT);
break;
case MESSAGE:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.MESSAGE);
break;
case TRANSACTION:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTION);
break;
case TRANSACTIONRESPONSE:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTIONRESPONSE);
break;
case BATCH:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCH);
break;
case BATCHRESPONSE:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.BATCHRESPONSE);
break;
case HISTORY:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.HISTORY);
break;
case SEARCHSET:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.SEARCHSET);
break;
case COLLECTION:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.COLLECTION);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.BundleType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Bundle.BundleType> convertBundleType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.BundleType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Bundle.BundleType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Bundle.BundleTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case DOCUMENT:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.DOCUMENT);
break;
case MESSAGE:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.MESSAGE);
break;
case TRANSACTION:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.TRANSACTION);
break;
case TRANSACTIONRESPONSE:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.TRANSACTIONRESPONSE);
break;
case BATCH:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.BATCH);
break;
case BATCHRESPONSE:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.BATCHRESPONSE);
break;
case HISTORY:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.HISTORY);
break;
case SEARCHSET:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.SEARCHSET);
break;
case COLLECTION:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.COLLECTION);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.BundleType.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleLinkComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasRelation())
tgt.setRelationElement(String43_50.convertString(src.getRelationElement()));
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r5.model.Bundle.BundleLinkComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasRelation())
tgt.setRelationElement(String43_50.convertString(src.getRelationElement()));
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.r4b.model.Bundle.BundleEntryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));
if (src.hasFullUrl())
tgt.setFullUrlElement(Uri43_50.convertUri(src.getFullUrlElement()));
if (src.hasResource())
tgt.setResource(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertResource(src.getResource()));
if (src.hasSearch())
tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch()));
if (src.hasRequest())
tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest()));
if (src.hasResponse())
tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r4b.model.Bundle.BundleEntryComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));
if (src.hasFullUrl())
tgt.setFullUrlElement(Uri43_50.convertUri(src.getFullUrlElement()));
if (src.hasResource())
tgt.setResource(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertResource(src.getResource()));
if (src.hasSearch())
tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch()));
if (src.hasRequest())
tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest()));
if (src.hasResponse())
tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse()));
return tgt;
}
public static org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.r4b.model.Bundle.BundleEntrySearchComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasMode())
tgt.setModeElement(convertSearchEntryMode(src.getModeElement()));
if (src.hasScore())
tgt.setScoreElement(Decimal43_50.convertDecimal(src.getScoreElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r4b.model.Bundle.BundleEntrySearchComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasMode())
tgt.setModeElement(convertSearchEntryMode(src.getModeElement()));
if (src.hasScore())
tgt.setScoreElement(Decimal43_50.convertDecimal(src.getScoreElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.SearchEntryMode> convertSearchEntryMode(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Bundle.SearchEntryMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.SearchEntryMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.SearchEntryModeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case MATCH:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.MATCH);
break;
case INCLUDE:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.INCLUDE);
break;
case OUTCOME:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.OUTCOME);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.SearchEntryMode.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Bundle.SearchEntryMode> convertSearchEntryMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.SearchEntryMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Bundle.SearchEntryMode> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Bundle.SearchEntryModeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case MATCH:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.SearchEntryMode.MATCH);
break;
case INCLUDE:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.SearchEntryMode.INCLUDE);
break;
case OUTCOME:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.SearchEntryMode.OUTCOME);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.SearchEntryMode.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r4b.model.Bundle.BundleEntryRequestComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasMethod())
tgt.setMethodElement(convertHTTPVerb(src.getMethodElement()));
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
if (src.hasIfNoneMatch())
tgt.setIfNoneMatchElement(String43_50.convertString(src.getIfNoneMatchElement()));
if (src.hasIfModifiedSince())
tgt.setIfModifiedSinceElement(Instant43_50.convertInstant(src.getIfModifiedSinceElement()));
if (src.hasIfMatch())
tgt.setIfMatchElement(String43_50.convertString(src.getIfMatchElement()));
if (src.hasIfNoneExist())
tgt.setIfNoneExistElement(String43_50.convertString(src.getIfNoneExistElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r4b.model.Bundle.BundleEntryRequestComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasMethod())
tgt.setMethodElement(convertHTTPVerb(src.getMethodElement()));
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
if (src.hasIfNoneMatch())
tgt.setIfNoneMatchElement(String43_50.convertString(src.getIfNoneMatchElement()));
if (src.hasIfModifiedSince())
tgt.setIfModifiedSinceElement(Instant43_50.convertInstant(src.getIfModifiedSinceElement()));
if (src.hasIfMatch())
tgt.setIfMatchElement(String43_50.convertString(src.getIfMatchElement()));
if (src.hasIfNoneExist())
tgt.setIfNoneExistElement(String43_50.convertString(src.getIfNoneExistElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.HTTPVerb> convertHTTPVerb(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Bundle.HTTPVerb> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.HTTPVerb> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Bundle.HTTPVerbEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case GET:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.GET);
break;
case HEAD:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.HEAD);
break;
case POST:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.POST);
break;
case PUT:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.PUT);
break;
case DELETE:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE);
break;
case PATCH:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.PATCH);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Bundle.HTTPVerb.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Bundle.HTTPVerb> convertHTTPVerb(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Bundle.HTTPVerb> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Bundle.HTTPVerb> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Bundle.HTTPVerbEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case GET:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.GET);
break;
case HEAD:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.HEAD);
break;
case POST:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.POST);
break;
case PUT:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.PUT);
break;
case DELETE:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.DELETE);
break;
case PATCH:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.PATCH);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Bundle.HTTPVerb.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r4b.model.Bundle.BundleEntryResponseComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasStatus())
tgt.setStatusElement(String43_50.convertString(src.getStatusElement()));
if (src.hasLocation())
tgt.setLocationElement(Uri43_50.convertUri(src.getLocationElement()));
if (src.hasEtag())
tgt.setEtagElement(String43_50.convertString(src.getEtagElement()));
if (src.hasLastModified())
tgt.setLastModifiedElement(Instant43_50.convertInstant(src.getLastModifiedElement()));
if (src.hasOutcome())
tgt.setOutcome(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertResource(src.getOutcome()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r4b.model.Bundle.BundleEntryResponseComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasStatus())
tgt.setStatusElement(String43_50.convertString(src.getStatusElement()));
if (src.hasLocation())
tgt.setLocationElement(Uri43_50.convertUri(src.getLocationElement()));
if (src.hasEtag())
tgt.setEtagElement(String43_50.convertString(src.getEtagElement()));
if (src.hasLastModified())
tgt.setLastModifiedElement(Instant43_50.convertInstant(src.getLastModifiedElement()));
if (src.hasOutcome())
tgt.setOutcome(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertResource(src.getOutcome()));
return tgt;
}
}

View File

@ -0,0 +1,527 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeableReference;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CarePlan43_50 {
public static org.hl7.fhir.r5.model.CarePlan convertCarePlan(org.hl7.fhir.r4b.model.CarePlan src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CarePlan tgt = new org.hl7.fhir.r5.model.CarePlan();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t));
for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(Uri43_50.convertUri(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertCarePlanStatus(src.getStatusElement()));
if (src.hasIntent())
tgt.setIntentElement(convertCarePlanIntent(src.getIntentElement()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
if (src.hasCreated())
tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement()));
if (src.hasAuthor())
tgt.setCustodian(Reference43_50.convertReference(src.getAuthor()));
for (org.hl7.fhir.r4b.model.Reference t : src.getContributor())
tgt.addContributor(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getCareTeam()) tgt.addCareTeam(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getAddresses())
tgt.addAddresses(Reference43_50.convertReferenceToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getGoal()) tgt.addGoal(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent t : src.getActivity())
tgt.addActivity(convertCarePlanActivityComponent(t));
for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.CarePlan convertCarePlan(org.hl7.fhir.r5.model.CarePlan src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CarePlan tgt = new org.hl7.fhir.r4b.model.CarePlan();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t));
for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(Uri43_50.convertUri(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertCarePlanStatus(src.getStatusElement()));
if (src.hasIntent())
tgt.setIntentElement(convertCarePlanIntent(src.getIntentElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
if (src.hasCreated())
tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement()));
if (src.hasCustodian())
tgt.setAuthor(Reference43_50.convertReference(src.getCustodian()));
for (org.hl7.fhir.r5.model.Reference t : src.getContributor())
tgt.addContributor(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getCareTeam()) tgt.addCareTeam(Reference43_50.convertReference(t));
for (CodeableReference t : src.getAddresses())
if (t.hasReference())
tgt.addAddresses(Reference43_50.convertReference(t.getReference()));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) tgt.addGoal(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent t : src.getActivity())
tgt.addActivity(convertCarePlanActivityComponent(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestStatus> convertCarePlanStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case DRAFT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD);
break;
case REVOKED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestStatus> convertCarePlanStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case DRAFT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.DRAFT);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ACTIVE);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ONHOLD);
break;
case REVOKED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.REVOKED);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanIntent> convertCarePlanIntent(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanIntent> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CarePlan.CarePlanIntentEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PROPOSAL:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PROPOSAL);
break;
case PLAN:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PLAN);
break;
case ORDER:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.ORDER);
break;
case OPTION:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.OPTION);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent> convertCarePlanIntent(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanIntent> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CarePlan.CarePlanIntentEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PROPOSAL:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.PROPOSAL);
break;
case PLAN:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.PLAN);
break;
case ORDER:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.ORDER);
break;
case OPTION:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.OPTION);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanIntent.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getOutcomeCodeableConcept())
tgt.addPerformedActivity(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getOutcomeReference())
tgt.addPerformedActivity(Reference43_50.convertReferenceToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Annotation t : src.getProgress()) tgt.addProgress(Annotation43_50.convertAnnotation(t));
if (src.hasReference())
tgt.setPlannedActivityReference(Reference43_50.convertReference(src.getReference()));
if (src.hasDetail())
tgt.setPlannedActivityDetail(convertCarePlanActivityDetailComponent(src.getDetail()));
return tgt;
}
public static org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (CodeableReference t : src.getPerformedActivity())
if (t.hasConcept())
tgt.addOutcomeCodeableConcept(CodeableConcept43_50.convertCodeableConcept(t.getConcept()));
for (CodeableReference t : src.getPerformedActivity())
if (t.hasReference())
tgt.addOutcomeReference(Reference43_50.convertReference(t.getReference()));
for (org.hl7.fhir.r5.model.Annotation t : src.getProgress()) tgt.addProgress(Annotation43_50.convertAnnotation(t));
if (src.hasPlannedActivityReference())
tgt.setReference(Reference43_50.convertReference(src.getPlannedActivityReference()));
if (src.hasPlannedActivityDetail())
tgt.setDetail(convertCarePlanActivityDetailComponent(src.getPlannedActivityDetail()));
return tgt;
}
public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityPlannedActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CarePlan.CarePlanActivityPlannedActivityDetailComponent tgt = new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityPlannedActivityDetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasKind())
tgt.setKindElement(convertCarePlanActivityKind(src.getKindElement()));
for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t));
for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(Uri43_50.convertUri(t));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode())
tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference())
tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getGoal()) tgt.addGoal(Reference43_50.convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertCarePlanActivityStatus(src.getStatusElement()));
if (src.hasStatusReason())
tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason()));
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement()));
if (src.hasScheduled())
tgt.setScheduled(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getScheduled()));
if (src.hasLocation())
tgt.getLocation().setReference(Reference43_50.convertReference(src.getLocation()));
for (org.hl7.fhir.r4b.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference43_50.convertReference(t));
if (src.hasProduct())
tgt.setProduct(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProduct()));
if (src.hasDailyAmount())
tgt.setDailyAmount(SimpleQuantity43_50.convertSimpleQuantity(src.getDailyAmount()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityPlannedActivityDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityDetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasKind())
tgt.setKindElement(convertCarePlanActivityKind(src.getKindElement()));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t));
for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(Uri43_50.convertUri(t));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
for (CodeableReference t : src.getReason())
if (t.hasConcept())
tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept()));
for (CodeableReference t : src.getReason())
if (t.hasReference())
tgt.addReasonReference(Reference43_50.convertReference(t.getReference()));
for (org.hl7.fhir.r5.model.Reference t : src.getGoal()) tgt.addGoal(Reference43_50.convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertCarePlanActivityStatus(src.getStatusElement()));
if (src.hasStatusReason())
tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason()));
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement()));
if (src.hasScheduled())
tgt.setScheduled(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getScheduled()));
if (src.getLocation().hasReference())
tgt.setLocation(Reference43_50.convertReference(src.getLocation().getReference()));
for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference43_50.convertReference(t));
if (src.hasProduct())
tgt.setProduct(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProduct()));
if (src.hasDailyAmount())
tgt.setDailyAmount(SimpleQuantity43_50.convertSimpleQuantity(src.getDailyAmount()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind> convertCarePlanActivityKind(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKindEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case APPOINTMENT:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.APPOINTMENT);
break;
case COMMUNICATIONREQUEST:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.COMMUNICATIONREQUEST);
break;
case DEVICEREQUEST:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.DEVICEREQUEST);
break;
case MEDICATIONREQUEST:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.MEDICATIONREQUEST);
break;
case NUTRITIONORDER:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.NUTRITIONORDER);
break;
case TASK:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.TASK);
break;
case SERVICEREQUEST:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.SERVICEREQUEST);
break;
case VISIONPRESCRIPTION:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.VISIONPRESCRIPTION);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind> convertCarePlanActivityKind(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKindEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case APPOINTMENT:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.APPOINTMENT);
break;
case COMMUNICATIONREQUEST:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.COMMUNICATIONREQUEST);
break;
case DEVICEREQUEST:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.DEVICEREQUEST);
break;
case MEDICATIONREQUEST:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.MEDICATIONREQUEST);
break;
case NUTRITIONORDER:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.NUTRITIONORDER);
break;
case TASK:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.TASK);
break;
case SERVICEREQUEST:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.SERVICEREQUEST);
break;
case VISIONPRESCRIPTION:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.VISIONPRESCRIPTION);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityKind.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus> convertCarePlanActivityStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case NOTSTARTED:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.NOTSTARTED);
break;
case SCHEDULED:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.SCHEDULED);
break;
case INPROGRESS:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.INPROGRESS);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.ONHOLD);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.COMPLETED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.CANCELLED);
break;
case STOPPED:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.STOPPED);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.UNKNOWN);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus> convertCarePlanActivityStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case NOTSTARTED:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.NOTSTARTED);
break;
case SCHEDULED:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.SCHEDULED);
break;
case INPROGRESS:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.INPROGRESS);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.ONHOLD);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.COMPLETED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.CANCELLED);
break;
case STOPPED:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.STOPPED);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.UNKNOWN);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.CarePlan.CarePlanActivityStatus.NULL);
break;
}
return tgt;
}
}

View File

@ -0,0 +1,192 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeableReference;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CareTeam43_50 {
public static org.hl7.fhir.r5.model.CareTeam convertCareTeam(org.hl7.fhir.r4b.model.CareTeam src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CareTeam tgt = new org.hl7.fhir.r5.model.CareTeam();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertCareTeamStatus(src.getStatusElement()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r4b.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertCareTeamParticipantComponent(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode())
tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference())
tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getManagingOrganization())
tgt.addManagingOrganization(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(ContactPoint43_50.convertContactPoint(t));
for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.CareTeam convertCareTeam(org.hl7.fhir.r5.model.CareTeam src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CareTeam tgt = new org.hl7.fhir.r4b.model.CareTeam();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertCareTeamStatus(src.getStatusElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertCareTeamParticipantComponent(t));
for (CodeableReference t : src.getReason())
if (t.hasConcept())
tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept()));
for (CodeableReference t : src.getReason())
if (t.hasReference())
tgt.addReasonReference(Reference43_50.convertReference(t.getReference()));
for (org.hl7.fhir.r5.model.Reference t : src.getManagingOrganization())
tgt.addManagingOrganization(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(ContactPoint43_50.convertContactPoint(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CareTeam.CareTeamStatus> convertCareTeamStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CareTeam.CareTeamStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CareTeam.CareTeamStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PROPOSED:
tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.PROPOSED);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ACTIVE);
break;
case SUSPENDED:
tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.SUSPENDED);
break;
case INACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.INACTIVE);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus> convertCareTeamStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CareTeam.CareTeamStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CareTeam.CareTeamStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PROPOSED:
tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.PROPOSED);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.ACTIVE);
break;
case SUSPENDED:
tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.SUSPENDED);
break;
case INACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.INACTIVE);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.CareTeam.CareTeamStatus.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent convertCareTeamParticipantComponent(org.hl7.fhir.r4b.model.CareTeam.CareTeamParticipantComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent tgt = new org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getRole())
tgt.setRole(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasMember())
tgt.setMember(Reference43_50.convertReference(src.getMember()));
if (src.hasOnBehalfOf())
tgt.setOnBehalfOf(Reference43_50.convertReference(src.getOnBehalfOf()));
if (src.hasPeriod())
tgt.setCoverage(Period43_50.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4b.model.CareTeam.CareTeamParticipantComponent convertCareTeamParticipantComponent(org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CareTeam.CareTeamParticipantComponent tgt = new org.hl7.fhir.r4b.model.CareTeam.CareTeamParticipantComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasRole())
tgt.addRole(CodeableConcept43_50.convertCodeableConcept(src.getRole()));
if (src.hasMember())
tgt.setMember(Reference43_50.convertReference(src.getMember()));
if (src.hasOnBehalfOf())
tgt.setOnBehalfOf(Reference43_50.convertReference(src.getOnBehalfOf()));
if (src.hasCoveragePeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getCoveragePeriod()));
return tgt;
}
}

View File

@ -0,0 +1,245 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ChargeItem43_50 {
public static org.hl7.fhir.r5.model.ChargeItem convertChargeItem(org.hl7.fhir.r4b.model.ChargeItem src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ChargeItem tgt = new org.hl7.fhir.r5.model.ChargeItem();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r4b.model.UriType t : src.getDefinitionUri()) tgt.getDefinitionUri().add(Uri43_50.convertUri(t));
for (org.hl7.fhir.r4b.model.CanonicalType t : src.getDefinitionCanonical())
tgt.getDefinitionCanonical().add(Canonical43_50.convertCanonical(t));
if (src.hasStatus())
tgt.setStatusElement(convertChargeItemStatus(src.getStatusElement()));
for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasContext())
tgt.setContext(Reference43_50.convertReference(src.getContext()));
if (src.hasOccurrence())
tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence()));
for (org.hl7.fhir.r4b.model.ChargeItem.ChargeItemPerformerComponent t : src.getPerformer())
tgt.addPerformer(convertChargeItemPerformerComponent(t));
if (src.hasPerformingOrganization())
tgt.setPerformingOrganization(Reference43_50.convertReference(src.getPerformingOrganization()));
if (src.hasRequestingOrganization())
tgt.setRequestingOrganization(Reference43_50.convertReference(src.getRequestingOrganization()));
if (src.hasCostCenter())
tgt.setCostCenter(Reference43_50.convertReference(src.getCostCenter()));
if (src.hasQuantity())
tgt.setQuantity(Quantity43_50.convertQuantity(src.getQuantity()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getBodysite())
tgt.addBodysite(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasFactorOverride())
tgt.setFactorOverrideElement(Decimal43_50.convertDecimal(src.getFactorOverrideElement()));
if (src.hasPriceOverride())
tgt.setPriceOverride(Money43_50.convertMoney(src.getPriceOverride()));
if (src.hasOverrideReason())
tgt.setOverrideReasonElement(String43_50.convertString(src.getOverrideReasonElement()));
if (src.hasEnterer())
tgt.setEnterer(Reference43_50.convertReference(src.getEnterer()));
if (src.hasEnteredDate())
tgt.setEnteredDateElement(DateTime43_50.convertDateTime(src.getEnteredDateElement()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReason())
tgt.addReason(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getService()) tgt.addService(Reference43_50.convertReference(t));
if (src.hasProductCodeableConcept())
tgt.addProduct().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getProductCodeableConcept()));
else if (src.hasProductReference())
tgt.addProduct().setReference(Reference43_50.convertReference(src.getProductReference()));
for (org.hl7.fhir.r4b.model.Reference t : src.getAccount()) tgt.addAccount(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInformation())
tgt.addSupportingInformation(Reference43_50.convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ChargeItem convertChargeItem(org.hl7.fhir.r5.model.ChargeItem src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ChargeItem tgt = new org.hl7.fhir.r4b.model.ChargeItem();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r5.model.UriType t : src.getDefinitionUri()) tgt.getDefinitionUri().add(Uri43_50.convertUri(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getDefinitionCanonical())
tgt.getDefinitionCanonical().add(Canonical43_50.convertCanonical(t));
if (src.hasStatus())
tgt.setStatusElement(convertChargeItemStatus(src.getStatusElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasContext())
tgt.setContext(Reference43_50.convertReference(src.getContext()));
if (src.hasOccurrence())
tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence()));
for (org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent t : src.getPerformer())
tgt.addPerformer(convertChargeItemPerformerComponent(t));
if (src.hasPerformingOrganization())
tgt.setPerformingOrganization(Reference43_50.convertReference(src.getPerformingOrganization()));
if (src.hasRequestingOrganization())
tgt.setRequestingOrganization(Reference43_50.convertReference(src.getRequestingOrganization()));
if (src.hasCostCenter())
tgt.setCostCenter(Reference43_50.convertReference(src.getCostCenter()));
if (src.hasQuantity())
tgt.setQuantity(Quantity43_50.convertQuantity(src.getQuantity()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodysite())
tgt.addBodysite(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasFactorOverride())
tgt.setFactorOverrideElement(Decimal43_50.convertDecimal(src.getFactorOverrideElement()));
if (src.hasPriceOverride())
tgt.setPriceOverride(Money43_50.convertMoney(src.getPriceOverride()));
if (src.hasOverrideReason())
tgt.setOverrideReasonElement(String43_50.convertString(src.getOverrideReasonElement()));
if (src.hasEnterer())
tgt.setEnterer(Reference43_50.convertReference(src.getEnterer()));
if (src.hasEnteredDate())
tgt.setEnteredDateElement(DateTime43_50.convertDateTime(src.getEnteredDateElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason())
tgt.addReason(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getService()) tgt.addService(Reference43_50.convertReference(t));
if (src.getProductFirstRep().hasConcept())
tgt.setProduct(CodeableConcept43_50.convertCodeableConcept(src.getProductFirstRep().getConcept()));
if (src.getProductFirstRep().hasReference())
tgt.setProduct(Reference43_50.convertReference(src.getProductFirstRep().getReference()));
for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) tgt.addAccount(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation())
tgt.addSupportingInformation(Reference43_50.convertReference(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus> convertChargeItemStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PLANNED:
tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.PLANNED);
break;
case BILLABLE:
tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.BILLABLE);
break;
case NOTBILLABLE:
tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.NOTBILLABLE);
break;
case ABORTED:
tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.ABORTED);
break;
case BILLED:
tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.BILLED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus> convertChargeItemStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PLANNED:
tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.PLANNED);
break;
case BILLABLE:
tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.BILLABLE);
break;
case NOTBILLABLE:
tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.NOTBILLABLE);
break;
case ABORTED:
tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.ABORTED);
break;
case BILLED:
tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.BILLED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemStatus.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent convertChargeItemPerformerComponent(org.hl7.fhir.r4b.model.ChargeItem.ChargeItemPerformerComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent tgt = new org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasFunction())
tgt.setFunction(CodeableConcept43_50.convertCodeableConcept(src.getFunction()));
if (src.hasActor())
tgt.setActor(Reference43_50.convertReference(src.getActor()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ChargeItem.ChargeItemPerformerComponent convertChargeItemPerformerComponent(org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ChargeItem.ChargeItemPerformerComponent tgt = new org.hl7.fhir.r4b.model.ChargeItem.ChargeItemPerformerComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasFunction())
tgt.setFunction(CodeableConcept43_50.convertCodeableConcept(src.getFunction()));
if (src.hasActor())
tgt.setActor(Reference43_50.convertReference(src.getActor()));
return tgt;
}
}

View File

@ -0,0 +1,294 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Money43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ChargeItemDefinition43_50 {
public static org.hl7.fhir.r5.model.ChargeItemDefinition convertChargeItemDefinition(org.hl7.fhir.r4b.model.ChargeItemDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ChargeItemDefinition tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
for (org.hl7.fhir.r4b.model.UriType t : src.getDerivedFromUri()) tgt.getDerivedFromUri().add(Uri43_50.convertUri(t));
for (org.hl7.fhir.r4b.model.CanonicalType t : src.getPartOf())
tgt.getPartOf().add(Canonical43_50.convertCanonical(t));
for (org.hl7.fhir.r4b.model.CanonicalType t : src.getReplaces())
tgt.getReplaces().add(Canonical43_50.convertCanonical(t));
if (src.hasStatus())
tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact())
tgt.addContact(ContactDetail43_50.convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext())
tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasCopyright())
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r4b.model.Reference t : src.getInstance()) tgt.addInstance(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability())
tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t));
for (org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent t : src.getPropertyGroup())
tgt.addPropertyGroup(convertChargeItemDefinitionPropertyGroupComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ChargeItemDefinition convertChargeItemDefinition(org.hl7.fhir.r5.model.ChargeItemDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ChargeItemDefinition tgt = new org.hl7.fhir.r4b.model.ChargeItemDefinition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
for (org.hl7.fhir.r5.model.UriType t : src.getDerivedFromUri()) tgt.getDerivedFromUri().add(Uri43_50.convertUri(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getPartOf())
tgt.getPartOf().add(Canonical43_50.convertCanonical(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getReplaces())
tgt.getReplaces().add(Canonical43_50.convertCanonical(t));
if (src.hasStatus())
tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(ContactDetail43_50.convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasCopyright())
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(Date43_50.convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(Date43_50.convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(Period43_50.convertPeriod(src.getEffectivePeriod()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r5.model.Reference t : src.getInstance()) tgt.addInstance(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability())
tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t));
for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent t : src.getPropertyGroup())
tgt.addPropertyGroup(convertChargeItemDefinitionPropertyGroupComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent convertChargeItemDefinitionApplicabilityComponent(org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasLanguage())
tgt.setLanguageElement(String43_50.convertString(src.getLanguageElement()));
if (src.hasExpression())
tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent convertChargeItemDefinitionApplicabilityComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent tgt = new org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasLanguage())
tgt.setLanguageElement(String43_50.convertString(src.getLanguageElement()));
if (src.hasExpression())
tgt.setExpressionElement(String43_50.convertString(src.getExpressionElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent convertChargeItemDefinitionPropertyGroupComponent(org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability())
tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t));
for (org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent t : src.getPriceComponent())
tgt.addPriceComponent(convertChargeItemDefinitionPropertyGroupPriceComponentComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent convertChargeItemDefinitionPropertyGroupComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent tgt = new org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability())
tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t));
for (org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent t : src.getPriceComponent())
tgt.addPriceComponent(convertChargeItemDefinitionPropertyGroupPriceComponentComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent convertChargeItemDefinitionPropertyGroupPriceComponentComponent(org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertChargeItemDefinitionPriceComponentType(src.getTypeElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasAmount())
tgt.setAmount(Money43_50.convertMoney(src.getAmount()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent convertChargeItemDefinitionPropertyGroupPriceComponentComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent tgt = new org.hl7.fhir.r4b.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertChargeItemDefinitionPriceComponentType(src.getTypeElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasAmount())
tgt.setAmount(Money43_50.convertMoney(src.getAmount()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType> convertChargeItemDefinitionPriceComponentType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case BASE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.BASE);
break;
case SURCHARGE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.SURCHARGE);
break;
case DEDUCTION:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.DEDUCTION);
break;
case DISCOUNT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.DISCOUNT);
break;
case TAX:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.TAX);
break;
case INFORMATIONAL:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.INFORMATIONAL);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType> convertChargeItemDefinitionPriceComponentType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.InvoicePriceComponentType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case BASE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.BASE);
break;
case SURCHARGE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.SURCHARGE);
break;
case DEDUCTION:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.DEDUCTION);
break;
case DISCOUNT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.DISCOUNT);
break;
case TAX:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.TAX);
break;
case INFORMATIONAL:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.INFORMATIONAL);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.InvoicePriceComponentType.NULL);
break;
}
return tgt;
}
}

View File

@ -0,0 +1,739 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Claim43_50 {
public static org.hl7.fhir.r5.model.Claim convertClaim(org.hl7.fhir.r4b.model.Claim src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Claim tgt = new org.hl7.fhir.r5.model.Claim();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertClaimStatus(src.getStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType()));
if (src.hasUse())
tgt.setUseElement(convertUse(src.getUseElement()));
if (src.hasPatient())
tgt.setPatient(Reference43_50.convertReference(src.getPatient()));
if (src.hasBillablePeriod())
tgt.setBillablePeriod(Period43_50.convertPeriod(src.getBillablePeriod()));
if (src.hasCreated())
tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement()));
if (src.hasEnterer())
tgt.setEnterer(Reference43_50.convertReference(src.getEnterer()));
if (src.hasInsurer())
tgt.setInsurer(Reference43_50.convertReference(src.getInsurer()));
if (src.hasProvider())
tgt.setProvider(Reference43_50.convertReference(src.getProvider()));
if (src.hasPriority())
tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority()));
if (src.hasFundsReserve())
tgt.setFundsReserve(CodeableConcept43_50.convertCodeableConcept(src.getFundsReserve()));
for (org.hl7.fhir.r4b.model.Claim.RelatedClaimComponent t : src.getRelated())
tgt.addRelated(convertRelatedClaimComponent(t));
if (src.hasPrescription())
tgt.setPrescription(Reference43_50.convertReference(src.getPrescription()));
if (src.hasOriginalPrescription())
tgt.setOriginalPrescription(Reference43_50.convertReference(src.getOriginalPrescription()));
if (src.hasPayee())
tgt.setPayee(convertPayeeComponent(src.getPayee()));
if (src.hasReferral())
tgt.setReferral(Reference43_50.convertReference(src.getReferral()));
if (src.hasFacility())
tgt.setFacility(Reference43_50.convertReference(src.getFacility()));
for (org.hl7.fhir.r4b.model.Claim.CareTeamComponent t : src.getCareTeam())
tgt.addCareTeam(convertCareTeamComponent(t));
for (org.hl7.fhir.r4b.model.Claim.SupportingInformationComponent t : src.getSupportingInfo())
tgt.addSupportingInfo(convertSupportingInformationComponent(t));
for (org.hl7.fhir.r4b.model.Claim.DiagnosisComponent t : src.getDiagnosis())
tgt.addDiagnosis(convertDiagnosisComponent(t));
for (org.hl7.fhir.r4b.model.Claim.ProcedureComponent t : src.getProcedure())
tgt.addProcedure(convertProcedureComponent(t));
for (org.hl7.fhir.r4b.model.Claim.InsuranceComponent t : src.getInsurance())
tgt.addInsurance(convertInsuranceComponent(t));
if (src.hasAccident())
tgt.setAccident(convertAccidentComponent(src.getAccident()));
for (org.hl7.fhir.r4b.model.Claim.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t));
if (src.hasTotal())
tgt.setTotal(Money43_50.convertMoney(src.getTotal()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Claim convertClaim(org.hl7.fhir.r5.model.Claim src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Claim tgt = new org.hl7.fhir.r4b.model.Claim();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertClaimStatus(src.getStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType()));
if (src.hasUse())
tgt.setUseElement(convertUse(src.getUseElement()));
if (src.hasPatient())
tgt.setPatient(Reference43_50.convertReference(src.getPatient()));
if (src.hasBillablePeriod())
tgt.setBillablePeriod(Period43_50.convertPeriod(src.getBillablePeriod()));
if (src.hasCreated())
tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement()));
if (src.hasEnterer())
tgt.setEnterer(Reference43_50.convertReference(src.getEnterer()));
if (src.hasInsurer())
tgt.setInsurer(Reference43_50.convertReference(src.getInsurer()));
if (src.hasProvider())
tgt.setProvider(Reference43_50.convertReference(src.getProvider()));
if (src.hasPriority())
tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority()));
if (src.hasFundsReserve())
tgt.setFundsReserve(CodeableConcept43_50.convertCodeableConcept(src.getFundsReserve()));
for (org.hl7.fhir.r5.model.Claim.RelatedClaimComponent t : src.getRelated())
tgt.addRelated(convertRelatedClaimComponent(t));
if (src.hasPrescription())
tgt.setPrescription(Reference43_50.convertReference(src.getPrescription()));
if (src.hasOriginalPrescription())
tgt.setOriginalPrescription(Reference43_50.convertReference(src.getOriginalPrescription()));
if (src.hasPayee())
tgt.setPayee(convertPayeeComponent(src.getPayee()));
if (src.hasReferral())
tgt.setReferral(Reference43_50.convertReference(src.getReferral()));
if (src.hasFacility())
tgt.setFacility(Reference43_50.convertReference(src.getFacility()));
for (org.hl7.fhir.r5.model.Claim.CareTeamComponent t : src.getCareTeam())
tgt.addCareTeam(convertCareTeamComponent(t));
for (org.hl7.fhir.r5.model.Claim.SupportingInformationComponent t : src.getSupportingInfo())
tgt.addSupportingInfo(convertSupportingInformationComponent(t));
for (org.hl7.fhir.r5.model.Claim.DiagnosisComponent t : src.getDiagnosis())
tgt.addDiagnosis(convertDiagnosisComponent(t));
for (org.hl7.fhir.r5.model.Claim.ProcedureComponent t : src.getProcedure())
tgt.addProcedure(convertProcedureComponent(t));
for (org.hl7.fhir.r5.model.Claim.InsuranceComponent t : src.getInsurance())
tgt.addInsurance(convertInsuranceComponent(t));
if (src.hasAccident())
tgt.setAccident(convertAccidentComponent(src.getAccident()));
for (org.hl7.fhir.r5.model.Claim.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t));
if (src.hasTotal())
tgt.setTotal(Money43_50.convertMoney(src.getTotal()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes> convertClaimStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED);
break;
case DRAFT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> convertClaimStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED);
break;
case DRAFT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.Use> convertUse(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.Use> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.Use> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.UseEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case CLAIM:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.CLAIM);
break;
case PREAUTHORIZATION:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREAUTHORIZATION);
break;
case PREDETERMINATION:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREDETERMINATION);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.Use> convertUse(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.Use> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.Use> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.UseEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case CLAIM:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.CLAIM);
break;
case PREAUTHORIZATION:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREAUTHORIZATION);
break;
case PREDETERMINATION:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREDETERMINATION);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r4b.model.Claim.RelatedClaimComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Claim.RelatedClaimComponent tgt = new org.hl7.fhir.r5.model.Claim.RelatedClaimComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasClaim())
tgt.setClaim(Reference43_50.convertReference(src.getClaim()));
if (src.hasRelationship())
tgt.setRelationship(CodeableConcept43_50.convertCodeableConcept(src.getRelationship()));
if (src.hasReference())
tgt.setReference(Identifier43_50.convertIdentifier(src.getReference()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Claim.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r5.model.Claim.RelatedClaimComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Claim.RelatedClaimComponent tgt = new org.hl7.fhir.r4b.model.Claim.RelatedClaimComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasClaim())
tgt.setClaim(Reference43_50.convertReference(src.getClaim()));
if (src.hasRelationship())
tgt.setRelationship(CodeableConcept43_50.convertCodeableConcept(src.getRelationship()));
if (src.hasReference())
tgt.setReference(Identifier43_50.convertIdentifier(src.getReference()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.PayeeComponent convertPayeeComponent(org.hl7.fhir.r4b.model.Claim.PayeeComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Claim.PayeeComponent tgt = new org.hl7.fhir.r5.model.Claim.PayeeComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasParty())
tgt.setParty(Reference43_50.convertReference(src.getParty()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Claim.PayeeComponent convertPayeeComponent(org.hl7.fhir.r5.model.Claim.PayeeComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Claim.PayeeComponent tgt = new org.hl7.fhir.r4b.model.Claim.PayeeComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasParty())
tgt.setParty(Reference43_50.convertReference(src.getParty()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r4b.model.Claim.CareTeamComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Claim.CareTeamComponent tgt = new org.hl7.fhir.r5.model.Claim.CareTeamComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasProvider())
tgt.setProvider(Reference43_50.convertReference(src.getProvider()));
if (src.hasResponsible())
tgt.setResponsibleElement(Boolean43_50.convertBoolean(src.getResponsibleElement()));
if (src.hasRole())
tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole()));
if (src.hasQualification())
tgt.setQualification(CodeableConcept43_50.convertCodeableConcept(src.getQualification()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Claim.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r5.model.Claim.CareTeamComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Claim.CareTeamComponent tgt = new org.hl7.fhir.r4b.model.Claim.CareTeamComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasProvider())
tgt.setProvider(Reference43_50.convertReference(src.getProvider()));
if (src.hasResponsible())
tgt.setResponsibleElement(Boolean43_50.convertBoolean(src.getResponsibleElement()));
if (src.hasRole())
tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole()));
if (src.hasQualification())
tgt.setQualification(CodeableConcept43_50.convertCodeableConcept(src.getQualification()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4b.model.Claim.SupportingInformationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Claim.SupportingInformationComponent tgt = new org.hl7.fhir.r5.model.Claim.SupportingInformationComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasCategory())
tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasTiming())
tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
if (src.hasReason())
tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Claim.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r5.model.Claim.SupportingInformationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Claim.SupportingInformationComponent tgt = new org.hl7.fhir.r4b.model.Claim.SupportingInformationComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasCategory())
tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasTiming())
tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
if (src.hasReason())
tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4b.model.Claim.DiagnosisComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Claim.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.Claim.DiagnosisComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasDiagnosis())
tgt.setDiagnosis(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDiagnosis()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType())
tgt.addType(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasOnAdmission())
tgt.setOnAdmission(CodeableConcept43_50.convertCodeableConcept(src.getOnAdmission()));
if (src.hasPackageCode())
tgt.setPackageCode(CodeableConcept43_50.convertCodeableConcept(src.getPackageCode()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Claim.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.Claim.DiagnosisComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Claim.DiagnosisComponent tgt = new org.hl7.fhir.r4b.model.Claim.DiagnosisComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasDiagnosis())
tgt.setDiagnosis(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDiagnosis()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasOnAdmission())
tgt.setOnAdmission(CodeableConcept43_50.convertCodeableConcept(src.getOnAdmission()));
if (src.hasPackageCode())
tgt.setPackageCode(CodeableConcept43_50.convertCodeableConcept(src.getPackageCode()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r4b.model.Claim.ProcedureComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Claim.ProcedureComponent tgt = new org.hl7.fhir.r5.model.Claim.ProcedureComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType())
tgt.addType(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasProcedure())
tgt.setProcedure(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProcedure()));
for (org.hl7.fhir.r4b.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Claim.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r5.model.Claim.ProcedureComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Claim.ProcedureComponent tgt = new org.hl7.fhir.r4b.model.Claim.ProcedureComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasProcedure())
tgt.setProcedure(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getProcedure()));
for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4b.model.Claim.InsuranceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Claim.InsuranceComponent tgt = new org.hl7.fhir.r5.model.Claim.InsuranceComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasFocal())
tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
if (src.hasCoverage())
tgt.setCoverage(Reference43_50.convertReference(src.getCoverage()));
if (src.hasBusinessArrangement())
tgt.setBusinessArrangementElement(String43_50.convertString(src.getBusinessArrangementElement()));
for (org.hl7.fhir.r4b.model.StringType t : src.getPreAuthRef())
tgt.getPreAuthRef().add(String43_50.convertString(t));
if (src.hasClaimResponse())
tgt.setClaimResponse(Reference43_50.convertReference(src.getClaimResponse()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Claim.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.Claim.InsuranceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Claim.InsuranceComponent tgt = new org.hl7.fhir.r4b.model.Claim.InsuranceComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasFocal())
tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
if (src.hasCoverage())
tgt.setCoverage(Reference43_50.convertReference(src.getCoverage()));
if (src.hasBusinessArrangement())
tgt.setBusinessArrangementElement(String43_50.convertString(src.getBusinessArrangementElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getPreAuthRef())
tgt.getPreAuthRef().add(String43_50.convertString(t));
if (src.hasClaimResponse())
tgt.setClaimResponse(Reference43_50.convertReference(src.getClaimResponse()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.AccidentComponent convertAccidentComponent(org.hl7.fhir.r4b.model.Claim.AccidentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Claim.AccidentComponent tgt = new org.hl7.fhir.r5.model.Claim.AccidentComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasDate())
tgt.setDateElement(Date43_50.convertDate(src.getDateElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasLocation())
tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Claim.AccidentComponent convertAccidentComponent(org.hl7.fhir.r5.model.Claim.AccidentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Claim.AccidentComponent tgt = new org.hl7.fhir.r4b.model.Claim.AccidentComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasDate())
tgt.setDateElement(Date43_50.convertDate(src.getDateElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasLocation())
tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.ItemComponent convertItemComponent(org.hl7.fhir.r4b.model.Claim.ItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Claim.ItemComponent tgt = new org.hl7.fhir.r5.model.Claim.ItemComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getCareTeamSequence())
tgt.getCareTeamSequence().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getDiagnosisSequence())
tgt.getDiagnosisSequence().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getProcedureSequence())
tgt.getProcedureSequence().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getInformationSequence())
tgt.getInformationSequence().add(PositiveInt43_50.convertPositiveInt(t));
if (src.hasRevenue())
tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue()));
if (src.hasCategory())
tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier())
tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasServiced())
tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced()));
if (src.hasLocation())
tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(Money43_50.convertMoney(src.getNet()));
for (org.hl7.fhir.r4b.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t));
if (src.hasBodySite())
tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSubSite())
tgt.addSubSite(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getEncounter()) tgt.addEncounter(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Claim.DetailComponent t : src.getDetail()) tgt.addDetail(convertDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Claim.ItemComponent convertItemComponent(org.hl7.fhir.r5.model.Claim.ItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Claim.ItemComponent tgt = new org.hl7.fhir.r4b.model.Claim.ItemComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getCareTeamSequence())
tgt.getCareTeamSequence().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDiagnosisSequence())
tgt.getDiagnosisSequence().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getProcedureSequence())
tgt.getProcedureSequence().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getInformationSequence())
tgt.getInformationSequence().add(PositiveInt43_50.convertPositiveInt(t));
if (src.hasRevenue())
tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue()));
if (src.hasCategory())
tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasServiced())
tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced()));
if (src.hasLocation())
tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(Money43_50.convertMoney(src.getNet()));
for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t));
if (src.hasBodySite())
tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite())
tgt.addSubSite(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getEncounter()) tgt.addEncounter(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Claim.DetailComponent t : src.getDetail()) tgt.addDetail(convertDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.DetailComponent convertDetailComponent(org.hl7.fhir.r4b.model.Claim.DetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Claim.DetailComponent tgt = new org.hl7.fhir.r5.model.Claim.DetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasRevenue())
tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue()));
if (src.hasCategory())
tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier())
tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(Money43_50.convertMoney(src.getNet()));
for (org.hl7.fhir.r4b.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Claim.SubDetailComponent t : src.getSubDetail())
tgt.addSubDetail(convertSubDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Claim.DetailComponent convertDetailComponent(org.hl7.fhir.r5.model.Claim.DetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Claim.DetailComponent tgt = new org.hl7.fhir.r4b.model.Claim.DetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasRevenue())
tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue()));
if (src.hasCategory())
tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(Money43_50.convertMoney(src.getNet()));
for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Claim.SubDetailComponent t : src.getSubDetail())
tgt.addSubDetail(convertSubDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r4b.model.Claim.SubDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Claim.SubDetailComponent tgt = new org.hl7.fhir.r5.model.Claim.SubDetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasRevenue())
tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue()));
if (src.hasCategory())
tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier())
tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(Money43_50.convertMoney(src.getNet()));
for (org.hl7.fhir.r4b.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Claim.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r5.model.Claim.SubDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Claim.SubDetailComponent tgt = new org.hl7.fhir.r4b.model.Claim.SubDetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasRevenue())
tgt.setRevenue(CodeableConcept43_50.convertCodeableConcept(src.getRevenue()));
if (src.hasCategory())
tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(Money43_50.convertMoney(src.getNet()));
for (org.hl7.fhir.r5.model.Reference t : src.getUdi()) tgt.addUdi(Reference43_50.convertReference(t));
return tgt;
}
}

View File

@ -0,0 +1,775 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ClaimResponse43_50 {
public static org.hl7.fhir.r5.model.ClaimResponse convertClaimResponse(org.hl7.fhir.r4b.model.ClaimResponse src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClaimResponse tgt = new org.hl7.fhir.r5.model.ClaimResponse();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertClaimResponseStatus(src.getStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType()));
if (src.hasUse())
tgt.setUseElement(convertUse(src.getUseElement()));
if (src.hasPatient())
tgt.setPatient(Reference43_50.convertReference(src.getPatient()));
if (src.hasCreated())
tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement()));
if (src.hasInsurer())
tgt.setInsurer(Reference43_50.convertReference(src.getInsurer()));
if (src.hasRequestor())
tgt.setRequestor(Reference43_50.convertReference(src.getRequestor()));
if (src.hasRequest())
tgt.setRequest(Reference43_50.convertReference(src.getRequest()));
if (src.hasOutcome())
tgt.setOutcomeElement(convertRemittanceOutcome(src.getOutcomeElement()));
if (src.hasDisposition())
tgt.setDispositionElement(String43_50.convertString(src.getDispositionElement()));
if (src.hasPreAuthRef())
tgt.setPreAuthRefElement(String43_50.convertString(src.getPreAuthRefElement()));
if (src.hasPreAuthPeriod())
tgt.setPreAuthPeriod(Period43_50.convertPeriod(src.getPreAuthPeriod()));
if (src.hasPayeeType())
tgt.setPayeeType(CodeableConcept43_50.convertCodeableConcept(src.getPayeeType()));
for (org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent t : src.getAddItem())
tgt.addAddItem(convertAddedItemComponent(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent t : src.getTotal()) tgt.addTotal(convertTotalComponent(t));
if (src.hasPayment())
tgt.setPayment(convertPaymentComponent(src.getPayment()));
if (src.hasFundsReserve())
tgt.setFundsReserve(CodeableConcept43_50.convertCodeableConcept(src.getFundsReserve()));
if (src.hasFormCode())
tgt.setFormCode(CodeableConcept43_50.convertCodeableConcept(src.getFormCode()));
if (src.hasForm())
tgt.setForm(Attachment43_50.convertAttachment(src.getForm()));
for (org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent t : src.getProcessNote())
tgt.addProcessNote(convertNoteComponent(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getCommunicationRequest())
tgt.addCommunicationRequest(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent t : src.getInsurance())
tgt.addInsurance(convertInsuranceComponent(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent t : src.getError()) tgt.addError(convertErrorComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClaimResponse convertClaimResponse(org.hl7.fhir.r5.model.ClaimResponse src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClaimResponse tgt = new org.hl7.fhir.r4b.model.ClaimResponse();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertClaimResponseStatus(src.getStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType()));
if (src.hasUse())
tgt.setUseElement(convertUse(src.getUseElement()));
if (src.hasPatient())
tgt.setPatient(Reference43_50.convertReference(src.getPatient()));
if (src.hasCreated())
tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement()));
if (src.hasInsurer())
tgt.setInsurer(Reference43_50.convertReference(src.getInsurer()));
if (src.hasRequestor())
tgt.setRequestor(Reference43_50.convertReference(src.getRequestor()));
if (src.hasRequest())
tgt.setRequest(Reference43_50.convertReference(src.getRequest()));
if (src.hasOutcome())
tgt.setOutcomeElement(convertRemittanceOutcome(src.getOutcomeElement()));
if (src.hasDisposition())
tgt.setDispositionElement(String43_50.convertString(src.getDispositionElement()));
if (src.hasPreAuthRef())
tgt.setPreAuthRefElement(String43_50.convertString(src.getPreAuthRefElement()));
if (src.hasPreAuthPeriod())
tgt.setPreAuthPeriod(Period43_50.convertPeriod(src.getPreAuthPeriod()));
if (src.hasPayeeType())
tgt.setPayeeType(CodeableConcept43_50.convertCodeableConcept(src.getPayeeType()));
for (org.hl7.fhir.r5.model.ClaimResponse.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t));
for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent t : src.getAddItem())
tgt.addAddItem(convertAddedItemComponent(t));
for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r5.model.ClaimResponse.TotalComponent t : src.getTotal()) tgt.addTotal(convertTotalComponent(t));
if (src.hasPayment())
tgt.setPayment(convertPaymentComponent(src.getPayment()));
if (src.hasFundsReserve())
tgt.setFundsReserve(CodeableConcept43_50.convertCodeableConcept(src.getFundsReserve()));
if (src.hasFormCode())
tgt.setFormCode(CodeableConcept43_50.convertCodeableConcept(src.getFormCode()));
if (src.hasForm())
tgt.setForm(Attachment43_50.convertAttachment(src.getForm()));
for (org.hl7.fhir.r5.model.ClaimResponse.NoteComponent t : src.getProcessNote())
tgt.addProcessNote(convertNoteComponent(t));
for (org.hl7.fhir.r5.model.Reference t : src.getCommunicationRequest())
tgt.addCommunicationRequest(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent t : src.getInsurance())
tgt.addInsurance(convertInsuranceComponent(t));
for (org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent t : src.getError()) tgt.addError(convertErrorComponent(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes> convertClaimResponseStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED);
break;
case DRAFT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> convertClaimResponseStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED);
break;
case DRAFT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.Use> convertUse(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.Use> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.Use> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.UseEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case CLAIM:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.CLAIM);
break;
case PREAUTHORIZATION:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREAUTHORIZATION);
break;
case PREDETERMINATION:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.PREDETERMINATION);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.Use.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.Use> convertUse(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.Use> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.Use> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.UseEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case CLAIM:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.CLAIM);
break;
case PREAUTHORIZATION:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREAUTHORIZATION);
break;
case PREDETERMINATION:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREDETERMINATION);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes> convertRemittanceOutcome(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case QUEUED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.QUEUED);
break;
case COMPLETE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.COMPLETE);
break;
case ERROR:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.ERROR);
break;
case PARTIAL:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.PARTIAL);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome> convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcomeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case QUEUED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.QUEUED);
break;
case COMPLETE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.COMPLETE);
break;
case ERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.ERROR);
break;
case PARTIAL:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.PARTIAL);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.ItemComponent convertItemComponent(org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClaimResponse.ItemComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ItemComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasItemSequence())
tgt.setItemSequenceElement(PositiveInt43_50.convertPositiveInt(src.getItemSequenceElement()));
for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent t : src.getDetail())
tgt.addDetail(convertItemDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent convertItemComponent(org.hl7.fhir.r5.model.ClaimResponse.ItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasItemSequence())
tgt.setItemSequenceElement(PositiveInt43_50.convertPositiveInt(src.getItemSequenceElement()));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent t : src.getDetail())
tgt.addDetail(convertItemDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
if (src.hasReason())
tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason()));
if (src.hasAmount())
tgt.setAmount(Money43_50.convertMoney(src.getAmount()));
if (src.hasValue())
tgt.setValueElement(Decimal43_50.convertDecimal(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
if (src.hasReason())
tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason()));
if (src.hasAmount())
tgt.setAmount(Money43_50.convertMoney(src.getAmount()));
if (src.hasValue())
tgt.setValueElement(Decimal43_50.convertDecimal(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent convertItemDetailComponent(org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasDetailSequence())
tgt.setDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getDetailSequenceElement()));
for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent t : src.getSubDetail())
tgt.addSubDetail(convertSubDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent convertItemDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasDetailSequence())
tgt.setDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getDetailSequenceElement()));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent t : src.getSubDetail())
tgt.addSubDetail(convertSubDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSubDetailSequence())
tgt.setSubDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSubDetailSequenceElement()));
for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSubDetailSequence())
tgt.setSubDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSubDetailSequenceElement()));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getItemSequence())
tgt.getItemSequence().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getDetailSequence())
tgt.getDetailSequence().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getSubdetailSequence())
tgt.getSubdetailSequence().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getProvider()) tgt.addProvider(Reference43_50.convertReference(t));
if (src.hasProductOrService())
tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier())
tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasServiced())
tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced()));
if (src.hasLocation())
tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(Money43_50.convertMoney(src.getNet()));
if (src.hasBodySite())
tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSubSite())
tgt.addSubSite(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent t : src.getDetail())
tgt.addDetail(convertAddedItemDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getItemSequence())
tgt.getItemSequence().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDetailSequence())
tgt.getDetailSequence().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getSubdetailSequence())
tgt.getSubdetailSequence().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r5.model.Reference t : src.getProvider()) tgt.addProvider(Reference43_50.convertReference(t));
if (src.hasProductOrService())
tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasServiced())
tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced()));
if (src.hasLocation())
tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(Money43_50.convertMoney(src.getNet()));
if (src.hasBodySite())
tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite())
tgt.addSubSite(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent t : src.getDetail())
tgt.addDetail(convertAddedItemDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasProductOrService())
tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier())
tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(Money43_50.convertMoney(src.getNet()));
for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent t : src.getSubDetail())
tgt.addSubDetail(convertAddedItemSubDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasProductOrService())
tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(Money43_50.convertMoney(src.getNet()));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent t : src.getSubDetail())
tgt.addSubDetail(convertAddedItemSubDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent convertAddedItemSubDetailComponent(org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasProductOrService())
tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier())
tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(Money43_50.convertMoney(src.getNet()));
for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent convertAddedItemSubDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasProductOrService())
tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(Money43_50.convertMoney(src.getNet()));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.TotalComponent convertTotalComponent(org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClaimResponse.TotalComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.TotalComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
if (src.hasAmount())
tgt.setAmount(Money43_50.convertMoney(src.getAmount()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent convertTotalComponent(org.hl7.fhir.r5.model.ClaimResponse.TotalComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
if (src.hasAmount())
tgt.setAmount(Money43_50.convertMoney(src.getAmount()));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent convertPaymentComponent(org.hl7.fhir.r4b.model.ClaimResponse.PaymentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasAdjustment())
tgt.setAdjustment(Money43_50.convertMoney(src.getAdjustment()));
if (src.hasAdjustmentReason())
tgt.setAdjustmentReason(CodeableConcept43_50.convertCodeableConcept(src.getAdjustmentReason()));
if (src.hasDate())
tgt.setDateElement(Date43_50.convertDate(src.getDateElement()));
if (src.hasAmount())
tgt.setAmount(Money43_50.convertMoney(src.getAmount()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClaimResponse.PaymentComponent convertPaymentComponent(org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClaimResponse.PaymentComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.PaymentComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasAdjustment())
tgt.setAdjustment(Money43_50.convertMoney(src.getAdjustment()));
if (src.hasAdjustmentReason())
tgt.setAdjustmentReason(CodeableConcept43_50.convertCodeableConcept(src.getAdjustmentReason()));
if (src.hasDate())
tgt.setDateElement(Date43_50.convertDate(src.getDateElement()));
if (src.hasAmount())
tgt.setAmount(Money43_50.convertMoney(src.getAmount()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.NoteComponent convertNoteComponent(org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClaimResponse.NoteComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.NoteComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasNumber())
tgt.setNumberElement(PositiveInt43_50.convertPositiveInt(src.getNumberElement()));
if (src.hasType())
tgt.setTypeElement(Enumerations43_50.convertNoteType(src.getTypeElement()));
if (src.hasText())
tgt.setTextElement(String43_50.convertString(src.getTextElement()));
if (src.hasLanguage())
tgt.setLanguage(CodeableConcept43_50.convertCodeableConcept(src.getLanguage()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent convertNoteComponent(org.hl7.fhir.r5.model.ClaimResponse.NoteComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasNumber())
tgt.setNumberElement(PositiveInt43_50.convertPositiveInt(src.getNumberElement()));
if (src.hasType())
tgt.setTypeElement(Enumerations43_50.convertNoteType(src.getTypeElement()));
if (src.hasText())
tgt.setTextElement(String43_50.convertString(src.getTextElement()));
if (src.hasLanguage())
tgt.setLanguage(CodeableConcept43_50.convertCodeableConcept(src.getLanguage()));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasFocal())
tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement()));
if (src.hasCoverage())
tgt.setCoverage(Reference43_50.convertReference(src.getCoverage()));
if (src.hasBusinessArrangement())
tgt.setBusinessArrangementElement(String43_50.convertString(src.getBusinessArrangementElement()));
if (src.hasClaimResponse())
tgt.setClaimResponse(Reference43_50.convertReference(src.getClaimResponse()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasFocal())
tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement()));
if (src.hasCoverage())
tgt.setCoverage(Reference43_50.convertReference(src.getCoverage()));
if (src.hasBusinessArrangement())
tgt.setBusinessArrangementElement(String43_50.convertString(src.getBusinessArrangementElement()));
if (src.hasClaimResponse())
tgt.setClaimResponse(Reference43_50.convertReference(src.getClaimResponse()));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent convertErrorComponent(org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasItemSequence())
tgt.setItemSequenceElement(PositiveInt43_50.convertPositiveInt(src.getItemSequenceElement()));
if (src.hasDetailSequence())
tgt.setDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getDetailSequenceElement()));
if (src.hasSubDetailSequence())
tgt.setSubDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSubDetailSequenceElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent convertErrorComponent(org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasItemSequence())
tgt.setItemSequenceElement(PositiveInt43_50.convertPositiveInt(src.getItemSequenceElement()));
if (src.hasDetailSequence())
tgt.setDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getDetailSequenceElement()));
if (src.hasSubDetailSequence())
tgt.setSubDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSubDetailSequenceElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
return tgt;
}
}

View File

@ -0,0 +1,201 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ClinicalImpression43_50 {
public static org.hl7.fhir.r5.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.r4b.model.ClinicalImpression src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClinicalImpression tgt = new org.hl7.fhir.r5.model.ClinicalImpression();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertClinicalImpressionStatus(src.getStatusElement()));
if (src.hasStatusReason())
tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason()));
// if (src.hasCode())
// tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
if (src.hasEffective())
tgt.setEffective(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEffective()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasAssessor())
tgt.setPerformer(Reference43_50.convertReference(src.getAssessor()));
if (src.hasPrevious())
tgt.setPrevious(Reference43_50.convertReference(src.getPrevious()));
for (org.hl7.fhir.r4b.model.Reference t : src.getProblem()) tgt.addProblem(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.UriType t : src.getProtocol()) tgt.getProtocol().add(Uri43_50.convertUri(t));
if (src.hasSummary())
tgt.setSummaryElement(String43_50.convertString(src.getSummaryElement()));
for (org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding())
tgt.addFinding(convertClinicalImpressionFindingComponent(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getPrognosisCodeableConcept())
tgt.addPrognosisCodeableConcept(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getPrognosisReference())
tgt.addPrognosisReference(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.r5.model.ClinicalImpression src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClinicalImpression tgt = new org.hl7.fhir.r4b.model.ClinicalImpression();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertClinicalImpressionStatus(src.getStatusElement()));
if (src.hasStatusReason())
tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason()));
// if (src.hasCode())
// tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
if (src.hasEffective())
tgt.setEffective(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEffective()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasPerformer())
tgt.setAssessor(Reference43_50.convertReference(src.getPerformer()));
if (src.hasPrevious())
tgt.setPrevious(Reference43_50.convertReference(src.getPrevious()));
for (org.hl7.fhir.r5.model.Reference t : src.getProblem()) tgt.addProblem(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.UriType t : src.getProtocol()) tgt.getProtocol().add(Uri43_50.convertUri(t));
if (src.hasSummary())
tgt.setSummaryElement(String43_50.convertString(src.getSummaryElement()));
for (org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding())
tgt.addFinding(convertClinicalImpressionFindingComponent(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPrognosisCodeableConcept())
tgt.addPrognosisCodeableConcept(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getPrognosisReference())
tgt.addPrognosisReference(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.EventStatus> convertClinicalImpressionStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.EventStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EventStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case INPROGRESS:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionStatus> convertClinicalImpressionStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.EventStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case INPROGRESS:
tgt.setValue(org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionStatus.INPROGRESS);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionStatus.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent tgt = new org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasItemCodeableConcept())
tgt.setItem(CodeableConcept43_50.convertCodeableConceptToCodeableReference(src.getItemCodeableConcept()));
if (src.hasItemReference())
tgt.setItem(Reference43_50.convertReferenceToCodeableReference(src.getItemReference()));
if (src.hasBasis())
tgt.setBasisElement(String43_50.convertString(src.getBasisElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionFindingComponent tgt = new org.hl7.fhir.r4b.model.ClinicalImpression.ClinicalImpressionFindingComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasItem() && src.getItem().hasConcept())
tgt.setItemCodeableConcept(CodeableConcept43_50.convertCodeableConcept(src.getItem().getConcept()));
if (src.hasItem() && src.getItem().hasReference())
tgt.setItemReference(Reference43_50.convertReference(src.getItem().getReference()));
if (src.hasBasis())
tgt.setBasisElement(String43_50.convertString(src.getBasisElement()));
return tgt;
}
}

View File

@ -0,0 +1,576 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Coding43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.stream.Collectors;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CodeSystem43_50 {
public static org.hl7.fhir.r5.model.CodeSystem convertCodeSystem(org.hl7.fhir.r4b.model.CodeSystem src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CodeSystem tgt = new org.hl7.fhir.r5.model.CodeSystem();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact())
tgt.addContact(ContactDetail43_50.convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext())
tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
if (src.hasCaseSensitive())
tgt.setCaseSensitiveElement(Boolean43_50.convertBoolean(src.getCaseSensitiveElement()));
if (src.hasValueSet())
tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement()));
if (src.hasHierarchyMeaning())
tgt.setHierarchyMeaningElement(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaningElement()));
if (src.hasCompositional())
tgt.setCompositionalElement(Boolean43_50.convertBoolean(src.getCompositionalElement()));
if (src.hasVersionNeeded())
tgt.setVersionNeededElement(Boolean43_50.convertBoolean(src.getVersionNeededElement()));
if (src.hasContent())
tgt.setContentElement(convertCodeSystemContentMode(src.getContentElement()));
if (src.hasSupplements())
tgt.setSupplementsElement(Canonical43_50.convertCanonical(src.getSupplementsElement()));
if (src.hasCount())
tgt.setCountElement(UnsignedInt43_50.convertUnsignedInt(src.getCountElement()));
for (org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter())
tgt.addFilter(convertCodeSystemFilterComponent(t));
for (org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent t : src.getProperty())
tgt.addProperty(convertPropertyComponent(t));
for (org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept())
tgt.addConcept(convertConceptDefinitionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.CodeSystem convertCodeSystem(org.hl7.fhir.r5.model.CodeSystem src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CodeSystem tgt = new org.hl7.fhir.r4b.model.CodeSystem();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(ContactDetail43_50.convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
if (src.hasCaseSensitive())
tgt.setCaseSensitiveElement(Boolean43_50.convertBoolean(src.getCaseSensitiveElement()));
if (src.hasValueSet())
tgt.setValueSetElement(Canonical43_50.convertCanonical(src.getValueSetElement()));
if (src.hasHierarchyMeaning())
tgt.setHierarchyMeaningElement(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaningElement()));
if (src.hasCompositional())
tgt.setCompositionalElement(Boolean43_50.convertBoolean(src.getCompositionalElement()));
if (src.hasVersionNeeded())
tgt.setVersionNeededElement(Boolean43_50.convertBoolean(src.getVersionNeededElement()));
if (src.hasContent())
tgt.setContentElement(convertCodeSystemContentMode(src.getContentElement()));
if (src.hasSupplements())
tgt.setSupplementsElement(Canonical43_50.convertCanonical(src.getSupplementsElement()));
if (src.hasCount())
tgt.setCountElement(UnsignedInt43_50.convertUnsignedInt(src.getCountElement()));
for (org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter())
tgt.addFilter(convertCodeSystemFilterComponent(t));
for (org.hl7.fhir.r5.model.CodeSystem.PropertyComponent t : src.getProperty())
tgt.addProperty(convertPropertyComponent(t));
for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept())
tgt.addConcept(convertConceptDefinitionComponent(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning> convertCodeSystemHierarchyMeaning(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case GROUPEDBY:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY);
break;
case ISA:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.ISA);
break;
case PARTOF:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF);
break;
case CLASSIFIEDWITH:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning> convertCodeSystemHierarchyMeaning(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaningEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case GROUPEDBY:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY);
break;
case ISA:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.ISA);
break;
case PARTOF:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF);
break;
case CLASSIFIEDWITH:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemHierarchyMeaning.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode> convertCodeSystemContentMode(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentModeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case NOTPRESENT:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.NOTPRESENT);
break;
case EXAMPLE:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.EXAMPLE);
break;
case FRAGMENT:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.FRAGMENT);
break;
case COMPLETE:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.COMPLETE);
break;
case SUPPLEMENT:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode> convertCodeSystemContentMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentModeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case NOTPRESENT:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.NOTPRESENT);
break;
case EXAMPLE:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.EXAMPLE);
break;
case FRAGMENT:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.FRAGMENT);
break;
case COMPLETE:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.COMPLETE);
break;
case SUPPLEMENT:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemContentMode.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
tgt.setOperator(src.getOperator().stream()
.map(CodeSystem43_50::convertFilterOperator)
.collect(Collectors.toList()));
if (src.hasValue())
tgt.setValueElement(String43_50.convertString(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
tgt.setOperator(src.getOperator().stream()
.map(CodeSystem43_50::convertFilterOperator)
.collect(Collectors.toList()));
if (src.hasValue())
tgt.setValueElement(String43_50.convertString(src.getValueElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FilterOperator> convertFilterOperator(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FilterOperator> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FilterOperator> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FilterOperatorEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case EQUAL:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EQUAL);
break;
case ISA:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISA);
break;
case DESCENDENTOF:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.DESCENDENTOF);
break;
case ISNOTA:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.ISNOTA);
break;
case REGEX:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.REGEX);
break;
case IN:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.IN);
break;
case NOTIN:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NOTIN);
break;
case GENERALIZES:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.GENERALIZES);
break;
case EXISTS:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.EXISTS);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FilterOperator.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FilterOperator> convertFilterOperator(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FilterOperator> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FilterOperator> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FilterOperatorEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case EQUAL:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.EQUAL);
break;
case ISA:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.ISA);
break;
case DESCENDENTOF:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.DESCENDENTOF);
break;
case ISNOTA:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.ISNOTA);
break;
case REGEX:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.REGEX);
break;
case IN:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.IN);
break;
case NOTIN:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.NOTIN);
break;
case GENERALIZES:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.GENERALIZES);
break;
case EXISTS:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.EXISTS);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FilterOperator.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.PropertyComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasUri())
tgt.setUriElement(Uri43_50.convertUri(src.getUriElement()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasType())
tgt.setTypeElement(convertPropertyType(src.getTypeElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r5.model.CodeSystem.PropertyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasUri())
tgt.setUriElement(Uri43_50.convertUri(src.getUriElement()));
if (src.hasDescription())
tgt.setDescriptionElement(String43_50.convertString(src.getDescriptionElement()));
if (src.hasType())
tgt.setTypeElement(convertPropertyType(src.getTypeElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.PropertyType> convertPropertyType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.PropertyType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.PropertyType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CodeSystem.PropertyTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case CODE:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODE);
break;
case CODING:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODING);
break;
case STRING:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.STRING);
break;
case INTEGER:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.INTEGER);
break;
case BOOLEAN:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.BOOLEAN);
break;
case DATETIME:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.DATETIME);
break;
case DECIMAL:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.DECIMAL);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.CodeSystem.PropertyType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.PropertyType> convertPropertyType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.PropertyType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CodeSystem.PropertyType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CodeSystem.PropertyTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case CODE:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.CODE);
break;
case CODING:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.CODING);
break;
case STRING:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.STRING);
break;
case INTEGER:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.INTEGER);
break;
case BOOLEAN:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.BOOLEAN);
break;
case DATETIME:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.DATETIME);
break;
case DECIMAL:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.DECIMAL);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.CodeSystem.PropertyType.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
if (src.hasDefinition())
tgt.setDefinitionElement(String43_50.convertString(src.getDefinitionElement()));
for (org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation())
tgt.addDesignation(convertConceptDefinitionDesignationComponent(t));
for (org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent t : src.getProperty())
tgt.addProperty(convertConceptPropertyComponent(t));
for (org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept())
tgt.addConcept(convertConceptDefinitionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
if (src.hasDefinition())
tgt.setDefinitionElement(String43_50.convertString(src.getDefinitionElement()));
for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation())
tgt.addDesignation(convertConceptDefinitionDesignationComponent(t));
for (org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent t : src.getProperty())
tgt.addProperty(convertConceptPropertyComponent(t));
for (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept())
tgt.addConcept(convertConceptDefinitionComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasLanguage())
tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement()));
if (src.hasUse())
tgt.setUse(Coding43_50.convertCoding(src.getUse()));
if (src.hasValue())
tgt.setValueElement(String43_50.convertString(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasLanguage())
tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement()));
if (src.hasUse())
tgt.setUse(Coding43_50.convertCoding(src.getUse()));
if (src.hasValue())
tgt.setValueElement(String43_50.convertString(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r4b.model.CodeSystem.ConceptPropertyComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
}

View File

@ -0,0 +1,308 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4b.model.StringType;
import org.hl7.fhir.r5.model.CodeableConcept;
import org.hl7.fhir.r5.model.CodeableReference;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Communication43_50 {
public static org.hl7.fhir.r5.model.Communication convertCommunication(org.hl7.fhir.r4b.model.Communication src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Communication tgt = new org.hl7.fhir.r5.model.Communication();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t));
for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(Uri43_50.convertUri(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getInResponseTo())
tgt.addInResponseTo(Reference43_50.convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertCommunicationStatus(src.getStatusElement()));
if (src.hasStatusReason())
tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPriority())
tgt.setPriorityElement(convertCommunicationPriority(src.getPriorityElement()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getMedium())
tgt.addMedium(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasTopic())
tgt.setTopic(CodeableConcept43_50.convertCodeableConcept(src.getTopic()));
for (org.hl7.fhir.r4b.model.Reference t : src.getAbout()) tgt.addAbout(Reference43_50.convertReference(t));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
if (src.hasSent())
tgt.setSentElement(DateTime43_50.convertDateTime(src.getSentElement()));
if (src.hasReceived())
tgt.setReceivedElement(DateTime43_50.convertDateTime(src.getReceivedElement()));
for (org.hl7.fhir.r4b.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference43_50.convertReference(t));
if (src.hasSender())
tgt.setSender(Reference43_50.convertReference(src.getSender()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode())
tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference())
tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Communication.CommunicationPayloadComponent t : src.getPayload())
tgt.addPayload(convertCommunicationPayloadComponent(t));
for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Communication convertCommunication(org.hl7.fhir.r5.model.Communication src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Communication tgt = new org.hl7.fhir.r4b.model.Communication();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t));
for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(Uri43_50.convertUri(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getInResponseTo())
tgt.addInResponseTo(Reference43_50.convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertCommunicationStatus(src.getStatusElement()));
if (src.hasStatusReason())
tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPriority())
tgt.setPriorityElement(convertCommunicationPriority(src.getPriorityElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium())
tgt.addMedium(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasTopic())
tgt.setTopic(CodeableConcept43_50.convertCodeableConcept(src.getTopic()));
for (org.hl7.fhir.r5.model.Reference t : src.getAbout()) tgt.addAbout(Reference43_50.convertReference(t));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
if (src.hasSent())
tgt.setSentElement(DateTime43_50.convertDateTime(src.getSentElement()));
if (src.hasReceived())
tgt.setReceivedElement(DateTime43_50.convertDateTime(src.getReceivedElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference43_50.convertReference(t));
if (src.hasSender())
tgt.setSender(Reference43_50.convertReference(src.getSender()));
for (CodeableReference t : src.getReason())
if (t.hasConcept())
tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept()));
for (CodeableReference t : src.getReason())
if (t.hasReference())
tgt.addReasonReference(Reference43_50.convertReference(t.getReference()));
for (org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent t : src.getPayload())
tgt.addPayload(convertCommunicationPayloadComponent(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.EventStatus> convertCommunicationStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.EventStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.EventStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.EventStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PREPARATION:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.PREPARATION);
break;
case INPROGRESS:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.INPROGRESS);
break;
case NOTDONE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NOTDONE);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ONHOLD);
break;
case STOPPED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.STOPPED);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.EventStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.EventStatus> convertCommunicationStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.EventStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.EventStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.EventStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PREPARATION:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.PREPARATION);
break;
case INPROGRESS:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.INPROGRESS);
break;
case NOTDONE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.NOTDONE);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.ONHOLD);
break;
case STOPPED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.STOPPED);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.EventStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> convertCommunicationPriority(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestPriority> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ROUTINE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE);
break;
case URGENT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT);
break;
case ASAP:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP);
break;
case STAT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestPriority> convertCommunicationPriority(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestPriority> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ROUTINE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE);
break;
case URGENT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT);
break;
case ASAP:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP);
break;
case STAT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.r4b.model.Communication.CommunicationPayloadComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasContent()) {
if (src.getContent() instanceof StringType) {
CodeableConcept tgtc = new CodeableConcept();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src.getContent(), tgtc);
tgtc.setText(src.getContentStringType().getValue());
tgt.setContent(tgtc);
} else {
if (src.hasContent())
tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent()));
}
}
return tgt;
}
public static org.hl7.fhir.r4b.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.r4b.model.Communication.CommunicationPayloadComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasContent()) {
if (src.hasContentCodeableConcept()) {
StringType tgts = new StringType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src.getContent(), tgts);
tgts.setValue(src.getContentCodeableConcept().getText());
tgt.setContent(tgts);
} else {
if (src.hasContent())
tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent()));
}
}
return tgt;
}
}

View File

@ -0,0 +1,303 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeableReference;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CommunicationRequest43_50 {
public final static String EXT_PAYLOAD_CONTENT = "http://hl7.org/fhir/4.0/StructureDefinition/extension-CommunicationRequest.payload.content";
public static org.hl7.fhir.r5.model.CommunicationRequest convertCommunicationRequest(org.hl7.fhir.r4b.model.CommunicationRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CommunicationRequest tgt = new org.hl7.fhir.r5.model.CommunicationRequest();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference43_50.convertReference(t));
if (src.hasGroupIdentifier())
tgt.setGroupIdentifier(Identifier43_50.convertIdentifier(src.getGroupIdentifier()));
if (src.hasStatus())
tgt.setStatusElement(convertCommunicationRequestStatus(src.getStatusElement()));
if (src.hasStatusReason())
tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPriority())
tgt.setPriorityElement(convertCommunicationPriority(src.getPriorityElement()));
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getMedium())
tgt.addMedium(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
for (org.hl7.fhir.r4b.model.Reference t : src.getAbout()) tgt.addAbout(Reference43_50.convertReference(t));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
for (org.hl7.fhir.r4b.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload())
tgt.addPayload(convertCommunicationRequestPayloadComponent(t));
if (src.hasOccurrence())
tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence()));
if (src.hasAuthoredOn())
tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement()));
if (src.hasRequester())
tgt.setRequester(Reference43_50.convertReference(src.getRequester()));
for (org.hl7.fhir.r4b.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference43_50.convertReference(t));
if (src.hasSender())
tgt.addInformationProvider(Reference43_50.convertReference(src.getSender()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode())
tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference())
tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.CommunicationRequest convertCommunicationRequest(org.hl7.fhir.r5.model.CommunicationRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CommunicationRequest tgt = new org.hl7.fhir.r4b.model.CommunicationRequest();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReplaces()) tgt.addReplaces(Reference43_50.convertReference(t));
if (src.hasGroupIdentifier())
tgt.setGroupIdentifier(Identifier43_50.convertIdentifier(src.getGroupIdentifier()));
if (src.hasStatus())
tgt.setStatusElement(convertCommunicationRequestStatus(src.getStatusElement()));
if (src.hasStatusReason())
tgt.setStatusReason(CodeableConcept43_50.convertCodeableConcept(src.getStatusReason()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPriority())
tgt.setPriorityElement(convertCommunicationPriority(src.getPriorityElement()));
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium())
tgt.addMedium(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
for (org.hl7.fhir.r5.model.Reference t : src.getAbout()) tgt.addAbout(Reference43_50.convertReference(t));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
for (org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload())
tgt.addPayload(convertCommunicationRequestPayloadComponent(t));
if (src.hasOccurrence())
tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence()));
if (src.hasAuthoredOn())
tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement()));
if (src.hasRequester())
tgt.setRequester(Reference43_50.convertReference(src.getRequester()));
for (org.hl7.fhir.r5.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference43_50.convertReference(t));
if (src.hasInformationProvider())
tgt.setSender(Reference43_50.convertReference(src.getInformationProviderFirstRep()));
for (CodeableReference t : src.getReason())
if (t.hasConcept())
tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept()));
for (CodeableReference t : src.getReason())
if (t.hasReference())
tgt.addReasonReference(Reference43_50.convertReference(t.getReference()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestStatus> convertCommunicationRequestStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case DRAFT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD);
break;
case REVOKED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestStatus> convertCommunicationRequestStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case DRAFT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.DRAFT);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ACTIVE);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ONHOLD);
break;
case REVOKED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.REVOKED);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> convertCommunicationPriority(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestPriority> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ROUTINE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE);
break;
case URGENT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT);
break;
case ASAP:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP);
break;
case STAT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestPriority> convertCommunicationPriority(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestPriority> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ROUTINE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE);
break;
case URGENT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT);
break;
case ASAP:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP);
break;
case STAT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.r4b.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (org.hl7.fhir.r4b.utils.ToolingExtensions.hasExtension(src, EXT_PAYLOAD_CONTENT)) {
org.hl7.fhir.r4b.model.Extension e = org.hl7.fhir.r4b.utils.ToolingExtensions.getExtension(src, EXT_PAYLOAD_CONTENT);
tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(e.getValue()));
org.hl7.fhir.r5.utils.ToolingExtensions.removeExtension(tgt, EXT_PAYLOAD_CONTENT);
} else if (src.hasContent()) {
org.hl7.fhir.r4b.model.DataType content = src.getContent();
if (content instanceof org.hl7.fhir.r4b.model.StringType) {
org.hl7.fhir.r4b.model.StringType string = (org.hl7.fhir.r4b.model.StringType) content;
org.hl7.fhir.r5.model.CodeableConcept code = new org.hl7.fhir.r5.model.CodeableConcept();
code.setTextElement((org.hl7.fhir.r5.model.StringType) ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(string));
tgt.setContent(code);
} else
tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(content));
}
return tgt;
}
public static org.hl7.fhir.r4b.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.r4b.model.CommunicationRequest.CommunicationRequestPayloadComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasContent()) {
org.hl7.fhir.r5.model.DataType content = src.getContent();
if (content instanceof org.hl7.fhir.r5.model.CodeableConcept) {
org.hl7.fhir.r5.model.CodeableConcept code = (org.hl7.fhir.r5.model.CodeableConcept) content;
if (code.hasText())
tgt.setContent(new org.hl7.fhir.r4b.model.StringType(code.getText()));
if (code.hasCoding() || code.hasExtension()) {
org.hl7.fhir.r4b.model.Extension e = new org.hl7.fhir.r4b.model.Extension(EXT_PAYLOAD_CONTENT);
e.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(code));
tgt.addExtension(e);
}
} else
tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(content));
}
return tgt;
}
}

View File

@ -0,0 +1,193 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CompartmentDefinition43_50 {
public static org.hl7.fhir.r5.model.CompartmentDefinition convertCompartmentDefinition(org.hl7.fhir.r4b.model.CompartmentDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CompartmentDefinition tgt = new org.hl7.fhir.r5.model.CompartmentDefinition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
if (src.hasVersion())
tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact())
tgt.addContact(ContactDetail43_50.convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext())
tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
if (src.hasPurpose())
tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement()));
if (src.hasCode())
tgt.setCodeElement(convertCompartmentType(src.getCodeElement()));
if (src.hasSearch())
tgt.setSearchElement(Boolean43_50.convertBoolean(src.getSearchElement()));
for (org.hl7.fhir.r4b.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource())
tgt.addResource(convertCompartmentDefinitionResourceComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.CompartmentDefinition convertCompartmentDefinition(org.hl7.fhir.r5.model.CompartmentDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CompartmentDefinition tgt = new org.hl7.fhir.r4b.model.CompartmentDefinition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
if (src.hasVersion())
tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(ContactDetail43_50.convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
if (src.hasPurpose())
tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement()));
if (src.hasCode())
tgt.setCodeElement(convertCompartmentType(src.getCodeElement()));
if (src.hasSearch())
tgt.setSearchElement(Boolean43_50.convertBoolean(src.getSearchElement()));
for (org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource())
tgt.addResource(convertCompartmentDefinitionResourceComponent(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.CompartmentType> convertCompartmentType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.CompartmentType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.CompartmentType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompartmentTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PATIENT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.PATIENT);
break;
case ENCOUNTER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.ENCOUNTER);
break;
case RELATEDPERSON:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.RELATEDPERSON);
break;
case PRACTITIONER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.PRACTITIONER);
break;
case DEVICE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.DEVICE);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompartmentType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.CompartmentType> convertCompartmentType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.CompartmentType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.CompartmentType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.CompartmentTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PATIENT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.PATIENT);
break;
case ENCOUNTER:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.ENCOUNTER);
break;
case RELATEDPERSON:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.RELATEDPERSON);
break;
case PRACTITIONER:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.PRACTITIONER);
break;
case DEVICE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.DEVICE);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompartmentType.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent convertCompartmentDefinitionResourceComponent(org.hl7.fhir.r4b.model.CompartmentDefinition.CompartmentDefinitionResourceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertResourceEnum(src.getCodeElement()));
for (org.hl7.fhir.r4b.model.StringType t : src.getParam()) tgt.getParam().add(String43_50.convertString(t));
if (src.hasDocumentation())
tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.CompartmentDefinition.CompartmentDefinitionResourceComponent convertCompartmentDefinitionResourceComponent(org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.r4b.model.CompartmentDefinition.CompartmentDefinitionResourceComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertResourceEnum(src.getCodeElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getParam()) tgt.getParam().add(String43_50.convertString(t));
if (src.hasDocumentation())
tgt.setDocumentationElement(String43_50.convertString(src.getDocumentationElement()));
return tgt;
}
}

View File

@ -0,0 +1,444 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext30_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.Reference30_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Narrative43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.RelatedArtifact;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Composition43_50 {
public static org.hl7.fhir.r5.model.Composition convertComposition(org.hl7.fhir.r4b.model.Composition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Composition tgt = new org.hl7.fhir.r5.model.Composition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
if (src.hasStatus())
tgt.setStatusElement(convertCompositionStatus(src.getStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
for (org.hl7.fhir.r4b.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference43_50.convertReference(t));
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasConfidentiality())
tgt.setConfidentialityElement(Code43_50.convertCode(src.getConfidentialityElement()));
for (org.hl7.fhir.r4b.model.Composition.CompositionAttesterComponent t : src.getAttester())
tgt.addAttester(convertCompositionAttesterComponent(t));
if (src.hasCustodian())
tgt.setCustodian(Reference43_50.convertReference(src.getCustodian()));
for (org.hl7.fhir.r4b.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo())
tgt.addRelatesTo(convertCompositionRelatesToComponent(t));
for (org.hl7.fhir.r4b.model.Composition.CompositionEventComponent t : src.getEvent())
tgt.addEvent(convertCompositionEventComponent(t));
for (org.hl7.fhir.r4b.model.Composition.SectionComponent t : src.getSection())
tgt.addSection(convertSectionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Composition convertComposition(org.hl7.fhir.r5.model.Composition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Composition tgt = new org.hl7.fhir.r4b.model.Composition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
if (src.hasStatus())
tgt.setStatusElement(convertCompositionStatus(src.getStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference43_50.convertReference(t));
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasConfidentiality())
tgt.setConfidentialityElement(Code43_50.convertCode(src.getConfidentialityElement()));
for (org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent t : src.getAttester())
tgt.addAttester(convertCompositionAttesterComponent(t));
if (src.hasCustodian())
tgt.setCustodian(Reference43_50.convertReference(src.getCustodian()));
for (RelatedArtifact t : src.getRelatesTo())
tgt.addRelatesTo(convertCompositionRelatesToComponent(t));
for (org.hl7.fhir.r5.model.Composition.CompositionEventComponent t : src.getEvent())
tgt.addEvent(convertCompositionEventComponent(t));
for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection())
tgt.addSection(convertSectionComponent(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.CompositionStatus> convertCompositionStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.CompositionStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.CompositionStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompositionStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PRELIMINARY:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY);
break;
case FINAL:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL);
break;
case AMENDED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.CompositionStatus> convertCompositionStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.CompositionStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.CompositionStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.CompositionStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PRELIMINARY:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.PRELIMINARY);
break;
case FINAL:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.FINAL);
break;
case AMENDED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.AMENDED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.CompositionStatus.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r4b.model.Composition.CompositionAttesterComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasMode())
tgt.setMode(convertCompositionAttestationMode(src.getModeElement()));
if (src.hasTime())
tgt.setTimeElement(DateTime43_50.convertDateTime(src.getTimeElement()));
if (src.hasParty())
tgt.setParty(Reference43_50.convertReference(src.getParty()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.r4b.model.Composition.CompositionAttesterComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasMode())
tgt.setModeElement(convertCompositionAttestationMode(src.getMode()));
if (src.hasTime())
tgt.setTimeElement(DateTime43_50.convertDateTime(src.getTimeElement()));
if (src.hasParty())
tgt.setParty(Reference43_50.convertReference(src.getParty()));
return tgt;
}
static public org.hl7.fhir.r5.model.CodeableConcept convertCompositionAttestationMode(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Composition.CompositionAttestationMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PERSONAL:
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("personal");
break;
case PROFESSIONAL:
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("professional");
break;
case LEGAL:
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("legal");
break;
case OFFICIAL:
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("official");
break;
default:
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Composition.CompositionAttestationMode> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Composition.CompositionAttestationModeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getCode("http://hl7.org/fhir/composition-attestation-mode")) {
case "personal":
tgt.setValue(org.hl7.fhir.r4b.model.Composition.CompositionAttestationMode.PERSONAL);
break;
case "professional":
tgt.setValue(org.hl7.fhir.r4b.model.Composition.CompositionAttestationMode.PROFESSIONAL);
break;
case "legal":
tgt.setValue(org.hl7.fhir.r4b.model.Composition.CompositionAttestationMode.LEGAL);
break;
case "official":
tgt.setValue(org.hl7.fhir.r4b.model.Composition.CompositionAttestationMode.OFFICIAL);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Composition.CompositionAttestationMode.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.RelatedArtifact convertCompositionRelatesToComponent(org.hl7.fhir.r4b.model.Composition.CompositionRelatesToComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.RelatedArtifact tgt = new org.hl7.fhir.r5.model.RelatedArtifact();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasCode())
tgt.setTypeElement(convertDocumentRelationshipType(src.getCodeElement()));
if (src.hasTargetReference())
tgt.setResourceReference(Reference43_50.convertReference(src.getTargetReference()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.r5.model.RelatedArtifact src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Composition.CompositionRelatesToComponent tgt = new org.hl7.fhir.r4b.model.Composition.CompositionRelatesToComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasType())
tgt.setCodeElement(convertDocumentRelationshipType(src.getTypeElement()));
if (src.hasResourceReference())
tgt.setTarget(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getResourceReference()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType> convertDocumentRelationshipType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case REPLACES:
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.REPLACES);
break;
case TRANSFORMS:
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.TRANSFORMS);
break;
case SIGNS:
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.SIGNS);
break;
case APPENDS:
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.APPENDS);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case REPLACES:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.REPLACES);
break;
case TRANSFORMS:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.TRANSFORMS);
break;
case SIGNS:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.SIGNS);
break;
case APPENDS:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.APPENDS);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentRelationshipType.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.r4b.model.Composition.CompositionEventComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionEventComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCode())
tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r4b.model.Reference t : src.getDetail()) tgt.addDetail(Reference43_50.convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.r5.model.Composition.CompositionEventComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.r4b.model.Composition.CompositionEventComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode())
tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(Reference43_50.convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.r4b.model.Composition.SectionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Composition.SectionComponent tgt = new org.hl7.fhir.r5.model.Composition.SectionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r4b.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference43_50.convertReference(t));
if (src.hasFocus())
tgt.setFocus(Reference43_50.convertReference(src.getFocus()));
if (src.hasText())
tgt.setText(Narrative43_50.convertNarrative(src.getText()));
if (src.hasMode())
tgt.setModeElement(convertSectionMode(src.getModeElement()));
if (src.hasOrderedBy())
tgt.setOrderedBy(CodeableConcept43_50.convertCodeableConcept(src.getOrderedBy()));
for (org.hl7.fhir.r4b.model.Reference t : src.getEntry()) tgt.addEntry(Reference43_50.convertReference(t));
if (src.hasEmptyReason())
tgt.setEmptyReason(CodeableConcept43_50.convertCodeableConcept(src.getEmptyReason()));
for (org.hl7.fhir.r4b.model.Composition.SectionComponent t : src.getSection())
tgt.addSection(convertSectionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.r5.model.Composition.SectionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Composition.SectionComponent tgt = new org.hl7.fhir.r4b.model.Composition.SectionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r5.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference43_50.convertReference(t));
if (src.hasFocus())
tgt.setFocus(Reference43_50.convertReference(src.getFocus()));
if (src.hasText())
tgt.setText(Narrative43_50.convertNarrative(src.getText()));
if (src.hasMode())
tgt.setModeElement(convertSectionMode(src.getModeElement()));
if (src.hasOrderedBy())
tgt.setOrderedBy(CodeableConcept43_50.convertCodeableConcept(src.getOrderedBy()));
for (org.hl7.fhir.r5.model.Reference t : src.getEntry()) tgt.addEntry(Reference43_50.convertReference(t));
if (src.hasEmptyReason())
tgt.setEmptyReason(CodeableConcept43_50.convertCodeableConcept(src.getEmptyReason()));
for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection())
tgt.addSection(convertSectionComponent(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ListMode> convertSectionMode(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ListMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ListMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ListModeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case WORKING:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.WORKING);
break;
case SNAPSHOT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.SNAPSHOT);
break;
case CHANGES:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.CHANGES);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ListMode.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ListMode> convertSectionMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ListMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ListMode> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ListModeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case WORKING:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.WORKING);
break;
case SNAPSHOT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.SNAPSHOT);
break;
case CHANGES:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.CHANGES);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ListMode.NULL);
break;
}
return tgt;
}
}

View File

@ -0,0 +1,456 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.VersionConvertorConstants;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.ContactDetail43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.metadata43_50.UsageContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CanonicalType;
import org.hl7.fhir.r5.model.Coding;
import org.hl7.fhir.r5.model.Enumeration;
import org.hl7.fhir.r5.model.Enumerations;
import org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship;
import org.hl7.fhir.r5.utils.ToolingExtensions;
import org.hl7.fhir.utilities.CanonicalPair;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ConceptMap43_50 {
public static org.hl7.fhir.r5.model.ConceptMap convertConceptMap(org.hl7.fhir.r4b.model.ConceptMap src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ConceptMap tgt = new org.hl7.fhir.r5.model.ConceptMap();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
if (src.hasIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(src.getIdentifierFirstRep()));
if (src.hasVersion())
tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4b.model.ContactDetail t : src.getContact())
tgt.addContact(ContactDetail43_50.convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4b.model.UsageContext t : src.getUseContext())
tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
if (src.hasSource())
tgt.setSourceScope(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSource()));
if (src.hasTarget())
tgt.setTargetScope(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTarget()));
for (org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup())
tgt.addGroup(convertConceptMapGroupComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ConceptMap convertConceptMap(org.hl7.fhir.r5.model.ConceptMap src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ConceptMap tgt = new org.hl7.fhir.r4b.model.ConceptMap();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
if (src.hasIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(src.getIdentifierFirstRep()));
if (src.hasVersion())
tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations43_50.convertPublicationStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean43_50.convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(String43_50.convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(ContactDetail43_50.convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(MarkDown43_50.convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(UsageContext43_50.convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(MarkDown43_50.convertMarkdown(src.getPurposeElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
if (src.hasSourceScope())
tgt.setSource(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSourceScope()));
if (src.hasTargetScope())
tgt.setTarget(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTargetScope()));
for (org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup())
tgt.addGroup(convertConceptMapGroupComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent convertConceptMapGroupComponent(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSource() || src.hasSourceVersion())
tgt.setSourceElement(convertUriAndVersionToCanonical(src.getSourceElement(), src.getSourceVersionElement()));
if (src.hasTarget() || src.hasTargetVersion())
tgt.setTargetElement(convertUriAndVersionToCanonical(src.getTargetElement(), src.getTargetVersionElement()));
for (org.hl7.fhir.r4b.model.ConceptMap.SourceElementComponent t : src.getElement())
tgt.addElement(convertSourceElementComponent(t));
if (src.hasUnmapped())
tgt.setUnmapped(convertConceptMapGroupUnmappedComponent(src.getUnmapped()));
return tgt;
}
private static CanonicalType convertUriAndVersionToCanonical(org.hl7.fhir.r4b.model.UriType srcUri, org.hl7.fhir.r4b.model.StringType srcVersion) {
if (srcUri == null && srcVersion == null)
return null;
org.hl7.fhir.r5.model.CanonicalType tgt = new org.hl7.fhir.r5.model.CanonicalType();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(srcUri == null ? srcVersion : srcUri, tgt);
if (srcUri.hasValue()) {
if (srcVersion.hasValue()) {
tgt.setValue(srcUri.getValue() + "|" + srcVersion.getValue());
} else {
tgt.setValue(srcUri.getValue());
}
}
return tgt;
}
public static org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupComponent convertConceptMapGroupComponent(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupComponent tgt = new org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSource()) {
CanonicalPair cp = new CanonicalPair(src.getSource());
tgt.setSource(cp.getUrl());
tgt.setSourceVersion(cp.getVersion());
}
if (src.hasTarget()) {
CanonicalPair cp = new CanonicalPair(src.getTarget());
tgt.setTarget(cp.getUrl());
tgt.setTargetVersion(cp.getVersion());
}
for (org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent t : src.getElement())
tgt.addElement(convertSourceElementComponent(t));
if (src.hasUnmapped())
tgt.setUnmapped(convertConceptMapGroupUnmappedComponent(src.getUnmapped()));
return tgt;
}
public static org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.r4b.model.ConceptMap.SourceElementComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
for (org.hl7.fhir.r4b.model.ConceptMap.TargetElementComponent t : src.getTarget()) {
if (t.getEquivalence() == org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.UNMATCHED) {
tgt.setNoMap(true);
} else {
tgt.addTarget(convertTargetElementComponent(t));
}
}
return tgt;
}
public static org.hl7.fhir.r4b.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.r4b.model.ConceptMap.SourceElementComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
if (src.hasNoMap() && src.getNoMap() == true) {
tgt.addTarget(new org.hl7.fhir.r4b.model.ConceptMap.TargetElementComponent().setEquivalence(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.UNMATCHED));
} else {
for (org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent t : src.getTarget())
tgt.addTarget(convertTargetElementComponent(t));
}
return tgt;
}
public static org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.r4b.model.ConceptMap.TargetElementComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
if (src.hasEquivalence())
tgt.setRelationshipElement(convertConceptMapRelationship(src.getEquivalenceElement()));
if (src.hasComment())
tgt.setCommentElement(String43_50.convertString(src.getCommentElement()));
for (org.hl7.fhir.r4b.model.ConceptMap.OtherElementComponent t : src.getDependsOn())
tgt.addDependsOn(convertOtherElementComponent(t));
for (org.hl7.fhir.r4b.model.ConceptMap.OtherElementComponent t : src.getProduct())
tgt.addProduct(convertOtherElementComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.r4b.model.ConceptMap.TargetElementComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
if (src.hasRelationship())
tgt.setEquivalenceElement(convertConceptMapEquivalence(src.getRelationshipElement()));
else
tgt.setEquivalence(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.RELATEDTO);
if (src.hasComment())
tgt.setCommentElement(String43_50.convertString(src.getCommentElement()));
for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getDependsOn())
tgt.addDependsOn(convertOtherElementComponent(t));
for (org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent t : src.getProduct())
tgt.addProduct(convertOtherElementComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence> convertConceptMapEquivalence(Enumeration<ConceptMapRelationship> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence> tgt = new org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence>(new org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalenceEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt, VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE);
if (src.hasExtension(VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE)) {
tgt.setValueAsString(src.getExtensionString(VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE));
} else {
switch (src.getValue()) {
case RELATEDTO:
tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.RELATEDTO);
break;
case EQUIVALENT:
tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.EQUIVALENT);
break;
case SOURCEISNARROWERTHANTARGET:
tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.WIDER);
break;
case SOURCEISBROADERTHANTARGET:
tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.NARROWER);
break;
case NOTRELATEDTO:
tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.DISJOINT);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence.NULL);
break;
}
}
return tgt;
}
public static Enumeration<ConceptMapRelationship> convertConceptMapRelationship(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ConceptMap.ConceptMapEquivalence> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
Enumeration<ConceptMapRelationship> tgt = new Enumeration<ConceptMapRelationship>(new Enumerations.ConceptMapRelationshipEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
ToolingExtensions.setCodeExtension(tgt, VersionConvertorConstants.EXT_OLD_CONCEPTMAP_EQUIVALENCE, src.getValueAsString());
switch (src.getValue()) {
case EQUIVALENT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT);
break;
case EQUAL:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.EQUIVALENT);
break;
case WIDER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET);
break;
case SUBSUMES:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISNARROWERTHANTARGET);
break;
case NARROWER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET);
break;
case SPECIALIZES:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.SOURCEISBROADERTHANTARGET);
break;
case RELATEDTO:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO);
break;
case INEXACT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.RELATEDTO);
break;
case UNMATCHED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL);
break;
case DISJOINT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NOTRELATEDTO);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r4b.model.ConceptMap.OtherElementComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasProperty())
tgt.setPropertyElement(Uri43_50.convertUri(src.getPropertyElement()));
if (src.hasSystem()) {
tgt.setValue(new Coding().setSystem(src.getSystem()).setCode(src.getValue()).setDisplay(src.getDisplay()));
} else if (src.hasValueElement()) {
tgt.setValue(String43_50.convertString(src.getValueElement()));
}
return tgt;
}
public static org.hl7.fhir.r4b.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.r4b.model.ConceptMap.OtherElementComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasProperty())
tgt.setPropertyElement(Uri43_50.convertUri(src.getPropertyElement()));
if (src.hasValueCoding()) {
tgt.setSystem(src.getValueCoding().getSystem());
tgt.setValue(src.getValueCoding().getCode());
tgt.setDisplay(src.getValueCoding().getDisplay());
} else if (src.hasValue()) {
tgt.setValue(src.getValue().primitiveValue());
}
return tgt;
}
public static org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent convertConceptMapGroupUnmappedComponent(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent tgt = new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasMode())
tgt.setModeElement(convertConceptMapGroupUnmappedMode(src.getModeElement()));
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
if (src.hasUrl())
tgt.setOtherMapElement(Canonical43_50.convertCanonical(src.getUrlElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedComponent convertConceptMapGroupUnmappedComponent(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedComponent tgt = new org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasMode())
tgt.setModeElement(convertConceptMapGroupUnmappedMode(src.getModeElement()));
if (src.hasCode())
tgt.setCodeElement(Code43_50.convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(String43_50.convertString(src.getDisplayElement()));
if (src.hasOtherMap())
tgt.setUrlElement(Canonical43_50.convertCanonical(src.getOtherMapElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode> convertConceptMapGroupUnmappedMode(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PROVIDED:
tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.USESOURCECODE);
break;
case FIXED:
tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED);
break;
case OTHERMAP:
tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedMode> convertConceptMapGroupUnmappedMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedMode> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case USESOURCECODE:
tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED);
break;
case FIXED:
tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED);
break;
case OTHERMAP:
tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL);
break;
}
return tgt;
}
}

View File

@ -0,0 +1,191 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import java.util.ArrayList;
import java.util.List;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeableConcept;
import org.hl7.fhir.r5.model.CodeableReference;
import org.hl7.fhir.r5.model.Coding;
import org.hl7.fhir.r5.model.Condition.ConditionParticipantComponent;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Condition43_50 {
public static org.hl7.fhir.r5.model.Condition convertCondition(org.hl7.fhir.r4b.model.Condition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Condition tgt = new org.hl7.fhir.r5.model.Condition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasClinicalStatus())
tgt.setClinicalStatus(CodeableConcept43_50.convertCodeableConcept(src.getClinicalStatus()));
if (src.hasVerificationStatus())
tgt.setVerificationStatus(CodeableConcept43_50.convertCodeableConcept(src.getVerificationStatus()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasSeverity())
tgt.setSeverity(CodeableConcept43_50.convertCodeableConcept(src.getSeverity()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getBodySite())
tgt.addBodySite(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
if (src.hasOnset())
tgt.setOnset(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOnset()));
if (src.hasAbatement())
tgt.setAbatement(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAbatement()));
if (src.hasRecordedDate())
tgt.setRecordedDateElement(DateTime43_50.convertDateTime(src.getRecordedDateElement()));
if (src.hasRecorder())
tgt.addParticipant().setFunction(new CodeableConcept(new Coding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "author", "Author"))).setActor(Reference43_50.convertReference(src.getRecorder()));
if (src.hasAsserter())
tgt.addParticipant().setFunction(new CodeableConcept(new Coding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "informant", "Informant"))).setActor(Reference43_50.convertReference(src.getAsserter()));
for (org.hl7.fhir.r4b.model.Condition.ConditionStageComponent t : src.getStage())
tgt.addStage(convertConditionStageComponent(t));
for (org.hl7.fhir.r4b.model.Condition.ConditionEvidenceComponent t : src.getEvidence())
tgt.getEvidence().addAll(convertConditionEvidenceComponent(t));
for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Condition convertCondition(org.hl7.fhir.r5.model.Condition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Condition tgt = new org.hl7.fhir.r4b.model.Condition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasClinicalStatus())
tgt.setClinicalStatus(CodeableConcept43_50.convertCodeableConcept(src.getClinicalStatus()));
if (src.hasVerificationStatus())
tgt.setVerificationStatus(CodeableConcept43_50.convertCodeableConcept(src.getVerificationStatus()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasSeverity())
tgt.setSeverity(CodeableConcept43_50.convertCodeableConcept(src.getSeverity()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite())
tgt.addBodySite(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
if (src.hasOnset())
tgt.setOnset(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOnset()));
if (src.hasAbatement())
tgt.setAbatement(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getAbatement()));
if (src.hasRecordedDate())
tgt.setRecordedDateElement(DateTime43_50.convertDateTime(src.getRecordedDateElement()));
for (org.hl7.fhir.r5.model.Condition.ConditionParticipantComponent t : src.getParticipant()) {
if (t.getFunction().hasCoding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "author"))
tgt.setRecorder(Reference43_50.convertReference(t.getActor()));
if (t.getFunction().hasCoding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "informant"))
tgt.setAsserter(Reference43_50.convertReference(t.getActor()));
}
for (org.hl7.fhir.r5.model.Condition.ConditionStageComponent t : src.getStage())
tgt.addStage(convertConditionStageComponent(t));
for (CodeableReference t : src.getEvidence())
tgt.addEvidence(convertConditionEvidenceComponent(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.r4b.model.Condition.ConditionStageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.r5.model.Condition.ConditionStageComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSummary())
tgt.setSummary(CodeableConcept43_50.convertCodeableConcept(src.getSummary()));
for (org.hl7.fhir.r4b.model.Reference t : src.getAssessment()) tgt.addAssessment(Reference43_50.convertReference(t));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.r5.model.Condition.ConditionStageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.r4b.model.Condition.ConditionStageComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSummary())
tgt.setSummary(CodeableConcept43_50.convertCodeableConcept(src.getSummary()));
for (org.hl7.fhir.r5.model.Reference t : src.getAssessment()) tgt.addAssessment(Reference43_50.convertReference(t));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
return tgt;
}
public static List<org.hl7.fhir.r5.model.CodeableReference> convertConditionEvidenceComponent(org.hl7.fhir.r4b.model.Condition.ConditionEvidenceComponent src) throws FHIRException {
if (src == null)
return null;
List<org.hl7.fhir.r5.model.CodeableReference> list = new ArrayList<>();
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCode()) {
org.hl7.fhir.r5.model.CodeableReference tgt = new org.hl7.fhir.r5.model.CodeableReference();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
tgt.setConcept(CodeableConcept43_50.convertCodeableConcept(t));
list.add(tgt);
}
for (org.hl7.fhir.r4b.model.Reference t : src.getDetail()) {
org.hl7.fhir.r5.model.CodeableReference tgt = new org.hl7.fhir.r5.model.CodeableReference();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
tgt.setReference(Reference43_50.convertReference(t));
list.add(tgt);
}
return list;
}
public static org.hl7.fhir.r4b.model.Condition.ConditionEvidenceComponent convertConditionEvidenceComponent(org.hl7.fhir.r5.model.CodeableReference src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.r4b.model.Condition.ConditionEvidenceComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
if (src.hasConcept())
tgt.addCode(CodeableConcept43_50.convertCodeableConcept(src.getConcept()));
if (src.hasReference())
tgt.addDetail(Reference43_50.convertReference(src.getReference()));
return tgt;
}
}

View File

@ -0,0 +1,408 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Consent43_50 {
public static org.hl7.fhir.r5.model.Consent convertConsent(org.hl7.fhir.r4b.model.Consent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Consent tgt = new org.hl7.fhir.r5.model.Consent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertConsentState(src.getStatusElement()));
// if (src.hasScope())
// tgt.setScope(CodeableConcept43_50.convertCodeableConcept(src.getScope()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPatient())
tgt.setSubject(Reference43_50.convertReference(src.getPatient()));
if (src.hasDateTime())
tgt.setDateTimeElement(DateTime43_50.convertDateTime(src.getDateTimeElement()));
for (org.hl7.fhir.r4b.model.Reference t : src.getPerformer()) tgt.addGrantee(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getOrganization()) tgt.addManager(Reference43_50.convertReference(t));
if (src.hasSourceAttachment())
tgt.addSourceAttachment(Attachment43_50.convertAttachment(src.getSourceAttachment()));
if (src.hasSourceReference())
tgt.addSourceReference(Reference43_50.convertReference(src.getSourceReference()));
// for (org.hl7.fhir.r4b.model.Consent.ConsentPolicyComponent t : src.getPolicy())
// tgt.addPolicy(convertConsentPolicyComponent(t));
// if (src.hasPolicyRule())
// tgt.setPolicyRule(CodeableConcept43_50.convertCodeableConcept(src.getPolicyRule()));
for (org.hl7.fhir.r4b.model.Consent.ConsentVerificationComponent t : src.getVerification())
tgt.addVerification(convertConsentVerificationComponent(t));
if (src.hasProvision())
tgt.setProvision(convertprovisionComponent(src.getProvision()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Consent convertConsent(org.hl7.fhir.r5.model.Consent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Consent tgt = new org.hl7.fhir.r4b.model.Consent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertConsentState(src.getStatusElement()));
// if (src.hasScope())
// tgt.setScope(CodeableConcept43_50.convertCodeableConcept(src.getScope()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasSubject())
tgt.setPatient(Reference43_50.convertReference(src.getSubject()));
if (src.hasDateTime())
tgt.setDateTimeElement(DateTime43_50.convertDateTime(src.getDateTimeElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getGrantee()) tgt.addPerformer(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getManager()) tgt.addOrganization(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getController())
tgt.addOrganization(Reference43_50.convertReference(t));
if (src.hasSourceAttachment())
tgt.setSource(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSourceAttachmentFirstRep()));
if (src.hasSourceReference())
tgt.setSource(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getSourceReferenceFirstRep()));
// for (org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent t : src.getPolicy())
// tgt.addPolicy(convertConsentPolicyComponent(t));
// if (src.hasPolicyRule())
// tgt.setPolicyRule(CodeableConcept43_50.convertCodeableConcept(src.getPolicyRule()));
for (org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent t : src.getVerification())
tgt.addVerification(convertConsentVerificationComponent(t));
if (src.hasProvision())
tgt.setProvision(convertprovisionComponent(src.getProvision()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Consent.ConsentState> convertConsentState(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Consent.ConsentState> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Consent.ConsentState> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Consent.ConsentStateEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case DRAFT:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.DRAFT);
break;
case PROPOSED:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.DRAFT);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.ACTIVE);
break;
case REJECTED:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.INACTIVE);
break;
case INACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.INACTIVE);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentState.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Consent.ConsentState> convertConsentState(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Consent.ConsentState> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Consent.ConsentState> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Consent.ConsentStateEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case DRAFT:
tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.DRAFT);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.ACTIVE);
break;
case INACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.INACTIVE);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentState.NULL);
break;
}
return tgt;
}
// public static org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent convertConsentPolicyComponent(org.hl7.fhir.r4b.model.Consent.ConsentPolicyComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent tgt = new org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasAuthority())
// tgt.setAuthorityElement(Uri43_50.convertUri(src.getAuthorityElement()));
// if (src.hasUri())
// tgt.setUriElement(Uri43_50.convertUri(src.getUriElement()));
// return tgt;
// }
//
// public static org.hl7.fhir.r4b.model.Consent.ConsentPolicyComponent convertConsentPolicyComponent(org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r4b.model.Consent.ConsentPolicyComponent tgt = new org.hl7.fhir.r4b.model.Consent.ConsentPolicyComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasAuthority())
// tgt.setAuthorityElement(Uri43_50.convertUri(src.getAuthorityElement()));
// if (src.hasUri())
// tgt.setUriElement(Uri43_50.convertUri(src.getUriElement()));
// return tgt;
// }
public static org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent convertConsentVerificationComponent(org.hl7.fhir.r4b.model.Consent.ConsentVerificationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent tgt = new org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasVerified())
tgt.setVerifiedElement(Boolean43_50.convertBoolean(src.getVerifiedElement()));
if (src.hasVerifiedWith())
tgt.setVerifiedWith(Reference43_50.convertReference(src.getVerifiedWith()));
if (src.hasVerificationDate())
tgt.getVerificationDate().add(DateTime43_50.convertDateTime(src.getVerificationDateElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Consent.ConsentVerificationComponent convertConsentVerificationComponent(org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Consent.ConsentVerificationComponent tgt = new org.hl7.fhir.r4b.model.Consent.ConsentVerificationComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasVerified())
tgt.setVerifiedElement(Boolean43_50.convertBoolean(src.getVerifiedElement()));
if (src.hasVerifiedWith())
tgt.setVerifiedWith(Reference43_50.convertReference(src.getVerifiedWith()));
if (src.hasVerificationDate())
tgt.setVerificationDateElement(DateTime43_50.convertDateTime(src.getVerificationDate().get(0)));
return tgt;
}
public static org.hl7.fhir.r5.model.Consent.ProvisionComponent convertprovisionComponent(org.hl7.fhir.r4b.model.Consent.ProvisionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Consent.ProvisionComponent tgt = new org.hl7.fhir.r5.model.Consent.ProvisionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertConsentProvisionType(src.getTypeElement()));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r4b.model.Consent.ProvisionActorComponent t : src.getActor())
tgt.addActor(convertprovisionActorComponent(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getAction())
tgt.addAction(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding43_50.convertCoding(t));
for (org.hl7.fhir.r4b.model.Coding t : src.getPurpose()) tgt.addPurpose(Coding43_50.convertCoding(t));
for (org.hl7.fhir.r4b.model.Coding t : src.getClass_()) tgt.addClass_(Coding43_50.convertCoding(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCode())
tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasDataPeriod())
tgt.setDataPeriod(Period43_50.convertPeriod(src.getDataPeriod()));
for (org.hl7.fhir.r4b.model.Consent.ProvisionDataComponent t : src.getData())
tgt.addData(convertprovisionDataComponent(t));
for (org.hl7.fhir.r4b.model.Consent.ProvisionComponent t : src.getProvision())
tgt.addProvision(convertprovisionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Consent.ProvisionComponent convertprovisionComponent(org.hl7.fhir.r5.model.Consent.ProvisionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Consent.ProvisionComponent tgt = new org.hl7.fhir.r4b.model.Consent.ProvisionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertConsentProvisionType(src.getTypeElement()));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r5.model.Consent.ProvisionActorComponent t : src.getActor())
tgt.addActor(convertprovisionActorComponent(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAction())
tgt.addAction(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding43_50.convertCoding(t));
for (org.hl7.fhir.r5.model.Coding t : src.getPurpose()) tgt.addPurpose(Coding43_50.convertCoding(t));
for (org.hl7.fhir.r5.model.Coding t : src.getClass_()) tgt.addClass_(Coding43_50.convertCoding(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode())
tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasDataPeriod())
tgt.setDataPeriod(Period43_50.convertPeriod(src.getDataPeriod()));
for (org.hl7.fhir.r5.model.Consent.ProvisionDataComponent t : src.getData())
tgt.addData(convertprovisionDataComponent(t));
for (org.hl7.fhir.r5.model.Consent.ProvisionComponent t : src.getProvision())
tgt.addProvision(convertprovisionComponent(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Consent.ConsentProvisionType> convertConsentProvisionType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Consent.ConsentProvisionType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Consent.ConsentProvisionType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Consent.ConsentProvisionTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case DENY:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentProvisionType.DENY);
break;
case PERMIT:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentProvisionType.PERMIT);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentProvisionType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Consent.ConsentProvisionType> convertConsentProvisionType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Consent.ConsentProvisionType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Consent.ConsentProvisionType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Consent.ConsentProvisionTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case DENY:
tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentProvisionType.DENY);
break;
case PERMIT:
tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentProvisionType.PERMIT);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentProvisionType.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Consent.ProvisionActorComponent convertprovisionActorComponent(org.hl7.fhir.r4b.model.Consent.ProvisionActorComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Consent.ProvisionActorComponent tgt = new org.hl7.fhir.r5.model.Consent.ProvisionActorComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasRole())
tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole()));
if (src.hasReference())
tgt.setReference(Reference43_50.convertReference(src.getReference()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Consent.ProvisionActorComponent convertprovisionActorComponent(org.hl7.fhir.r5.model.Consent.ProvisionActorComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Consent.ProvisionActorComponent tgt = new org.hl7.fhir.r4b.model.Consent.ProvisionActorComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasRole())
tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole()));
if (src.hasReference())
tgt.setReference(Reference43_50.convertReference(src.getReference()));
return tgt;
}
public static org.hl7.fhir.r5.model.Consent.ProvisionDataComponent convertprovisionDataComponent(org.hl7.fhir.r4b.model.Consent.ProvisionDataComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Consent.ProvisionDataComponent tgt = new org.hl7.fhir.r5.model.Consent.ProvisionDataComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasMeaning())
tgt.setMeaningElement(convertConsentDataMeaning(src.getMeaningElement()));
if (src.hasReference())
tgt.setReference(Reference43_50.convertReference(src.getReference()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Consent.ProvisionDataComponent convertprovisionDataComponent(org.hl7.fhir.r5.model.Consent.ProvisionDataComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Consent.ProvisionDataComponent tgt = new org.hl7.fhir.r4b.model.Consent.ProvisionDataComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasMeaning())
tgt.setMeaningElement(convertConsentDataMeaning(src.getMeaningElement()));
if (src.hasReference())
tgt.setReference(Reference43_50.convertReference(src.getReference()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Consent.ConsentDataMeaning> convertConsentDataMeaning(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Consent.ConsentDataMeaning> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Consent.ConsentDataMeaningEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case INSTANCE:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.INSTANCE);
break;
case RELATED:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.RELATED);
break;
case DEPENDENTS:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.DEPENDENTS);
break;
case AUTHOREDBY:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.AUTHOREDBY);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning> convertConsentDataMeaning(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Consent.ConsentDataMeaning> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Consent.ConsentDataMeaningEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case INSTANCE:
tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.INSTANCE);
break;
case RELATED:
tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.RELATED);
break;
case DEPENDENTS:
tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.DEPENDENTS);
break;
case AUTHOREDBY:
tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.AUTHOREDBY);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Consent.ConsentDataMeaning.NULL);
break;
}
return tgt;
}
}

View File

@ -0,0 +1,997 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeableReference;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Contract43_50 {
public static org.hl7.fhir.r5.model.Contract convertContract(org.hl7.fhir.r4b.model.Contract src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract tgt = new org.hl7.fhir.r5.model.Contract();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
if (src.hasVersion())
tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
if (src.hasStatus())
tgt.setStatusElement(convertContractStatus(src.getStatusElement()));
if (src.hasLegalState())
tgt.setLegalState(CodeableConcept43_50.convertCodeableConcept(src.getLegalState()));
if (src.hasInstantiatesCanonical())
tgt.setInstantiatesCanonical(Reference43_50.convertReference(src.getInstantiatesCanonical()));
if (src.hasInstantiatesUri())
tgt.setInstantiatesUriElement(Uri43_50.convertUri(src.getInstantiatesUriElement()));
if (src.hasContentDerivative())
tgt.setContentDerivative(CodeableConcept43_50.convertCodeableConcept(src.getContentDerivative()));
if (src.hasIssued())
tgt.setIssuedElement(DateTime43_50.convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(Period43_50.convertPeriod(src.getApplies()));
if (src.hasExpirationType())
tgt.setExpirationType(CodeableConcept43_50.convertCodeableConcept(src.getExpirationType()));
for (org.hl7.fhir.r4b.model.Reference t : src.getSubject()) tgt.addSubject(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getAuthority()) tgt.addAuthority(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getDomain()) tgt.addDomain(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getSite()) tgt.addSite(Reference43_50.convertReference(t));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement()));
for (org.hl7.fhir.r4b.model.StringType t : src.getAlias()) tgt.getAlias().add(String43_50.convertString(t));
if (src.hasAuthor())
tgt.setAuthor(Reference43_50.convertReference(src.getAuthor()));
if (src.hasScope())
tgt.setScope(CodeableConcept43_50.convertCodeableConcept(src.getScope()));
if (src.hasTopic())
tgt.setTopic(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTopic()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSubType())
tgt.addSubType(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasContentDefinition())
tgt.setContentDefinition(convertContentDefinitionComponent(src.getContentDefinition()));
for (org.hl7.fhir.r4b.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getRelevantHistory())
tgt.addRelevantHistory(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Contract.SignatoryComponent t : src.getSigner())
tgt.addSigner(convertSignatoryComponent(t));
for (org.hl7.fhir.r4b.model.Contract.FriendlyLanguageComponent t : src.getFriendly())
tgt.addFriendly(convertFriendlyLanguageComponent(t));
for (org.hl7.fhir.r4b.model.Contract.LegalLanguageComponent t : src.getLegal())
tgt.addLegal(convertLegalLanguageComponent(t));
for (org.hl7.fhir.r4b.model.Contract.ComputableLanguageComponent t : src.getRule())
tgt.addRule(convertComputableLanguageComponent(t));
if (src.hasLegallyBinding())
tgt.setLegallyBinding(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLegallyBinding()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract convertContract(org.hl7.fhir.r5.model.Contract src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract tgt = new org.hl7.fhir.r4b.model.Contract();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
if (src.hasVersion())
tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
if (src.hasStatus())
tgt.setStatusElement(convertContractStatus(src.getStatusElement()));
if (src.hasLegalState())
tgt.setLegalState(CodeableConcept43_50.convertCodeableConcept(src.getLegalState()));
if (src.hasInstantiatesCanonical())
tgt.setInstantiatesCanonical(Reference43_50.convertReference(src.getInstantiatesCanonical()));
if (src.hasInstantiatesUri())
tgt.setInstantiatesUriElement(Uri43_50.convertUri(src.getInstantiatesUriElement()));
if (src.hasContentDerivative())
tgt.setContentDerivative(CodeableConcept43_50.convertCodeableConcept(src.getContentDerivative()));
if (src.hasIssued())
tgt.setIssuedElement(DateTime43_50.convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(Period43_50.convertPeriod(src.getApplies()));
if (src.hasExpirationType())
tgt.setExpirationType(CodeableConcept43_50.convertCodeableConcept(src.getExpirationType()));
for (org.hl7.fhir.r5.model.Reference t : src.getSubject()) tgt.addSubject(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getAuthority()) tgt.addAuthority(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getDomain()) tgt.addDomain(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSite()) tgt.addSite(Reference43_50.convertReference(t));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(String43_50.convertString(src.getTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(String43_50.convertString(src.getSubtitleElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getAlias()) tgt.getAlias().add(String43_50.convertString(t));
if (src.hasAuthor())
tgt.setAuthor(Reference43_50.convertReference(src.getAuthor()));
if (src.hasScope())
tgt.setScope(CodeableConcept43_50.convertCodeableConcept(src.getScope()));
if (src.hasTopic())
tgt.setTopic(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTopic()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubType())
tgt.addSubType(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasContentDefinition())
tgt.setContentDefinition(convertContentDefinitionComponent(src.getContentDefinition()));
for (org.hl7.fhir.r5.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory())
tgt.addRelevantHistory(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Contract.SignatoryComponent t : src.getSigner())
tgt.addSigner(convertSignatoryComponent(t));
for (org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent t : src.getFriendly())
tgt.addFriendly(convertFriendlyLanguageComponent(t));
for (org.hl7.fhir.r5.model.Contract.LegalLanguageComponent t : src.getLegal())
tgt.addLegal(convertLegalLanguageComponent(t));
for (org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent t : src.getRule())
tgt.addRule(convertComputableLanguageComponent(t));
if (src.hasLegallyBinding())
tgt.setLegallyBinding(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLegallyBinding()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes> convertContractStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case AMENDED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.AMENDED);
break;
case APPENDED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.APPENDED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.CANCELLED);
break;
case DISPUTED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.DISPUTED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.ENTEREDINERROR);
break;
case EXECUTABLE:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.EXECUTABLE);
break;
case EXECUTED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.EXECUTED);
break;
case NEGOTIABLE:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.NEGOTIABLE);
break;
case OFFERED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.OFFERED);
break;
case POLICY:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.POLICY);
break;
case REJECTED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.REJECTED);
break;
case RENEWED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.RENEWED);
break;
case REVOKED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.REVOKED);
break;
case RESOLVED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.RESOLVED);
break;
case TERMINATED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.TERMINATED);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes> convertContractStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Contract.ContractResourceStatusCodes> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case AMENDED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.AMENDED);
break;
case APPENDED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.APPENDED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.CANCELLED);
break;
case DISPUTED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.DISPUTED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.ENTEREDINERROR);
break;
case EXECUTABLE:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.EXECUTABLE);
break;
case EXECUTED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.EXECUTED);
break;
case NEGOTIABLE:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.NEGOTIABLE);
break;
case OFFERED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.OFFERED);
break;
case POLICY:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.POLICY);
break;
case REJECTED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.REJECTED);
break;
case RENEWED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.RENEWED);
break;
case REVOKED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.REVOKED);
break;
case RESOLVED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.RESOLVED);
break;
case TERMINATED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.TERMINATED);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourceStatusCodes.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent convertContentDefinitionComponent(org.hl7.fhir.r4b.model.Contract.ContentDefinitionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent tgt = new org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType()));
if (src.hasPublisher())
tgt.setPublisher(Reference43_50.convertReference(src.getPublisher()));
if (src.hasPublicationDate())
tgt.setPublicationDateElement(DateTime43_50.convertDateTime(src.getPublicationDateElement()));
if (src.hasPublicationStatus())
tgt.setPublicationStatusElement(convertContractPublicationStatus(src.getPublicationStatusElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.ContentDefinitionComponent convertContentDefinitionComponent(org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.ContentDefinitionComponent tgt = new org.hl7.fhir.r4b.model.Contract.ContentDefinitionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType()));
if (src.hasPublisher())
tgt.setPublisher(Reference43_50.convertReference(src.getPublisher()));
if (src.hasPublicationDate())
tgt.setPublicationDateElement(DateTime43_50.convertDateTime(src.getPublicationDateElement()));
if (src.hasPublicationStatus())
tgt.setPublicationStatusElement(convertContractPublicationStatus(src.getPublicationStatusElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(MarkDown43_50.convertMarkdown(src.getCopyrightElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes> convertContractPublicationStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case AMENDED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.AMENDED);
break;
case APPENDED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.APPENDED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.CANCELLED);
break;
case DISPUTED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.DISPUTED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.ENTEREDINERROR);
break;
case EXECUTABLE:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.EXECUTABLE);
break;
case EXECUTED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.EXECUTED);
break;
case NEGOTIABLE:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.NEGOTIABLE);
break;
case OFFERED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.OFFERED);
break;
case POLICY:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.POLICY);
break;
case REJECTED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.REJECTED);
break;
case RENEWED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.RENEWED);
break;
case REVOKED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.REVOKED);
break;
case RESOLVED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.RESOLVED);
break;
case TERMINATED:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.TERMINATED);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes> convertContractPublicationStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Contract.ContractResourcePublicationStatusCodes> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case AMENDED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.AMENDED);
break;
case APPENDED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.APPENDED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.CANCELLED);
break;
case DISPUTED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.DISPUTED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.ENTEREDINERROR);
break;
case EXECUTABLE:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.EXECUTABLE);
break;
case EXECUTED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.EXECUTED);
break;
case NEGOTIABLE:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.NEGOTIABLE);
break;
case OFFERED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.OFFERED);
break;
case POLICY:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.POLICY);
break;
case REJECTED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.REJECTED);
break;
case RENEWED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.RENEWED);
break;
case REVOKED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.REVOKED);
break;
case RESOLVED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.RESOLVED);
break;
case TERMINATED:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.TERMINATED);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Contract.ContractResourcePublicationStatusCodes.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.r4b.model.Contract.TermComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.TermComponent tgt = new org.hl7.fhir.r5.model.Contract.TermComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
if (src.hasIssued())
tgt.setIssuedElement(DateTime43_50.convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(Period43_50.convertPeriod(src.getApplies()));
if (src.hasTopic())
tgt.setTopic(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTopic()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType()));
if (src.hasText())
tgt.setTextElement(String43_50.convertString(src.getTextElement()));
for (org.hl7.fhir.r4b.model.Contract.SecurityLabelComponent t : src.getSecurityLabel())
tgt.addSecurityLabel(convertSecurityLabelComponent(t));
if (src.hasOffer())
tgt.setOffer(convertContractOfferComponent(src.getOffer()));
for (org.hl7.fhir.r4b.model.Contract.ContractAssetComponent t : src.getAsset())
tgt.addAsset(convertContractAssetComponent(t));
for (org.hl7.fhir.r4b.model.Contract.ActionComponent t : src.getAction()) tgt.addAction(convertActionComponent(t));
for (org.hl7.fhir.r4b.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.r5.model.Contract.TermComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.TermComponent tgt = new org.hl7.fhir.r4b.model.Contract.TermComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
if (src.hasIssued())
tgt.setIssuedElement(DateTime43_50.convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(Period43_50.convertPeriod(src.getApplies()));
if (src.hasTopic())
tgt.setTopic(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTopic()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType()));
if (src.hasText())
tgt.setTextElement(String43_50.convertString(src.getTextElement()));
for (org.hl7.fhir.r5.model.Contract.SecurityLabelComponent t : src.getSecurityLabel())
tgt.addSecurityLabel(convertSecurityLabelComponent(t));
if (src.hasOffer())
tgt.setOffer(convertContractOfferComponent(src.getOffer()));
for (org.hl7.fhir.r5.model.Contract.ContractAssetComponent t : src.getAsset())
tgt.addAsset(convertContractAssetComponent(t));
for (org.hl7.fhir.r5.model.Contract.ActionComponent t : src.getAction()) tgt.addAction(convertActionComponent(t));
for (org.hl7.fhir.r5.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.SecurityLabelComponent convertSecurityLabelComponent(org.hl7.fhir.r4b.model.Contract.SecurityLabelComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.SecurityLabelComponent tgt = new org.hl7.fhir.r5.model.Contract.SecurityLabelComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r4b.model.UnsignedIntType t : src.getNumber())
tgt.getNumber().add(UnsignedInt43_50.convertUnsignedInt(t));
if (src.hasClassification())
tgt.setClassification(Coding43_50.convertCoding(src.getClassification()));
for (org.hl7.fhir.r4b.model.Coding t : src.getCategory()) tgt.addCategory(Coding43_50.convertCoding(t));
for (org.hl7.fhir.r4b.model.Coding t : src.getControl()) tgt.addControl(Coding43_50.convertCoding(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.SecurityLabelComponent convertSecurityLabelComponent(org.hl7.fhir.r5.model.Contract.SecurityLabelComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.SecurityLabelComponent tgt = new org.hl7.fhir.r4b.model.Contract.SecurityLabelComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getNumber())
tgt.getNumber().add(UnsignedInt43_50.convertUnsignedInt(t));
if (src.hasClassification())
tgt.setClassification(Coding43_50.convertCoding(src.getClassification()));
for (org.hl7.fhir.r5.model.Coding t : src.getCategory()) tgt.addCategory(Coding43_50.convertCoding(t));
for (org.hl7.fhir.r5.model.Coding t : src.getControl()) tgt.addControl(Coding43_50.convertCoding(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ContractOfferComponent convertContractOfferComponent(org.hl7.fhir.r4b.model.Contract.ContractOfferComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.ContractOfferComponent tgt = new org.hl7.fhir.r5.model.Contract.ContractOfferComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r4b.model.Contract.ContractPartyComponent t : src.getParty())
tgt.addParty(convertContractPartyComponent(t));
if (src.hasTopic())
tgt.setTopic(Reference43_50.convertReference(src.getTopic()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasDecision())
tgt.setDecision(CodeableConcept43_50.convertCodeableConcept(src.getDecision()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getDecisionMode())
tgt.addDecisionMode(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.Contract.AnswerComponent t : src.getAnswer()) tgt.addAnswer(convertAnswerComponent(t));
if (src.hasText())
tgt.setTextElement(String43_50.convertString(src.getTextElement()));
for (org.hl7.fhir.r4b.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t));
for (org.hl7.fhir.r4b.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.ContractOfferComponent convertContractOfferComponent(org.hl7.fhir.r5.model.Contract.ContractOfferComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.ContractOfferComponent tgt = new org.hl7.fhir.r4b.model.Contract.ContractOfferComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r5.model.Contract.ContractPartyComponent t : src.getParty())
tgt.addParty(convertContractPartyComponent(t));
if (src.hasTopic())
tgt.setTopic(Reference43_50.convertReference(src.getTopic()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasDecision())
tgt.setDecision(CodeableConcept43_50.convertCodeableConcept(src.getDecision()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDecisionMode())
tgt.addDecisionMode(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Contract.AnswerComponent t : src.getAnswer()) tgt.addAnswer(convertAnswerComponent(t));
if (src.hasText())
tgt.setTextElement(String43_50.convertString(src.getTextElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t));
for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ContractPartyComponent convertContractPartyComponent(org.hl7.fhir.r4b.model.Contract.ContractPartyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.ContractPartyComponent tgt = new org.hl7.fhir.r5.model.Contract.ContractPartyComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r4b.model.Reference t : src.getReference()) tgt.addReference(Reference43_50.convertReference(t));
if (src.hasRole())
tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.ContractPartyComponent convertContractPartyComponent(org.hl7.fhir.r5.model.Contract.ContractPartyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.ContractPartyComponent tgt = new org.hl7.fhir.r4b.model.Contract.ContractPartyComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r5.model.Reference t : src.getReference()) tgt.addReference(Reference43_50.convertReference(t));
if (src.hasRole())
tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole()));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.AnswerComponent convertAnswerComponent(org.hl7.fhir.r4b.model.Contract.AnswerComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.AnswerComponent tgt = new org.hl7.fhir.r5.model.Contract.AnswerComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.AnswerComponent convertAnswerComponent(org.hl7.fhir.r5.model.Contract.AnswerComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.AnswerComponent tgt = new org.hl7.fhir.r4b.model.Contract.AnswerComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ContractAssetComponent convertContractAssetComponent(org.hl7.fhir.r4b.model.Contract.ContractAssetComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.ContractAssetComponent tgt = new org.hl7.fhir.r5.model.Contract.ContractAssetComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasScope())
tgt.setScope(CodeableConcept43_50.convertCodeableConcept(src.getScope()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getType())
tgt.addType(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getTypeReference())
tgt.addTypeReference(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSubtype())
tgt.addSubtype(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasRelationship())
tgt.setRelationship(Coding43_50.convertCoding(src.getRelationship()));
for (org.hl7.fhir.r4b.model.Contract.AssetContextComponent t : src.getContext())
tgt.addContext(convertAssetContextComponent(t));
if (src.hasCondition())
tgt.setConditionElement(String43_50.convertString(src.getConditionElement()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getPeriodType())
tgt.addPeriodType(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.Period t : src.getPeriod()) tgt.addPeriod(Period43_50.convertPeriod(t));
for (org.hl7.fhir.r4b.model.Period t : src.getUsePeriod()) tgt.addUsePeriod(Period43_50.convertPeriod(t));
if (src.hasText())
tgt.setTextElement(String43_50.convertString(src.getTextElement()));
for (org.hl7.fhir.r4b.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t));
for (org.hl7.fhir.r4b.model.Contract.AnswerComponent t : src.getAnswer()) tgt.addAnswer(convertAnswerComponent(t));
for (org.hl7.fhir.r4b.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t));
for (org.hl7.fhir.r4b.model.Contract.ValuedItemComponent t : src.getValuedItem())
tgt.addValuedItem(convertValuedItemComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.ContractAssetComponent convertContractAssetComponent(org.hl7.fhir.r5.model.Contract.ContractAssetComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.ContractAssetComponent tgt = new org.hl7.fhir.r4b.model.Contract.ContractAssetComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasScope())
tgt.setScope(CodeableConcept43_50.convertCodeableConcept(src.getScope()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getTypeReference())
tgt.addTypeReference(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubtype())
tgt.addSubtype(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasRelationship())
tgt.setRelationship(Coding43_50.convertCoding(src.getRelationship()));
for (org.hl7.fhir.r5.model.Contract.AssetContextComponent t : src.getContext())
tgt.addContext(convertAssetContextComponent(t));
if (src.hasCondition())
tgt.setConditionElement(String43_50.convertString(src.getConditionElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPeriodType())
tgt.addPeriodType(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Period t : src.getPeriod()) tgt.addPeriod(Period43_50.convertPeriod(t));
for (org.hl7.fhir.r5.model.Period t : src.getUsePeriod()) tgt.addUsePeriod(Period43_50.convertPeriod(t));
if (src.hasText())
tgt.setTextElement(String43_50.convertString(src.getTextElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t));
for (org.hl7.fhir.r5.model.Contract.AnswerComponent t : src.getAnswer()) tgt.addAnswer(convertAnswerComponent(t));
for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t));
for (org.hl7.fhir.r5.model.Contract.ValuedItemComponent t : src.getValuedItem())
tgt.addValuedItem(convertValuedItemComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.AssetContextComponent convertAssetContextComponent(org.hl7.fhir.r4b.model.Contract.AssetContextComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.AssetContextComponent tgt = new org.hl7.fhir.r5.model.Contract.AssetContextComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasReference())
tgt.setReference(Reference43_50.convertReference(src.getReference()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCode())
tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasText())
tgt.setTextElement(String43_50.convertString(src.getTextElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.AssetContextComponent convertAssetContextComponent(org.hl7.fhir.r5.model.Contract.AssetContextComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.AssetContextComponent tgt = new org.hl7.fhir.r4b.model.Contract.AssetContextComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasReference())
tgt.setReference(Reference43_50.convertReference(src.getReference()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode())
tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasText())
tgt.setTextElement(String43_50.convertString(src.getTextElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.r4b.model.Contract.ValuedItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.r5.model.Contract.ValuedItemComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasEntity())
tgt.setEntity(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEntity()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
if (src.hasEffectiveTime())
tgt.setEffectiveTimeElement(DateTime43_50.convertDateTime(src.getEffectiveTimeElement()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasPoints())
tgt.setPointsElement(Decimal43_50.convertDecimal(src.getPointsElement()));
if (src.hasNet())
tgt.setNet(Money43_50.convertMoney(src.getNet()));
if (src.hasPayment())
tgt.setPaymentElement(String43_50.convertString(src.getPaymentElement()));
if (src.hasPaymentDate())
tgt.setPaymentDateElement(DateTime43_50.convertDateTime(src.getPaymentDateElement()));
if (src.hasResponsible())
tgt.setResponsible(Reference43_50.convertReference(src.getResponsible()));
if (src.hasRecipient())
tgt.setRecipient(Reference43_50.convertReference(src.getRecipient()));
for (org.hl7.fhir.r4b.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t));
for (org.hl7.fhir.r4b.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.r5.model.Contract.ValuedItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.r4b.model.Contract.ValuedItemComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasEntity())
tgt.setEntity(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getEntity()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
if (src.hasEffectiveTime())
tgt.setEffectiveTimeElement(DateTime43_50.convertDateTime(src.getEffectiveTimeElement()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
if (src.hasPoints())
tgt.setPointsElement(Decimal43_50.convertDecimal(src.getPointsElement()));
if (src.hasNet())
tgt.setNet(Money43_50.convertMoney(src.getNet()));
if (src.hasPayment())
tgt.setPaymentElement(String43_50.convertString(src.getPaymentElement()));
if (src.hasPaymentDate())
tgt.setPaymentDateElement(DateTime43_50.convertDateTime(src.getPaymentDateElement()));
if (src.hasResponsible())
tgt.setResponsible(Reference43_50.convertReference(src.getResponsible()));
if (src.hasRecipient())
tgt.setRecipient(Reference43_50.convertReference(src.getRecipient()));
for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t));
for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ActionComponent convertActionComponent(org.hl7.fhir.r4b.model.Contract.ActionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.ActionComponent tgt = new org.hl7.fhir.r5.model.Contract.ActionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4b.model.Contract.ActionSubjectComponent t : src.getSubject())
tgt.addSubject(convertActionSubjectComponent(t));
if (src.hasIntent())
tgt.setIntent(CodeableConcept43_50.convertCodeableConcept(src.getIntent()));
for (org.hl7.fhir.r4b.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t));
if (src.hasStatus())
tgt.setStatus(CodeableConcept43_50.convertCodeableConcept(src.getStatus()));
if (src.hasContext())
tgt.setContext(Reference43_50.convertReference(src.getContext()));
for (org.hl7.fhir.r4b.model.StringType t : src.getContextLinkId())
tgt.getContextLinkId().add(String43_50.convertString(t));
if (src.hasOccurrence())
tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence()));
for (org.hl7.fhir.r4b.model.Reference t : src.getRequester()) tgt.addRequester(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.StringType t : src.getRequesterLinkId())
tgt.getRequesterLinkId().add(String43_50.convertString(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getPerformerType())
tgt.addPerformerType(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPerformerRole())
tgt.setPerformerRole(CodeableConcept43_50.convertCodeableConcept(src.getPerformerRole()));
if (src.hasPerformer())
tgt.setPerformer(Reference43_50.convertReference(src.getPerformer()));
for (org.hl7.fhir.r4b.model.StringType t : src.getPerformerLinkId())
tgt.getPerformerLinkId().add(String43_50.convertString(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode())
tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference())
tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t));
for (org.hl7.fhir.r4b.model.StringType t : src.getReasonLinkId())
tgt.getReasonLinkId().add(String43_50.convertString(t));
for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
for (org.hl7.fhir.r4b.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.ActionComponent convertActionComponent(org.hl7.fhir.r5.model.Contract.ActionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.ActionComponent tgt = new org.hl7.fhir.r4b.model.Contract.ActionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(Boolean43_50.convertBoolean(src.getDoNotPerformElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.Contract.ActionSubjectComponent t : src.getSubject())
tgt.addSubject(convertActionSubjectComponent(t));
if (src.hasIntent())
tgt.setIntent(CodeableConcept43_50.convertCodeableConcept(src.getIntent()));
for (org.hl7.fhir.r5.model.StringType t : src.getLinkId()) tgt.getLinkId().add(String43_50.convertString(t));
if (src.hasStatus())
tgt.setStatus(CodeableConcept43_50.convertCodeableConcept(src.getStatus()));
if (src.hasContext())
tgt.setContext(Reference43_50.convertReference(src.getContext()));
for (org.hl7.fhir.r5.model.StringType t : src.getContextLinkId())
tgt.getContextLinkId().add(String43_50.convertString(t));
if (src.hasOccurrence())
tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence()));
for (org.hl7.fhir.r5.model.Reference t : src.getRequester()) tgt.addRequester(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.StringType t : src.getRequesterLinkId())
tgt.getRequesterLinkId().add(String43_50.convertString(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPerformerType())
tgt.addPerformerType(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasPerformerRole())
tgt.setPerformerRole(CodeableConcept43_50.convertCodeableConcept(src.getPerformerRole()));
if (src.hasPerformer())
tgt.setPerformer(Reference43_50.convertReference(src.getPerformer()));
for (org.hl7.fhir.r5.model.StringType t : src.getPerformerLinkId())
tgt.getPerformerLinkId().add(String43_50.convertString(t));
for (CodeableReference t : src.getReason())
if (t.hasConcept())
tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept()));
for (CodeableReference t : src.getReason())
if (t.hasReference())
tgt.addReasonReference(Reference43_50.convertReference(t.getReference()));
for (org.hl7.fhir.r5.model.StringType t : src.getReasonLinkId()) tgt.getReason().add(String43_50.convertString(t));
for (org.hl7.fhir.r5.model.StringType t : src.getReasonLinkId())
tgt.getReasonLinkId().add(String43_50.convertString(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(UnsignedInt43_50.convertUnsignedInt(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ActionSubjectComponent convertActionSubjectComponent(org.hl7.fhir.r4b.model.Contract.ActionSubjectComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.ActionSubjectComponent tgt = new org.hl7.fhir.r5.model.Contract.ActionSubjectComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r4b.model.Reference t : src.getReference()) tgt.addReference(Reference43_50.convertReference(t));
if (src.hasRole())
tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.ActionSubjectComponent convertActionSubjectComponent(org.hl7.fhir.r5.model.Contract.ActionSubjectComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.ActionSubjectComponent tgt = new org.hl7.fhir.r4b.model.Contract.ActionSubjectComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r5.model.Reference t : src.getReference()) tgt.addReference(Reference43_50.convertReference(t));
if (src.hasRole())
tgt.setRole(CodeableConcept43_50.convertCodeableConcept(src.getRole()));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.r4b.model.Contract.SignatoryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.r5.model.Contract.SignatoryComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(Coding43_50.convertCoding(src.getType()));
if (src.hasParty())
tgt.setParty(Reference43_50.convertReference(src.getParty()));
for (org.hl7.fhir.r4b.model.Signature t : src.getSignature()) tgt.addSignature(Signature43_50.convertSignature(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.r5.model.Contract.SignatoryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.r4b.model.Contract.SignatoryComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(Coding43_50.convertCoding(src.getType()));
if (src.hasParty())
tgt.setParty(Reference43_50.convertReference(src.getParty()));
for (org.hl7.fhir.r5.model.Signature t : src.getSignature()) tgt.addSignature(Signature43_50.convertSignature(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.r4b.model.Contract.FriendlyLanguageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.r4b.model.Contract.FriendlyLanguageComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.r4b.model.Contract.LegalLanguageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.r5.model.Contract.LegalLanguageComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.r5.model.Contract.LegalLanguageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.r4b.model.Contract.LegalLanguageComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.r4b.model.Contract.ComputableLanguageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.r4b.model.Contract.ComputableLanguageComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getContent()));
return tgt;
}
}

View File

@ -0,0 +1,251 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.PositiveInt43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Coverage43_50 {
public static org.hl7.fhir.r5.model.Coverage convertCoverage(org.hl7.fhir.r4b.model.Coverage src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Coverage tgt = new org.hl7.fhir.r5.model.Coverage();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertCoverageStatus(src.getStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasPolicyHolder())
tgt.setPolicyHolder(Reference43_50.convertReference(src.getPolicyHolder()));
if (src.hasSubscriber())
tgt.setSubscriber(Reference43_50.convertReference(src.getSubscriber()));
if (src.hasSubscriberId())
tgt.getSubscriberId().setValueElement(String43_50.convertString(src.getSubscriberIdElement()));
if (src.hasBeneficiary())
tgt.setBeneficiary(Reference43_50.convertReference(src.getBeneficiary()));
if (src.hasDependent())
tgt.setDependentElement(String43_50.convertString(src.getDependentElement()));
if (src.hasRelationship())
tgt.setRelationship(CodeableConcept43_50.convertCodeableConcept(src.getRelationship()));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r4b.model.Reference t : src.getPayor()) tgt.addPayor(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Coverage.ClassComponent t : src.getClass_()) tgt.addClass_(convertClassComponent(t));
if (src.hasOrder())
tgt.setOrderElement(PositiveInt43_50.convertPositiveInt(src.getOrderElement()));
if (src.hasNetwork())
tgt.setNetworkElement(String43_50.convertString(src.getNetworkElement()));
for (org.hl7.fhir.r4b.model.Coverage.CostToBeneficiaryComponent t : src.getCostToBeneficiary())
tgt.addCostToBeneficiary(convertCostToBeneficiaryComponent(t));
if (src.hasSubrogation())
tgt.setSubrogationElement(Boolean43_50.convertBoolean(src.getSubrogationElement()));
for (org.hl7.fhir.r4b.model.Reference t : src.getContract()) tgt.addContract(Reference43_50.convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Coverage convertCoverage(org.hl7.fhir.r5.model.Coverage src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Coverage tgt = new org.hl7.fhir.r4b.model.Coverage();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertCoverageStatus(src.getStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasPolicyHolder())
tgt.setPolicyHolder(Reference43_50.convertReference(src.getPolicyHolder()));
if (src.hasSubscriber())
tgt.setSubscriber(Reference43_50.convertReference(src.getSubscriber()));
if (src.hasSubscriberId())
tgt.setSubscriberIdElement(String43_50.convertString(src.getSubscriberId().getValueElement()));
if (src.hasBeneficiary())
tgt.setBeneficiary(Reference43_50.convertReference(src.getBeneficiary()));
if (src.hasDependent())
tgt.setDependentElement(String43_50.convertString(src.getDependentElement()));
if (src.hasRelationship())
tgt.setRelationship(CodeableConcept43_50.convertCodeableConcept(src.getRelationship()));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r5.model.Reference t : src.getPayor()) tgt.addPayor(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Coverage.ClassComponent t : src.getClass_()) tgt.addClass_(convertClassComponent(t));
if (src.hasOrder())
tgt.setOrderElement(PositiveInt43_50.convertPositiveInt(src.getOrderElement()));
if (src.hasNetwork())
tgt.setNetworkElement(String43_50.convertString(src.getNetworkElement()));
for (org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent t : src.getCostToBeneficiary())
tgt.addCostToBeneficiary(convertCostToBeneficiaryComponent(t));
if (src.hasSubrogation())
tgt.setSubrogationElement(Boolean43_50.convertBoolean(src.getSubrogationElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getContract()) tgt.addContract(Reference43_50.convertReference(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes> convertCoverageStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED);
break;
case DRAFT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> convertCoverageStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED);
break;
case DRAFT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Coverage.ClassComponent convertClassComponent(org.hl7.fhir.r4b.model.Coverage.ClassComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Coverage.ClassComponent tgt = new org.hl7.fhir.r5.model.Coverage.ClassComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasValue())
tgt.setValueElement(String43_50.convertString(src.getValueElement()));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Coverage.ClassComponent convertClassComponent(org.hl7.fhir.r5.model.Coverage.ClassComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Coverage.ClassComponent tgt = new org.hl7.fhir.r4b.model.Coverage.ClassComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasValue())
tgt.setValueElement(String43_50.convertString(src.getValueElement()));
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent convertCostToBeneficiaryComponent(org.hl7.fhir.r4b.model.Coverage.CostToBeneficiaryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent tgt = new org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
for (org.hl7.fhir.r4b.model.Coverage.ExemptionComponent t : src.getException())
tgt.addException(convertExemptionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Coverage.CostToBeneficiaryComponent convertCostToBeneficiaryComponent(org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Coverage.CostToBeneficiaryComponent tgt = new org.hl7.fhir.r4b.model.Coverage.CostToBeneficiaryComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
for (org.hl7.fhir.r5.model.Coverage.ExemptionComponent t : src.getException())
tgt.addException(convertExemptionComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Coverage.ExemptionComponent convertExemptionComponent(org.hl7.fhir.r4b.model.Coverage.ExemptionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Coverage.ExemptionComponent tgt = new org.hl7.fhir.r5.model.Coverage.ExemptionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Coverage.ExemptionComponent convertExemptionComponent(org.hl7.fhir.r5.model.Coverage.ExemptionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Coverage.ExemptionComponent tgt = new org.hl7.fhir.r4b.model.Coverage.ExemptionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasPeriod())
tgt.setPeriod(Period43_50.convertPeriod(src.getPeriod()));
return tgt;
}
}

View File

@ -0,0 +1,351 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Money43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.SimpleQuantity43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.PositiveInt43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.stream.Collectors;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CoverageEligibilityRequest43_50 {
public static org.hl7.fhir.r5.model.CoverageEligibilityRequest convertCoverageEligibilityRequest(org.hl7.fhir.r4b.model.CoverageEligibilityRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CoverageEligibilityRequest tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertEligibilityRequestStatus(src.getStatusElement()));
if (src.hasPriority())
tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority()));
tgt.setPurpose(src.getPurpose().stream()
.map(CoverageEligibilityRequest43_50::convertEligibilityRequestPurpose)
.collect(Collectors.toList()));
if (src.hasPatient())
tgt.setPatient(Reference43_50.convertReference(src.getPatient()));
if (src.hasServiced())
tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced()));
if (src.hasCreated())
tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement()));
if (src.hasEnterer())
tgt.setEnterer(Reference43_50.convertReference(src.getEnterer()));
if (src.hasProvider())
tgt.setProvider(Reference43_50.convertReference(src.getProvider()));
if (src.hasInsurer())
tgt.setInsurer(Reference43_50.convertReference(src.getInsurer()));
if (src.hasFacility())
tgt.setFacility(Reference43_50.convertReference(src.getFacility()));
for (org.hl7.fhir.r4b.model.CoverageEligibilityRequest.SupportingInformationComponent t : src.getSupportingInfo())
tgt.addSupportingInfo(convertSupportingInformationComponent(t));
for (org.hl7.fhir.r4b.model.CoverageEligibilityRequest.InsuranceComponent t : src.getInsurance())
tgt.addInsurance(convertInsuranceComponent(t));
for (org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DetailsComponent t : src.getItem())
tgt.addItem(convertDetailsComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.CoverageEligibilityRequest convertCoverageEligibilityRequest(org.hl7.fhir.r5.model.CoverageEligibilityRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CoverageEligibilityRequest tgt = new org.hl7.fhir.r4b.model.CoverageEligibilityRequest();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertEligibilityRequestStatus(src.getStatusElement()));
if (src.hasPriority())
tgt.setPriority(CodeableConcept43_50.convertCodeableConcept(src.getPriority()));
tgt.setPurpose(src.getPurpose().stream()
.map(CoverageEligibilityRequest43_50::convertEligibilityRequestPurpose)
.collect(Collectors.toList()));
if (src.hasPatient())
tgt.setPatient(Reference43_50.convertReference(src.getPatient()));
if (src.hasServiced())
tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced()));
if (src.hasCreated())
tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement()));
if (src.hasEnterer())
tgt.setEnterer(Reference43_50.convertReference(src.getEnterer()));
if (src.hasProvider())
tgt.setProvider(Reference43_50.convertReference(src.getProvider()));
if (src.hasInsurer())
tgt.setInsurer(Reference43_50.convertReference(src.getInsurer()));
if (src.hasFacility())
tgt.setFacility(Reference43_50.convertReference(src.getFacility()));
for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent t : src.getSupportingInfo())
tgt.addSupportingInfo(convertSupportingInformationComponent(t));
for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent t : src.getInsurance())
tgt.addInsurance(convertInsuranceComponent(t));
for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent t : src.getItem())
tgt.addItem(convertDetailsComponent(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes> convertEligibilityRequestStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ACTIVE);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.CANCELLED);
break;
case DRAFT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.DRAFT);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> convertEligibilityRequestStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED);
break;
case DRAFT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose> convertEligibilityRequestPurpose(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurposeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case AUTHREQUIREMENTS:
tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS);
break;
case BENEFITS:
tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS);
break;
case DISCOVERY:
tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY);
break;
case VALIDATION:
tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose> convertEligibilityRequestPurpose(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurposeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case AUTHREQUIREMENTS:
tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS);
break;
case BENEFITS:
tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS);
break;
case DISCOVERY:
tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY);
break;
case VALIDATION:
tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.EligibilityRequestPurpose.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.SupportingInformationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasInformation())
tgt.setInformation(Reference43_50.convertReference(src.getInformation()));
if (src.hasAppliesToAll())
tgt.setAppliesToAllElement(Boolean43_50.convertBoolean(src.getAppliesToAllElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.CoverageEligibilityRequest.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CoverageEligibilityRequest.SupportingInformationComponent tgt = new org.hl7.fhir.r4b.model.CoverageEligibilityRequest.SupportingInformationComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
if (src.hasInformation())
tgt.setInformation(Reference43_50.convertReference(src.getInformation()));
if (src.hasAppliesToAll())
tgt.setAppliesToAllElement(Boolean43_50.convertBoolean(src.getAppliesToAllElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.InsuranceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasFocal())
tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement()));
if (src.hasCoverage())
tgt.setCoverage(Reference43_50.convertReference(src.getCoverage()));
if (src.hasBusinessArrangement())
tgt.setBusinessArrangementElement(String43_50.convertString(src.getBusinessArrangementElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.CoverageEligibilityRequest.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CoverageEligibilityRequest.InsuranceComponent tgt = new org.hl7.fhir.r4b.model.CoverageEligibilityRequest.InsuranceComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasFocal())
tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement()));
if (src.hasCoverage())
tgt.setCoverage(Reference43_50.convertReference(src.getCoverage()));
if (src.hasBusinessArrangement())
tgt.setBusinessArrangementElement(String43_50.convertString(src.getBusinessArrangementElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent convertDetailsComponent(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DetailsComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getSupportingInfoSequence())
tgt.getSupportingInfoSequence().add(PositiveInt43_50.convertPositiveInt(t));
if (src.hasCategory())
tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier())
tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasProvider())
tgt.setProvider(Reference43_50.convertReference(src.getProvider()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFacility())
tgt.setFacility(Reference43_50.convertReference(src.getFacility()));
for (org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DiagnosisComponent t : src.getDiagnosis())
tgt.addDiagnosis(convertDiagnosisComponent(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getDetail()) tgt.addDetail(Reference43_50.convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DetailsComponent convertDetailsComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DetailsComponent tgt = new org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DetailsComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getSupportingInfoSequence())
tgt.getSupportingInfoSequence().add(PositiveInt43_50.convertPositiveInt(t));
if (src.hasCategory())
tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasProvider())
tgt.setProvider(Reference43_50.convertReference(src.getProvider()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
if (src.hasFacility())
tgt.setFacility(Reference43_50.convertReference(src.getFacility()));
for (org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent t : src.getDiagnosis())
tgt.addDiagnosis(convertDiagnosisComponent(t));
for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(Reference43_50.convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DiagnosisComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasDiagnosis())
tgt.setDiagnosis(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDiagnosis()));
return tgt;
}
public static org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DiagnosisComponent tgt = new org.hl7.fhir.r4b.model.CoverageEligibilityRequest.DiagnosisComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasDiagnosis())
tgt.setDiagnosis(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getDiagnosis()));
return tgt;
}
}

View File

@ -0,0 +1,272 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class DetectedIssue43_50 {
public static org.hl7.fhir.r5.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.r4b.model.DetectedIssue src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DetectedIssue tgt = new org.hl7.fhir.r5.model.DetectedIssue();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertDetectedIssueStatus(src.getStatusElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasSeverity())
tgt.setSeverityElement(convertDetectedIssueSeverity(src.getSeverityElement()));
if (src.hasPatient())
tgt.setPatient(Reference43_50.convertReference(src.getPatient()));
if (src.hasIdentified())
tgt.setIdentified(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getIdentified()));
if (src.hasAuthor())
tgt.setAuthor(Reference43_50.convertReference(src.getAuthor()));
for (org.hl7.fhir.r4b.model.Reference t : src.getImplicated()) tgt.addImplicated(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueEvidenceComponent t : src.getEvidence())
tgt.addEvidence(convertDetectedIssueEvidenceComponent(t));
if (src.hasDetail())
tgt.setDetailElement(String43_50.convertString(src.getDetailElement()));
if (src.hasReference())
tgt.setReferenceElement(Uri43_50.convertUri(src.getReferenceElement()));
for (org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation())
tgt.addMitigation(convertDetectedIssueMitigationComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.r5.model.DetectedIssue src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.DetectedIssue tgt = new org.hl7.fhir.r4b.model.DetectedIssue();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertDetectedIssueStatus(src.getStatusElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasSeverity())
tgt.setSeverityElement(convertDetectedIssueSeverity(src.getSeverityElement()));
if (src.hasPatient())
tgt.setPatient(Reference43_50.convertReference(src.getPatient()));
if (src.hasIdentified())
tgt.setIdentified(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getIdentified()));
if (src.hasAuthor())
tgt.setAuthor(Reference43_50.convertReference(src.getAuthor()));
for (org.hl7.fhir.r5.model.Reference t : src.getImplicated()) tgt.addImplicated(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent t : src.getEvidence())
tgt.addEvidence(convertDetectedIssueEvidenceComponent(t));
if (src.hasDetail())
tgt.setDetailElement(String43_50.convertString(src.getDetailElement()));
if (src.hasReference())
tgt.setReferenceElement(Uri43_50.convertUri(src.getReferenceElement()));
for (org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation())
tgt.addMitigation(convertDetectedIssueMitigationComponent(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ObservationStatus> convertDetectedIssueStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ObservationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ObservationStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ObservationStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case REGISTERED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.REGISTERED);
break;
case PRELIMINARY:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.PRELIMINARY);
break;
case FINAL:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.FINAL);
break;
case AMENDED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.AMENDED);
break;
case CORRECTED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CORRECTED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.CANCELLED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ObservationStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ObservationStatus> convertDetectedIssueStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ObservationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.ObservationStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.ObservationStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case REGISTERED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.REGISTERED);
break;
case PRELIMINARY:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.PRELIMINARY);
break;
case FINAL:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.FINAL);
break;
case AMENDED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.AMENDED);
break;
case CORRECTED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.CORRECTED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.CANCELLED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.ObservationStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity> convertDetectedIssueSeverity(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case HIGH:
tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.HIGH);
break;
case MODERATE:
tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.MODERATE);
break;
case LOW:
tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.LOW);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity> convertDetectedIssueSeverity(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case HIGH:
tgt.setValue(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity.HIGH);
break;
case MODERATE:
tgt.setValue(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity.MODERATE);
break;
case LOW:
tgt.setValue(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity.LOW);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueSeverity.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent convertDetectedIssueEvidenceComponent(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueEvidenceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent tgt = new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getCode())
tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getDetail()) tgt.addDetail(Reference43_50.convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueEvidenceComponent convertDetectedIssueEvidenceComponent(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueEvidenceComponent tgt = new org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueEvidenceComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode())
tgt.addCode(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getDetail()) tgt.addDetail(Reference43_50.convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueMitigationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasAction())
tgt.setAction(CodeableConcept43_50.convertCodeableConcept(src.getAction()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference43_50.convertReference(src.getAuthor()));
return tgt;
}
public static org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.r4b.model.DetectedIssue.DetectedIssueMitigationComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasAction())
tgt.setAction(CodeableConcept43_50.convertCodeableConcept(src.getAction()));
if (src.hasDate())
tgt.setDateElement(DateTime43_50.convertDateTime(src.getDateElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference43_50.convertReference(src.getAuthor()));
return tgt;
}
}

View File

@ -0,0 +1,461 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Base64Binary43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Device43_50 {
public static org.hl7.fhir.r5.model.Device convertDevice(org.hl7.fhir.r4b.model.Device src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Device tgt = new org.hl7.fhir.r5.model.Device();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasDefinition())
tgt.getDefinition().setReference(Reference43_50.convertReference(src.getDefinition()));
for (org.hl7.fhir.r4b.model.Device.DeviceUdiCarrierComponent t : src.getUdiCarrier())
tgt.addUdiCarrier(convertDeviceUdiCarrierComponent(t));
if (src.hasStatus())
tgt.setStatusElement(convertFHIRDeviceStatus(src.getStatusElement()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getStatusReason())
tgt.addStatusReason(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasDistinctIdentifier())
tgt.getBiologicalSourceEvent().setValueElement(String43_50.convertString(src.getDistinctIdentifierElement()));
if (src.hasManufacturer())
tgt.setManufacturerElement(String43_50.convertString(src.getManufacturerElement()));
if (src.hasManufactureDate())
tgt.setManufactureDateElement(DateTime43_50.convertDateTime(src.getManufactureDateElement()));
if (src.hasExpirationDate())
tgt.setExpirationDateElement(DateTime43_50.convertDateTime(src.getExpirationDateElement()));
if (src.hasLotNumber())
tgt.setLotNumberElement(String43_50.convertString(src.getLotNumberElement()));
if (src.hasSerialNumber())
tgt.setSerialNumberElement(String43_50.convertString(src.getSerialNumberElement()));
for (org.hl7.fhir.r4b.model.Device.DeviceDeviceNameComponent t : src.getDeviceName())
tgt.addDeviceName(convertDeviceDeviceNameComponent(t));
if (src.hasModelNumber())
tgt.setModelNumberElement(String43_50.convertString(src.getModelNumberElement()));
if (src.hasPartNumber())
tgt.setPartNumberElement(String43_50.convertString(src.getPartNumberElement()));
if (src.hasType())
tgt.addType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
// for (org.hl7.fhir.r4b.model.Device.DeviceSpecializationComponent t : src.getSpecialization())
// tgt.addSpecialization(convertDeviceSpecializationComponent(t));
for (org.hl7.fhir.r4b.model.Device.DeviceVersionComponent t : src.getVersion())
tgt.addVersion(convertDeviceVersionComponent(t));
for (org.hl7.fhir.r4b.model.Device.DevicePropertyComponent t : src.getProperty())
tgt.addProperty(convertDevicePropertyComponent(t));
if (src.hasPatient())
tgt.setSubject(Reference43_50.convertReference(src.getPatient()));
if (src.hasOwner())
tgt.setOwner(Reference43_50.convertReference(src.getOwner()));
for (org.hl7.fhir.r4b.model.ContactPoint t : src.getContact())
tgt.addContact(ContactPoint43_50.convertContactPoint(t));
if (src.hasLocation())
tgt.setLocation(Reference43_50.convertReference(src.getLocation()));
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSafety())
tgt.addSafety(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasParent())
tgt.setParent(Reference43_50.convertReference(src.getParent()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Device convertDevice(org.hl7.fhir.r5.model.Device src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Device tgt = new org.hl7.fhir.r4b.model.Device();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.getDefinition().hasReference())
tgt.setDefinition(Reference43_50.convertReference(src.getDefinition().getReference()));
for (org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent t : src.getUdiCarrier())
tgt.addUdiCarrier(convertDeviceUdiCarrierComponent(t));
if (src.hasStatus())
tgt.setStatusElement(convertFHIRDeviceStatus(src.getStatusElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason())
tgt.addStatusReason(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasBiologicalSourceEvent())
tgt.setDistinctIdentifierElement(String43_50.convertString(src.getBiologicalSourceEvent().getValueElement()));
if (src.hasManufacturer())
tgt.setManufacturerElement(String43_50.convertString(src.getManufacturerElement()));
if (src.hasManufactureDate())
tgt.setManufactureDateElement(DateTime43_50.convertDateTime(src.getManufactureDateElement()));
if (src.hasExpirationDate())
tgt.setExpirationDateElement(DateTime43_50.convertDateTime(src.getExpirationDateElement()));
if (src.hasLotNumber())
tgt.setLotNumberElement(String43_50.convertString(src.getLotNumberElement()));
if (src.hasSerialNumber())
tgt.setSerialNumberElement(String43_50.convertString(src.getSerialNumberElement()));
for (org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent t : src.getDeviceName())
tgt.addDeviceName(convertDeviceDeviceNameComponent(t));
if (src.hasModelNumber())
tgt.setModelNumberElement(String43_50.convertString(src.getModelNumberElement()));
if (src.hasPartNumber())
tgt.setPartNumberElement(String43_50.convertString(src.getPartNumberElement()));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getTypeFirstRep()));
// for (org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent t : src.getSpecialization())
// tgt.addSpecialization(convertDeviceSpecializationComponent(t));
for (org.hl7.fhir.r5.model.Device.DeviceVersionComponent t : src.getVersion())
tgt.addVersion(convertDeviceVersionComponent(t));
for (org.hl7.fhir.r5.model.Device.DevicePropertyComponent t : src.getProperty())
tgt.addProperty(convertDevicePropertyComponent(t));
if (src.hasSubject())
tgt.setPatient(Reference43_50.convertReference(src.getSubject()));
if (src.hasOwner())
tgt.setOwner(Reference43_50.convertReference(src.getOwner()));
for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact())
tgt.addContact(ContactPoint43_50.convertContactPoint(t));
if (src.hasLocation())
tgt.setLocation(Reference43_50.convertReference(src.getLocation()));
if (src.hasUrl())
tgt.setUrlElement(Uri43_50.convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSafety())
tgt.addSafety(CodeableConcept43_50.convertCodeableConcept(t));
if (src.hasParent())
tgt.setParent(Reference43_50.convertReference(src.getParent()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Device.FHIRDeviceStatus> convertFHIRDeviceStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Device.FHIRDeviceStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Device.FHIRDeviceStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.ACTIVE);
break;
case INACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.INACTIVE);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.NULL);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus> convertFHIRDeviceStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Device.FHIRDeviceStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Device.FHIRDeviceStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus.ACTIVE);
break;
case INACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus.INACTIVE);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Device.FHIRDeviceStatus.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent convertDeviceUdiCarrierComponent(org.hl7.fhir.r4b.model.Device.DeviceUdiCarrierComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasDeviceIdentifier())
tgt.setDeviceIdentifierElement(String43_50.convertString(src.getDeviceIdentifierElement()));
if (src.hasIssuer())
tgt.setIssuerElement(Uri43_50.convertUri(src.getIssuerElement()));
if (src.hasJurisdiction())
tgt.setJurisdictionElement(Uri43_50.convertUri(src.getJurisdictionElement()));
if (src.hasCarrierAIDC())
tgt.setCarrierAIDCElement(Base64Binary43_50.convertBase64Binary(src.getCarrierAIDCElement()));
if (src.hasCarrierHRF())
tgt.setCarrierHRFElement(String43_50.convertString(src.getCarrierHRFElement()));
if (src.hasEntryType())
tgt.setEntryTypeElement(convertUDIEntryType(src.getEntryTypeElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Device.DeviceUdiCarrierComponent convertDeviceUdiCarrierComponent(org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Device.DeviceUdiCarrierComponent tgt = new org.hl7.fhir.r4b.model.Device.DeviceUdiCarrierComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasDeviceIdentifier())
tgt.setDeviceIdentifierElement(String43_50.convertString(src.getDeviceIdentifierElement()));
if (src.hasIssuer())
tgt.setIssuerElement(Uri43_50.convertUri(src.getIssuerElement()));
if (src.hasJurisdiction())
tgt.setJurisdictionElement(Uri43_50.convertUri(src.getJurisdictionElement()));
if (src.hasCarrierAIDC())
tgt.setCarrierAIDCElement(Base64Binary43_50.convertBase64Binary(src.getCarrierAIDCElement()));
if (src.hasCarrierHRF())
tgt.setCarrierHRFElement(String43_50.convertString(src.getCarrierHRFElement()));
if (src.hasEntryType())
tgt.setEntryTypeElement(convertUDIEntryType(src.getEntryTypeElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Device.UDIEntryType> convertUDIEntryType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Device.UDIEntryType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Device.UDIEntryType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Device.UDIEntryTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case BARCODE:
tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.BARCODE);
break;
case RFID:
tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.RFID);
break;
case MANUAL:
tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.MANUAL);
break;
case CARD:
tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.CARD);
break;
case SELFREPORTED:
tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.SELFREPORTED);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Device.UDIEntryType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Device.UDIEntryType> convertUDIEntryType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Device.UDIEntryType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Device.UDIEntryType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Device.UDIEntryTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case BARCODE:
tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.BARCODE);
break;
case RFID:
tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.RFID);
break;
case MANUAL:
tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.MANUAL);
break;
case CARD:
tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.CARD);
break;
case SELFREPORTED:
tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.SELFREPORTED);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Device.UDIEntryType.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent convertDeviceDeviceNameComponent(org.hl7.fhir.r4b.model.Device.DeviceDeviceNameComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasType())
tgt.setTypeElement(convertDeviceNameType(src.getTypeElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Device.DeviceDeviceNameComponent convertDeviceDeviceNameComponent(org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Device.DeviceDeviceNameComponent tgt = new org.hl7.fhir.r4b.model.Device.DeviceDeviceNameComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasType())
tgt.setTypeElement(convertDeviceNameType(src.getTypeElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DeviceNameType> convertDeviceNameType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DeviceNameType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DeviceNameType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DeviceNameTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case USERFRIENDLYNAME:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME);
break;
case PATIENTREPORTEDNAME:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME);
break;
case MANUFACTURERNAME:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.REGISTEREDNAME);
break;
case MODELNAME:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME);
break;
case OTHER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DeviceNameType> convertDeviceNameType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DeviceNameType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DeviceNameType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DeviceNameTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case USERFRIENDLYNAME:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.USERFRIENDLYNAME);
break;
case PATIENTREPORTEDNAME:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME);
break;
case REGISTEREDNAME:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.MANUFACTURERNAME);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.NULL);
break;
}
return tgt;
}
// public static org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r4b.model.Device.DeviceSpecializationComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasSystemType())
// tgt.setSystemType(CodeableConcept43_50.convertCodeableConcept(src.getSystemType()));
// if (src.hasVersion())
// tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
// return tgt;
// }
//
// public static org.hl7.fhir.r4b.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r4b.model.Device.DeviceSpecializationComponent tgt = new org.hl7.fhir.r4b.model.Device.DeviceSpecializationComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasSystemType())
// tgt.setSystemType(CodeableConcept43_50.convertCodeableConcept(src.getSystemType()));
// if (src.hasVersion())
// tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
// return tgt;
// }
public static org.hl7.fhir.r5.model.Device.DeviceVersionComponent convertDeviceVersionComponent(org.hl7.fhir.r4b.model.Device.DeviceVersionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Device.DeviceVersionComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceVersionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasComponent())
tgt.setComponent(Identifier43_50.convertIdentifier(src.getComponent()));
if (src.hasValue())
tgt.setValueElement(String43_50.convertString(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.Device.DeviceVersionComponent convertDeviceVersionComponent(org.hl7.fhir.r5.model.Device.DeviceVersionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Device.DeviceVersionComponent tgt = new org.hl7.fhir.r4b.model.Device.DeviceVersionComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasComponent())
tgt.setComponent(Identifier43_50.convertIdentifier(src.getComponent()));
if (src.hasValue())
tgt.setValueElement(String43_50.convertString(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Device.DevicePropertyComponent convertDevicePropertyComponent(org.hl7.fhir.r4b.model.Device.DevicePropertyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Device.DevicePropertyComponent tgt = new org.hl7.fhir.r5.model.Device.DevicePropertyComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4b.model.Quantity t : src.getValueQuantity()) tgt.setValue(Quantity43_50.convertQuantity(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getValueCode())
tgt.setValue(CodeableConcept43_50.convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.Device.DevicePropertyComponent convertDevicePropertyComponent(org.hl7.fhir.r5.model.Device.DevicePropertyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.Device.DevicePropertyComponent tgt = new org.hl7.fhir.r4b.model.Device.DevicePropertyComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasValueQuantity()) tgt.addValueQuantity(Quantity43_50.convertQuantity(src.getValueQuantity()));
if (src.hasValueCodeableConcept())
tgt.addValueCode(CodeableConcept43_50.convertCodeableConcept(src.getValueCodeableConcept()));
return tgt;
}
}

View File

@ -0,0 +1,340 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.*;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionClassificationComponent;
import org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionVersionComponent;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class DeviceDefinition43_50 {
public static org.hl7.fhir.r5.model.DeviceDefinition convertDeviceDefinition(org.hl7.fhir.r4b.model.DeviceDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DeviceDefinition tgt = new org.hl7.fhir.r5.model.DeviceDefinition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent t : src.getUdiDeviceIdentifier())
tgt.addUdiDeviceIdentifier(convertDeviceDefinitionUdiDeviceIdentifierComponent(t));
if (src.hasManufacturerReference())
tgt.setManufacturer(Reference43_50.convertReference(src.getManufacturerReference()));
for (org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent t : src.getDeviceName())
tgt.addDeviceName(convertDeviceDefinitionDeviceNameComponent(t));
if (src.hasModelNumber())
tgt.setModelNumberElement(String43_50.convertString(src.getModelNumberElement()));
if (src.hasType())
tgt.addClassification().setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
// for (org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionSpecializationComponent t : src.getSpecialization())
// tgt.addSpecialization(convertDeviceDefinitionSpecializationComponent(t));
for (org.hl7.fhir.r4b.model.StringType t : src.getVersion())
tgt.getVersion().add(new DeviceDefinitionVersionComponent().setValueElement(String43_50.convertString(t)));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSafety())
tgt.addSafety(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r4b.model.ProductShelfLife t : src.getShelfLifeStorage())
tgt.addShelfLifeStorage(ProductShelfLife43_50.convertProductShelfLife(t));
// if (src.hasPhysicalCharacteristics())
// tgt.setPhysicalCharacteristics(ProdCharacteristic43_50.convertProdCharacteristic(src.getPhysicalCharacteristics()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getLanguageCode())
tgt.addLanguageCode(CodeableConcept43_50.convertCodeableConcept(t));
// for (org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionCapabilityComponent t : src.getCapability())
// tgt.addCapability(convertDeviceDefinitionCapabilityComponent(t));
for (org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionPropertyComponent t : src.getProperty())
tgt.addProperty(convertDeviceDefinitionPropertyComponent(t));
if (src.hasOwner())
tgt.setOwner(Reference43_50.convertReference(src.getOwner()));
for (org.hl7.fhir.r4b.model.ContactPoint t : src.getContact())
tgt.addContact(ContactPoint43_50.convertContactPoint(t));
// if (src.hasOnlineInformation())
// tgt.setOnlineInformationElement(Uri43_50.convertUri(src.getOnlineInformationElement()));
for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
if (src.hasParentDevice())
tgt.setParentDevice(Reference43_50.convertReference(src.getParentDevice()));
for (org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionMaterialComponent t : src.getMaterial())
tgt.addMaterial(convertDeviceDefinitionMaterialComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.DeviceDefinition convertDeviceDefinition(org.hl7.fhir.r5.model.DeviceDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.DeviceDefinition tgt = new org.hl7.fhir.r4b.model.DeviceDefinition();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent t : src.getUdiDeviceIdentifier())
tgt.addUdiDeviceIdentifier(convertDeviceDefinitionUdiDeviceIdentifierComponent(t));
if (src.hasManufacturer())
tgt.setManufacturer(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getManufacturer()));
for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent t : src.getDeviceName())
tgt.addDeviceName(convertDeviceDefinitionDeviceNameComponent(t));
if (src.hasModelNumber())
tgt.setModelNumberElement(String43_50.convertString(src.getModelNumberElement()));
for (DeviceDefinitionClassificationComponent t : src.getClassification())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(t.getType()));
// for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent t : src.getSpecialization())
// tgt.addSpecialization(convertDeviceDefinitionSpecializationComponent(t));
for (DeviceDefinitionVersionComponent t : src.getVersion())
tgt.getVersion().add(String43_50.convertString(t.getValueElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSafety())
tgt.addSafety(CodeableConcept43_50.convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.ProductShelfLife t : src.getShelfLifeStorage())
tgt.addShelfLifeStorage(ProductShelfLife43_50.convertProductShelfLife(t));
// if (src.hasPhysicalCharacteristics())
// tgt.setPhysicalCharacteristics(ProdCharacteristic43_50.convertProdCharacteristic(src.getPhysicalCharacteristics()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLanguageCode())
tgt.addLanguageCode(CodeableConcept43_50.convertCodeableConcept(t));
// for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent t : src.getCapability())
// tgt.addCapability(convertDeviceDefinitionCapabilityComponent(t));
for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent t : src.getProperty())
tgt.addProperty(convertDeviceDefinitionPropertyComponent(t));
if (src.hasOwner())
tgt.setOwner(Reference43_50.convertReference(src.getOwner()));
for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact())
tgt.addContact(ContactPoint43_50.convertContactPoint(t));
// if (src.hasOnlineInformation())
// tgt.setOnlineInformationElement(Uri43_50.convertUri(src.getOnlineInformationElement()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
if (src.hasParentDevice())
tgt.setParentDevice(Reference43_50.convertReference(src.getParentDevice()));
for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent t : src.getMaterial())
tgt.addMaterial(convertDeviceDefinitionMaterialComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent convertDeviceDefinitionUdiDeviceIdentifierComponent(org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasDeviceIdentifier())
tgt.setDeviceIdentifierElement(String43_50.convertString(src.getDeviceIdentifierElement()));
if (src.hasIssuer())
tgt.setIssuerElement(Uri43_50.convertUri(src.getIssuerElement()));
if (src.hasJurisdiction())
tgt.setJurisdictionElement(Uri43_50.convertUri(src.getJurisdictionElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent convertDeviceDefinitionUdiDeviceIdentifierComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent tgt = new org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasDeviceIdentifier())
tgt.setDeviceIdentifierElement(String43_50.convertString(src.getDeviceIdentifierElement()));
if (src.hasIssuer())
tgt.setIssuerElement(Uri43_50.convertUri(src.getIssuerElement()));
if (src.hasJurisdiction())
tgt.setJurisdictionElement(Uri43_50.convertUri(src.getJurisdictionElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent convertDeviceDefinitionDeviceNameComponent(org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasType())
tgt.setTypeElement(convertDeviceNameType(src.getTypeElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent convertDeviceDefinitionDeviceNameComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent tgt = new org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasName())
tgt.setNameElement(String43_50.convertString(src.getNameElement()));
if (src.hasType())
tgt.setTypeElement(convertDeviceNameType(src.getTypeElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DeviceNameType> convertDeviceNameType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DeviceNameType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DeviceNameType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DeviceNameTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case USERFRIENDLYNAME:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME);
break;
case PATIENTREPORTEDNAME:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME);
break;
case MANUFACTURERNAME:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.REGISTEREDNAME);
break;
case MODELNAME:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DeviceNameType> convertDeviceNameType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DeviceNameType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DeviceNameType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DeviceNameTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case USERFRIENDLYNAME:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.USERFRIENDLYNAME);
break;
case PATIENTREPORTEDNAME:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME);
break;
case REGISTEREDNAME:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.MANUFACTURERNAME);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DeviceNameType.NULL);
break;
}
return tgt;
}
//
// public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasSystemType())
// tgt.setSystemTypeElement(String43_50.convertString(src.getSystemTypeElement()));
// if (src.hasVersion())
// tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
// return tgt;
// }
//
// public static org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionSpecializationComponent tgt = new org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionSpecializationComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasSystemType())
// tgt.setSystemTypeElement(String43_50.convertString(src.getSystemTypeElement()));
// if (src.hasVersion())
// tgt.setVersionElement(String43_50.convertString(src.getVersionElement()));
// return tgt;
// }
//
// public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent convertDeviceDefinitionCapabilityComponent(org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionCapabilityComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasType())
// tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
// for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getDescription())
// tgt.addDescription(CodeableConcept43_50.convertCodeableConcept(t));
// return tgt;
// }
//
// public static org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionCapabilityComponent convertDeviceDefinitionCapabilityComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent src) throws FHIRException {
// if (src == null)
// return null;
// org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionCapabilityComponent tgt = new org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionCapabilityComponent();
// ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
// if (src.hasType())
// tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
// for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDescription())
// tgt.addDescription(CodeableConcept43_50.convertCodeableConcept(t));
// return tgt;
// }
public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent convertDeviceDefinitionPropertyComponent(org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionPropertyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4b.model.Quantity t : src.getValueQuantity())
tgt.setValue(Quantity43_50.convertQuantity(t));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getValueCode())
tgt.setValue(CodeableConcept43_50.convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionPropertyComponent convertDeviceDefinitionPropertyComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionPropertyComponent tgt = new org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionPropertyComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasValueQuantity())
tgt.addValueQuantity(Quantity43_50.convertQuantity(src.getValueQuantity()));
if (src.hasValueCodeableConcept())
tgt.addValueCode(CodeableConcept43_50.convertCodeableConcept(src.getValueCodeableConcept()));
return tgt;
}
public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent convertDeviceDefinitionMaterialComponent(org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionMaterialComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSubstance())
tgt.setSubstance(CodeableConcept43_50.convertCodeableConcept(src.getSubstance()));
if (src.hasAlternate())
tgt.setAlternateElement(Boolean43_50.convertBoolean(src.getAlternateElement()));
if (src.hasAllergenicIndicator())
tgt.setAllergenicIndicatorElement(Boolean43_50.convertBoolean(src.getAllergenicIndicatorElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionMaterialComponent convertDeviceDefinitionMaterialComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionMaterialComponent tgt = new org.hl7.fhir.r4b.model.DeviceDefinition.DeviceDefinitionMaterialComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasSubstance())
tgt.setSubstance(CodeableConcept43_50.convertCodeableConcept(src.getSubstance()));
if (src.hasAlternate())
tgt.setAlternateElement(Boolean43_50.convertBoolean(src.getAlternateElement()));
if (src.hasAllergenicIndicator())
tgt.setAllergenicIndicatorElement(Boolean43_50.convertBoolean(src.getAllergenicIndicatorElement()));
return tgt;
}
}

View File

@ -0,0 +1,399 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Timing43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class DeviceMetric43_50 {
public static org.hl7.fhir.r5.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.r4b.model.DeviceMetric src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DeviceMetric tgt = new org.hl7.fhir.r5.model.DeviceMetric();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasUnit())
tgt.setUnit(CodeableConcept43_50.convertCodeableConcept(src.getUnit()));
if (src.hasSource())
tgt.setSource(Reference43_50.convertReference(src.getSource()));
if (src.hasParent())
tgt.setParent(Reference43_50.convertReference(src.getParent()));
if (src.hasOperationalStatus())
tgt.setOperationalStatusElement(convertDeviceMetricOperationalStatus(src.getOperationalStatusElement()));
if (src.hasColor())
tgt.setColorElement(convertDeviceMetricColor(src.getColorElement()));
if (src.hasCategory())
tgt.setCategoryElement(convertDeviceMetricCategory(src.getCategoryElement()));
if (src.hasMeasurementPeriod())
tgt.setMeasurementPeriod(Timing43_50.convertTiming(src.getMeasurementPeriod()));
for (org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration())
tgt.addCalibration(convertDeviceMetricCalibrationComponent(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.r5.model.DeviceMetric src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.DeviceMetric tgt = new org.hl7.fhir.r4b.model.DeviceMetric();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
if (src.hasType())
tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
if (src.hasUnit())
tgt.setUnit(CodeableConcept43_50.convertCodeableConcept(src.getUnit()));
if (src.hasSource())
tgt.setSource(Reference43_50.convertReference(src.getSource()));
if (src.hasParent())
tgt.setParent(Reference43_50.convertReference(src.getParent()));
if (src.hasOperationalStatus())
tgt.setOperationalStatusElement(convertDeviceMetricOperationalStatus(src.getOperationalStatusElement()));
if (src.hasColor())
tgt.setColorElement(convertDeviceMetricColor(src.getColorElement()));
if (src.hasCategory())
tgt.setCategoryElement(convertDeviceMetricCategory(src.getCategoryElement()));
if (src.hasMeasurementPeriod())
tgt.setMeasurementPeriod(Timing43_50.convertTiming(src.getMeasurementPeriod()));
for (org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration())
tgt.addCalibration(convertDeviceMetricCalibrationComponent(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus> convertDeviceMetricOperationalStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ON:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.ON);
break;
case OFF:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.OFF);
break;
case STANDBY:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus> convertDeviceMetricOperationalStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ON:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.ON);
break;
case OFF:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.OFF);
break;
case STANDBY:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricOperationalStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor> convertDeviceMetricColor(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColorEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case BLACK:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.BLACK);
break;
case RED:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.RED);
break;
case GREEN:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.GREEN);
break;
case YELLOW:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.YELLOW);
break;
case BLUE:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.BLUE);
break;
case MAGENTA:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.MAGENTA);
break;
case CYAN:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.CYAN);
break;
case WHITE:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.WHITE);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor> convertDeviceMetricColor(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColorEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case BLACK:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.BLACK);
break;
case RED:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.RED);
break;
case GREEN:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.GREEN);
break;
case YELLOW:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.YELLOW);
break;
case BLUE:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.BLUE);
break;
case MAGENTA:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.MAGENTA);
break;
case CYAN:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.CYAN);
break;
case WHITE:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.WHITE);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricColor.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory> convertDeviceMetricCategory(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategoryEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case MEASUREMENT:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT);
break;
case SETTING:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.SETTING);
break;
case CALCULATION:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.CALCULATION);
break;
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory> convertDeviceMetricCategory(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategoryEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case MEASUREMENT:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT);
break;
case SETTING:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.SETTING);
break;
case CALCULATION:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.CALCULATION);
break;
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCategory.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertDeviceMetricCalibrationType(src.getTypeElement()));
if (src.hasState())
tgt.setStateElement(convertDeviceMetricCalibrationState(src.getStateElement()));
if (src.hasTime())
tgt.setTimeElement(Instant43_50.convertInstant(src.getTimeElement()));
return tgt;
}
public static org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertDeviceMetricCalibrationType(src.getTypeElement()));
if (src.hasState())
tgt.setStateElement(convertDeviceMetricCalibrationState(src.getStateElement()));
if (src.hasTime())
tgt.setTimeElement(Instant43_50.convertInstant(src.getTimeElement()));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType> convertDeviceMetricCalibrationType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED);
break;
case OFFSET:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET);
break;
case GAIN:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.GAIN);
break;
case TWOPOINT:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType> convertDeviceMetricCalibrationType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED);
break;
case OFFSET:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET);
break;
case GAIN:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.GAIN);
break;
case TWOPOINT:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState> convertDeviceMetricCalibrationState(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case NOTCALIBRATED:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED);
break;
case CALIBRATIONREQUIRED:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED);
break;
case CALIBRATED:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED);
break;
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState> convertDeviceMetricCalibrationState(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case NOTCALIBRATED:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED);
break;
case CALIBRATIONREQUIRED:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED);
break;
case CALIBRATED:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED);
break;
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceMetric.DeviceMetricCalibrationState.NULL);
break;
}
return tgt;
}
}

View File

@ -0,0 +1,379 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeableReference;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class DeviceRequest43_50 {
public static org.hl7.fhir.r5.model.DeviceRequest convertDeviceRequest(org.hl7.fhir.r4b.model.DeviceRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DeviceRequest tgt = new org.hl7.fhir.r5.model.DeviceRequest();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r4b.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t));
for (org.hl7.fhir.r4b.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(Uri43_50.convertUri(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t));
// for (org.hl7.fhir.r4b.model.Reference t : src.getPriorRequest())
// tgt.addPriorRequest(Reference43_50.convertReference(t));
if (src.hasGroupIdentifier())
tgt.setGroupIdentifier(Identifier43_50.convertIdentifier(src.getGroupIdentifier()));
if (src.hasStatus())
tgt.setStatusElement(convertDeviceRequestStatus(src.getStatusElement()));
if (src.hasIntent())
tgt.setIntentElement(convertRequestIntent(src.getIntentElement()));
if (src.hasPriority())
tgt.setPriorityElement(convertRequestPriority(src.getPriorityElement()));
if (src.hasCodeCodeableConcept())
tgt.getCode().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getCodeCodeableConcept()));
else if (src.hasCodeReference())
tgt.getCode().setReference(Reference43_50.convertReference(src.getCodeReference()));
for (org.hl7.fhir.r4b.model.DeviceRequest.DeviceRequestParameterComponent t : src.getParameter())
tgt.addParameter(convertDeviceRequestParameterComponent(t));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
if (src.hasOccurrence())
tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence()));
if (src.hasAuthoredOn())
tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement()));
if (src.hasRequester())
tgt.setRequester(Reference43_50.convertReference(src.getRequester()));
if (src.hasPerformerType())
tgt.setPerformerType(CodeableConcept43_50.convertCodeableConcept(src.getPerformerType()));
if (src.hasPerformer())
tgt.setPerformer(Reference43_50.convertReference(src.getPerformer()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode())
tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference())
tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getInsurance()) tgt.addInsurance(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(Reference43_50.convertReference(t));
for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getRelevantHistory())
tgt.addRelevantHistory(Reference43_50.convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.DeviceRequest convertDeviceRequest(org.hl7.fhir.r5.model.DeviceRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.DeviceRequest tgt = new org.hl7.fhir.r4b.model.DeviceRequest();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(Canonical43_50.convertCanonical(t));
for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(Uri43_50.convertUri(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t));
// for (org.hl7.fhir.r5.model.Reference t : src.getPriorRequest())
// tgt.addPriorRequest(Reference43_50.convertReference(t));
if (src.hasGroupIdentifier())
tgt.setGroupIdentifier(Identifier43_50.convertIdentifier(src.getGroupIdentifier()));
if (src.hasStatus())
tgt.setStatusElement(convertDeviceRequestStatus(src.getStatusElement()));
if (src.hasIntent())
tgt.setIntentElement(convertRequestIntent(src.getIntentElement()));
if (src.hasPriority())
tgt.setPriorityElement(convertRequestPriority(src.getPriorityElement()));
if (src.getCode().hasConcept())
tgt.setCode(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getCode().getConcept()));
if (src.getCode().hasReference())
tgt.setCode(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getCode().getReference()));
for (org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent t : src.getParameter())
tgt.addParameter(convertDeviceRequestParameterComponent(t));
if (src.hasSubject())
tgt.setSubject(Reference43_50.convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(Reference43_50.convertReference(src.getEncounter()));
if (src.hasOccurrence())
tgt.setOccurrence(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getOccurrence()));
if (src.hasAuthoredOn())
tgt.setAuthoredOnElement(DateTime43_50.convertDateTime(src.getAuthoredOnElement()));
if (src.hasRequester())
tgt.setRequester(Reference43_50.convertReference(src.getRequester()));
if (src.hasPerformerType())
tgt.setPerformerType(CodeableConcept43_50.convertCodeableConcept(src.getPerformerType()));
if (src.hasPerformer())
tgt.setPerformer(Reference43_50.convertReference(src.getPerformer()));
for (CodeableReference t : src.getReason())
if (t.hasConcept())
tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept()));
for (CodeableReference t : src.getReason())
if (t.hasReference())
tgt.addReasonReference(Reference43_50.convertReference(t.getReference()));
for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) tgt.addInsurance(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(Reference43_50.convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory())
tgt.addRelevantHistory(Reference43_50.convertReference(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestStatus> convertDeviceRequestStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case DRAFT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.DRAFT);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ACTIVE);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ONHOLD);
break;
case REVOKED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.REVOKED);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestStatus> convertDeviceRequestStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case DRAFT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.DRAFT);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ACTIVE);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ONHOLD);
break;
case REVOKED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.REVOKED);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestIntent> convertRequestIntent(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestIntent> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestIntent> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestIntentEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PROPOSAL:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PROPOSAL);
break;
case PLAN:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.PLAN);
break;
case DIRECTIVE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.DIRECTIVE);
break;
case ORDER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORDER);
break;
case ORIGINALORDER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.ORIGINALORDER);
break;
case REFLEXORDER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.REFLEXORDER);
break;
case FILLERORDER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.FILLERORDER);
break;
case INSTANCEORDER:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.INSTANCEORDER);
break;
case OPTION:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.OPTION);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestIntent.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestIntent> convertRequestIntent(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestIntent> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestIntent> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestIntentEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case PROPOSAL:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PROPOSAL);
break;
case PLAN:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.PLAN);
break;
case DIRECTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.DIRECTIVE);
break;
case ORDER:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORDER);
break;
case ORIGINALORDER:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.ORIGINALORDER);
break;
case REFLEXORDER:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.REFLEXORDER);
break;
case FILLERORDER:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.FILLERORDER);
break;
case INSTANCEORDER:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.INSTANCEORDER);
break;
case OPTION:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.OPTION);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestIntent.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> convertRequestPriority(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestPriority> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.RequestPriorityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ROUTINE:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ROUTINE);
break;
case URGENT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.URGENT);
break;
case ASAP:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.ASAP);
break;
case STAT:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.STAT);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.RequestPriority.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestPriority> convertRequestPriority(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.RequestPriority> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RequestPriority> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RequestPriorityEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ROUTINE:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ROUTINE);
break;
case URGENT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.URGENT);
break;
case ASAP:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.ASAP);
break;
case STAT:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.STAT);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RequestPriority.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent convertDeviceRequestParameterComponent(org.hl7.fhir.r4b.model.DeviceRequest.DeviceRequestParameterComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent tgt = new org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4b.model.DeviceRequest.DeviceRequestParameterComponent convertDeviceRequestParameterComponent(org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.DeviceRequest.DeviceRequestParameterComponent tgt = new org.hl7.fhir.r4b.model.DeviceRequest.DeviceRequestParameterComponent();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
if (src.hasCode())
tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
if (src.hasValue())
tgt.setValue(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getValue()));
return tgt;
}
}

View File

@ -0,0 +1,170 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Annotation43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeableReference;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class DeviceUseStatement43_50 {
public static org.hl7.fhir.r5.model.DeviceUsage convertDeviceUseStatement(org.hl7.fhir.r4b.model.DeviceUseStatement src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DeviceUsage tgt = new org.hl7.fhir.r5.model.DeviceUsage();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertDeviceUseStatementStatus(src.getStatusElement()));
if (src.hasSubject())
tgt.setPatient(Reference43_50.convertReference(src.getSubject()));
for (org.hl7.fhir.r4b.model.Reference t : src.getDerivedFrom())
tgt.addDerivedFrom(Reference43_50.convertReference(t));
if (src.hasTiming())
tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming()));
if (src.hasRecordedOn())
tgt.setDateAssertedElement(DateTime43_50.convertDateTime(src.getRecordedOnElement()));
if (src.hasSource())
tgt.setInformationSource(Reference43_50.convertReference(src.getSource()));
if (src.hasDevice())
tgt.getDevice().setReference(Reference43_50.convertReference(src.getDevice()));
for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getReasonCode())
tgt.addReason(CodeableConcept43_50.convertCodeableConceptToCodeableReference(t));
for (org.hl7.fhir.r4b.model.Reference t : src.getReasonReference())
tgt.addReason(Reference43_50.convertReferenceToCodeableReference(t));
if (src.hasBodySite())
tgt.getBodySite().setConcept(CodeableConcept43_50.convertCodeableConcept(src.getBodySite()));
for (org.hl7.fhir.r4b.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4b.model.DeviceUseStatement convertDeviceUseStatement(org.hl7.fhir.r5.model.DeviceUsage src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4b.model.DeviceUseStatement tgt = new org.hl7.fhir.r4b.model.DeviceUseStatement();
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference43_50.convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertDeviceUseStatementStatus(src.getStatusElement()));
if (src.hasPatient())
tgt.setSubject(Reference43_50.convertReference(src.getPatient()));
for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom())
tgt.addDerivedFrom(Reference43_50.convertReference(t));
if (src.hasTiming())
tgt.setTiming(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getTiming()));
if (src.hasDateAsserted())
tgt.setRecordedOnElement(DateTime43_50.convertDateTime(src.getDateAssertedElement()));
if (src.hasInformationSource())
tgt.setSource(Reference43_50.convertReference(src.getInformationSource()));
if (src.getDevice().hasReference())
tgt.setDevice(Reference43_50.convertReference(src.getDevice().getReference()));
for (CodeableReference t : src.getReason())
if (t.hasConcept())
tgt.addReasonCode(CodeableConcept43_50.convertCodeableConcept(t.getConcept()));
for (CodeableReference t : src.getReason())
if (t.hasReference())
tgt.addReasonReference(Reference43_50.convertReference(t.getReference()));
if (src.getBodySite().hasConcept())
tgt.setBodySite(CodeableConcept43_50.convertCodeableConcept(src.getBodySite().getConcept()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation43_50.convertAnnotation(t));
return tgt;
}
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus> convertDeviceUseStatementStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.ACTIVE);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.ENTEREDINERROR);
break;
case INTENDED:
tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.INTENDED);
break;
case STOPPED:
tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.STOPPED);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.ONHOLD);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus> convertDeviceUseStatementStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DeviceUsage.DeviceUsageStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatusEnumFactory());
ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus.ACTIVE);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR);
break;
case INTENDED:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus.INTENDED);
break;
case STOPPED:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus.STOPPED);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus.ONHOLD);
break;
default:
tgt.setValue(org.hl7.fhir.r4b.model.DeviceUseStatement.DeviceUseStatementStatus.NULL);
break;
}
return tgt;
}
}

Some files were not shown because too many files have changed in this diff Show More