This commit is contained in:
Grahame Grieve 2019-02-24 21:31:47 +11:00
parent e24fe8a966
commit 445c90ff9a
191 changed files with 94576 additions and 139 deletions

View File

@ -35,5 +35,6 @@
<classpathentry kind="var" path="M2_REPO/net/bytebuddy/byte-buddy/1.9.3/byte-buddy-1.9.3.jar" sourcepath="M2_REPO/net/bytebuddy/byte-buddy/1.9.3/byte-buddy-1.9.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/net/bytebuddy/byte-buddy-agent/1.9.3/byte-buddy-agent-1.9.3.jar" sourcepath="M2_REPO/net/bytebuddy/byte-buddy-agent/1.9.3/byte-buddy-agent-1.9.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/objenesis/objenesis/2.6/objenesis-2.6.jar" sourcepath="M2_REPO/org/objenesis/objenesis/2.6/objenesis-2.6-sources.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/org.hl7.fhir.r5"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -0,0 +1,67 @@
package org.hl7.fhir.convertors;
/*-
* #%L
* org.hl7.fhir.convertors
* %%
* Copyright (C) 2015 - 2019 Health Level 7
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import org.hl7.fhir.dstu2.model.Resource;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.ValueSet;
public class IGR2ConvertorAdvisor5 implements VersionConvertorAdvisor50 {
@Override
public boolean ignoreEntry(BundleEntryComponent src) {
return false;
}
@Override
public Resource convertR2(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
@Override
public org.hl7.fhir.dstu2016may.model.Resource convertR2016May(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
@Override
public org.hl7.fhir.dstu3.model.Resource convertR3(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
@Override
public void handleCodeSystem(CodeSystem cs, ValueSet vs) {
cs.setId(vs.getId());
}
@Override
public CodeSystem getCodeSystem(ValueSet src) {
return null;
}
@Override
public org.hl7.fhir.r4.model.Resource convertR4(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
}

View File

@ -0,0 +1,156 @@
package org.hl7.fhir.convertors;
/*-
* #%L
* org.hl7.fhir.convertors
* %%
* Copyright (C) 2014 - 2019 Health Level 7
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.hl7.fhir.dstu2016may.formats.JsonParser;
import org.hl7.fhir.dstu2016may.formats.XmlParser;
import org.hl7.fhir.dstu2016may.model.Resource;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.conformance.ProfileUtilities;
import org.hl7.fhir.r5.context.SimpleWorkerContext.IContextResourceLoader;
import org.hl7.fhir.r5.model.Bundle;
import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r5.model.Bundle.BundleType;
import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.MetadataResource;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.r5.model.UriType;
import org.hl7.fhir.r5.model.ValueSet;
public class R2016MayToR5Loader implements IContextResourceLoader, VersionConvertorAdvisor50 {
private List<CodeSystem> cslist = new ArrayList<>();
private boolean patchUrls;
private boolean killPrimitives;;
@Override
public Bundle loadBundle(InputStream stream, boolean isJson) throws FHIRException, IOException {
Resource r2016may = null;
if (isJson)
r2016may = new JsonParser().parse(stream);
else
r2016may = new XmlParser().parse(stream);
org.hl7.fhir.r5.model.Resource r5 = VersionConvertor_14_50.convertResource(r2016may);
Bundle b;
if (r5 instanceof Bundle)
b = (Bundle) r5;
else {
b = new Bundle();
b.setId(UUID.randomUUID().toString().toLowerCase());
b.setType(BundleType.COLLECTION);
b.addEntry().setResource(r5).setFullUrl(r5 instanceof MetadataResource ? ((MetadataResource) r5).getUrl() : null);
}
for (CodeSystem cs : cslist) {
BundleEntryComponent be = b.addEntry();
be.setFullUrl(cs.getUrl());
be.setResource(cs);
}
if (killPrimitives) {
List<BundleEntryComponent> remove = new ArrayList<BundleEntryComponent>();
for (BundleEntryComponent be : b.getEntry()) {
if (be.hasResource() && be.getResource() instanceof StructureDefinition) {
StructureDefinition sd = (StructureDefinition) be.getResource();
if (sd.getKind() == StructureDefinitionKind.PRIMITIVETYPE)
remove.add(be);
}
}
b.getEntry().removeAll(remove);
}
for (BundleEntryComponent be : b.getEntry()) {
if (be.hasResource() && be.getResource() instanceof StructureDefinition) {
StructureDefinition sd = (StructureDefinition) be.getResource();
new ProfileUtilities(null, null, null).setIds(sd, false);
if (patchUrls) {
sd.setUrl(sd.getUrl().replace("http://hl7.org/fhir/", "http://hl7.org/fhir/2016May/"));
sd.addExtension().setUrl("http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace").setValue(new UriType("http://hl7.org/fhir"));
}
}
}
return b;
}
@Override
public boolean ignoreEntry(BundleEntryComponent src) {
return false;
}
@Override
public org.hl7.fhir.dstu2.model.Resource convertR2(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
@Override
public Resource convertR2016May(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
@Override
public org.hl7.fhir.dstu3.model.Resource convertR3(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
@Override
public void handleCodeSystem(CodeSystem cs, ValueSet vs) {
cs.setId(vs.getId());
cs.setValueSet(vs.getUrl());
cslist.add(cs);
}
@Override
public CodeSystem getCodeSystem(ValueSet src) {
return null;
}
public boolean isPatchUrls() {
return patchUrls;
}
public R2016MayToR5Loader setPatchUrls(boolean patchUrls) {
this.patchUrls = patchUrls;
return this;
}
public boolean isKillPrimitives() {
return killPrimitives;
}
public R2016MayToR5Loader setKillPrimitives(boolean killPrimitives) {
this.killPrimitives = killPrimitives;
return this;
}
@Override
public org.hl7.fhir.r4.model.Resource convertR4(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
}

View File

@ -0,0 +1,153 @@
package org.hl7.fhir.convertors;
/*-
* #%L
* org.hl7.fhir.convertors
* %%
* Copyright (C) 2015 - 2019 Health Level 7
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.hl7.fhir.dstu2.formats.JsonParser;
import org.hl7.fhir.dstu2.formats.XmlParser;
import org.hl7.fhir.dstu2.model.Resource;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.context.SimpleWorkerContext.IContextResourceLoader;
import org.hl7.fhir.r5.model.Bundle;
import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r5.model.Bundle.BundleType;
import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.MetadataResource;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.r5.model.UriType;
import org.hl7.fhir.r5.model.ValueSet;
public class R2ToR5Loader implements IContextResourceLoader, VersionConvertorAdvisor50 {
private List<CodeSystem> cslist = new ArrayList<>();
private boolean patchUrls;
private boolean killPrimitives;;
@Override
public Bundle loadBundle(InputStream stream, boolean isJson) throws FHIRException, IOException {
Resource r2 = null;
if (isJson)
r2 = new JsonParser().parse(stream);
else
r2 = new XmlParser().parse(stream);
org.hl7.fhir.r5.model.Resource r5 = new VersionConvertor_10_50(this).convertResource(r2);
Bundle b;
if (r5 instanceof Bundle)
b = (Bundle) r5;
else {
b = new Bundle();
b.setId(UUID.randomUUID().toString().toLowerCase());
b.setType(BundleType.COLLECTION);
b.addEntry().setResource(r5).setFullUrl(r5 instanceof MetadataResource ? ((MetadataResource) r5).getUrl() : null);
}
// Add any code systems defined as part of processing value sets to the end of the converted Bundle
for (CodeSystem cs : cslist) {
BundleEntryComponent be = b.addEntry();
be.setFullUrl(cs.getUrl());
be.setResource(cs);
}
cslist.clear();
if (killPrimitives) {
List<BundleEntryComponent> remove = new ArrayList<BundleEntryComponent>();
for (BundleEntryComponent be : b.getEntry()) {
if (be.hasResource() && be.getResource() instanceof StructureDefinition) {
StructureDefinition sd = (StructureDefinition) be.getResource();
if (sd.getKind() == StructureDefinitionKind.PRIMITIVETYPE)
remove.add(be);
}
}
b.getEntry().removeAll(remove);
}
if (patchUrls) {
for (BundleEntryComponent be : b.getEntry()) {
if (be.hasResource() && be.getResource() instanceof StructureDefinition) {
StructureDefinition sd = (StructureDefinition) be.getResource();
sd.setUrl(sd.getUrl().replace("http://hl7.org/fhir/", "http://hl7.org/fhir/DSTU2/"));
sd.addExtension().setUrl("http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace").setValue(new UriType("http://hl7.org/fhir"));
}
}
}
return b;
}
@Override
public boolean ignoreEntry(BundleEntryComponent src) {
return false;
}
@Override
public Resource convertR2(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
@Override
public org.hl7.fhir.dstu2016may.model.Resource convertR2016May(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
public org.hl7.fhir.dstu3.model.Resource convertR3(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
@Override
public void handleCodeSystem(CodeSystem cs, ValueSet vs) {
cs.setId(vs.getId());
cs.setValueSet(vs.getUrl());
cslist.add(cs);
}
@Override
public CodeSystem getCodeSystem(ValueSet src) {
return null;
}
public boolean isPatchUrls() {
return patchUrls;
}
public R2ToR5Loader setPatchUrls(boolean patchUrls) {
this.patchUrls = patchUrls;
return this;
}
public boolean isKillPrimitives() {
return killPrimitives;
}
public R2ToR5Loader setKillPrimitives(boolean killPrimitives) {
this.killPrimitives = killPrimitives;
return this;
}
@Override
public org.hl7.fhir.r4.model.Resource convertR4(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
}

View File

@ -0,0 +1,171 @@
package org.hl7.fhir.convertors;
/*-
* #%L
* org.hl7.fhir.convertors
* %%
* Copyright (C) 2015 - 2019 Health Level 7
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.hl7.fhir.dstu3.formats.JsonParser;
import org.hl7.fhir.dstu3.formats.XmlParser;
import org.hl7.fhir.dstu3.model.Resource;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.context.SimpleWorkerContext.IContextResourceLoader;
import org.hl7.fhir.r5.model.Bundle;
import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r5.model.Bundle.BundleType;
import org.hl7.fhir.r5.model.CanonicalType;
import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.ElementDefinition;
import org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent;
import org.hl7.fhir.r5.model.MetadataResource;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.r5.model.UriType;
import org.hl7.fhir.r5.model.ValueSet;
public class R3ToR5Loader implements IContextResourceLoader, VersionConvertorAdvisor50 {
private List<CodeSystem> cslist = new ArrayList<>();
private boolean patchUrls;
private boolean killPrimitives;;
@Override
public Bundle loadBundle(InputStream stream, boolean isJson) throws FHIRException, IOException {
Resource r3 = null;
if (isJson)
r3 = new JsonParser().parse(stream);
else
r3 = new XmlParser().parse(stream);
org.hl7.fhir.r5.model.Resource r5 = VersionConvertor_30_50.convertResource(r3, false);
Bundle b;
if (r5 instanceof Bundle)
b = (Bundle) r5;
else {
b = new Bundle();
b.setId(UUID.randomUUID().toString().toLowerCase());
b.setType(BundleType.COLLECTION);
b.addEntry().setResource(r5).setFullUrl(r5 instanceof MetadataResource ? ((MetadataResource) r5).getUrl() : null);
}
for (CodeSystem cs : cslist) {
BundleEntryComponent be = b.addEntry();
be.setFullUrl(cs.getUrl());
be.setResource(cs);
}
if (killPrimitives) {
List<BundleEntryComponent> remove = new ArrayList<BundleEntryComponent>();
for (BundleEntryComponent be : b.getEntry()) {
if (be.hasResource() && be.getResource() instanceof StructureDefinition) {
StructureDefinition sd = (StructureDefinition) be.getResource();
if (sd.getKind() == StructureDefinitionKind.PRIMITIVETYPE)
remove.add(be);
}
}
b.getEntry().removeAll(remove);
}
if (patchUrls) {
for (BundleEntryComponent be : b.getEntry()) {
if (be.hasResource() && be.getResource() instanceof StructureDefinition) {
StructureDefinition sd = (StructureDefinition) be.getResource();
sd.setUrl(sd.getUrl().replace("http://hl7.org/fhir/", "http://hl7.org/fhir/3.0/"));
sd.addExtension().setUrl("http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace").setValue(new UriType("http://hl7.org/fhir"));
for (ElementDefinition ed : sd.getSnapshot().getElement())
patchUrl(ed);
for (ElementDefinition ed : sd.getDifferential().getElement())
patchUrl(ed);
}
}
}
return b;
}
private void patchUrl(ElementDefinition ed) {
for (TypeRefComponent tr : ed.getType()) {
for (CanonicalType s : tr.getTargetProfile()) {
s.setValue(s.getValue().replace("http://hl7.org/fhir/", "http://hl7.org/fhir/3.0/"));
}
for (CanonicalType s : tr.getProfile()) {
s.setValue(s.getValue().replace("http://hl7.org/fhir/", "http://hl7.org/fhir/3.0/"));
}
}
}
@Override
public boolean ignoreEntry(BundleEntryComponent src) {
return false;
}
@Override
public org.hl7.fhir.dstu2.model.Resource convertR2(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
@Override
public org.hl7.fhir.dstu2016may.model.Resource convertR2016May(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
@Override
public Resource convertR3(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
@Override
public void handleCodeSystem(CodeSystem cs, ValueSet vs) {
cs.setId(vs.getId());
cs.setValueSet(vs.getUrl());
cslist.add(cs);
}
@Override
public CodeSystem getCodeSystem(ValueSet src) {
return null;
}
public boolean isPatchUrls() {
return patchUrls;
}
public R3ToR5Loader setPatchUrls(boolean patchUrls) {
this.patchUrls = patchUrls;
return this;
}
public boolean isKillPrimitives() {
return killPrimitives;
}
public R3ToR5Loader setKillPrimitives(boolean killPrimitives) {
this.killPrimitives = killPrimitives;
return this;
}
@Override
public org.hl7.fhir.r4.model.Resource convertR4(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
}

View File

@ -0,0 +1,171 @@
package org.hl7.fhir.convertors;
/*-
* #%L
* org.hl7.fhir.convertors
* %%
* Copyright (C) 2015 - 2019 Health Level 7
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.hl7.fhir.r4.formats.JsonParser;
import org.hl7.fhir.r4.formats.XmlParser;
import org.hl7.fhir.r4.model.Resource;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.context.SimpleWorkerContext.IContextResourceLoader;
import org.hl7.fhir.r5.model.Bundle;
import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r5.model.Bundle.BundleType;
import org.hl7.fhir.r5.model.CanonicalType;
import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.ElementDefinition;
import org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent;
import org.hl7.fhir.r5.model.MetadataResource;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.r5.model.UriType;
import org.hl7.fhir.r5.model.ValueSet;
public class R4ToR5Loader implements IContextResourceLoader, VersionConvertorAdvisor50 {
private List<CodeSystem> cslist = new ArrayList<>();
private boolean patchUrls;
private boolean killPrimitives;;
@Override
public Bundle loadBundle(InputStream stream, boolean isJson) throws FHIRException, IOException {
Resource r4 = null;
if (isJson)
r4 = new JsonParser().parse(stream);
else
r4 = new XmlParser().parse(stream);
org.hl7.fhir.r5.model.Resource r5 = VersionConvertor_40_50.convertResource(r4);
Bundle b;
if (r5 instanceof Bundle)
b = (Bundle) r5;
else {
b = new Bundle();
b.setId(UUID.randomUUID().toString().toLowerCase());
b.setType(BundleType.COLLECTION);
b.addEntry().setResource(r5).setFullUrl(r5 instanceof MetadataResource ? ((MetadataResource) r5).getUrl() : null);
}
for (CodeSystem cs : cslist) {
BundleEntryComponent be = b.addEntry();
be.setFullUrl(cs.getUrl());
be.setResource(cs);
}
if (killPrimitives) {
List<BundleEntryComponent> remove = new ArrayList<BundleEntryComponent>();
for (BundleEntryComponent be : b.getEntry()) {
if (be.hasResource() && be.getResource() instanceof StructureDefinition) {
StructureDefinition sd = (StructureDefinition) be.getResource();
if (sd.getKind() == StructureDefinitionKind.PRIMITIVETYPE)
remove.add(be);
}
}
b.getEntry().removeAll(remove);
}
if (patchUrls) {
for (BundleEntryComponent be : b.getEntry()) {
if (be.hasResource() && be.getResource() instanceof StructureDefinition) {
StructureDefinition sd = (StructureDefinition) be.getResource();
sd.setUrl(sd.getUrl().replace("http://hl7.org/fhir/", "http://hl7.org/fhir/4.0/"));
sd.addExtension().setUrl("http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace").setValue(new UriType("http://hl7.org/fhir"));
for (ElementDefinition ed : sd.getSnapshot().getElement())
patchUrl(ed);
for (ElementDefinition ed : sd.getDifferential().getElement())
patchUrl(ed);
}
}
}
return b;
}
private void patchUrl(ElementDefinition ed) {
for (TypeRefComponent tr : ed.getType()) {
for (CanonicalType s : tr.getTargetProfile()) {
s.setValue(s.getValue().replace("http://hl7.org/fhir/", "http://hl7.org/fhir/4.0/"));
}
for (CanonicalType s : tr.getProfile()) {
s.setValue(s.getValue().replace("http://hl7.org/fhir/", "http://hl7.org/fhir/4.0/"));
}
}
}
@Override
public boolean ignoreEntry(BundleEntryComponent src) {
return false;
}
@Override
public org.hl7.fhir.dstu2.model.Resource convertR2(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
@Override
public org.hl7.fhir.dstu2016may.model.Resource convertR2016May(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
@Override
public Resource convertR4(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
@Override
public void handleCodeSystem(CodeSystem cs, ValueSet vs) {
cs.setId(vs.getId());
cs.setValueSet(vs.getUrl());
cslist.add(cs);
}
@Override
public CodeSystem getCodeSystem(ValueSet src) {
return null;
}
public boolean isPatchUrls() {
return patchUrls;
}
public R4ToR5Loader setPatchUrls(boolean patchUrls) {
this.patchUrls = patchUrls;
return this;
}
public boolean isKillPrimitives() {
return killPrimitives;
}
public R4ToR5Loader setKillPrimitives(boolean killPrimitives) {
this.killPrimitives = killPrimitives;
return this;
}
@Override
public org.hl7.fhir.dstu3.model.Resource convertR3(org.hl7.fhir.r5.model.Resource resource) throws FHIRException {
return null;
}
}

View File

@ -34,27 +34,27 @@ import java.util.Set;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.exceptions.FHIRFormatError;
import org.hl7.fhir.r4.elementmodel.Manager.FhirFormat;
import org.hl7.fhir.r4.formats.IParser.OutputStyle;
import org.hl7.fhir.r4.formats.JsonParser;
import org.hl7.fhir.r4.formats.XmlParser;
import org.hl7.fhir.r4.model.Base;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r4.model.CanonicalType;
import org.hl7.fhir.r4.model.ElementDefinition;
import org.hl7.fhir.r4.model.ElementDefinition.ElementDefinitionBindingComponent;
import org.hl7.fhir.r4.model.ElementDefinition.TypeRefComponent;
import org.hl7.fhir.r4.model.Enumerations.BindingStrength;
import org.hl7.fhir.r4.model.PrimitiveType;
import org.hl7.fhir.r4.model.Resource;
import org.hl7.fhir.r4.model.StructureDefinition;
import org.hl7.fhir.r4.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.r4.model.Type;
import org.hl7.fhir.r4.model.UriType;
import org.hl7.fhir.r4.model.ValueSet;
import org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent;
import org.hl7.fhir.r4.utils.ToolingExtensions;
import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat;
import org.hl7.fhir.r5.formats.IParser.OutputStyle;
import org.hl7.fhir.r5.formats.JsonParser;
import org.hl7.fhir.r5.formats.XmlParser;
import org.hl7.fhir.r5.model.Base;
import org.hl7.fhir.r5.model.Bundle;
import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r5.model.CanonicalType;
import org.hl7.fhir.r5.model.ElementDefinition;
import org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent;
import org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent;
import org.hl7.fhir.r5.model.Enumerations.BindingStrength;
import org.hl7.fhir.r5.model.PrimitiveType;
import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.r5.model.Type;
import org.hl7.fhir.r5.model.UriType;
import org.hl7.fhir.r5.model.ValueSet;
import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent;
import org.hl7.fhir.r5.utils.ToolingExtensions;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.IniFile;
import org.hl7.fhir.utilities.TextFile;
@ -117,10 +117,11 @@ public class SpecDifferenceEvaluator {
public void loadFromIni(IniFile ini) {
String[] names = ini.getPropertyNames("r3-renames");
for (String n : names)
// note reverse of order
renames.put(ini.getStringProperty("r3-renames", n), n);
String[] names = ini.getPropertyNames("r5-renames");
if (names != null)
for (String n : names)
// note reverse of order
renames.put(ini.getStringProperty("r5-renames", n), n);
}
public SpecPackage getOriginal() {
@ -137,13 +138,13 @@ public class SpecDifferenceEvaluator {
// loadVS2(self.original.valuesets, "C:\\work\\org.hl7.fhir.dstu2.original\\build\\publish\\valuesets.xml");
// loadVS(self.revision.valuesets, "C:\\work\\org.hl7.fhir.dstu2.original\\build\\publish\\valuesets.xml");
loadSD3(self.original.types, "C:\\work\\org.hl7.fhir\\build\\source\\release3\\profiles-types.xml");
loadSD4(self.original.types, "C:\\work\\org.hl7.fhir\\build\\source\\release4\\profiles-types.xml");
loadSD(self.revision.types, "C:\\work\\org.hl7.fhir\\build\\publish\\profiles-types.xml");
loadSD3(self.original.resources, "C:\\work\\org.hl7.fhir\\build\\source\\release3\\profiles-resources.xml");
loadSD4(self.original.resources, "C:\\work\\org.hl7.fhir\\build\\source\\release4\\profiles-resources.xml");
loadSD(self.revision.resources, "C:\\work\\org.hl7.fhir\\build\\publish\\profiles-resources.xml");
loadVS3(self.original.expansions, "C:\\work\\org.hl7.fhir\\build\\source\\release3\\expansions.xml");
loadVS4(self.original.expansions, "C:\\work\\org.hl7.fhir\\build\\source\\release4\\expansions.xml");
loadVS(self.revision.expansions, "C:\\work\\org.hl7.fhir\\build\\publish\\expansions.xml");
loadVS3(self.original.valuesets, "C:\\work\\org.hl7.fhir\\build\\source\\release3\\valuesets.xml");
loadVS4(self.original.valuesets, "C:\\work\\org.hl7.fhir\\build\\source\\release4\\valuesets.xml");
loadVS(self.revision.valuesets, "C:\\work\\org.hl7.fhir\\build\\publish\\valuesets.xml");
StringBuilder b = new StringBuilder();
b.append("<html>\r\n");
@ -158,12 +159,12 @@ public class SpecDifferenceEvaluator {
System.out.println("done");
}
private static void loadSD3(Map<String, StructureDefinition> map, String fn) throws FHIRException, FileNotFoundException, IOException {
org.hl7.fhir.dstu3.model.Bundle bundle = (org.hl7.fhir.dstu3.model.Bundle) new org.hl7.fhir.dstu3.formats.XmlParser().parse(new FileInputStream(fn));
for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent be : bundle.getEntry()) {
if (be.getResource() instanceof org.hl7.fhir.dstu3.model.StructureDefinition) {
org.hl7.fhir.dstu3.model.StructureDefinition sd = (org.hl7.fhir.dstu3.model.StructureDefinition) be.getResource();
map.put(sd.getName(), VersionConvertor_30_40.convertStructureDefinition(sd));
private static void loadSD4(Map<String, StructureDefinition> map, String fn) throws FHIRException, FileNotFoundException, IOException {
org.hl7.fhir.r4.model.Bundle bundle = (org.hl7.fhir.r4.model.Bundle) new org.hl7.fhir.r4.formats.XmlParser().parse(new FileInputStream(fn));
for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent be : bundle.getEntry()) {
if (be.getResource() instanceof org.hl7.fhir.r4.model.StructureDefinition) {
org.hl7.fhir.r4.model.StructureDefinition sd = (org.hl7.fhir.r4.model.StructureDefinition) be.getResource();
map.put(sd.getName(), org.hl7.fhir.convertors.conv40_50.StructureDefinition.convertStructureDefinition(sd));
}
}
@ -178,12 +179,12 @@ public class SpecDifferenceEvaluator {
}
}
private static void loadVS3(Map<String, ValueSet> map, String fn) throws FHIRException, FileNotFoundException, IOException {
org.hl7.fhir.dstu3.model.Bundle bundle = (org.hl7.fhir.dstu3.model.Bundle) new org.hl7.fhir.dstu3.formats.XmlParser().parse(new FileInputStream(fn));
for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent be : bundle.getEntry()) {
if (be.getResource() instanceof org.hl7.fhir.dstu3.model.ValueSet) {
org.hl7.fhir.dstu3.model.ValueSet sd = (org.hl7.fhir.dstu3.model.ValueSet) be.getResource();
map.put(sd.getName(), VersionConvertor_30_40.convertValueSet(sd));
private static void loadVS4(Map<String, ValueSet> map, String fn) throws FHIRException, FileNotFoundException, IOException {
org.hl7.fhir.r4.model.Bundle bundle = (org.hl7.fhir.r4.model.Bundle) new org.hl7.fhir.r4.formats.XmlParser().parse(new FileInputStream(fn));
for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent be : bundle.getEntry()) {
if (be.getResource() instanceof org.hl7.fhir.r4.model.ValueSet) {
org.hl7.fhir.r4.model.ValueSet sd = (org.hl7.fhir.r4.model.ValueSet) be.getResource();
map.put(sd.getName(), org.hl7.fhir.convertors.conv40_50.ValueSet.convertValueSet(sd));
}
}
}
@ -540,11 +541,11 @@ public class SpecDifferenceEvaluator {
// now, look for matches by name (ignoring slicing for now)
String tp = mapPath(tn, target.getPath());
if (tp.endsWith("[x]"))
tp = tp.substring(0, tp.length()-3);
tp = tp.substring(0, tp.length()-4);
for (ElementDefinition ed : list) {
String p = ed.getPath();
if (p.endsWith("[x]"))
p = p.substring(0, p.length()-3);
p = p.substring(0, p.length()-4);
if (p.equals(tp))
return ed;
}
@ -966,7 +967,7 @@ public class SpecDifferenceEvaluator {
}
}
public void saveR2AsR3(ZipGenerator zip, FhirFormat fmt) throws IOException {
public void saveR4AsR5(ZipGenerator zip, FhirFormat fmt) throws IOException {
for (StructureDefinition t : original.types.values())
saveResource(zip, t, fmt);
for (StructureDefinition t : original.resources.values())
@ -1242,6 +1243,8 @@ public class SpecDifferenceEvaluator {
if (Utilities.noString(r) && Utilities.existsInList(rev.getId(), "Element.id", "Extension.url"))
r = "string";
String o = describeType(orig.getType().get(0));
if (Utilities.noString(o) && Utilities.existsInList(orig.getId(), "Element.id", "Extension.url"))
o = "string";
if (!o.equals(r)) {
oa.add(new JsonPrimitive(o));
ra.add(new JsonPrimitive(r));
@ -1297,6 +1300,8 @@ public class SpecDifferenceEvaluator {
if (Utilities.noString(r) && Utilities.existsInList(rev.getId(), "Element.id", "Extension.url"))
r = "string";
String o = describeType(orig.getType().get(0));
if (Utilities.noString(o) && Utilities.existsInList(orig.getId(), "Element.id", "Extension.url"))
o = "string";
if (!o.equals(r)) {
element.appendChild(makeElementWithAttribute(doc, "removed-type", "name", o));
element.appendChild(makeElementWithAttribute(doc, "added-type", "name", r));

View File

@ -23,26 +23,27 @@ package org.hl7.fhir.convertors;
import java.net.URISyntaxException;
import org.hl7.fhir.r4.model.FhirPublication;
import org.hl7.fhir.r4.terminologies.TerminologyClient;
import org.hl7.fhir.r4.terminologies.TerminologyClientR4;
import org.hl7.fhir.r5.model.FhirPublication;
import org.hl7.fhir.r5.terminologies.TerminologyClient;
import org.hl7.fhir.r5.terminologies.TerminologyClientR5;
import org.hl7.fhir.utilities.Utilities;
public class TerminologyClientFactory {
public static TerminologyClient makeClient(String url, FhirPublication v) throws URISyntaxException {
if (v == null)
return new TerminologyClientR4(checkEndsWith("/r4", url));
return new TerminologyClientR5(checkEndsWith("/r4", url));
switch (v) {
case DSTU2016May: return new TerminologyClientR3(checkEndsWith("/r3", url)); // r3 is the least worst match
case DSTU1: throw new Error("The version "+v.toString()+" is not currently supported");
case DSTU2: return new TerminologyClientR2(checkEndsWith("/r2", url));
case R4: return new TerminologyClientR4(checkEndsWith("/r4", url));
case R4: return new TerminologyClientR5(checkEndsWith("/r4", url));
case R5: return new TerminologyClientR5(checkEndsWith("/r4", url)); // r4 for now, since the terminology is currently the same
case STU3: return new TerminologyClientR3(checkEndsWith("/r3", url));
default: throw new Error("The version "+v.toString()+" is not currently supported");
}
}
private static String checkEndsWith(String term, String url) {
if (url.endsWith(term))
return url;

View File

@ -26,21 +26,21 @@ import java.util.Map;
import org.hl7.fhir.dstu2.utils.client.FHIRToolingClient;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.context.HTMLClientLogger;
import org.hl7.fhir.r4.model.CapabilityStatement;
import org.hl7.fhir.r4.model.Parameters;
import org.hl7.fhir.r4.model.TerminologyCapabilities;
import org.hl7.fhir.r4.model.ValueSet;
import org.hl7.fhir.r4.terminologies.TerminologyClient;
import org.hl7.fhir.r5.context.HTMLClientLogger;
import org.hl7.fhir.r5.model.CapabilityStatement;
import org.hl7.fhir.r5.model.Parameters;
import org.hl7.fhir.r5.model.TerminologyCapabilities;
import org.hl7.fhir.r5.model.ValueSet;
import org.hl7.fhir.r5.terminologies.TerminologyClient;
public class TerminologyClientR2 implements TerminologyClient {
private FHIRToolingClient client; // todo: use the R2 client
private VersionConvertor_10_40 conv;
private VersionConvertor_10_50 conv;
public TerminologyClientR2(String address) throws URISyntaxException {
client = new FHIRToolingClient(address);
conv = new VersionConvertor_10_40(null);
conv = new VersionConvertor_10_50(null);
}
@Override

View File

@ -26,12 +26,12 @@ import java.util.Map;
import org.hl7.fhir.dstu3.utils.client.FHIRToolingClient;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.context.HTMLClientLogger;
import org.hl7.fhir.r4.model.CapabilityStatement;
import org.hl7.fhir.r4.model.Parameters;
import org.hl7.fhir.r4.model.TerminologyCapabilities;
import org.hl7.fhir.r4.model.ValueSet;
import org.hl7.fhir.r4.terminologies.TerminologyClient;
import org.hl7.fhir.r5.context.HTMLClientLogger;
import org.hl7.fhir.r5.model.CapabilityStatement;
import org.hl7.fhir.r5.model.Parameters;
import org.hl7.fhir.r5.model.TerminologyCapabilities;
import org.hl7.fhir.r5.model.ValueSet;
import org.hl7.fhir.r5.terminologies.TerminologyClient;
public class TerminologyClientR3 implements TerminologyClient {
@ -43,7 +43,7 @@ public class TerminologyClientR3 implements TerminologyClient {
@Override
public TerminologyCapabilities getTerminologyCapabilities() throws FHIRException {
return (TerminologyCapabilities) VersionConvertor_30_40.convertTerminologyCapabilities(client.getTerminologyCapabilities(), false);
return (TerminologyCapabilities) VersionConvertor_30_50.convertTerminologyCapabilities(client.getTerminologyCapabilities(), false);
}
@Override
@ -53,24 +53,24 @@ public class TerminologyClientR3 implements TerminologyClient {
@Override
public ValueSet expandValueset(ValueSet vs, Parameters p, Map<String, String> params) throws FHIRException {
org.hl7.fhir.dstu3.model.ValueSet vs2 = (org.hl7.fhir.dstu3.model.ValueSet) VersionConvertor_30_40.convertResource(vs, false);
org.hl7.fhir.dstu3.model.ExpansionProfile p2 = (org.hl7.fhir.dstu3.model.ExpansionProfile) VersionConvertor_30_40.convertResource(p, false);
org.hl7.fhir.dstu3.model.ValueSet vs2 = (org.hl7.fhir.dstu3.model.ValueSet) VersionConvertor_30_50.convertResource(vs, false);
org.hl7.fhir.dstu3.model.ExpansionProfile p2 = (org.hl7.fhir.dstu3.model.ExpansionProfile) VersionConvertor_30_50.convertResource(p, false);
vs2 = client.expandValueset(vs2, p2, params); // todo: second parameter
return (ValueSet) VersionConvertor_30_40.convertResource(vs2, false);
return (ValueSet) VersionConvertor_30_50.convertResource(vs2, false);
}
@Override
public Parameters validateCS(Parameters pin) throws FHIRException {
org.hl7.fhir.dstu3.model.Parameters p2 = (org.hl7.fhir.dstu3.model.Parameters) VersionConvertor_30_40.convertResource(pin, false);
org.hl7.fhir.dstu3.model.Parameters p2 = (org.hl7.fhir.dstu3.model.Parameters) VersionConvertor_30_50.convertResource(pin, false);
p2 = client.operateType(org.hl7.fhir.dstu3.model.CodeSystem.class, "validate-code", p2);
return (Parameters) VersionConvertor_30_40.convertResource(p2, false);
return (Parameters) VersionConvertor_30_50.convertResource(p2, false);
}
@Override
public Parameters validateVS(Parameters pin) throws FHIRException {
org.hl7.fhir.dstu3.model.Parameters p2 = (org.hl7.fhir.dstu3.model.Parameters) VersionConvertor_30_40.convertResource(pin, false);
org.hl7.fhir.dstu3.model.Parameters p2 = (org.hl7.fhir.dstu3.model.Parameters) VersionConvertor_30_50.convertResource(pin, false);
p2 = client.operateType(org.hl7.fhir.dstu3.model.ValueSet.class, "validate-code", p2);
return (Parameters) VersionConvertor_30_40.convertResource(p2, false);
return (Parameters) VersionConvertor_30_50.convertResource(p2, false);
}
@Override
@ -85,12 +85,12 @@ public class TerminologyClientR3 implements TerminologyClient {
@Override
public CapabilityStatement getCapabilitiesStatementQuick() throws FHIRException {
return (CapabilityStatement) VersionConvertor_30_40.convertResource(client.getCapabilitiesStatementQuick(), false);
return (CapabilityStatement) VersionConvertor_30_50.convertResource(client.getCapabilitiesStatementQuick(), false);
}
@Override
public Parameters lookupCode(Map<String, String> params) throws FHIRException {
return (Parameters) VersionConvertor_30_40.convertResource(client.lookupCode(params), false);
return (Parameters) VersionConvertor_30_50.convertResource(client.lookupCode(params), false);
}
}

View File

@ -0,0 +1,96 @@
package org.hl7.fhir.convertors;
/*-
* #%L
* org.hl7.fhir.convertors
* %%
* Copyright (C) 2014 - 2019 Health Level 7
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.net.URISyntaxException;
import java.util.Map;
import org.hl7.fhir.r4.utils.client.FHIRToolingClient;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.context.HTMLClientLogger;
import org.hl7.fhir.r5.model.CapabilityStatement;
import org.hl7.fhir.r5.model.Parameters;
import org.hl7.fhir.r5.model.TerminologyCapabilities;
import org.hl7.fhir.r5.model.ValueSet;
import org.hl7.fhir.r5.terminologies.TerminologyClient;
public class TerminologyClientR4 implements TerminologyClient {
private FHIRToolingClient client; // todo: use the R2 client
public TerminologyClientR4(String address) throws URISyntaxException {
client = new FHIRToolingClient(address);
}
@Override
public TerminologyCapabilities getTerminologyCapabilities() throws FHIRException {
return (TerminologyCapabilities) org.hl7.fhir.convertors.conv40_50.TerminologyCapabilities.convertTerminologyCapabilities(client.getTerminologyCapabilities());
}
@Override
public String getAddress() {
return client.getAddress();
}
@Override
public ValueSet expandValueset(ValueSet vs, Parameters p, Map<String, String> params) throws FHIRException {
org.hl7.fhir.r4.model.ValueSet vs2 = (org.hl7.fhir.r4.model.ValueSet) VersionConvertor_40_50.convertResource(vs);
org.hl7.fhir.r4.model.Parameters p2 = (org.hl7.fhir.r4.model.Parameters) VersionConvertor_40_50.convertResource(p);
vs2 = client.expandValueset(vs2, p2, params); // todo: second parameter
return (ValueSet) VersionConvertor_40_50.convertResource(vs2);
}
@Override
public Parameters validateCS(Parameters pin) throws FHIRException {
org.hl7.fhir.r4.model.Parameters p2 = (org.hl7.fhir.r4.model.Parameters) VersionConvertor_40_50.convertResource(pin);
p2 = client.operateType(org.hl7.fhir.r4.model.CodeSystem.class, "validate-code", p2);
return (Parameters) VersionConvertor_40_50.convertResource(p2);
}
@Override
public Parameters validateVS(Parameters pin) throws FHIRException {
org.hl7.fhir.r4.model.Parameters p2 = (org.hl7.fhir.r4.model.Parameters) VersionConvertor_40_50.convertResource(pin);
p2 = client.operateType(org.hl7.fhir.r4.model.ValueSet.class, "validate-code", p2);
return (Parameters) VersionConvertor_40_50.convertResource(p2);
}
@Override
public void setTimeout(int i) {
// ignored in this version - need to roll R4 internal changes back to R2 if desired
}
@Override
public void setLogger(HTMLClientLogger txLog) {
// ignored in this version - need to roll R4 internal changes back to R2 if desired
}
@Override
public CapabilityStatement getCapabilitiesStatementQuick() throws FHIRException {
return (CapabilityStatement) VersionConvertor_40_50.convertResource(client.getCapabilitiesStatementQuick());
}
@Override
public Parameters lookupCode(Map<String, String> params) throws FHIRException {
return (Parameters) VersionConvertor_40_50.convertResource(client.lookupCode(params));
}
}

View File

@ -0,0 +1,39 @@
package org.hl7.fhir.convertors;
/*-
* #%L
* org.hl7.fhir.convertors
* %%
* Copyright (C) 2014 - 2019 Health Level 7
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import org.hl7.fhir.exceptions.FHIRException;
public interface VersionConvertorAdvisor50 {
boolean ignoreEntry(org.hl7.fhir.r5.model.Bundle.BundleEntryComponent src);
// called ?
org.hl7.fhir.dstu2.model.Resource convertR2(org.hl7.fhir.r5.model.Resource resource) throws FHIRException;
org.hl7.fhir.dstu2016may.model.Resource convertR2016May(org.hl7.fhir.r5.model.Resource resource) throws FHIRException;
org.hl7.fhir.dstu3.model.Resource convertR3(org.hl7.fhir.r5.model.Resource resource) throws FHIRException;
org.hl7.fhir.r4.model.Resource convertR4(org.hl7.fhir.r5.model.Resource resource) throws FHIRException;
// called when an r2 value set has a codeSystem in it
void handleCodeSystem(org.hl7.fhir.r5.model.CodeSystem tgtcs, org.hl7.fhir.r5.model.ValueSet source) throws FHIRException;
org.hl7.fhir.r5.model.CodeSystem getCodeSystem(org.hl7.fhir.r5.model.ValueSet src) throws FHIRException;
}

View File

@ -0,0 +1,181 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Account extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Account convertAccount(org.hl7.fhir.r4.model.Account src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Account tgt = new org.hl7.fhir.r5.model.Account();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertAccountStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getSubject())
tgt.addSubject(convertReference(t));
if (src.hasServicePeriod())
tgt.setServicePeriod(convertPeriod(src.getServicePeriod()));
for (org.hl7.fhir.r4.model.Account.CoverageComponent t : src.getCoverage())
tgt.addCoverage(convertCoverageComponent(t));
if (src.hasOwner())
tgt.setOwner(convertReference(src.getOwner()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.Account.GuarantorComponent t : src.getGuarantor())
tgt.addGuarantor(convertGuarantorComponent(t));
if (src.hasPartOf())
tgt.setPartOf(convertReference(src.getPartOf()));
return tgt;
}
public static org.hl7.fhir.r4.model.Account convertAccount(org.hl7.fhir.r5.model.Account src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Account tgt = new org.hl7.fhir.r4.model.Account();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertAccountStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getSubject())
tgt.addSubject(convertReference(t));
if (src.hasServicePeriod())
tgt.setServicePeriod(convertPeriod(src.getServicePeriod()));
for (org.hl7.fhir.r5.model.Account.CoverageComponent t : src.getCoverage())
tgt.addCoverage(convertCoverageComponent(t));
if (src.hasOwner())
tgt.setOwner(convertReference(src.getOwner()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.Account.GuarantorComponent t : src.getGuarantor())
tgt.addGuarantor(convertGuarantorComponent(t));
if (src.hasPartOf())
tgt.setPartOf(convertReference(src.getPartOf()));
return tgt;
}
public static org.hl7.fhir.r5.model.Account.AccountStatus convertAccountStatus(org.hl7.fhir.r4.model.Account.AccountStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.Account.AccountStatus.ACTIVE;
case INACTIVE: return org.hl7.fhir.r5.model.Account.AccountStatus.INACTIVE;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Account.AccountStatus.ENTEREDINERROR;
case ONHOLD: return org.hl7.fhir.r5.model.Account.AccountStatus.ONHOLD;
case UNKNOWN: return org.hl7.fhir.r5.model.Account.AccountStatus.UNKNOWN;
default: return org.hl7.fhir.r5.model.Account.AccountStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Account.AccountStatus convertAccountStatus(org.hl7.fhir.r5.model.Account.AccountStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.Account.AccountStatus.ACTIVE;
case INACTIVE: return org.hl7.fhir.r4.model.Account.AccountStatus.INACTIVE;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Account.AccountStatus.ENTEREDINERROR;
case ONHOLD: return org.hl7.fhir.r4.model.Account.AccountStatus.ONHOLD;
case UNKNOWN: return org.hl7.fhir.r4.model.Account.AccountStatus.UNKNOWN;
default: return org.hl7.fhir.r4.model.Account.AccountStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Account.CoverageComponent convertCoverageComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasCoverage())
tgt.setCoverage(convertReference(src.getCoverage()));
if (src.hasPriority())
tgt.setPriorityElement(convertPositiveInt(src.getPriorityElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Account.CoverageComponent convertCoverageComponent(org.hl7.fhir.r5.model.Account.CoverageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Account.CoverageComponent tgt = new org.hl7.fhir.r4.model.Account.CoverageComponent();
copyElement(src, tgt);
if (src.hasCoverage())
tgt.setCoverage(convertReference(src.getCoverage()));
if (src.hasPriority())
tgt.setPriorityElement(convertPositiveInt(src.getPriorityElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Account.GuarantorComponent convertGuarantorComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasParty())
tgt.setParty(convertReference(src.getParty()));
if (src.hasOnHold())
tgt.setOnHoldElement(convertBoolean(src.getOnHoldElement()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4.model.Account.GuarantorComponent convertGuarantorComponent(org.hl7.fhir.r5.model.Account.GuarantorComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Account.GuarantorComponent tgt = new org.hl7.fhir.r4.model.Account.GuarantorComponent();
copyElement(src, tgt);
if (src.hasParty())
tgt.setParty(convertReference(src.getParty()));
if (src.hasOnHold())
tgt.setOnHoldElement(convertBoolean(src.getOnHoldElement()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
}

View File

@ -0,0 +1,419 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ActivityDefinition extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.ActivityDefinition convertActivityDefinition(org.hl7.fhir.r4.model.ActivityDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ActivityDefinition tgt = new org.hl7.fhir.r5.model.ActivityDefinition();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasSubject())
tgt.setSubject(convertType(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasUsage())
tgt.setUsageElement(convertString(src.getUsageElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic())
tgt.addTopic(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor())
tgt.addEditor(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(convertContactDetail(t));
for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(convertRelatedArtifact(t));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getLibrary())
tgt.getLibrary().add(convertCanonical(t));
if (src.hasKind())
tgt.setKind(convertActivityDefinitionKind(src.getKind()));
if (src.hasProfile())
tgt.setProfileElement(convertCanonical(src.getProfileElement()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasIntent())
tgt.setIntent(convertRequestIntent(src.getIntent()));
if (src.hasPriority())
tgt.setPriority(convertRequestPriority(src.getPriority()));
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement()));
if (src.hasTiming())
tgt.setTiming(convertType(src.getTiming()));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
for (org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertActivityDefinitionParticipantComponent(t));
if (src.hasProduct())
tgt.setProduct(convertType(src.getProduct()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
for (org.hl7.fhir.r4.model.Dosage t : src.getDosage())
tgt.addDosage(convertDosage(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite())
tgt.addBodySite(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getSpecimenRequirement())
tgt.addSpecimenRequirement(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getObservationRequirement())
tgt.addObservationRequirement(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getObservationResultRequirement())
tgt.addObservationResultRequirement(convertReference(t));
if (src.hasTransform())
tgt.setTransformElement(convertCanonical(src.getTransformElement()));
for (org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue())
tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ActivityDefinition convertActivityDefinition(org.hl7.fhir.r5.model.ActivityDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ActivityDefinition tgt = new org.hl7.fhir.r4.model.ActivityDefinition();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasSubject())
tgt.setSubject(convertType(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasUsage())
tgt.setUsageElement(convertString(src.getUsageElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic())
tgt.addTopic(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor())
tgt.addEditor(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(convertContactDetail(t));
for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(convertRelatedArtifact(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary())
tgt.getLibrary().add(convertCanonical(t));
if (src.hasKind())
tgt.setKind(convertActivityDefinitionKind(src.getKind()));
if (src.hasProfile())
tgt.setProfileElement(convertCanonical(src.getProfileElement()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasIntent())
tgt.setIntent(convertRequestIntent(src.getIntent()));
if (src.hasPriority())
tgt.setPriority(convertRequestPriority(src.getPriority()));
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement()));
if (src.hasTiming())
tgt.setTiming(convertType(src.getTiming()));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
for (org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertActivityDefinitionParticipantComponent(t));
if (src.hasProduct())
tgt.setProduct(convertType(src.getProduct()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
for (org.hl7.fhir.r5.model.Dosage t : src.getDosage())
tgt.addDosage(convertDosage(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite())
tgt.addBodySite(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSpecimenRequirement())
tgt.addSpecimenRequirement(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getObservationRequirement())
tgt.addObservationRequirement(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getObservationResultRequirement())
tgt.addObservationResultRequirement(convertReference(t));
if (src.hasTransform())
tgt.setTransformElement(convertCanonical(src.getTransformElement()));
for (org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent t : src.getDynamicValue())
tgt.addDynamicValue(convertActivityDefinitionDynamicValueComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind convertActivityDefinitionKind(org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case APPOINTMENT: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENT;
case APPOINTMENTRESPONSE: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENTRESPONSE;
case CAREPLAN: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.CAREPLAN;
case CLAIM: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.CLAIM;
case COMMUNICATIONREQUEST: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.COMMUNICATIONREQUEST;
case CONTRACT: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.CONTRACT;
case DEVICEREQUEST: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.DEVICEREQUEST;
case ENROLLMENTREQUEST: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.ENROLLMENTREQUEST;
case IMMUNIZATIONRECOMMENDATION: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.IMMUNIZATIONRECOMMENDATION;
case MEDICATIONREQUEST: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.MEDICATIONREQUEST;
case NUTRITIONORDER: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.NUTRITIONORDER;
case SERVICEREQUEST: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.SERVICEREQUEST;
case SUPPLYREQUEST: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.SUPPLYREQUEST;
case TASK: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.TASK;
case VISIONPRESCRIPTION: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.VISIONPRESCRIPTION;
default: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind.NULL;
}
}
public static org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind convertActivityDefinitionKind(org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionKind src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case APPOINTMENT: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENT;
case APPOINTMENTRESPONSE: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.APPOINTMENTRESPONSE;
case CAREPLAN: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.CAREPLAN;
case CLAIM: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.CLAIM;
case COMMUNICATIONREQUEST: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.COMMUNICATIONREQUEST;
case CONTRACT: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.CONTRACT;
case DEVICEREQUEST: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.DEVICEREQUEST;
case ENROLLMENTREQUEST: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.ENROLLMENTREQUEST;
case IMMUNIZATIONRECOMMENDATION: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.IMMUNIZATIONRECOMMENDATION;
case MEDICATIONREQUEST: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.MEDICATIONREQUEST;
case NUTRITIONORDER: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.NUTRITIONORDER;
case SERVICEREQUEST: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.SERVICEREQUEST;
case SUPPLYREQUEST: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.SUPPLYREQUEST;
case TASK: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.TASK;
case VISIONPRESCRIPTION: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.VISIONPRESCRIPTION;
default: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionKind.NULL;
}
}
public static org.hl7.fhir.r5.model.ActivityDefinition.RequestIntent convertRequestIntent(org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROPOSAL: return org.hl7.fhir.r5.model.ActivityDefinition.RequestIntent.PROPOSAL;
case PLAN: return org.hl7.fhir.r5.model.ActivityDefinition.RequestIntent.PLAN;
case DIRECTIVE: return org.hl7.fhir.r5.model.ActivityDefinition.RequestIntent.DIRECTIVE;
case ORDER: return org.hl7.fhir.r5.model.ActivityDefinition.RequestIntent.ORDER;
case ORIGINALORDER: return org.hl7.fhir.r5.model.ActivityDefinition.RequestIntent.ORIGINALORDER;
case REFLEXORDER: return org.hl7.fhir.r5.model.ActivityDefinition.RequestIntent.REFLEXORDER;
case FILLERORDER: return org.hl7.fhir.r5.model.ActivityDefinition.RequestIntent.FILLERORDER;
case INSTANCEORDER: return org.hl7.fhir.r5.model.ActivityDefinition.RequestIntent.INSTANCEORDER;
case OPTION: return org.hl7.fhir.r5.model.ActivityDefinition.RequestIntent.OPTION;
default: return org.hl7.fhir.r5.model.ActivityDefinition.RequestIntent.NULL;
}
}
public static org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent convertRequestIntent(org.hl7.fhir.r5.model.ActivityDefinition.RequestIntent src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROPOSAL: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.PROPOSAL;
case PLAN: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.PLAN;
case DIRECTIVE: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.DIRECTIVE;
case ORDER: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.ORDER;
case ORIGINALORDER: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.ORIGINALORDER;
case REFLEXORDER: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.REFLEXORDER;
case FILLERORDER: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.FILLERORDER;
case INSTANCEORDER: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.INSTANCEORDER;
case OPTION: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.OPTION;
default: return org.hl7.fhir.r4.model.ActivityDefinition.RequestIntent.NULL;
}
}
public static org.hl7.fhir.r5.model.ActivityDefinition.RequestPriority convertRequestPriority(org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ROUTINE: return org.hl7.fhir.r5.model.ActivityDefinition.RequestPriority.ROUTINE;
case URGENT: return org.hl7.fhir.r5.model.ActivityDefinition.RequestPriority.URGENT;
case ASAP: return org.hl7.fhir.r5.model.ActivityDefinition.RequestPriority.ASAP;
case STAT: return org.hl7.fhir.r5.model.ActivityDefinition.RequestPriority.STAT;
default: return org.hl7.fhir.r5.model.ActivityDefinition.RequestPriority.NULL;
}
}
public static org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority convertRequestPriority(org.hl7.fhir.r5.model.ActivityDefinition.RequestPriority src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ROUTINE: return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.ROUTINE;
case URGENT: return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.URGENT;
case ASAP: return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.ASAP;
case STAT: return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.STAT;
default: return org.hl7.fhir.r4.model.ActivityDefinition.RequestPriority.NULL;
}
}
public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent convertActivityDefinitionParticipantComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertActivityParticipantType(src.getType()));
if (src.hasRole())
tgt.setRole(convertCodeableConcept(src.getRole()));
return tgt;
}
public static org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent convertActivityDefinitionParticipantComponent(org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionParticipantComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent tgt = new org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionParticipantComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertActivityParticipantType(src.getType()));
if (src.hasRole())
tgt.setRole(convertCodeableConcept(src.getRole()));
return tgt;
}
public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityParticipantType convertActivityParticipantType(org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PATIENT: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityParticipantType.PATIENT;
case PRACTITIONER: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityParticipantType.PRACTITIONER;
case RELATEDPERSON: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityParticipantType.RELATEDPERSON;
case DEVICE: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityParticipantType.DEVICE;
default: return org.hl7.fhir.r5.model.ActivityDefinition.ActivityParticipantType.NULL;
}
}
public static org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType convertActivityParticipantType(org.hl7.fhir.r5.model.ActivityDefinition.ActivityParticipantType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PATIENT: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.PATIENT;
case PRACTITIONER: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.PRACTITIONER;
case RELATEDPERSON: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.RELATEDPERSON;
case DEVICE: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.DEVICE;
default: return org.hl7.fhir.r4.model.ActivityDefinition.ActivityParticipantType.NULL;
}
}
public static org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent convertActivityDefinitionDynamicValueComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasPath())
tgt.setPathElement(convertString(src.getPathElement()));
if (src.hasExpression())
tgt.setExpression(convertExpression(src.getExpression()));
return tgt;
}
public static org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent convertActivityDefinitionDynamicValueComponent(org.hl7.fhir.r5.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent tgt = new org.hl7.fhir.r4.model.ActivityDefinition.ActivityDefinitionDynamicValueComponent();
copyElement(src, tgt);
if (src.hasPath())
tgt.setPathElement(convertString(src.getPathElement()));
if (src.hasExpression())
tgt.setExpression(convertExpression(src.getExpression()));
return tgt;
}
}

View File

@ -0,0 +1,215 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class AdverseEvent extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.AdverseEvent convertAdverseEvent(org.hl7.fhir.r4.model.AdverseEvent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.AdverseEvent tgt = new org.hl7.fhir.r5.model.AdverseEvent();
copyDomainResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasActuality())
tgt.setActuality(convertAdverseEventActuality(src.getActuality()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasEvent())
tgt.setEvent(convertCodeableConcept(src.getEvent()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasDetected())
tgt.setDetectedElement(convertDateTime(src.getDetectedElement()));
if (src.hasRecordedDate())
tgt.setRecordedDateElement(convertDateTime(src.getRecordedDateElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getResultingCondition())
tgt.addResultingCondition(convertReference(t));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
if (src.hasSeriousness())
tgt.setSeriousness(convertCodeableConcept(src.getSeriousness()));
if (src.hasSeverity())
tgt.setSeverity(convertCodeableConcept(src.getSeverity()));
if (src.hasOutcome())
tgt.setOutcome(convertCodeableConcept(src.getOutcome()));
if (src.hasRecorder())
tgt.setRecorder(convertReference(src.getRecorder()));
for (org.hl7.fhir.r4.model.Reference t : src.getContributor())
tgt.addContributor(convertReference(t));
for (org.hl7.fhir.r4.model.AdverseEvent.AdverseEventSuspectEntityComponent t : src.getSuspectEntity())
tgt.addSuspectEntity(convertAdverseEventSuspectEntityComponent(t));
for (org.hl7.fhir.r4.model.Reference t : src.getSubjectMedicalHistory())
tgt.addSubjectMedicalHistory(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReferenceDocument())
tgt.addReferenceDocument(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getStudy())
tgt.addStudy(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.AdverseEvent convertAdverseEvent(org.hl7.fhir.r5.model.AdverseEvent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.AdverseEvent tgt = new org.hl7.fhir.r4.model.AdverseEvent();
copyDomainResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasActuality())
tgt.setActuality(convertAdverseEventActuality(src.getActuality()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasEvent())
tgt.setEvent(convertCodeableConcept(src.getEvent()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasDetected())
tgt.setDetectedElement(convertDateTime(src.getDetectedElement()));
if (src.hasRecordedDate())
tgt.setRecordedDateElement(convertDateTime(src.getRecordedDateElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getResultingCondition())
tgt.addResultingCondition(convertReference(t));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
if (src.hasSeriousness())
tgt.setSeriousness(convertCodeableConcept(src.getSeriousness()));
if (src.hasSeverity())
tgt.setSeverity(convertCodeableConcept(src.getSeverity()));
if (src.hasOutcome())
tgt.setOutcome(convertCodeableConcept(src.getOutcome()));
if (src.hasRecorder())
tgt.setRecorder(convertReference(src.getRecorder()));
for (org.hl7.fhir.r5.model.Reference t : src.getContributor())
tgt.addContributor(convertReference(t));
for (org.hl7.fhir.r5.model.AdverseEvent.AdverseEventSuspectEntityComponent t : src.getSuspectEntity())
tgt.addSuspectEntity(convertAdverseEventSuspectEntityComponent(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSubjectMedicalHistory())
tgt.addSubjectMedicalHistory(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReferenceDocument())
tgt.addReferenceDocument(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getStudy())
tgt.addStudy(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.AdverseEvent.AdverseEventActuality convertAdverseEventActuality(org.hl7.fhir.r4.model.AdverseEvent.AdverseEventActuality src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTUAL: return org.hl7.fhir.r5.model.AdverseEvent.AdverseEventActuality.ACTUAL;
case POTENTIAL: return org.hl7.fhir.r5.model.AdverseEvent.AdverseEventActuality.POTENTIAL;
default: return org.hl7.fhir.r5.model.AdverseEvent.AdverseEventActuality.NULL;
}
}
public static org.hl7.fhir.r4.model.AdverseEvent.AdverseEventActuality convertAdverseEventActuality(org.hl7.fhir.r5.model.AdverseEvent.AdverseEventActuality src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTUAL: return org.hl7.fhir.r4.model.AdverseEvent.AdverseEventActuality.ACTUAL;
case POTENTIAL: return org.hl7.fhir.r4.model.AdverseEvent.AdverseEventActuality.POTENTIAL;
default: return org.hl7.fhir.r4.model.AdverseEvent.AdverseEventActuality.NULL;
}
}
public static org.hl7.fhir.r5.model.AdverseEvent.AdverseEventSuspectEntityComponent convertAdverseEventSuspectEntityComponent(org.hl7.fhir.r4.model.AdverseEvent.AdverseEventSuspectEntityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.AdverseEvent.AdverseEventSuspectEntityComponent tgt = new org.hl7.fhir.r5.model.AdverseEvent.AdverseEventSuspectEntityComponent();
copyElement(src, tgt);
if (src.hasInstance())
tgt.setInstance(convertReference(src.getInstance()));
for (org.hl7.fhir.r4.model.AdverseEvent.AdverseEventSuspectEntityCausalityComponent t : src.getCausality())
tgt.addCausality(convertAdverseEventSuspectEntityCausalityComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.AdverseEvent.AdverseEventSuspectEntityComponent convertAdverseEventSuspectEntityComponent(org.hl7.fhir.r5.model.AdverseEvent.AdverseEventSuspectEntityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.AdverseEvent.AdverseEventSuspectEntityComponent tgt = new org.hl7.fhir.r4.model.AdverseEvent.AdverseEventSuspectEntityComponent();
copyElement(src, tgt);
if (src.hasInstance())
tgt.setInstance(convertReference(src.getInstance()));
for (org.hl7.fhir.r5.model.AdverseEvent.AdverseEventSuspectEntityCausalityComponent t : src.getCausality())
tgt.addCausality(convertAdverseEventSuspectEntityCausalityComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.AdverseEvent.AdverseEventSuspectEntityCausalityComponent convertAdverseEventSuspectEntityCausalityComponent(org.hl7.fhir.r4.model.AdverseEvent.AdverseEventSuspectEntityCausalityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.AdverseEvent.AdverseEventSuspectEntityCausalityComponent tgt = new org.hl7.fhir.r5.model.AdverseEvent.AdverseEventSuspectEntityCausalityComponent();
copyElement(src, tgt);
if (src.hasAssessment())
tgt.setAssessment(convertCodeableConcept(src.getAssessment()));
if (src.hasProductRelatedness())
tgt.setProductRelatednessElement(convertString(src.getProductRelatednessElement()));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
if (src.hasMethod())
tgt.setMethod(convertCodeableConcept(src.getMethod()));
return tgt;
}
public static org.hl7.fhir.r4.model.AdverseEvent.AdverseEventSuspectEntityCausalityComponent convertAdverseEventSuspectEntityCausalityComponent(org.hl7.fhir.r5.model.AdverseEvent.AdverseEventSuspectEntityCausalityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.AdverseEvent.AdverseEventSuspectEntityCausalityComponent tgt = new org.hl7.fhir.r4.model.AdverseEvent.AdverseEventSuspectEntityCausalityComponent();
copyElement(src, tgt);
if (src.hasAssessment())
tgt.setAssessment(convertCodeableConcept(src.getAssessment()));
if (src.hasProductRelatedness())
tgt.setProductRelatednessElement(convertString(src.getProductRelatednessElement()));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
if (src.hasMethod())
tgt.setMethod(convertCodeableConcept(src.getMethod()));
return tgt;
}
}

View File

@ -0,0 +1,255 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class AllergyIntolerance extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.r4.model.AllergyIntolerance src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.AllergyIntolerance tgt = new org.hl7.fhir.r5.model.AllergyIntolerance();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasClinicalStatus())
tgt.setClinicalStatus(convertCodeableConcept(src.getClinicalStatus()));
if (src.hasVerificationStatus())
tgt.setVerificationStatus(convertCodeableConcept(src.getVerificationStatus()));
if (src.hasType())
tgt.setType(convertAllergyIntoleranceType(src.getType()));
for (org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory> t : src.getCategory())
tgt.addCategory(convertAllergyIntoleranceCategory(t.getValue()));
if (src.hasCriticality())
tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasOnset())
tgt.setOnset(convertType(src.getOnset()));
if (src.hasRecordedDate())
tgt.setRecordedDateElement(convertDateTime(src.getRecordedDateElement()));
if (src.hasRecorder())
tgt.setRecorder(convertReference(src.getRecorder()));
if (src.hasAsserter())
tgt.setAsserter(convertReference(src.getAsserter()));
if (src.hasLastOccurrence())
tgt.setLastOccurrenceElement(convertDateTime(src.getLastOccurrenceElement()));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction())
tgt.addReaction(convertAllergyIntoleranceReactionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.r5.model.AllergyIntolerance src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.AllergyIntolerance tgt = new org.hl7.fhir.r4.model.AllergyIntolerance();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasClinicalStatus())
tgt.setClinicalStatus(convertCodeableConcept(src.getClinicalStatus()));
if (src.hasVerificationStatus())
tgt.setVerificationStatus(convertCodeableConcept(src.getVerificationStatus()));
if (src.hasType())
tgt.setType(convertAllergyIntoleranceType(src.getType()));
for (org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory> t : src.getCategory())
tgt.addCategory(convertAllergyIntoleranceCategory(t.getValue()));
if (src.hasCriticality())
tgt.setCriticality(convertAllergyIntoleranceCriticality(src.getCriticality()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasOnset())
tgt.setOnset(convertType(src.getOnset()));
if (src.hasRecordedDate())
tgt.setRecordedDateElement(convertDateTime(src.getRecordedDateElement()));
if (src.hasRecorder())
tgt.setRecorder(convertReference(src.getRecorder()));
if (src.hasAsserter())
tgt.setAsserter(convertReference(src.getAsserter()));
if (src.hasLastOccurrence())
tgt.setLastOccurrenceElement(convertDateTime(src.getLastOccurrenceElement()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction())
tgt.addReaction(convertAllergyIntoleranceReactionComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType convertAllergyIntoleranceType(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ALLERGY: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY;
case INTOLERANCE: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE;
default: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.NULL;
}
}
public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType convertAllergyIntoleranceType(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ALLERGY: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY;
case INTOLERANCE: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE;
default: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.NULL;
}
}
public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory convertAllergyIntoleranceCategory(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case FOOD: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD;
case MEDICATION: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION;
case ENVIRONMENT: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT;
case BIOLOGIC: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC;
default: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL;
}
}
public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory convertAllergyIntoleranceCategory(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case FOOD: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD;
case MEDICATION: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION;
case ENVIRONMENT: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT;
case BIOLOGIC: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC;
default: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL;
}
}
public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality convertAllergyIntoleranceCriticality(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case LOW: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW;
case HIGH: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH;
case UNABLETOASSESS: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS;
default: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL;
}
}
public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality convertAllergyIntoleranceCriticality(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case LOW: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW;
case HIGH: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH;
case UNABLETOASSESS: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS;
default: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL;
}
}
public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasSubstance())
tgt.setSubstance(convertCodeableConcept(src.getSubstance()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getManifestation())
tgt.addManifestation(convertCodeableConcept(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasOnset())
tgt.setOnsetElement(convertDateTime(src.getOnsetElement()));
if (src.hasSeverity())
tgt.setSeverity(convertAllergyIntoleranceSeverity(src.getSeverity()));
if (src.hasExposureRoute())
tgt.setExposureRoute(convertCodeableConcept(src.getExposureRoute()));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt = new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent();
copyElement(src, tgt);
if (src.hasSubstance())
tgt.setSubstance(convertCodeableConcept(src.getSubstance()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getManifestation())
tgt.addManifestation(convertCodeableConcept(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasOnset())
tgt.setOnsetElement(convertDateTime(src.getOnsetElement()));
if (src.hasSeverity())
tgt.setSeverity(convertAllergyIntoleranceSeverity(src.getSeverity()));
if (src.hasExposureRoute())
tgt.setExposureRoute(convertCodeableConcept(src.getExposureRoute()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity convertAllergyIntoleranceSeverity(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case MILD: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD;
case MODERATE: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE;
case SEVERE: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE;
default: return org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL;
}
}
public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity convertAllergyIntoleranceSeverity(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case MILD: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD;
case MODERATE: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE;
case SEVERE: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE;
default: return org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL;
}
}
}

View File

@ -0,0 +1,265 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Appointment extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Appointment convertAppointment(org.hl7.fhir.r4.model.Appointment src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Appointment tgt = new org.hl7.fhir.r5.model.Appointment();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertAppointmentStatus(src.getStatus()));
if (src.hasCancelationReason())
tgt.setCancelationReason(convertCodeableConcept(src.getCancelationReason()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceCategory())
tgt.addServiceCategory(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType())
tgt.addServiceType(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty())
tgt.addSpecialty(convertCodeableConcept(t));
if (src.hasAppointmentType())
tgt.setAppointmentType(convertCodeableConcept(src.getAppointmentType()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
if (src.hasPriority())
tgt.setPriorityElement(convertUnsignedInt(src.getPriorityElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation())
tgt.addSupportingInformation(convertReference(t));
if (src.hasStart())
tgt.setStartElement(convertInstant(src.getStartElement()));
if (src.hasEnd())
tgt.setEndElement(convertInstant(src.getEndElement()));
if (src.hasMinutesDuration())
tgt.setMinutesDurationElement(convertPositiveInt(src.getMinutesDurationElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getSlot())
tgt.addSlot(convertReference(t));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasComment())
tgt.setCommentElement(convertString(src.getCommentElement()));
if (src.hasPatientInstruction())
tgt.setPatientInstructionElement(convertString(src.getPatientInstructionElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertAppointmentParticipantComponent(t));
for (org.hl7.fhir.r4.model.Period t : src.getRequestedPeriod())
tgt.addRequestedPeriod(convertPeriod(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Appointment convertAppointment(org.hl7.fhir.r5.model.Appointment src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Appointment tgt = new org.hl7.fhir.r4.model.Appointment();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertAppointmentStatus(src.getStatus()));
if (src.hasCancelationReason())
tgt.setCancelationReason(convertCodeableConcept(src.getCancelationReason()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceCategory())
tgt.addServiceCategory(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType())
tgt.addServiceType(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty())
tgt.addSpecialty(convertCodeableConcept(t));
if (src.hasAppointmentType())
tgt.setAppointmentType(convertCodeableConcept(src.getAppointmentType()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
if (src.hasPriority())
tgt.setPriorityElement(convertUnsignedInt(src.getPriorityElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation())
tgt.addSupportingInformation(convertReference(t));
if (src.hasStart())
tgt.setStartElement(convertInstant(src.getStartElement()));
if (src.hasEnd())
tgt.setEndElement(convertInstant(src.getEndElement()));
if (src.hasMinutesDuration())
tgt.setMinutesDurationElement(convertPositiveInt(src.getMinutesDurationElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getSlot())
tgt.addSlot(convertReference(t));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasComment())
tgt.setCommentElement(convertString(src.getCommentElement()));
if (src.hasPatientInstruction())
tgt.setPatientInstructionElement(convertString(src.getPatientInstructionElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn())
tgt.addBasedOn(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(convertPeriod(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Appointment.AppointmentStatus convertAppointmentStatus(org.hl7.fhir.r4.model.Appointment.AppointmentStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROPOSED: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PROPOSED;
case PENDING: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.PENDING;
case BOOKED: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.BOOKED;
case ARRIVED: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ARRIVED;
case FULFILLED: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.FULFILLED;
case CANCELLED: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CANCELLED;
case NOSHOW: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NOSHOW;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.ENTEREDINERROR;
case CHECKEDIN: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.CHECKEDIN;
case WAITLIST: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.WAITLIST;
default: return org.hl7.fhir.r5.model.Appointment.AppointmentStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Appointment.AppointmentStatus convertAppointmentStatus(org.hl7.fhir.r5.model.Appointment.AppointmentStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROPOSED: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PROPOSED;
case PENDING: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.PENDING;
case BOOKED: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.BOOKED;
case ARRIVED: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ARRIVED;
case FULFILLED: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.FULFILLED;
case CANCELLED: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.CANCELLED;
case NOSHOW: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NOSHOW;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.ENTEREDINERROR;
case CHECKEDIN: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.CHECKEDIN;
case WAITLIST: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.WAITLIST;
default: return org.hl7.fhir.r4.model.Appointment.AppointmentStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
if (src.hasRequired())
tgt.setRequired(convertParticipantRequired(src.getRequired()));
if (src.hasStatus())
tgt.setStatus(convertParticipationStatus(src.getStatus()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
if (src.hasRequired())
tgt.setRequired(convertParticipantRequired(src.getRequired()));
if (src.hasStatus())
tgt.setStatus(convertParticipationStatus(src.getStatus()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r5.model.Appointment.ParticipantRequired convertParticipantRequired(org.hl7.fhir.r4.model.Appointment.ParticipantRequired src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case REQUIRED: return org.hl7.fhir.r5.model.Appointment.ParticipantRequired.REQUIRED;
case OPTIONAL: return org.hl7.fhir.r5.model.Appointment.ParticipantRequired.OPTIONAL;
case INFORMATIONONLY: return org.hl7.fhir.r5.model.Appointment.ParticipantRequired.INFORMATIONONLY;
default: return org.hl7.fhir.r5.model.Appointment.ParticipantRequired.NULL;
}
}
public static org.hl7.fhir.r4.model.Appointment.ParticipantRequired convertParticipantRequired(org.hl7.fhir.r5.model.Appointment.ParticipantRequired src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case REQUIRED: return org.hl7.fhir.r4.model.Appointment.ParticipantRequired.REQUIRED;
case OPTIONAL: return org.hl7.fhir.r4.model.Appointment.ParticipantRequired.OPTIONAL;
case INFORMATIONONLY: return org.hl7.fhir.r4.model.Appointment.ParticipantRequired.INFORMATIONONLY;
default: return org.hl7.fhir.r4.model.Appointment.ParticipantRequired.NULL;
}
}
public static org.hl7.fhir.r5.model.Appointment.ParticipationStatus convertParticipationStatus(org.hl7.fhir.r4.model.Appointment.ParticipationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACCEPTED: return org.hl7.fhir.r5.model.Appointment.ParticipationStatus.ACCEPTED;
case DECLINED: return org.hl7.fhir.r5.model.Appointment.ParticipationStatus.DECLINED;
case TENTATIVE: return org.hl7.fhir.r5.model.Appointment.ParticipationStatus.TENTATIVE;
case NEEDSACTION: return org.hl7.fhir.r5.model.Appointment.ParticipationStatus.NEEDSACTION;
default: return org.hl7.fhir.r5.model.Appointment.ParticipationStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Appointment.ParticipationStatus convertParticipationStatus(org.hl7.fhir.r5.model.Appointment.ParticipationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACCEPTED: return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.ACCEPTED;
case DECLINED: return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.DECLINED;
case TENTATIVE: return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.TENTATIVE;
case NEEDSACTION: return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NEEDSACTION;
default: return org.hl7.fhir.r4.model.Appointment.ParticipationStatus.NULL;
}
}
}

View File

@ -0,0 +1,115 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class AppointmentResponse extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.AppointmentResponse convertAppointmentResponse(org.hl7.fhir.r4.model.AppointmentResponse src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.AppointmentResponse tgt = new org.hl7.fhir.r5.model.AppointmentResponse();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasAppointment())
tgt.setAppointment(convertReference(src.getAppointment()));
if (src.hasStart())
tgt.setStartElement(convertInstant(src.getStartElement()));
if (src.hasEnd())
tgt.setEndElement(convertInstant(src.getEndElement()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getParticipantType())
tgt.addParticipantType(convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
if (src.hasParticipantStatus())
tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus()));
if (src.hasComment())
tgt.setCommentElement(convertString(src.getCommentElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.AppointmentResponse convertAppointmentResponse(org.hl7.fhir.r5.model.AppointmentResponse src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.AppointmentResponse tgt = new org.hl7.fhir.r4.model.AppointmentResponse();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasAppointment())
tgt.setAppointment(convertReference(src.getAppointment()));
if (src.hasStart())
tgt.setStartElement(convertInstant(src.getStartElement()));
if (src.hasEnd())
tgt.setEndElement(convertInstant(src.getEndElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getParticipantType())
tgt.addParticipantType(convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
if (src.hasParticipantStatus())
tgt.setParticipantStatus(convertParticipantStatus(src.getParticipantStatus()));
if (src.hasComment())
tgt.setCommentElement(convertString(src.getCommentElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.AppointmentResponse.ParticipantStatus convertParticipantStatus(org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACCEPTED: return org.hl7.fhir.r5.model.AppointmentResponse.ParticipantStatus.ACCEPTED;
case DECLINED: return org.hl7.fhir.r5.model.AppointmentResponse.ParticipantStatus.DECLINED;
case TENTATIVE: return org.hl7.fhir.r5.model.AppointmentResponse.ParticipantStatus.TENTATIVE;
case NEEDSACTION: return org.hl7.fhir.r5.model.AppointmentResponse.ParticipantStatus.NEEDSACTION;
default: return org.hl7.fhir.r5.model.AppointmentResponse.ParticipantStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus convertParticipantStatus(org.hl7.fhir.r5.model.AppointmentResponse.ParticipantStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACCEPTED: return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.ACCEPTED;
case DECLINED: return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.DECLINED;
case TENTATIVE: return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.TENTATIVE;
case NEEDSACTION: return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NEEDSACTION;
default: return org.hl7.fhir.r4.model.AppointmentResponse.ParticipantStatus.NULL;
}
}
}

View File

@ -0,0 +1,367 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class AuditEvent extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.AuditEvent convertAuditEvent(org.hl7.fhir.r4.model.AuditEvent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.AuditEvent tgt = new org.hl7.fhir.r5.model.AuditEvent();
copyDomainResource(src, tgt);
if (src.hasType())
tgt.setType(convertCoding(src.getType()));
for (org.hl7.fhir.r4.model.Coding t : src.getSubtype())
tgt.addSubtype(convertCoding(t));
if (src.hasAction())
tgt.setAction(convertAuditEventAction(src.getAction()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasRecorded())
tgt.setRecordedElement(convertInstant(src.getRecordedElement()));
if (src.hasOutcome())
tgt.setOutcome(convertAuditEventOutcome(src.getOutcome()));
if (src.hasOutcomeDesc())
tgt.setOutcomeDescElement(convertString(src.getOutcomeDescElement()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfEvent())
tgt.addPurposeOfEvent(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent t : src.getAgent())
tgt.addAgent(convertAuditEventAgentComponent(t));
if (src.hasSource())
tgt.setSource(convertAuditEventSourceComponent(src.getSource()));
for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent t : src.getEntity())
tgt.addEntity(convertAuditEventEntityComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.AuditEvent convertAuditEvent(org.hl7.fhir.r5.model.AuditEvent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.AuditEvent tgt = new org.hl7.fhir.r4.model.AuditEvent();
copyDomainResource(src, tgt);
if (src.hasType())
tgt.setType(convertCoding(src.getType()));
for (org.hl7.fhir.r5.model.Coding t : src.getSubtype())
tgt.addSubtype(convertCoding(t));
if (src.hasAction())
tgt.setAction(convertAuditEventAction(src.getAction()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasRecorded())
tgt.setRecordedElement(convertInstant(src.getRecordedElement()));
if (src.hasOutcome())
tgt.setOutcome(convertAuditEventOutcome(src.getOutcome()));
if (src.hasOutcomeDesc())
tgt.setOutcomeDescElement(convertString(src.getOutcomeDescElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfEvent())
tgt.addPurposeOfEvent(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;
}
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAction convertAuditEventAction(org.hl7.fhir.r4.model.AuditEvent.AuditEventAction src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case C: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.C;
case R: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.R;
case U: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.U;
case D: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.D;
case E: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.E;
default: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAction.NULL;
}
}
public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAction convertAuditEventAction(org.hl7.fhir.r5.model.AuditEvent.AuditEventAction src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case C: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.C;
case R: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.R;
case U: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.U;
case D: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.D;
case E: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.E;
default: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAction.NULL;
}
}
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome convertAuditEventOutcome(org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case _0: return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome._0;
case _4: return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome._4;
case _8: return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome._8;
case _12: return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome._12;
default: return org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome.NULL;
}
}
public static org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome convertAuditEventOutcome(org.hl7.fhir.r5.model.AuditEvent.AuditEventOutcome src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case _0: return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._0;
case _4: return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._4;
case _8: return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._8;
case _12: return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome._12;
default: return org.hl7.fhir.r4.model.AuditEvent.AuditEventOutcome.NULL;
}
}
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRole())
tgt.addRole(convertCodeableConcept(t));
if (src.hasWho())
tgt.setWho(convertReference(src.getWho()));
if (src.hasAltId())
tgt.setAltIdElement(convertString(src.getAltIdElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasRequestor())
tgt.setRequestorElement(convertBoolean(src.getRequestorElement()));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
for (org.hl7.fhir.r4.model.UriType t : src.getPolicy())
tgt.getPolicy().add(convertUri(t));
if (src.hasMedia())
tgt.setMedia(convertCoding(src.getMedia()));
if (src.hasNetwork())
tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfUse())
tgt.addPurposeOfUse(convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRole())
tgt.addRole(convertCodeableConcept(t));
if (src.hasWho())
tgt.setWho(convertReference(src.getWho()));
if (src.hasAltId())
tgt.setAltIdElement(convertString(src.getAltIdElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasRequestor())
tgt.setRequestorElement(convertBoolean(src.getRequestorElement()));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
for (org.hl7.fhir.r5.model.UriType t : src.getPolicy())
tgt.getPolicy().add(convertUri(t));
if (src.hasMedia())
tgt.setMedia(convertCoding(src.getMedia()));
if (src.hasNetwork())
tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfUse())
tgt.addPurposeOfUse(convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasAddress())
tgt.setAddressElement(convertString(src.getAddressElement()));
if (src.hasType())
tgt.setType(convertAuditEventAgentNetworkType(src.getType()));
return tgt;
}
public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent();
copyElement(src, tgt);
if (src.hasAddress())
tgt.setAddressElement(convertString(src.getAddressElement()));
if (src.hasType())
tgt.setType(convertAuditEventAgentNetworkType(src.getType()));
return tgt;
}
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType convertAuditEventAgentNetworkType(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case _1: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._1;
case _2: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._2;
case _3: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._3;
case _4: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._4;
case _5: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._5;
default: return org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType.NULL;
}
}
public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType convertAuditEventAgentNetworkType(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case _1: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._1;
case _2: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._2;
case _3: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._3;
case _4: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._4;
case _5: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._5;
default: return org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType.NULL;
}
}
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasSite())
tgt.setSiteElement(convertString(src.getSiteElement()));
if (src.hasObserver())
tgt.setObserver(convertReference(src.getObserver()));
for (org.hl7.fhir.r4.model.Coding t : src.getType())
tgt.addType(convertCoding(t));
return tgt;
}
public static org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent();
copyElement(src, tgt);
if (src.hasSite())
tgt.setSiteElement(convertString(src.getSiteElement()));
if (src.hasObserver())
tgt.setObserver(convertReference(src.getObserver()));
for (org.hl7.fhir.r5.model.Coding t : src.getType())
tgt.addType(convertCoding(t));
return tgt;
}
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasWhat())
tgt.setWhat(convertReference(src.getWhat()));
if (src.hasType())
tgt.setType(convertCoding(src.getType()));
if (src.hasRole())
tgt.setRole(convertCoding(src.getRole()));
if (src.hasLifecycle())
tgt.setLifecycle(convertCoding(src.getLifecycle()));
for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel())
tgt.addSecurityLabel(convertCoding(t));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasQuery())
tgt.setQueryElement(convertBase64Binary(src.getQueryElement()));
for (org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail())
tgt.addDetail(convertAuditEventEntityDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityComponent();
copyElement(src, tgt);
if (src.hasWhat())
tgt.setWhat(convertReference(src.getWhat()));
if (src.hasType())
tgt.setType(convertCoding(src.getType()));
if (src.hasRole())
tgt.setRole(convertCoding(src.getRole()));
if (src.hasLifecycle())
tgt.setLifecycle(convertCoding(src.getLifecycle()));
for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel())
tgt.addSecurityLabel(convertCoding(t));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasQuery())
tgt.setQueryElement(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.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertString(src.getTypeElement()));
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertString(src.getTypeElement()));
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
return tgt;
}
}

View File

@ -0,0 +1,79 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Basic extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Basic convertBasic(org.hl7.fhir.r4.model.Basic src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Basic tgt = new org.hl7.fhir.r5.model.Basic();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasCreated())
tgt.setCreatedElement(convertDate(src.getCreatedElement()));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
return tgt;
}
public static org.hl7.fhir.r4.model.Basic convertBasic(org.hl7.fhir.r5.model.Basic src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Basic tgt = new org.hl7.fhir.r4.model.Basic();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasCreated())
tgt.setCreatedElement(convertDate(src.getCreatedElement()));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
return tgt;
}
}

View File

@ -0,0 +1,71 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Binary extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Binary convertBinary(org.hl7.fhir.r4.model.Binary src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Binary tgt = new org.hl7.fhir.r5.model.Binary();
copyResource(src, tgt);
if (src.hasContentType())
tgt.setContentTypeElement(convertCode(src.getContentTypeElement()));
if (src.hasSecurityContext())
tgt.setSecurityContext(convertReference(src.getSecurityContext()));
if (src.hasData())
tgt.setDataElement(convertBase64Binary(src.getDataElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Binary convertBinary(org.hl7.fhir.r5.model.Binary src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Binary tgt = new org.hl7.fhir.r4.model.Binary();
copyResource(src, tgt);
if (src.hasContentType())
tgt.setContentTypeElement(convertCode(src.getContentTypeElement()));
if (src.hasSecurityContext())
tgt.setSecurityContext(convertReference(src.getSecurityContext()));
if (src.hasData())
tgt.setDataElement(convertBase64Binary(src.getDataElement()));
return tgt;
}
}

View File

@ -0,0 +1,287 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class BiologicallyDerivedProduct extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct convertBiologicallyDerivedProduct(org.hl7.fhir.r4.model.BiologicallyDerivedProduct src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.BiologicallyDerivedProduct tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasProductCategory())
tgt.setProductCategory(convertBiologicallyDerivedProductCategory(src.getProductCategory()));
if (src.hasProductCode())
tgt.setProductCode(convertCodeableConcept(src.getProductCode()));
if (src.hasStatus())
tgt.setStatus(convertBiologicallyDerivedProductStatus(src.getStatus()));
for (org.hl7.fhir.r4.model.Reference t : src.getRequest())
tgt.addRequest(convertReference(t));
if (src.hasQuantity())
tgt.setQuantityElement(convertInteger(src.getQuantityElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getParent())
tgt.addParent(convertReference(t));
if (src.hasCollection())
tgt.setCollection(convertBiologicallyDerivedProductCollectionComponent(src.getCollection()));
for (org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent t : src.getProcessing())
tgt.addProcessing(convertBiologicallyDerivedProductProcessingComponent(t));
if (src.hasManipulation())
tgt.setManipulation(convertBiologicallyDerivedProductManipulationComponent(src.getManipulation()));
for (org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent t : src.getStorage())
tgt.addStorage(convertBiologicallyDerivedProductStorageComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct convertBiologicallyDerivedProduct(org.hl7.fhir.r5.model.BiologicallyDerivedProduct src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.BiologicallyDerivedProduct tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasProductCategory())
tgt.setProductCategory(convertBiologicallyDerivedProductCategory(src.getProductCategory()));
if (src.hasProductCode())
tgt.setProductCode(convertCodeableConcept(src.getProductCode()));
if (src.hasStatus())
tgt.setStatus(convertBiologicallyDerivedProductStatus(src.getStatus()));
for (org.hl7.fhir.r5.model.Reference t : src.getRequest())
tgt.addRequest(convertReference(t));
if (src.hasQuantity())
tgt.setQuantityElement(convertInteger(src.getQuantityElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getParent())
tgt.addParent(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;
}
public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory convertBiologicallyDerivedProductCategory(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ORGAN: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.ORGAN;
case TISSUE: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.TISSUE;
case FLUID: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.FLUID;
case CELLS: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.CELLS;
case BIOLOGICALAGENT: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.BIOLOGICALAGENT;
default: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.NULL;
}
}
public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory convertBiologicallyDerivedProductCategory(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ORGAN: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.ORGAN;
case TISSUE: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.TISSUE;
case FLUID: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.FLUID;
case CELLS: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.CELLS;
case BIOLOGICALAGENT: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.BIOLOGICALAGENT;
default: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.NULL;
}
}
public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus convertBiologicallyDerivedProductStatus(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case AVAILABLE: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.AVAILABLE;
case UNAVAILABLE: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.UNAVAILABLE;
default: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus convertBiologicallyDerivedProductStatus(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case AVAILABLE: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.AVAILABLE;
case UNAVAILABLE: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.UNAVAILABLE;
default: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent convertBiologicallyDerivedProductCollectionComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasCollector())
tgt.setCollector(convertReference(src.getCollector()));
if (src.hasSource())
tgt.setSource(convertReference(src.getSource()));
if (src.hasCollected())
tgt.setCollected(convertType(src.getCollected()));
return tgt;
}
public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent convertBiologicallyDerivedProductCollectionComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent();
copyElement(src, tgt);
if (src.hasCollector())
tgt.setCollector(convertReference(src.getCollector()));
if (src.hasSource())
tgt.setSource(convertReference(src.getSource()));
if (src.hasCollected())
tgt.setCollected(convertType(src.getCollected()));
return tgt;
}
public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent convertBiologicallyDerivedProductProcessingComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasProcedure())
tgt.setProcedure(convertCodeableConcept(src.getProcedure()));
if (src.hasAdditive())
tgt.setAdditive(convertReference(src.getAdditive()));
if (src.hasTime())
tgt.setTime(convertType(src.getTime()));
return tgt;
}
public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent convertBiologicallyDerivedProductProcessingComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasProcedure())
tgt.setProcedure(convertCodeableConcept(src.getProcedure()));
if (src.hasAdditive())
tgt.setAdditive(convertReference(src.getAdditive()));
if (src.hasTime())
tgt.setTime(convertType(src.getTime()));
return tgt;
}
public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent convertBiologicallyDerivedProductManipulationComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasTime())
tgt.setTime(convertType(src.getTime()));
return tgt;
}
public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent convertBiologicallyDerivedProductManipulationComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasTime())
tgt.setTime(convertType(src.getTime()));
return tgt;
}
public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent convertBiologicallyDerivedProductStorageComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasTemperature())
tgt.setTemperatureElement(convertDecimal(src.getTemperatureElement()));
if (src.hasScale())
tgt.setScale(convertBiologicallyDerivedProductStorageScale(src.getScale()));
if (src.hasDuration())
tgt.setDuration(convertPeriod(src.getDuration()));
return tgt;
}
public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent convertBiologicallyDerivedProductStorageComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasTemperature())
tgt.setTemperatureElement(convertDecimal(src.getTemperatureElement()));
if (src.hasScale())
tgt.setScale(convertBiologicallyDerivedProductStorageScale(src.getScale()));
if (src.hasDuration())
tgt.setDuration(convertPeriod(src.getDuration()));
return tgt;
}
public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale convertBiologicallyDerivedProductStorageScale(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case FARENHEIT: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.FARENHEIT;
case CELSIUS: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.CELSIUS;
case KELVIN: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.KELVIN;
default: return org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL;
}
}
public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale convertBiologicallyDerivedProductStorageScale(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case FARENHEIT: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.FARENHEIT;
case CELSIUS: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.CELSIUS;
case KELVIN: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.KELVIN;
default: return org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL;
}
}
}

View File

@ -0,0 +1,91 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class BodyStructure extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.BodyStructure convertBodyStructure(org.hl7.fhir.r4.model.BodyStructure src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.BodyStructure tgt = new org.hl7.fhir.r5.model.BodyStructure();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasActive())
tgt.setActiveElement(convertBoolean(src.getActiveElement()));
if (src.hasMorphology())
tgt.setMorphology(convertCodeableConcept(src.getMorphology()));
if (src.hasLocation())
tgt.setLocation(convertCodeableConcept(src.getLocation()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getLocationQualifier())
tgt.addLocationQualifier(convertCodeableConcept(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.Attachment t : src.getImage())
tgt.addImage(convertAttachment(t));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
return tgt;
}
public static org.hl7.fhir.r4.model.BodyStructure convertBodyStructure(org.hl7.fhir.r5.model.BodyStructure src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.BodyStructure tgt = new org.hl7.fhir.r4.model.BodyStructure();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasActive())
tgt.setActiveElement(convertBoolean(src.getActiveElement()));
if (src.hasMorphology())
tgt.setMorphology(convertCodeableConcept(src.getMorphology()));
if (src.hasLocation())
tgt.setLocation(convertCodeableConcept(src.getLocation()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLocationQualifier())
tgt.addLocationQualifier(convertCodeableConcept(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.Attachment t : src.getImage())
tgt.addImage(convertAttachment(t));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
return tgt;
}
}

View File

@ -0,0 +1,335 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Bundle extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Bundle convertBundle(org.hl7.fhir.r4.model.Bundle src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Bundle tgt = new org.hl7.fhir.r5.model.Bundle();
copyResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasType())
tgt.setType(convertBundleType(src.getType()));
if (src.hasTimestamp())
tgt.setTimestampElement(convertInstant(src.getTimestampElement()));
if (src.hasTotal())
tgt.setTotalElement(convertUnsignedInt(src.getTotalElement()));
for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink())
tgt.addLink(convertBundleLinkComponent(t));
for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent t : src.getEntry())
tgt.addEntry(convertBundleEntryComponent(t));
if (src.hasSignature())
tgt.setSignature(convertSignature(src.getSignature()));
return tgt;
}
public static org.hl7.fhir.r4.model.Bundle convertBundle(org.hl7.fhir.r5.model.Bundle src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Bundle tgt = new org.hl7.fhir.r4.model.Bundle();
copyResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasType())
tgt.setType(convertBundleType(src.getType()));
if (src.hasTimestamp())
tgt.setTimestampElement(convertInstant(src.getTimestampElement()));
if (src.hasTotal())
tgt.setTotalElement(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(convertSignature(src.getSignature()));
return tgt;
}
public static org.hl7.fhir.r5.model.Bundle.BundleType convertBundleType(org.hl7.fhir.r4.model.Bundle.BundleType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DOCUMENT: return org.hl7.fhir.r5.model.Bundle.BundleType.DOCUMENT;
case MESSAGE: return org.hl7.fhir.r5.model.Bundle.BundleType.MESSAGE;
case TRANSACTION: return org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTION;
case TRANSACTIONRESPONSE: return org.hl7.fhir.r5.model.Bundle.BundleType.TRANSACTIONRESPONSE;
case BATCH: return org.hl7.fhir.r5.model.Bundle.BundleType.BATCH;
case BATCHRESPONSE: return org.hl7.fhir.r5.model.Bundle.BundleType.BATCHRESPONSE;
case HISTORY: return org.hl7.fhir.r5.model.Bundle.BundleType.HISTORY;
case SEARCHSET: return org.hl7.fhir.r5.model.Bundle.BundleType.SEARCHSET;
case COLLECTION: return org.hl7.fhir.r5.model.Bundle.BundleType.COLLECTION;
default: return org.hl7.fhir.r5.model.Bundle.BundleType.NULL;
}
}
public static org.hl7.fhir.r4.model.Bundle.BundleType convertBundleType(org.hl7.fhir.r5.model.Bundle.BundleType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DOCUMENT: return org.hl7.fhir.r4.model.Bundle.BundleType.DOCUMENT;
case MESSAGE: return org.hl7.fhir.r4.model.Bundle.BundleType.MESSAGE;
case TRANSACTION: return org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION;
case TRANSACTIONRESPONSE: return org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTIONRESPONSE;
case BATCH: return org.hl7.fhir.r4.model.Bundle.BundleType.BATCH;
case BATCHRESPONSE: return org.hl7.fhir.r4.model.Bundle.BundleType.BATCHRESPONSE;
case HISTORY: return org.hl7.fhir.r4.model.Bundle.BundleType.HISTORY;
case SEARCHSET: return org.hl7.fhir.r4.model.Bundle.BundleType.SEARCHSET;
case COLLECTION: return org.hl7.fhir.r4.model.Bundle.BundleType.COLLECTION;
default: return org.hl7.fhir.r4.model.Bundle.BundleType.NULL;
}
}
public static org.hl7.fhir.r5.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasRelation())
tgt.setRelationElement(convertString(src.getRelationElement()));
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.r5.model.Bundle.BundleLinkComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleLinkComponent();
copyElement(src, tgt);
if (src.hasRelation())
tgt.setRelationElement(convertString(src.getRelationElement()));
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink())
tgt.addLink(convertBundleLinkComponent(t));
if (src.hasFullUrl())
tgt.setFullUrlElement(convertUri(src.getFullUrlElement()));
if (src.hasResource())
tgt.setResource(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.r4.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink())
tgt.addLink(convertBundleLinkComponent(t));
if (src.hasFullUrl())
tgt.setFullUrlElement(convertUri(src.getFullUrlElement()));
if (src.hasResource())
tgt.setResource(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.r4.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();
copyElement(src, tgt);
if (src.hasMode())
tgt.setMode(convertSearchEntryMode(src.getMode()));
if (src.hasScore())
tgt.setScoreElement(convertDecimal(src.getScoreElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntrySearchComponent();
copyElement(src, tgt);
if (src.hasMode())
tgt.setMode(convertSearchEntryMode(src.getMode()));
if (src.hasScore())
tgt.setScoreElement(convertDecimal(src.getScoreElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Bundle.SearchEntryMode convertSearchEntryMode(org.hl7.fhir.r4.model.Bundle.SearchEntryMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case MATCH: return org.hl7.fhir.r5.model.Bundle.SearchEntryMode.MATCH;
case INCLUDE: return org.hl7.fhir.r5.model.Bundle.SearchEntryMode.INCLUDE;
case OUTCOME: return org.hl7.fhir.r5.model.Bundle.SearchEntryMode.OUTCOME;
default: return org.hl7.fhir.r5.model.Bundle.SearchEntryMode.NULL;
}
}
public static org.hl7.fhir.r4.model.Bundle.SearchEntryMode convertSearchEntryMode(org.hl7.fhir.r5.model.Bundle.SearchEntryMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case MATCH: return org.hl7.fhir.r4.model.Bundle.SearchEntryMode.MATCH;
case INCLUDE: return org.hl7.fhir.r4.model.Bundle.SearchEntryMode.INCLUDE;
case OUTCOME: return org.hl7.fhir.r4.model.Bundle.SearchEntryMode.OUTCOME;
default: return org.hl7.fhir.r4.model.Bundle.SearchEntryMode.NULL;
}
}
public static org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasMethod())
tgt.setMethod(convertHTTPVerb(src.getMethod()));
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
if (src.hasIfNoneMatch())
tgt.setIfNoneMatchElement(convertString(src.getIfNoneMatchElement()));
if (src.hasIfModifiedSince())
tgt.setIfModifiedSinceElement(convertInstant(src.getIfModifiedSinceElement()));
if (src.hasIfMatch())
tgt.setIfMatchElement(convertString(src.getIfMatchElement()));
if (src.hasIfNoneExist())
tgt.setIfNoneExistElement(convertString(src.getIfNoneExistElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent();
copyElement(src, tgt);
if (src.hasMethod())
tgt.setMethod(convertHTTPVerb(src.getMethod()));
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
if (src.hasIfNoneMatch())
tgt.setIfNoneMatchElement(convertString(src.getIfNoneMatchElement()));
if (src.hasIfModifiedSince())
tgt.setIfModifiedSinceElement(convertInstant(src.getIfModifiedSinceElement()));
if (src.hasIfMatch())
tgt.setIfMatchElement(convertString(src.getIfMatchElement()));
if (src.hasIfNoneExist())
tgt.setIfNoneExistElement(convertString(src.getIfNoneExistElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Bundle.HTTPVerb convertHTTPVerb(org.hl7.fhir.r4.model.Bundle.HTTPVerb src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case GET: return org.hl7.fhir.r5.model.Bundle.HTTPVerb.GET;
case HEAD: return org.hl7.fhir.r5.model.Bundle.HTTPVerb.HEAD;
case POST: return org.hl7.fhir.r5.model.Bundle.HTTPVerb.POST;
case PUT: return org.hl7.fhir.r5.model.Bundle.HTTPVerb.PUT;
case DELETE: return org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE;
case PATCH: return org.hl7.fhir.r5.model.Bundle.HTTPVerb.PATCH;
default: return org.hl7.fhir.r5.model.Bundle.HTTPVerb.NULL;
}
}
public static org.hl7.fhir.r4.model.Bundle.HTTPVerb convertHTTPVerb(org.hl7.fhir.r5.model.Bundle.HTTPVerb src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case GET: return org.hl7.fhir.r4.model.Bundle.HTTPVerb.GET;
case HEAD: return org.hl7.fhir.r4.model.Bundle.HTTPVerb.HEAD;
case POST: return org.hl7.fhir.r4.model.Bundle.HTTPVerb.POST;
case PUT: return org.hl7.fhir.r4.model.Bundle.HTTPVerb.PUT;
case DELETE: return org.hl7.fhir.r4.model.Bundle.HTTPVerb.DELETE;
case PATCH: return org.hl7.fhir.r4.model.Bundle.HTTPVerb.PATCH;
default: return org.hl7.fhir.r4.model.Bundle.HTTPVerb.NULL;
}
}
public static org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasStatus())
tgt.setStatusElement(convertString(src.getStatusElement()));
if (src.hasLocation())
tgt.setLocationElement(convertUri(src.getLocationElement()));
if (src.hasEtag())
tgt.setEtagElement(convertString(src.getEtagElement()));
if (src.hasLastModified())
tgt.setLastModifiedElement(convertInstant(src.getLastModifiedElement()));
if (src.hasOutcome())
tgt.setOutcome(convertResource(src.getOutcome()));
return tgt;
}
public static org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent();
copyElement(src, tgt);
if (src.hasStatus())
tgt.setStatusElement(convertString(src.getStatusElement()));
if (src.hasLocation())
tgt.setLocationElement(convertUri(src.getLocationElement()));
if (src.hasEtag())
tgt.setEtagElement(convertString(src.getEtagElement()));
if (src.hasLastModified())
tgt.setLastModifiedElement(convertInstant(src.getLastModifiedElement()));
if (src.hasOutcome())
tgt.setOutcome(convertResource(src.getOutcome()));
return tgt;
}
}

View File

@ -0,0 +1,829 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CapabilityStatement extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.CapabilityStatement convertCapabilityStatement(org.hl7.fhir.r4.model.CapabilityStatement src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CapabilityStatement tgt = new org.hl7.fhir.r5.model.CapabilityStatement();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasKind())
tgt.setKind(convertCapabilityStatementKind(src.getKind()));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiates())
tgt.getInstantiates().add(convertCanonical(t));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getImports())
tgt.getImports().add(convertCanonical(t));
if (src.hasSoftware())
tgt.setSoftware(convertCapabilityStatementSoftwareComponent(src.getSoftware()));
if (src.hasImplementation())
tgt.setImplementation(convertCapabilityStatementImplementationComponent(src.getImplementation()));
if (src.hasFhirVersion())
tgt.setFhirVersion(Enumerations.convertFHIRVersion(src.getFhirVersion()));
for (org.hl7.fhir.r4.model.CodeType t : src.getFormat())
tgt.getFormat().add(convertCode(t));
for (org.hl7.fhir.r4.model.CodeType t : src.getPatchFormat())
tgt.getPatchFormat().add(convertCode(t));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getImplementationGuide())
tgt.getImplementationGuide().add(convertCanonical(t));
for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest())
tgt.addRest(convertCapabilityStatementRestComponent(t));
for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging())
tgt.addMessaging(convertCapabilityStatementMessagingComponent(t));
for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument())
tgt.addDocument(convertCapabilityStatementDocumentComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CapabilityStatement convertCapabilityStatement(org.hl7.fhir.r5.model.CapabilityStatement src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CapabilityStatement tgt = new org.hl7.fhir.r4.model.CapabilityStatement();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasKind())
tgt.setKind(convertCapabilityStatementKind(src.getKind()));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiates())
tgt.getInstantiates().add(convertCanonical(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getImports())
tgt.getImports().add(convertCanonical(t));
if (src.hasSoftware())
tgt.setSoftware(convertCapabilityStatementSoftwareComponent(src.getSoftware()));
if (src.hasImplementation())
tgt.setImplementation(convertCapabilityStatementImplementationComponent(src.getImplementation()));
if (src.hasFhirVersion())
tgt.setFhirVersion(Enumerations.convertFHIRVersion(src.getFhirVersion()));
for (org.hl7.fhir.r5.model.CodeType t : src.getFormat())
tgt.getFormat().add(convertCode(t));
for (org.hl7.fhir.r5.model.CodeType t : src.getPatchFormat())
tgt.getPatchFormat().add(convertCode(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getImplementationGuide())
tgt.getImplementationGuide().add(convertCanonical(t));
for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent t : src.getRest())
tgt.addRest(convertCapabilityStatementRestComponent(t));
for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent t : src.getMessaging())
tgt.addMessaging(convertCapabilityStatementMessagingComponent(t));
for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent t : src.getDocument())
tgt.addDocument(convertCapabilityStatementDocumentComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementKind convertCapabilityStatementKind(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case INSTANCE: return org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementKind.INSTANCE;
case CAPABILITY: return org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY;
case REQUIREMENTS: return org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS;
default: return org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementKind.NULL;
}
}
public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind convertCapabilityStatementKind(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementKind src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case INSTANCE: return org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.INSTANCE;
case CAPABILITY: return org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.CAPABILITY;
case REQUIREMENTS: return org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.REQUIREMENTS;
default: return org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementKind.NULL;
}
}
public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent convertCapabilityStatementSoftwareComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent();
copyElement(src, tgt);
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasReleaseDate())
tgt.setReleaseDateElement(convertDateTime(src.getReleaseDateElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent convertCapabilityStatementSoftwareComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementSoftwareComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementSoftwareComponent();
copyElement(src, tgt);
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasReleaseDate())
tgt.setReleaseDateElement(convertDateTime(src.getReleaseDateElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent convertCapabilityStatementImplementationComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasUrl())
tgt.setUrlElement(convertUrl(src.getUrlElement()));
if (src.hasCustodian())
tgt.setCustodian(convertReference(src.getCustodian()));
return tgt;
}
public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent convertCapabilityStatementImplementationComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementImplementationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementImplementationComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasUrl())
tgt.setUrlElement(convertUrl(src.getUrlElement()));
if (src.hasCustodian())
tgt.setCustodian(convertReference(src.getCustodian()));
return tgt;
}
public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent convertCapabilityStatementRestComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent();
copyElement(src, tgt);
if (src.hasMode())
tgt.setMode(convertRestfulCapabilityMode(src.getMode()));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
if (src.hasSecurity())
tgt.setSecurity(convertCapabilityStatementRestSecurityComponent(src.getSecurity()));
for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource())
tgt.addResource(convertCapabilityStatementRestResourceComponent(t));
for (org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction())
tgt.addInteraction(convertSystemInteractionComponent(t));
for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam())
tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t));
for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation())
tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getCompartment())
tgt.getCompartment().add(convertCanonical(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent convertCapabilityStatementRestComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent();
copyElement(src, tgt);
if (src.hasMode())
tgt.setMode(convertRestfulCapabilityMode(src.getMode()));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
if (src.hasSecurity())
tgt.setSecurity(convertCapabilityStatementRestSecurityComponent(src.getSecurity()));
for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent t : src.getResource())
tgt.addResource(convertCapabilityStatementRestResourceComponent(t));
for (org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent t : src.getInteraction())
tgt.addInteraction(convertSystemInteractionComponent(t));
for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam())
tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t));
for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation())
tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getCompartment())
tgt.getCompartment().add(convertCanonical(t));
return tgt;
}
public static org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode convertRestfulCapabilityMode(org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case CLIENT: return org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.CLIENT;
case SERVER: return org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.SERVER;
default: return org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode.NULL;
}
}
public static org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode convertRestfulCapabilityMode(org.hl7.fhir.r5.model.CapabilityStatement.RestfulCapabilityMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case CLIENT: return org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.CLIENT;
case SERVER: return org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.SERVER;
default: return org.hl7.fhir.r4.model.CapabilityStatement.RestfulCapabilityMode.NULL;
}
}
public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent convertCapabilityStatementRestSecurityComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent();
copyElement(src, tgt);
if (src.hasCors())
tgt.setCorsElement(convertBoolean(src.getCorsElement()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getService())
tgt.addService(convertCodeableConcept(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent convertCapabilityStatementRestSecurityComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestSecurityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestSecurityComponent();
copyElement(src, tgt);
if (src.hasCors())
tgt.setCorsElement(convertBoolean(src.getCorsElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getService())
tgt.addService(convertCodeableConcept(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent convertCapabilityStatementRestResourceComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertCode(src.getTypeElement()));
if (src.hasProfile())
tgt.setProfileElement(convertCanonical(src.getProfileElement()));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getSupportedProfile())
tgt.getSupportedProfile().add(convertCanonical(t));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
for (org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction())
tgt.addInteraction(convertResourceInteractionComponent(t));
if (src.hasVersioning())
tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning()));
if (src.hasReadHistory())
tgt.setReadHistoryElement(convertBoolean(src.getReadHistoryElement()));
if (src.hasUpdateCreate())
tgt.setUpdateCreateElement(convertBoolean(src.getUpdateCreateElement()));
if (src.hasConditionalCreate())
tgt.setConditionalCreateElement(convertBoolean(src.getConditionalCreateElement()));
if (src.hasConditionalRead())
tgt.setConditionalRead(convertConditionalReadStatus(src.getConditionalRead()));
if (src.hasConditionalUpdate())
tgt.setConditionalUpdateElement(convertBoolean(src.getConditionalUpdateElement()));
if (src.hasConditionalDelete())
tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete()));
for (org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy> t : src.getReferencePolicy())
tgt.addReferencePolicy(convertReferenceHandlingPolicy(t.getValue()));
for (org.hl7.fhir.r4.model.StringType t : src.getSearchInclude())
tgt.getSearchInclude().add(convertString(t));
for (org.hl7.fhir.r4.model.StringType t : src.getSearchRevInclude())
tgt.getSearchRevInclude().add(convertString(t));
for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam())
tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t));
for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation())
tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent convertCapabilityStatementRestResourceComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertCode(src.getTypeElement()));
if (src.hasProfile())
tgt.setProfileElement(convertCanonical(src.getProfileElement()));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getSupportedProfile())
tgt.getSupportedProfile().add(convertCanonical(t));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
for (org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent t : src.getInteraction())
tgt.addInteraction(convertResourceInteractionComponent(t));
if (src.hasVersioning())
tgt.setVersioning(convertResourceVersionPolicy(src.getVersioning()));
if (src.hasReadHistory())
tgt.setReadHistoryElement(convertBoolean(src.getReadHistoryElement()));
if (src.hasUpdateCreate())
tgt.setUpdateCreateElement(convertBoolean(src.getUpdateCreateElement()));
if (src.hasConditionalCreate())
tgt.setConditionalCreateElement(convertBoolean(src.getConditionalCreateElement()));
if (src.hasConditionalRead())
tgt.setConditionalRead(convertConditionalReadStatus(src.getConditionalRead()));
if (src.hasConditionalUpdate())
tgt.setConditionalUpdateElement(convertBoolean(src.getConditionalUpdateElement()));
if (src.hasConditionalDelete())
tgt.setConditionalDelete(convertConditionalDeleteStatus(src.getConditionalDelete()));
for (org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy> t : src.getReferencePolicy())
tgt.addReferencePolicy(convertReferenceHandlingPolicy(t.getValue()));
for (org.hl7.fhir.r5.model.StringType t : src.getSearchInclude())
tgt.getSearchInclude().add(convertString(t));
for (org.hl7.fhir.r5.model.StringType t : src.getSearchRevInclude())
tgt.getSearchRevInclude().add(convertString(t));
for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent t : src.getSearchParam())
tgt.addSearchParam(convertCapabilityStatementRestResourceSearchParamComponent(t));
for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent t : src.getOperation())
tgt.addOperation(convertCapabilityStatementRestResourceOperationComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy convertResourceVersionPolicy(org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case NOVERSION: return org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION;
case VERSIONED: return org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED;
case VERSIONEDUPDATE: return org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE;
default: return org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy.NULL;
}
}
public static org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy convertResourceVersionPolicy(org.hl7.fhir.r5.model.CapabilityStatement.ResourceVersionPolicy src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case NOVERSION: return org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NOVERSION;
case VERSIONED: return org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONED;
case VERSIONEDUPDATE: return org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.VERSIONEDUPDATE;
default: return org.hl7.fhir.r4.model.CapabilityStatement.ResourceVersionPolicy.NULL;
}
}
public static org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus convertConditionalReadStatus(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case NOTSUPPORTED: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED;
case MODIFIEDSINCE: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE;
case NOTMATCH: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH;
case FULLSUPPORT: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT;
default: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus convertConditionalReadStatus(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalReadStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case NOTSUPPORTED: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NOTSUPPORTED;
case MODIFIEDSINCE: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.MODIFIEDSINCE;
case NOTMATCH: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NOTMATCH;
case FULLSUPPORT: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.FULLSUPPORT;
default: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalReadStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus convertConditionalDeleteStatus(org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case NOTSUPPORTED: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED;
case SINGLE: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE;
case MULTIPLE: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE;
default: return org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus convertConditionalDeleteStatus(org.hl7.fhir.r5.model.CapabilityStatement.ConditionalDeleteStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case NOTSUPPORTED: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NOTSUPPORTED;
case SINGLE: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.SINGLE;
case MULTIPLE: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.MULTIPLE;
default: return org.hl7.fhir.r4.model.CapabilityStatement.ConditionalDeleteStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy convertReferenceHandlingPolicy(org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case LITERAL: return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL;
case LOGICAL: return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL;
case RESOLVES: return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES;
case ENFORCED: return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED;
case LOCAL: return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL;
default: return org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy.NULL;
}
}
public static org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy convertReferenceHandlingPolicy(org.hl7.fhir.r5.model.CapabilityStatement.ReferenceHandlingPolicy src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case LITERAL: return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LITERAL;
case LOGICAL: return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LOGICAL;
case RESOLVES: return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.RESOLVES;
case ENFORCED: return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.ENFORCED;
case LOCAL: return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.LOCAL;
default: return org.hl7.fhir.r4.model.CapabilityStatement.ReferenceHandlingPolicy.NULL;
}
}
public static org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertTypeRestfulInteraction(src.getCode()));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent convertResourceInteractionComponent(org.hl7.fhir.r5.model.CapabilityStatement.ResourceInteractionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.ResourceInteractionComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertTypeRestfulInteraction(src.getCode()));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction convertTypeRestfulInteraction(org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case READ: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.READ;
case VREAD: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.VREAD;
case UPDATE: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.UPDATE;
case PATCH: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.PATCH;
case DELETE: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.DELETE;
case HISTORYINSTANCE: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE;
case HISTORYTYPE: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE;
case CREATE: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.CREATE;
case SEARCHTYPE: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE;
default: return org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction.NULL;
}
}
public static org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction convertTypeRestfulInteraction(org.hl7.fhir.r5.model.CapabilityStatement.TypeRestfulInteraction src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case READ: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.READ;
case VREAD: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.VREAD;
case UPDATE: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.UPDATE;
case PATCH: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.PATCH;
case DELETE: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.DELETE;
case HISTORYINSTANCE: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYINSTANCE;
case HISTORYTYPE: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.HISTORYTYPE;
case CREATE: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.CREATE;
case SEARCHTYPE: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.SEARCHTYPE;
default: return org.hl7.fhir.r4.model.CapabilityStatement.TypeRestfulInteraction.NULL;
}
}
public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent convertCapabilityStatementRestResourceSearchParamComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent();
copyElement(src, tgt);
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasDefinition())
tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement()));
if (src.hasType())
tgt.setType(Enumerations.convertSearchParamType(src.getType()));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent convertCapabilityStatementRestResourceSearchParamComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent();
copyElement(src, tgt);
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasDefinition())
tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement()));
if (src.hasType())
tgt.setType(Enumerations.convertSearchParamType(src.getType()));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent convertCapabilityStatementRestResourceOperationComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent();
copyElement(src, tgt);
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasDefinition())
tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement()));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent convertCapabilityStatementRestResourceOperationComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent();
copyElement(src, tgt);
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasDefinition())
tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement()));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertSystemRestfulInteraction(src.getCode()));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent convertSystemInteractionComponent(org.hl7.fhir.r5.model.CapabilityStatement.SystemInteractionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.SystemInteractionComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertSystemRestfulInteraction(src.getCode()));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction convertSystemRestfulInteraction(org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case TRANSACTION: return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION;
case BATCH: return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.BATCH;
case SEARCHSYSTEM: return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM;
case HISTORYSYSTEM: return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM;
default: return org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction.NULL;
}
}
public static org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction convertSystemRestfulInteraction(org.hl7.fhir.r5.model.CapabilityStatement.SystemRestfulInteraction src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case TRANSACTION: return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.TRANSACTION;
case BATCH: return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.BATCH;
case SEARCHSYSTEM: return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.SEARCHSYSTEM;
case HISTORYSYSTEM: return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.HISTORYSYSTEM;
default: return org.hl7.fhir.r4.model.CapabilityStatement.SystemRestfulInteraction.NULL;
}
}
public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent convertCapabilityStatementMessagingComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint())
tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t));
if (src.hasReliableCache())
tgt.setReliableCacheElement(convertUnsignedInt(src.getReliableCacheElement()));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage())
tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent convertCapabilityStatementMessagingComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent t : src.getEndpoint())
tgt.addEndpoint(convertCapabilityStatementMessagingEndpointComponent(t));
if (src.hasReliableCache())
tgt.setReliableCacheElement(convertUnsignedInt(src.getReliableCacheElement()));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent t : src.getSupportedMessage())
tgt.addSupportedMessage(convertCapabilityStatementMessagingSupportedMessageComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent convertCapabilityStatementMessagingEndpointComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent();
copyElement(src, tgt);
if (src.hasProtocol())
tgt.setProtocol(convertCoding(src.getProtocol()));
if (src.hasAddress())
tgt.setAddressElement(convertUrl(src.getAddressElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent convertCapabilityStatementMessagingEndpointComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingEndpointComponent();
copyElement(src, tgt);
if (src.hasProtocol())
tgt.setProtocol(convertCoding(src.getProtocol()));
if (src.hasAddress())
tgt.setAddressElement(convertUrl(src.getAddressElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent convertCapabilityStatementMessagingSupportedMessageComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent();
copyElement(src, tgt);
if (src.hasMode())
tgt.setMode(convertEventCapabilityMode(src.getMode()));
if (src.hasDefinition())
tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent convertCapabilityStatementMessagingSupportedMessageComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent();
copyElement(src, tgt);
if (src.hasMode())
tgt.setMode(convertEventCapabilityMode(src.getMode()));
if (src.hasDefinition())
tgt.setDefinitionElement(convertCanonical(src.getDefinitionElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode convertEventCapabilityMode(org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case SENDER: return org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.SENDER;
case RECEIVER: return org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.RECEIVER;
default: return org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode.NULL;
}
}
public static org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode convertEventCapabilityMode(org.hl7.fhir.r5.model.CapabilityStatement.EventCapabilityMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case SENDER: return org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.SENDER;
case RECEIVER: return org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.RECEIVER;
default: return org.hl7.fhir.r4.model.CapabilityStatement.EventCapabilityMode.NULL;
}
}
public static org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent convertCapabilityStatementDocumentComponent(org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent();
copyElement(src, tgt);
if (src.hasMode())
tgt.setMode(convertDocumentMode(src.getMode()));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
if (src.hasProfile())
tgt.setProfileElement(convertCanonical(src.getProfileElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent convertCapabilityStatementDocumentComponent(org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementDocumentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent tgt = new org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementDocumentComponent();
copyElement(src, tgt);
if (src.hasMode())
tgt.setMode(convertDocumentMode(src.getMode()));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertMarkdown(src.getDocumentationElement()));
if (src.hasProfile())
tgt.setProfileElement(convertCanonical(src.getProfileElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode convertDocumentMode(org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PRODUCER: return org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.PRODUCER;
case CONSUMER: return org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.CONSUMER;
default: return org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode.NULL;
}
}
public static org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode convertDocumentMode(org.hl7.fhir.r5.model.CapabilityStatement.DocumentMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PRODUCER: return org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.PRODUCER;
case CONSUMER: return org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.CONSUMER;
default: return org.hl7.fhir.r4.model.CapabilityStatement.DocumentMode.NULL;
}
}
}

View File

@ -0,0 +1,391 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CarePlan extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.CarePlan convertCarePlan(org.hl7.fhir.r4.model.CarePlan src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CarePlan tgt = new org.hl7.fhir.r5.model.CarePlan();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(convertCanonical(t));
for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(convertUri(t));
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReplaces())
tgt.addReplaces(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getPartOf())
tgt.addPartOf(convertReference(t));
if (src.hasStatus())
tgt.setStatus(convertCarePlanStatus(src.getStatus()));
if (src.hasIntent())
tgt.setIntent(convertCarePlanIntent(src.getIntent()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
for (org.hl7.fhir.r4.model.Reference t : src.getContributor())
tgt.addContributor(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getCareTeam())
tgt.addCareTeam(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getAddresses())
tgt.addAddresses(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getGoal())
tgt.addGoal(convertReference(t));
for (org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent t : src.getActivity())
tgt.addActivity(convertCarePlanActivityComponent(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CarePlan convertCarePlan(org.hl7.fhir.r5.model.CarePlan src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CarePlan tgt = new org.hl7.fhir.r4.model.CarePlan();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(convertCanonical(t));
for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(convertUri(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReplaces())
tgt.addReplaces(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getPartOf())
tgt.addPartOf(convertReference(t));
if (src.hasStatus())
tgt.setStatus(convertCarePlanStatus(src.getStatus()));
if (src.hasIntent())
tgt.setIntent(convertCarePlanIntent(src.getIntent()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
for (org.hl7.fhir.r5.model.Reference t : src.getContributor())
tgt.addContributor(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getCareTeam())
tgt.addCareTeam(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getAddresses())
tgt.addAddresses(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getGoal())
tgt.addGoal(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(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r5.model.CarePlan.CarePlanStatus convertCarePlanStatus(org.hl7.fhir.r4.model.CarePlan.CarePlanStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DRAFT: return org.hl7.fhir.r5.model.CarePlan.CarePlanStatus.DRAFT;
case ACTIVE: return org.hl7.fhir.r5.model.CarePlan.CarePlanStatus.ACTIVE;
case ONHOLD: return org.hl7.fhir.r5.model.CarePlan.CarePlanStatus.ONHOLD;
case REVOKED: return org.hl7.fhir.r5.model.CarePlan.CarePlanStatus.REVOKED;
case COMPLETED: return org.hl7.fhir.r5.model.CarePlan.CarePlanStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.CarePlan.CarePlanStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r5.model.CarePlan.CarePlanStatus.UNKNOWN;
default: return org.hl7.fhir.r5.model.CarePlan.CarePlanStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.CarePlan.CarePlanStatus convertCarePlanStatus(org.hl7.fhir.r5.model.CarePlan.CarePlanStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DRAFT: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.DRAFT;
case ACTIVE: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ACTIVE;
case ONHOLD: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ONHOLD;
case REVOKED: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.REVOKED;
case COMPLETED: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.UNKNOWN;
default: return org.hl7.fhir.r4.model.CarePlan.CarePlanStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.CarePlan.CarePlanIntent convertCarePlanIntent(org.hl7.fhir.r4.model.CarePlan.CarePlanIntent src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROPOSAL: return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PROPOSAL;
case PLAN: return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.PLAN;
case ORDER: return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.ORDER;
case OPTION: return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.OPTION;
default: return org.hl7.fhir.r5.model.CarePlan.CarePlanIntent.NULL;
}
}
public static org.hl7.fhir.r4.model.CarePlan.CarePlanIntent convertCarePlanIntent(org.hl7.fhir.r5.model.CarePlan.CarePlanIntent src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROPOSAL: return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.PROPOSAL;
case PLAN: return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.PLAN;
case ORDER: return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.ORDER;
case OPTION: return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.OPTION;
default: return org.hl7.fhir.r4.model.CarePlan.CarePlanIntent.NULL;
}
}
public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getOutcomeCodeableConcept())
tgt.addOutcomeCodeableConcept(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getOutcomeReference())
tgt.addOutcomeReference(convertReference(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getProgress())
tgt.addProgress(convertAnnotation(t));
if (src.hasReference())
tgt.setReference(convertReference(src.getReference()));
if (src.hasDetail())
tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail()));
return tgt;
}
public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.r4.model.CarePlan.CarePlanActivityComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getOutcomeCodeableConcept())
tgt.addOutcomeCodeableConcept(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getOutcomeReference())
tgt.addOutcomeReference(convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getProgress())
tgt.addProgress(convertAnnotation(t));
if (src.hasReference())
tgt.setReference(convertReference(src.getReference()));
if (src.hasDetail())
tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail()));
return tgt;
}
public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.r5.model.CarePlan.CarePlanActivityDetailComponent();
copyElement(src, tgt);
if (src.hasKind())
tgt.setKind(convertCarePlanActivityKind(src.getKind()));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(convertCanonical(t));
for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(convertUri(t));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getGoal())
tgt.addGoal(convertReference(t));
if (src.hasStatus())
tgt.setStatus(convertCarePlanActivityStatus(src.getStatus()));
if (src.hasStatusReason())
tgt.setStatusReason(convertCodeableConcept(src.getStatusReason()));
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement()));
if (src.hasScheduled())
tgt.setScheduled(convertType(src.getScheduled()));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
for (org.hl7.fhir.r4.model.Reference t : src.getPerformer())
tgt.addPerformer(convertReference(t));
if (src.hasProduct())
tgt.setProduct(convertType(src.getProduct()));
if (src.hasDailyAmount())
tgt.setDailyAmount(convertSimpleQuantity(src.getDailyAmount()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.r4.model.CarePlan.CarePlanActivityDetailComponent();
copyElement(src, tgt);
if (src.hasKind())
tgt.setKind(convertCarePlanActivityKind(src.getKind()));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(convertCanonical(t));
for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(convertUri(t));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getGoal())
tgt.addGoal(convertReference(t));
if (src.hasStatus())
tgt.setStatus(convertCarePlanActivityStatus(src.getStatus()));
if (src.hasStatusReason())
tgt.setStatusReason(convertCodeableConcept(src.getStatusReason()));
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement()));
if (src.hasScheduled())
tgt.setScheduled(convertType(src.getScheduled()));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
for (org.hl7.fhir.r5.model.Reference t : src.getPerformer())
tgt.addPerformer(convertReference(t));
if (src.hasProduct())
tgt.setProduct(convertType(src.getProduct()));
if (src.hasDailyAmount())
tgt.setDailyAmount(convertSimpleQuantity(src.getDailyAmount()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind convertCarePlanActivityKind(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case APPOINTMENT: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.APPOINTMENT;
case COMMUNICATIONREQUEST: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.COMMUNICATIONREQUEST;
case DEVICEREQUEST: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.DEVICEREQUEST;
case MEDICATIONREQUEST: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.MEDICATIONREQUEST;
case NUTRITIONORDER: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.NUTRITIONORDER;
case TASK: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.TASK;
case SERVICEREQUEST: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.SERVICEREQUEST;
case VISIONPRESCRIPTION: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.VISIONPRESCRIPTION;
default: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind.NULL;
}
}
public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind convertCarePlanActivityKind(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityKind src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case APPOINTMENT: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.APPOINTMENT;
case COMMUNICATIONREQUEST: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.COMMUNICATIONREQUEST;
case DEVICEREQUEST: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.DEVICEREQUEST;
case MEDICATIONREQUEST: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.MEDICATIONREQUEST;
case NUTRITIONORDER: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.NUTRITIONORDER;
case TASK: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.TASK;
case SERVICEREQUEST: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.SERVICEREQUEST;
case VISIONPRESCRIPTION: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.VISIONPRESCRIPTION;
default: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityKind.NULL;
}
}
public static org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus convertCarePlanActivityStatus(org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case NOTSTARTED: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.NOTSTARTED;
case SCHEDULED: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.SCHEDULED;
case INPROGRESS: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.INPROGRESS;
case ONHOLD: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.ONHOLD;
case COMPLETED: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.COMPLETED;
case CANCELLED: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.CANCELLED;
case STOPPED: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.STOPPED;
case UNKNOWN: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.UNKNOWN;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus convertCarePlanActivityStatus(org.hl7.fhir.r5.model.CarePlan.CarePlanActivityStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case NOTSTARTED: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.NOTSTARTED;
case SCHEDULED: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.SCHEDULED;
case INPROGRESS: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.INPROGRESS;
case ONHOLD: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.ONHOLD;
case COMPLETED: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.COMPLETED;
case CANCELLED: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.CANCELLED;
case STOPPED: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.STOPPED;
case UNKNOWN: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.UNKNOWN;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.CarePlan.CarePlanActivityStatus.NULL;
}
}
}

View File

@ -0,0 +1,169 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CareTeam extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.CareTeam convertCareTeam(org.hl7.fhir.r4.model.CareTeam src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CareTeam tgt = new org.hl7.fhir.r5.model.CareTeam();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertCareTeamStatus(src.getStatus()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertCareTeamParticipantComponent(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getManagingOrganization())
tgt.addManagingOrganization(convertReference(t));
for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(convertContactPoint(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CareTeam convertCareTeam(org.hl7.fhir.r5.model.CareTeam src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CareTeam tgt = new org.hl7.fhir.r4.model.CareTeam();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertCareTeamStatus(src.getStatus()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertCareTeamParticipantComponent(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getManagingOrganization())
tgt.addManagingOrganization(convertReference(t));
for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(convertContactPoint(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r5.model.CareTeam.CareTeamStatus convertCareTeamStatus(org.hl7.fhir.r4.model.CareTeam.CareTeamStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROPOSED: return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.PROPOSED;
case ACTIVE: return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ACTIVE;
case SUSPENDED: return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.SUSPENDED;
case INACTIVE: return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.INACTIVE;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.CareTeam.CareTeamStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.CareTeam.CareTeamStatus convertCareTeamStatus(org.hl7.fhir.r5.model.CareTeam.CareTeamStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROPOSED: return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.PROPOSED;
case ACTIVE: return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.ACTIVE;
case SUSPENDED: return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.SUSPENDED;
case INACTIVE: return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.INACTIVE;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.CareTeam.CareTeamStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent convertCareTeamParticipantComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRole())
tgt.addRole(convertCodeableConcept(t));
if (src.hasMember())
tgt.setMember(convertReference(src.getMember()));
if (src.hasOnBehalfOf())
tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent convertCareTeamParticipantComponent(org.hl7.fhir.r5.model.CareTeam.CareTeamParticipantComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent tgt = new org.hl7.fhir.r4.model.CareTeam.CareTeamParticipantComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRole())
tgt.addRole(convertCodeableConcept(t));
if (src.hasMember())
tgt.setMember(convertReference(src.getMember()));
if (src.hasOnBehalfOf())
tgt.setOnBehalfOf(convertReference(src.getOnBehalfOf()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
}

View File

@ -0,0 +1,155 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CatalogEntry extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.CatalogEntry convertCatalogEntry(org.hl7.fhir.r4.model.CatalogEntry src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CatalogEntry tgt = new org.hl7.fhir.r5.model.CatalogEntry();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasOrderable())
tgt.setOrderableElement(convertBoolean(src.getOrderableElement()));
if (src.hasReferencedItem())
tgt.setReferencedItem(convertReference(src.getReferencedItem()));
for (org.hl7.fhir.r4.model.Identifier t : src.getAdditionalIdentifier())
tgt.addAdditionalIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getClassification())
tgt.addClassification(convertCodeableConcept(t));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasValidityPeriod())
tgt.setValidityPeriod(convertPeriod(src.getValidityPeriod()));
if (src.hasValidTo())
tgt.setValidToElement(convertDateTime(src.getValidToElement()));
if (src.hasLastUpdated())
tgt.setLastUpdatedElement(convertDateTime(src.getLastUpdatedElement()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAdditionalCharacteristic())
tgt.addAdditionalCharacteristic(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAdditionalClassification())
tgt.addAdditionalClassification(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CatalogEntry.CatalogEntryRelatedEntryComponent t : src.getRelatedEntry())
tgt.addRelatedEntry(convertCatalogEntryRelatedEntryComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CatalogEntry convertCatalogEntry(org.hl7.fhir.r5.model.CatalogEntry src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CatalogEntry tgt = new org.hl7.fhir.r4.model.CatalogEntry();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasOrderable())
tgt.setOrderableElement(convertBoolean(src.getOrderableElement()));
if (src.hasReferencedItem())
tgt.setReferencedItem(convertReference(src.getReferencedItem()));
for (org.hl7.fhir.r5.model.Identifier t : src.getAdditionalIdentifier())
tgt.addAdditionalIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getClassification())
tgt.addClassification(convertCodeableConcept(t));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasValidityPeriod())
tgt.setValidityPeriod(convertPeriod(src.getValidityPeriod()));
if (src.hasValidTo())
tgt.setValidToElement(convertDateTime(src.getValidToElement()));
if (src.hasLastUpdated())
tgt.setLastUpdatedElement(convertDateTime(src.getLastUpdatedElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAdditionalCharacteristic())
tgt.addAdditionalCharacteristic(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAdditionalClassification())
tgt.addAdditionalClassification(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CatalogEntry.CatalogEntryRelatedEntryComponent t : src.getRelatedEntry())
tgt.addRelatedEntry(convertCatalogEntryRelatedEntryComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.CatalogEntry.CatalogEntryRelatedEntryComponent convertCatalogEntryRelatedEntryComponent(org.hl7.fhir.r4.model.CatalogEntry.CatalogEntryRelatedEntryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CatalogEntry.CatalogEntryRelatedEntryComponent tgt = new org.hl7.fhir.r5.model.CatalogEntry.CatalogEntryRelatedEntryComponent();
copyElement(src, tgt);
if (src.hasRelationtype())
tgt.setRelationtype(convertCatalogEntryRelationType(src.getRelationtype()));
if (src.hasItem())
tgt.setItem(convertReference(src.getItem()));
return tgt;
}
public static org.hl7.fhir.r4.model.CatalogEntry.CatalogEntryRelatedEntryComponent convertCatalogEntryRelatedEntryComponent(org.hl7.fhir.r5.model.CatalogEntry.CatalogEntryRelatedEntryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CatalogEntry.CatalogEntryRelatedEntryComponent tgt = new org.hl7.fhir.r4.model.CatalogEntry.CatalogEntryRelatedEntryComponent();
copyElement(src, tgt);
if (src.hasRelationtype())
tgt.setRelationtype(convertCatalogEntryRelationType(src.getRelationtype()));
if (src.hasItem())
tgt.setItem(convertReference(src.getItem()));
return tgt;
}
public static org.hl7.fhir.r5.model.CatalogEntry.CatalogEntryRelationType convertCatalogEntryRelationType(org.hl7.fhir.r4.model.CatalogEntry.CatalogEntryRelationType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case TRIGGERS: return org.hl7.fhir.r5.model.CatalogEntry.CatalogEntryRelationType.TRIGGERS;
case ISREPLACEDBY: return org.hl7.fhir.r5.model.CatalogEntry.CatalogEntryRelationType.ISREPLACEDBY;
default: return org.hl7.fhir.r5.model.CatalogEntry.CatalogEntryRelationType.NULL;
}
}
public static org.hl7.fhir.r4.model.CatalogEntry.CatalogEntryRelationType convertCatalogEntryRelationType(org.hl7.fhir.r5.model.CatalogEntry.CatalogEntryRelationType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case TRIGGERS: return org.hl7.fhir.r4.model.CatalogEntry.CatalogEntryRelationType.TRIGGERS;
case ISREPLACEDBY: return org.hl7.fhir.r4.model.CatalogEntry.CatalogEntryRelationType.ISREPLACEDBY;
default: return org.hl7.fhir.r4.model.CatalogEntry.CatalogEntryRelationType.NULL;
}
}
}

View File

@ -0,0 +1,217 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ChargeItem extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.ChargeItem convertChargeItem(org.hl7.fhir.r4.model.ChargeItem src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ChargeItem tgt = new org.hl7.fhir.r5.model.ChargeItem();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.UriType t : src.getDefinitionUri())
tgt.getDefinitionUri().add(convertUri(t));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getDefinitionCanonical())
tgt.getDefinitionCanonical().add(convertCanonical(t));
if (src.hasStatus())
tgt.setStatus(convertChargeItemStatus(src.getStatus()));
for (org.hl7.fhir.r4.model.Reference t : src.getPartOf())
tgt.addPartOf(convertReference(t));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasContext())
tgt.setContext(convertReference(src.getContext()));
if (src.hasOccurrence())
tgt.setOccurrence(convertType(src.getOccurrence()));
for (org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent t : src.getPerformer())
tgt.addPerformer(convertChargeItemPerformerComponent(t));
if (src.hasPerformingOrganization())
tgt.setPerformingOrganization(convertReference(src.getPerformingOrganization()));
if (src.hasRequestingOrganization())
tgt.setRequestingOrganization(convertReference(src.getRequestingOrganization()));
if (src.hasCostCenter())
tgt.setCostCenter(convertReference(src.getCostCenter()));
if (src.hasQuantity())
tgt.setQuantity(convertQuantity(src.getQuantity()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodysite())
tgt.addBodysite(convertCodeableConcept(t));
if (src.hasFactorOverride())
tgt.setFactorOverrideElement(convertDecimal(src.getFactorOverrideElement()));
if (src.hasPriceOverride())
tgt.setPriceOverride(convertMoney(src.getPriceOverride()));
if (src.hasOverrideReason())
tgt.setOverrideReasonElement(convertString(src.getOverrideReasonElement()));
if (src.hasEnterer())
tgt.setEnterer(convertReference(src.getEnterer()));
if (src.hasEnteredDate())
tgt.setEnteredDateElement(convertDateTime(src.getEnteredDateElement()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason())
tgt.addReason(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getService())
tgt.addService(convertReference(t));
if (src.hasProduct())
tgt.setProduct(convertType(src.getProduct()));
for (org.hl7.fhir.r4.model.Reference t : src.getAccount())
tgt.addAccount(convertReference(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation())
tgt.addSupportingInformation(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ChargeItem convertChargeItem(org.hl7.fhir.r5.model.ChargeItem src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ChargeItem tgt = new org.hl7.fhir.r4.model.ChargeItem();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.UriType t : src.getDefinitionUri())
tgt.getDefinitionUri().add(convertUri(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getDefinitionCanonical())
tgt.getDefinitionCanonical().add(convertCanonical(t));
if (src.hasStatus())
tgt.setStatus(convertChargeItemStatus(src.getStatus()));
for (org.hl7.fhir.r5.model.Reference t : src.getPartOf())
tgt.addPartOf(convertReference(t));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasContext())
tgt.setContext(convertReference(src.getContext()));
if (src.hasOccurrence())
tgt.setOccurrence(convertType(src.getOccurrence()));
for (org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent t : src.getPerformer())
tgt.addPerformer(convertChargeItemPerformerComponent(t));
if (src.hasPerformingOrganization())
tgt.setPerformingOrganization(convertReference(src.getPerformingOrganization()));
if (src.hasRequestingOrganization())
tgt.setRequestingOrganization(convertReference(src.getRequestingOrganization()));
if (src.hasCostCenter())
tgt.setCostCenter(convertReference(src.getCostCenter()));
if (src.hasQuantity())
tgt.setQuantity(convertQuantity(src.getQuantity()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodysite())
tgt.addBodysite(convertCodeableConcept(t));
if (src.hasFactorOverride())
tgt.setFactorOverrideElement(convertDecimal(src.getFactorOverrideElement()));
if (src.hasPriceOverride())
tgt.setPriceOverride(convertMoney(src.getPriceOverride()));
if (src.hasOverrideReason())
tgt.setOverrideReasonElement(convertString(src.getOverrideReasonElement()));
if (src.hasEnterer())
tgt.setEnterer(convertReference(src.getEnterer()));
if (src.hasEnteredDate())
tgt.setEnteredDateElement(convertDateTime(src.getEnteredDateElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason())
tgt.addReason(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getService())
tgt.addService(convertReference(t));
if (src.hasProduct())
tgt.setProduct(convertType(src.getProduct()));
for (org.hl7.fhir.r5.model.Reference t : src.getAccount())
tgt.addAccount(convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation())
tgt.addSupportingInformation(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus convertChargeItemStatus(org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PLANNED: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.PLANNED;
case BILLABLE: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.BILLABLE;
case NOTBILLABLE: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.NOTBILLABLE;
case ABORTED: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.ABORTED;
case BILLED: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.BILLED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.UNKNOWN;
default: return org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus convertChargeItemStatus(org.hl7.fhir.r5.model.ChargeItem.ChargeItemStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PLANNED: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.PLANNED;
case BILLABLE: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.BILLABLE;
case NOTBILLABLE: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.NOTBILLABLE;
case ABORTED: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.ABORTED;
case BILLED: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.BILLED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.UNKNOWN;
default: return org.hl7.fhir.r4.model.ChargeItem.ChargeItemStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent convertChargeItemPerformerComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasFunction())
tgt.setFunction(convertCodeableConcept(src.getFunction()));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
return tgt;
}
public static org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent convertChargeItemPerformerComponent(org.hl7.fhir.r5.model.ChargeItem.ChargeItemPerformerComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent tgt = new org.hl7.fhir.r4.model.ChargeItem.ChargeItemPerformerComponent();
copyElement(src, tgt);
if (src.hasFunction())
tgt.setFunction(convertCodeableConcept(src.getFunction()));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
return tgt;
}
}

View File

@ -0,0 +1,263 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ChargeItemDefinition extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.ChargeItemDefinition convertChargeItemDefinition(org.hl7.fhir.r4.model.ChargeItemDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ChargeItemDefinition tgt = new org.hl7.fhir.r5.model.ChargeItemDefinition();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
for (org.hl7.fhir.r4.model.UriType t : src.getDerivedFromUri())
tgt.getDerivedFromUri().add(convertUri(t));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getPartOf())
tgt.getPartOf().add(convertCanonical(t));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getReplaces())
tgt.getReplaces().add(convertCanonical(t));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r4.model.Reference t : src.getInstance())
tgt.addInstance(convertReference(t));
for (org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability())
tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t));
for (org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent t : src.getPropertyGroup())
tgt.addPropertyGroup(convertChargeItemDefinitionPropertyGroupComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ChargeItemDefinition convertChargeItemDefinition(org.hl7.fhir.r5.model.ChargeItemDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ChargeItemDefinition tgt = new org.hl7.fhir.r4.model.ChargeItemDefinition();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
for (org.hl7.fhir.r5.model.UriType t : src.getDerivedFromUri())
tgt.getDerivedFromUri().add(convertUri(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getPartOf())
tgt.getPartOf().add(convertCanonical(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getReplaces())
tgt.getReplaces().add(convertCanonical(t));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r5.model.Reference t : src.getInstance())
tgt.addInstance(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.r4.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();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasLanguage())
tgt.setLanguageElement(convertString(src.getLanguageElement()));
if (src.hasExpression())
tgt.setExpressionElement(convertString(src.getExpressionElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent convertChargeItemDefinitionApplicabilityComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent tgt = new org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasLanguage())
tgt.setLanguageElement(convertString(src.getLanguageElement()));
if (src.hasExpression())
tgt.setExpressionElement(convertString(src.getExpressionElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent convertChargeItemDefinitionPropertyGroupComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent t : src.getApplicability())
tgt.addApplicability(convertChargeItemDefinitionApplicabilityComponent(t));
for (org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent t : src.getPriceComponent())
tgt.addPriceComponent(convertChargeItemDefinitionPropertyGroupPriceComponentComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent convertChargeItemDefinitionPropertyGroupComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent tgt = new org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent();
copyElement(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.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertChargeItemDefinitionPriceComponentType(src.getType()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasAmount())
tgt.setAmount(convertMoney(src.getAmount()));
return tgt;
}
public static org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent convertChargeItemDefinitionPropertyGroupPriceComponentComponent(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent tgt = new org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertChargeItemDefinitionPriceComponentType(src.getType()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasAmount())
tgt.setAmount(convertMoney(src.getAmount()));
return tgt;
}
public static org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType convertChargeItemDefinitionPriceComponentType(org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case BASE: return org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.BASE;
case SURCHARGE: return org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.SURCHARGE;
case DEDUCTION: return org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.DEDUCTION;
case DISCOUNT: return org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.DISCOUNT;
case TAX: return org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.TAX;
case INFORMATIONAL: return org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.INFORMATIONAL;
default: return org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.NULL;
}
}
public static org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType convertChargeItemDefinitionPriceComponentType(org.hl7.fhir.r5.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case BASE: return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.BASE;
case SURCHARGE: return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.SURCHARGE;
case DEDUCTION: return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.DEDUCTION;
case DISCOUNT: return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.DISCOUNT;
case TAX: return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.TAX;
case INFORMATIONAL: return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.INFORMATIONAL;
default: return org.hl7.fhir.r4.model.ChargeItemDefinition.ChargeItemDefinitionPriceComponentType.NULL;
}
}
}

View File

@ -0,0 +1,709 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Claim extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Claim convertClaim(org.hl7.fhir.r4.model.Claim src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Claim tgt = new org.hl7.fhir.r5.model.Claim();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertClaimStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(convertCodeableConcept(src.getSubType()));
if (src.hasUse())
tgt.setUse(convertUse(src.getUse()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasBillablePeriod())
tgt.setBillablePeriod(convertPeriod(src.getBillablePeriod()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasEnterer())
tgt.setEnterer(convertReference(src.getEnterer()));
if (src.hasInsurer())
tgt.setInsurer(convertReference(src.getInsurer()));
if (src.hasProvider())
tgt.setProvider(convertReference(src.getProvider()));
if (src.hasPriority())
tgt.setPriority(convertCodeableConcept(src.getPriority()));
if (src.hasFundsReserve())
tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve()));
for (org.hl7.fhir.r4.model.Claim.RelatedClaimComponent t : src.getRelated())
tgt.addRelated(convertRelatedClaimComponent(t));
if (src.hasPrescription())
tgt.setPrescription(convertReference(src.getPrescription()));
if (src.hasOriginalPrescription())
tgt.setOriginalPrescription(convertReference(src.getOriginalPrescription()));
if (src.hasPayee())
tgt.setPayee(convertPayeeComponent(src.getPayee()));
if (src.hasReferral())
tgt.setReferral(convertReference(src.getReferral()));
if (src.hasFacility())
tgt.setFacility(convertReference(src.getFacility()));
for (org.hl7.fhir.r4.model.Claim.CareTeamComponent t : src.getCareTeam())
tgt.addCareTeam(convertCareTeamComponent(t));
for (org.hl7.fhir.r4.model.Claim.SupportingInformationComponent t : src.getSupportingInfo())
tgt.addSupportingInfo(convertSupportingInformationComponent(t));
for (org.hl7.fhir.r4.model.Claim.DiagnosisComponent t : src.getDiagnosis())
tgt.addDiagnosis(convertDiagnosisComponent(t));
for (org.hl7.fhir.r4.model.Claim.ProcedureComponent t : src.getProcedure())
tgt.addProcedure(convertProcedureComponent(t));
for (org.hl7.fhir.r4.model.Claim.InsuranceComponent t : src.getInsurance())
tgt.addInsurance(convertInsuranceComponent(t));
if (src.hasAccident())
tgt.setAccident(convertAccidentComponent(src.getAccident()));
for (org.hl7.fhir.r4.model.Claim.ItemComponent t : src.getItem())
tgt.addItem(convertItemComponent(t));
if (src.hasTotal())
tgt.setTotal(convertMoney(src.getTotal()));
return tgt;
}
public static org.hl7.fhir.r4.model.Claim convertClaim(org.hl7.fhir.r5.model.Claim src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Claim tgt = new org.hl7.fhir.r4.model.Claim();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertClaimStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(convertCodeableConcept(src.getSubType()));
if (src.hasUse())
tgt.setUse(convertUse(src.getUse()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasBillablePeriod())
tgt.setBillablePeriod(convertPeriod(src.getBillablePeriod()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasEnterer())
tgt.setEnterer(convertReference(src.getEnterer()));
if (src.hasInsurer())
tgt.setInsurer(convertReference(src.getInsurer()));
if (src.hasProvider())
tgt.setProvider(convertReference(src.getProvider()));
if (src.hasPriority())
tgt.setPriority(convertCodeableConcept(src.getPriority()));
if (src.hasFundsReserve())
tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve()));
for (org.hl7.fhir.r5.model.Claim.RelatedClaimComponent t : src.getRelated())
tgt.addRelated(convertRelatedClaimComponent(t));
if (src.hasPrescription())
tgt.setPrescription(convertReference(src.getPrescription()));
if (src.hasOriginalPrescription())
tgt.setOriginalPrescription(convertReference(src.getOriginalPrescription()));
if (src.hasPayee())
tgt.setPayee(convertPayeeComponent(src.getPayee()));
if (src.hasReferral())
tgt.setReferral(convertReference(src.getReferral()));
if (src.hasFacility())
tgt.setFacility(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(convertMoney(src.getTotal()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.ClaimStatus convertClaimStatus(org.hl7.fhir.r4.model.Claim.ClaimStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.Claim.ClaimStatus.ACTIVE;
case CANCELLED: return org.hl7.fhir.r5.model.Claim.ClaimStatus.CANCELLED;
case DRAFT: return org.hl7.fhir.r5.model.Claim.ClaimStatus.DRAFT;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Claim.ClaimStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.Claim.ClaimStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Claim.ClaimStatus convertClaimStatus(org.hl7.fhir.r5.model.Claim.ClaimStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.Claim.ClaimStatus.ACTIVE;
case CANCELLED: return org.hl7.fhir.r4.model.Claim.ClaimStatus.CANCELLED;
case DRAFT: return org.hl7.fhir.r4.model.Claim.ClaimStatus.DRAFT;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Claim.ClaimStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.Claim.ClaimStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Claim.Use convertUse(org.hl7.fhir.r4.model.Claim.Use src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case CLAIM: return org.hl7.fhir.r5.model.Claim.Use.CLAIM;
case PREAUTHORIZATION: return org.hl7.fhir.r5.model.Claim.Use.PREAUTHORIZATION;
case PREDETERMINATION: return org.hl7.fhir.r5.model.Claim.Use.PREDETERMINATION;
default: return org.hl7.fhir.r5.model.Claim.Use.NULL;
}
}
public static org.hl7.fhir.r4.model.Claim.Use convertUse(org.hl7.fhir.r5.model.Claim.Use src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case CLAIM: return org.hl7.fhir.r4.model.Claim.Use.CLAIM;
case PREAUTHORIZATION: return org.hl7.fhir.r4.model.Claim.Use.PREAUTHORIZATION;
case PREDETERMINATION: return org.hl7.fhir.r4.model.Claim.Use.PREDETERMINATION;
default: return org.hl7.fhir.r4.model.Claim.Use.NULL;
}
}
public static org.hl7.fhir.r5.model.Claim.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasClaim())
tgt.setClaim(convertReference(src.getClaim()));
if (src.hasRelationship())
tgt.setRelationship(convertCodeableConcept(src.getRelationship()));
if (src.hasReference())
tgt.setReference(convertIdentifier(src.getReference()));
return tgt;
}
public static org.hl7.fhir.r4.model.Claim.RelatedClaimComponent convertRelatedClaimComponent(org.hl7.fhir.r5.model.Claim.RelatedClaimComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Claim.RelatedClaimComponent tgt = new org.hl7.fhir.r4.model.Claim.RelatedClaimComponent();
copyElement(src, tgt);
if (src.hasClaim())
tgt.setClaim(convertReference(src.getClaim()));
if (src.hasRelationship())
tgt.setRelationship(convertCodeableConcept(src.getRelationship()));
if (src.hasReference())
tgt.setReference(convertIdentifier(src.getReference()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.PayeeComponent convertPayeeComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasParty())
tgt.setParty(convertReference(src.getParty()));
return tgt;
}
public static org.hl7.fhir.r4.model.Claim.PayeeComponent convertPayeeComponent(org.hl7.fhir.r5.model.Claim.PayeeComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Claim.PayeeComponent tgt = new org.hl7.fhir.r4.model.Claim.PayeeComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasParty())
tgt.setParty(convertReference(src.getParty()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasProvider())
tgt.setProvider(convertReference(src.getProvider()));
if (src.hasResponsible())
tgt.setResponsibleElement(convertBoolean(src.getResponsibleElement()));
if (src.hasRole())
tgt.setRole(convertCodeableConcept(src.getRole()));
if (src.hasQualification())
tgt.setQualification(convertCodeableConcept(src.getQualification()));
return tgt;
}
public static org.hl7.fhir.r4.model.Claim.CareTeamComponent convertCareTeamComponent(org.hl7.fhir.r5.model.Claim.CareTeamComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Claim.CareTeamComponent tgt = new org.hl7.fhir.r4.model.Claim.CareTeamComponent();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasProvider())
tgt.setProvider(convertReference(src.getProvider()));
if (src.hasResponsible())
tgt.setResponsibleElement(convertBoolean(src.getResponsibleElement()));
if (src.hasRole())
tgt.setRole(convertCodeableConcept(src.getRole()));
if (src.hasQualification())
tgt.setQualification(convertCodeableConcept(src.getQualification()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasTiming())
tgt.setTiming(convertType(src.getTiming()));
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
if (src.hasReason())
tgt.setReason(convertCodeableConcept(src.getReason()));
return tgt;
}
public static org.hl7.fhir.r4.model.Claim.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r5.model.Claim.SupportingInformationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Claim.SupportingInformationComponent tgt = new org.hl7.fhir.r4.model.Claim.SupportingInformationComponent();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasTiming())
tgt.setTiming(convertType(src.getTiming()));
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
if (src.hasReason())
tgt.setReason(convertCodeableConcept(src.getReason()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasDiagnosis())
tgt.setDiagnosis(convertType(src.getDiagnosis()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
if (src.hasOnAdmission())
tgt.setOnAdmission(convertCodeableConcept(src.getOnAdmission()));
if (src.hasPackageCode())
tgt.setPackageCode(convertCodeableConcept(src.getPackageCode()));
return tgt;
}
public static org.hl7.fhir.r4.model.Claim.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.Claim.DiagnosisComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Claim.DiagnosisComponent tgt = new org.hl7.fhir.r4.model.Claim.DiagnosisComponent();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasDiagnosis())
tgt.setDiagnosis(convertType(src.getDiagnosis()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
if (src.hasOnAdmission())
tgt.setOnAdmission(convertCodeableConcept(src.getOnAdmission()));
if (src.hasPackageCode())
tgt.setPackageCode(convertCodeableConcept(src.getPackageCode()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasProcedure())
tgt.setProcedure(convertType(src.getProcedure()));
for (org.hl7.fhir.r4.model.Reference t : src.getUdi())
tgt.addUdi(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Claim.ProcedureComponent convertProcedureComponent(org.hl7.fhir.r5.model.Claim.ProcedureComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Claim.ProcedureComponent tgt = new org.hl7.fhir.r4.model.Claim.ProcedureComponent();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasProcedure())
tgt.setProcedure(convertType(src.getProcedure()));
for (org.hl7.fhir.r5.model.Reference t : src.getUdi())
tgt.addUdi(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasFocal())
tgt.setFocalElement(convertBoolean(src.getFocalElement()));
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasCoverage())
tgt.setCoverage(convertReference(src.getCoverage()));
if (src.hasBusinessArrangement())
tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement()));
for (org.hl7.fhir.r4.model.StringType t : src.getPreAuthRef())
tgt.getPreAuthRef().add(convertString(t));
if (src.hasClaimResponse())
tgt.setClaimResponse(convertReference(src.getClaimResponse()));
return tgt;
}
public static org.hl7.fhir.r4.model.Claim.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.Claim.InsuranceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Claim.InsuranceComponent tgt = new org.hl7.fhir.r4.model.Claim.InsuranceComponent();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasFocal())
tgt.setFocalElement(convertBoolean(src.getFocalElement()));
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasCoverage())
tgt.setCoverage(convertReference(src.getCoverage()));
if (src.hasBusinessArrangement())
tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getPreAuthRef())
tgt.getPreAuthRef().add(convertString(t));
if (src.hasClaimResponse())
tgt.setClaimResponse(convertReference(src.getClaimResponse()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.AccidentComponent convertAccidentComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasDate())
tgt.setDateElement(convertDate(src.getDateElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasLocation())
tgt.setLocation(convertType(src.getLocation()));
return tgt;
}
public static org.hl7.fhir.r4.model.Claim.AccidentComponent convertAccidentComponent(org.hl7.fhir.r5.model.Claim.AccidentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Claim.AccidentComponent tgt = new org.hl7.fhir.r4.model.Claim.AccidentComponent();
copyElement(src, tgt);
if (src.hasDate())
tgt.setDateElement(convertDate(src.getDateElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasLocation())
tgt.setLocation(convertType(src.getLocation()));
return tgt;
}
public static org.hl7.fhir.r5.model.Claim.ItemComponent convertItemComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
for (org.hl7.fhir.r4.model.PositiveIntType t : src.getCareTeamSequence())
tgt.getCareTeamSequence().add(convertPositiveInt(t));
for (org.hl7.fhir.r4.model.PositiveIntType t : src.getDiagnosisSequence())
tgt.getDiagnosisSequence().add(convertPositiveInt(t));
for (org.hl7.fhir.r4.model.PositiveIntType t : src.getProcedureSequence())
tgt.getProcedureSequence().add(convertPositiveInt(t));
for (org.hl7.fhir.r4.model.PositiveIntType t : src.getInformationSequence())
tgt.getInformationSequence().add(convertPositiveInt(t));
if (src.hasRevenue())
tgt.setRevenue(convertCodeableConcept(src.getRevenue()));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(convertCodeableConcept(t));
if (src.hasServiced())
tgt.setServiced(convertType(src.getServiced()));
if (src.hasLocation())
tgt.setLocation(convertType(src.getLocation()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(convertMoney(src.getNet()));
for (org.hl7.fhir.r4.model.Reference t : src.getUdi())
tgt.addUdi(convertReference(t));
if (src.hasBodySite())
tgt.setBodySite(convertCodeableConcept(src.getBodySite()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubSite())
tgt.addSubSite(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getEncounter())
tgt.addEncounter(convertReference(t));
for (org.hl7.fhir.r4.model.Claim.DetailComponent t : src.getDetail())
tgt.addDetail(convertDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Claim.ItemComponent convertItemComponent(org.hl7.fhir.r5.model.Claim.ItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Claim.ItemComponent tgt = new org.hl7.fhir.r4.model.Claim.ItemComponent();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getCareTeamSequence())
tgt.getCareTeamSequence().add(convertPositiveInt(t));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDiagnosisSequence())
tgt.getDiagnosisSequence().add(convertPositiveInt(t));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getProcedureSequence())
tgt.getProcedureSequence().add(convertPositiveInt(t));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getInformationSequence())
tgt.getInformationSequence().add(convertPositiveInt(t));
if (src.hasRevenue())
tgt.setRevenue(convertCodeableConcept(src.getRevenue()));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(convertCodeableConcept(t));
if (src.hasServiced())
tgt.setServiced(convertType(src.getServiced()));
if (src.hasLocation())
tgt.setLocation(convertType(src.getLocation()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(convertMoney(src.getNet()));
for (org.hl7.fhir.r5.model.Reference t : src.getUdi())
tgt.addUdi(convertReference(t));
if (src.hasBodySite())
tgt.setBodySite(convertCodeableConcept(src.getBodySite()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite())
tgt.addSubSite(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getEncounter())
tgt.addEncounter(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.r4.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();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasRevenue())
tgt.setRevenue(convertCodeableConcept(src.getRevenue()));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(convertMoney(src.getNet()));
for (org.hl7.fhir.r4.model.Reference t : src.getUdi())
tgt.addUdi(convertReference(t));
for (org.hl7.fhir.r4.model.Claim.SubDetailComponent t : src.getSubDetail())
tgt.addSubDetail(convertSubDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Claim.DetailComponent convertDetailComponent(org.hl7.fhir.r5.model.Claim.DetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Claim.DetailComponent tgt = new org.hl7.fhir.r4.model.Claim.DetailComponent();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasRevenue())
tgt.setRevenue(convertCodeableConcept(src.getRevenue()));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(convertMoney(src.getNet()));
for (org.hl7.fhir.r5.model.Reference t : src.getUdi())
tgt.addUdi(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.r4.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();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasRevenue())
tgt.setRevenue(convertCodeableConcept(src.getRevenue()));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(convertMoney(src.getNet()));
for (org.hl7.fhir.r4.model.Reference t : src.getUdi())
tgt.addUdi(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Claim.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r5.model.Claim.SubDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Claim.SubDetailComponent tgt = new org.hl7.fhir.r4.model.Claim.SubDetailComponent();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasRevenue())
tgt.setRevenue(convertCodeableConcept(src.getRevenue()));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(convertMoney(src.getNet()));
for (org.hl7.fhir.r5.model.Reference t : src.getUdi())
tgt.addUdi(convertReference(t));
return tgt;
}
}

View File

@ -0,0 +1,713 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ClaimResponse extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.ClaimResponse convertClaimResponse(org.hl7.fhir.r4.model.ClaimResponse src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClaimResponse tgt = new org.hl7.fhir.r5.model.ClaimResponse();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertClaimResponseStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(convertCodeableConcept(src.getSubType()));
if (src.hasUse())
tgt.setUse(convertUse(src.getUse()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasInsurer())
tgt.setInsurer(convertReference(src.getInsurer()));
if (src.hasRequestor())
tgt.setRequestor(convertReference(src.getRequestor()));
if (src.hasRequest())
tgt.setRequest(convertReference(src.getRequest()));
if (src.hasOutcome())
tgt.setOutcome(convertRemittanceOutcome(src.getOutcome()));
if (src.hasDisposition())
tgt.setDispositionElement(convertString(src.getDispositionElement()));
if (src.hasPreAuthRef())
tgt.setPreAuthRefElement(convertString(src.getPreAuthRefElement()));
if (src.hasPreAuthPeriod())
tgt.setPreAuthPeriod(convertPeriod(src.getPreAuthPeriod()));
if (src.hasPayeeType())
tgt.setPayeeType(convertCodeableConcept(src.getPayeeType()));
for (org.hl7.fhir.r4.model.ClaimResponse.ItemComponent t : src.getItem())
tgt.addItem(convertItemComponent(t));
for (org.hl7.fhir.r4.model.ClaimResponse.AddedItemComponent t : src.getAddItem())
tgt.addAddItem(convertAddedItemComponent(t));
for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r4.model.ClaimResponse.TotalComponent t : src.getTotal())
tgt.addTotal(convertTotalComponent(t));
if (src.hasPayment())
tgt.setPayment(convertPaymentComponent(src.getPayment()));
if (src.hasFundsReserve())
tgt.setFundsReserve(convertCodeableConcept(src.getFundsReserve()));
if (src.hasFormCode())
tgt.setFormCode(convertCodeableConcept(src.getFormCode()));
if (src.hasForm())
tgt.setForm(convertAttachment(src.getForm()));
for (org.hl7.fhir.r4.model.ClaimResponse.NoteComponent t : src.getProcessNote())
tgt.addProcessNote(convertNoteComponent(t));
for (org.hl7.fhir.r4.model.Reference t : src.getCommunicationRequest())
tgt.addCommunicationRequest(convertReference(t));
for (org.hl7.fhir.r4.model.ClaimResponse.InsuranceComponent t : src.getInsurance())
tgt.addInsurance(convertInsuranceComponent(t));
for (org.hl7.fhir.r4.model.ClaimResponse.ErrorComponent t : src.getError())
tgt.addError(convertErrorComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ClaimResponse convertClaimResponse(org.hl7.fhir.r5.model.ClaimResponse src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClaimResponse tgt = new org.hl7.fhir.r4.model.ClaimResponse();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertClaimResponseStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(convertCodeableConcept(src.getSubType()));
if (src.hasUse())
tgt.setUse(convertUse(src.getUse()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasInsurer())
tgt.setInsurer(convertReference(src.getInsurer()));
if (src.hasRequestor())
tgt.setRequestor(convertReference(src.getRequestor()));
if (src.hasRequest())
tgt.setRequest(convertReference(src.getRequest()));
if (src.hasOutcome())
tgt.setOutcome(convertRemittanceOutcome(src.getOutcome()));
if (src.hasDisposition())
tgt.setDispositionElement(convertString(src.getDispositionElement()));
if (src.hasPreAuthRef())
tgt.setPreAuthRefElement(convertString(src.getPreAuthRefElement()));
if (src.hasPreAuthPeriod())
tgt.setPreAuthPeriod(convertPeriod(src.getPreAuthPeriod()));
if (src.hasPayeeType())
tgt.setPayeeType(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(convertCodeableConcept(src.getFundsReserve()));
if (src.hasFormCode())
tgt.setFormCode(convertCodeableConcept(src.getFormCode()));
if (src.hasForm())
tgt.setForm(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(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;
}
public static org.hl7.fhir.r5.model.ClaimResponse.ClaimResponseStatus convertClaimResponseStatus(org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.ClaimResponse.ClaimResponseStatus.ACTIVE;
case CANCELLED: return org.hl7.fhir.r5.model.ClaimResponse.ClaimResponseStatus.CANCELLED;
case DRAFT: return org.hl7.fhir.r5.model.ClaimResponse.ClaimResponseStatus.DRAFT;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.ClaimResponse.ClaimResponseStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.ClaimResponse.ClaimResponseStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus convertClaimResponseStatus(org.hl7.fhir.r5.model.ClaimResponse.ClaimResponseStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.ACTIVE;
case CANCELLED: return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.CANCELLED;
case DRAFT: return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.DRAFT;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.ClaimResponse.ClaimResponseStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.ClaimResponse.Use convertUse(org.hl7.fhir.r4.model.ClaimResponse.Use src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case CLAIM: return org.hl7.fhir.r5.model.ClaimResponse.Use.CLAIM;
case PREAUTHORIZATION: return org.hl7.fhir.r5.model.ClaimResponse.Use.PREAUTHORIZATION;
case PREDETERMINATION: return org.hl7.fhir.r5.model.ClaimResponse.Use.PREDETERMINATION;
default: return org.hl7.fhir.r5.model.ClaimResponse.Use.NULL;
}
}
public static org.hl7.fhir.r4.model.ClaimResponse.Use convertUse(org.hl7.fhir.r5.model.ClaimResponse.Use src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case CLAIM: return org.hl7.fhir.r4.model.ClaimResponse.Use.CLAIM;
case PREAUTHORIZATION: return org.hl7.fhir.r4.model.ClaimResponse.Use.PREAUTHORIZATION;
case PREDETERMINATION: return org.hl7.fhir.r4.model.ClaimResponse.Use.PREDETERMINATION;
default: return org.hl7.fhir.r4.model.ClaimResponse.Use.NULL;
}
}
public static org.hl7.fhir.r5.model.ClaimResponse.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case QUEUED: return org.hl7.fhir.r5.model.ClaimResponse.RemittanceOutcome.QUEUED;
case COMPLETE: return org.hl7.fhir.r5.model.ClaimResponse.RemittanceOutcome.COMPLETE;
case ERROR: return org.hl7.fhir.r5.model.ClaimResponse.RemittanceOutcome.ERROR;
case PARTIAL: return org.hl7.fhir.r5.model.ClaimResponse.RemittanceOutcome.PARTIAL;
default: return org.hl7.fhir.r5.model.ClaimResponse.RemittanceOutcome.NULL;
}
}
public static org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r5.model.ClaimResponse.RemittanceOutcome src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case QUEUED: return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.QUEUED;
case COMPLETE: return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.COMPLETE;
case ERROR: return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.ERROR;
case PARTIAL: return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.PARTIAL;
default: return org.hl7.fhir.r4.model.ClaimResponse.RemittanceOutcome.NULL;
}
}
public static org.hl7.fhir.r5.model.ClaimResponse.ItemComponent convertItemComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasItemSequence())
tgt.setItemSequenceElement(convertPositiveInt(src.getItemSequenceElement()));
for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(convertPositiveInt(t));
for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r4.model.ClaimResponse.ItemDetailComponent t : src.getDetail())
tgt.addDetail(convertItemDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ClaimResponse.ItemComponent convertItemComponent(org.hl7.fhir.r5.model.ClaimResponse.ItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClaimResponse.ItemComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.ItemComponent();
copyElement(src, tgt);
if (src.hasItemSequence())
tgt.setItemSequenceElement(convertPositiveInt(src.getItemSequenceElement()));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(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.r4.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();
copyElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasReason())
tgt.setReason(convertCodeableConcept(src.getReason()));
if (src.hasAmount())
tgt.setAmount(convertMoney(src.getAmount()));
if (src.hasValue())
tgt.setValueElement(convertDecimal(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent();
copyElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasReason())
tgt.setReason(convertCodeableConcept(src.getReason()));
if (src.hasAmount())
tgt.setAmount(convertMoney(src.getAmount()));
if (src.hasValue())
tgt.setValueElement(convertDecimal(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent convertItemDetailComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasDetailSequence())
tgt.setDetailSequenceElement(convertPositiveInt(src.getDetailSequenceElement()));
for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(convertPositiveInt(t));
for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r4.model.ClaimResponse.SubDetailComponent t : src.getSubDetail())
tgt.addSubDetail(convertSubDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ClaimResponse.ItemDetailComponent convertItemDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClaimResponse.ItemDetailComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.ItemDetailComponent();
copyElement(src, tgt);
if (src.hasDetailSequence())
tgt.setDetailSequenceElement(convertPositiveInt(src.getDetailSequenceElement()));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(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.r4.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();
copyElement(src, tgt);
if (src.hasSubDetailSequence())
tgt.setSubDetailSequenceElement(convertPositiveInt(src.getSubDetailSequenceElement()));
for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(convertPositiveInt(t));
for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ClaimResponse.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClaimResponse.SubDetailComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.SubDetailComponent();
copyElement(src, tgt);
if (src.hasSubDetailSequence())
tgt.setSubDetailSequenceElement(convertPositiveInt(src.getSubDetailSequenceElement()));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(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.r4.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();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.PositiveIntType t : src.getItemSequence())
tgt.getItemSequence().add(convertPositiveInt(t));
for (org.hl7.fhir.r4.model.PositiveIntType t : src.getDetailSequence())
tgt.getDetailSequence().add(convertPositiveInt(t));
for (org.hl7.fhir.r4.model.PositiveIntType t : src.getSubdetailSequence())
tgt.getSubdetailSequence().add(convertPositiveInt(t));
for (org.hl7.fhir.r4.model.Reference t : src.getProvider())
tgt.addProvider(convertReference(t));
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(convertCodeableConcept(t));
if (src.hasServiced())
tgt.setServiced(convertType(src.getServiced()));
if (src.hasLocation())
tgt.setLocation(convertType(src.getLocation()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(convertMoney(src.getNet()));
if (src.hasBodySite())
tgt.setBodySite(convertCodeableConcept(src.getBodySite()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubSite())
tgt.addSubSite(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(convertPositiveInt(t));
for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r4.model.ClaimResponse.AddedItemDetailComponent t : src.getDetail())
tgt.addDetail(convertAddedItemDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ClaimResponse.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClaimResponse.AddedItemComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.AddedItemComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getItemSequence())
tgt.getItemSequence().add(convertPositiveInt(t));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDetailSequence())
tgt.getDetailSequence().add(convertPositiveInt(t));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getSubdetailSequence())
tgt.getSubdetailSequence().add(convertPositiveInt(t));
for (org.hl7.fhir.r5.model.Reference t : src.getProvider())
tgt.addProvider(convertReference(t));
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode())
tgt.addProgramCode(convertCodeableConcept(t));
if (src.hasServiced())
tgt.setServiced(convertType(src.getServiced()));
if (src.hasLocation())
tgt.setLocation(convertType(src.getLocation()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(convertMoney(src.getNet()));
if (src.hasBodySite())
tgt.setBodySite(convertCodeableConcept(src.getBodySite()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubSite())
tgt.addSubSite(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(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.r4.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();
copyElement(src, tgt);
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(convertMoney(src.getNet()));
for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(convertPositiveInt(t));
for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
for (org.hl7.fhir.r4.model.ClaimResponse.AddedItemSubDetailComponent t : src.getSubDetail())
tgt.addSubDetail(convertAddedItemSubDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ClaimResponse.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClaimResponse.AddedItemDetailComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.AddedItemDetailComponent();
copyElement(src, tgt);
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(convertMoney(src.getNet()));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(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.r4.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();
copyElement(src, tgt);
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(convertMoney(src.getNet()));
for (org.hl7.fhir.r4.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(convertPositiveInt(t));
for (org.hl7.fhir.r4.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
tgt.addAdjudication(convertAdjudicationComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ClaimResponse.AddedItemSubDetailComponent convertAddedItemSubDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClaimResponse.AddedItemSubDetailComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.AddedItemSubDetailComponent();
copyElement(src, tgt);
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasNet())
tgt.setNet(convertMoney(src.getNet()));
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
tgt.getNoteNumber().add(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.r4.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();
copyElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasAmount())
tgt.setAmount(convertMoney(src.getAmount()));
return tgt;
}
public static org.hl7.fhir.r4.model.ClaimResponse.TotalComponent convertTotalComponent(org.hl7.fhir.r5.model.ClaimResponse.TotalComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClaimResponse.TotalComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.TotalComponent();
copyElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasAmount())
tgt.setAmount(convertMoney(src.getAmount()));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent convertPaymentComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasAdjustment())
tgt.setAdjustment(convertMoney(src.getAdjustment()));
if (src.hasAdjustmentReason())
tgt.setAdjustmentReason(convertCodeableConcept(src.getAdjustmentReason()));
if (src.hasDate())
tgt.setDateElement(convertDate(src.getDateElement()));
if (src.hasAmount())
tgt.setAmount(convertMoney(src.getAmount()));
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
return tgt;
}
public static org.hl7.fhir.r4.model.ClaimResponse.PaymentComponent convertPaymentComponent(org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClaimResponse.PaymentComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.PaymentComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasAdjustment())
tgt.setAdjustment(convertMoney(src.getAdjustment()));
if (src.hasAdjustmentReason())
tgt.setAdjustmentReason(convertCodeableConcept(src.getAdjustmentReason()));
if (src.hasDate())
tgt.setDateElement(convertDate(src.getDateElement()));
if (src.hasAmount())
tgt.setAmount(convertMoney(src.getAmount()));
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.NoteComponent convertNoteComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasNumber())
tgt.setNumberElement(convertPositiveInt(src.getNumberElement()));
if (src.hasType())
tgt.setType(Enumerations.convertNoteType(src.getType()));
if (src.hasText())
tgt.setTextElement(convertString(src.getTextElement()));
if (src.hasLanguage())
tgt.setLanguage(convertCodeableConcept(src.getLanguage()));
return tgt;
}
public static org.hl7.fhir.r4.model.ClaimResponse.NoteComponent convertNoteComponent(org.hl7.fhir.r5.model.ClaimResponse.NoteComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClaimResponse.NoteComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.NoteComponent();
copyElement(src, tgt);
if (src.hasNumber())
tgt.setNumberElement(convertPositiveInt(src.getNumberElement()));
if (src.hasType())
tgt.setType(Enumerations.convertNoteType(src.getType()));
if (src.hasText())
tgt.setTextElement(convertString(src.getTextElement()));
if (src.hasLanguage())
tgt.setLanguage(convertCodeableConcept(src.getLanguage()));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasFocal())
tgt.setFocalElement(convertBoolean(src.getFocalElement()));
if (src.hasCoverage())
tgt.setCoverage(convertReference(src.getCoverage()));
if (src.hasBusinessArrangement())
tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement()));
if (src.hasClaimResponse())
tgt.setClaimResponse(convertReference(src.getClaimResponse()));
return tgt;
}
public static org.hl7.fhir.r4.model.ClaimResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClaimResponse.InsuranceComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.InsuranceComponent();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasFocal())
tgt.setFocalElement(convertBoolean(src.getFocalElement()));
if (src.hasCoverage())
tgt.setCoverage(convertReference(src.getCoverage()));
if (src.hasBusinessArrangement())
tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement()));
if (src.hasClaimResponse())
tgt.setClaimResponse(convertReference(src.getClaimResponse()));
return tgt;
}
public static org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent convertErrorComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasItemSequence())
tgt.setItemSequenceElement(convertPositiveInt(src.getItemSequenceElement()));
if (src.hasDetailSequence())
tgt.setDetailSequenceElement(convertPositiveInt(src.getDetailSequenceElement()));
if (src.hasSubDetailSequence())
tgt.setSubDetailSequenceElement(convertPositiveInt(src.getSubDetailSequenceElement()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
return tgt;
}
public static org.hl7.fhir.r4.model.ClaimResponse.ErrorComponent convertErrorComponent(org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClaimResponse.ErrorComponent tgt = new org.hl7.fhir.r4.model.ClaimResponse.ErrorComponent();
copyElement(src, tgt);
if (src.hasItemSequence())
tgt.setItemSequenceElement(convertPositiveInt(src.getItemSequenceElement()));
if (src.hasDetailSequence())
tgt.setDetailSequenceElement(convertPositiveInt(src.getDetailSequenceElement()));
if (src.hasSubDetailSequence())
tgt.setSubDetailSequenceElement(convertPositiveInt(src.getSubDetailSequenceElement()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
return tgt;
}
}

View File

@ -0,0 +1,213 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ClinicalImpression extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.r4.model.ClinicalImpression src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClinicalImpression tgt = new org.hl7.fhir.r5.model.ClinicalImpression();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertClinicalImpressionStatus(src.getStatus()));
if (src.hasStatusReason())
tgt.setStatusReason(convertCodeableConcept(src.getStatusReason()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasEffective())
tgt.setEffective(convertType(src.getEffective()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasAssessor())
tgt.setAssessor(convertReference(src.getAssessor()));
if (src.hasPrevious())
tgt.setPrevious(convertReference(src.getPrevious()));
for (org.hl7.fhir.r4.model.Reference t : src.getProblem())
tgt.addProblem(convertReference(t));
for (org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionInvestigationComponent t : src.getInvestigation())
tgt.addInvestigation(convertClinicalImpressionInvestigationComponent(t));
for (org.hl7.fhir.r4.model.UriType t : src.getProtocol())
tgt.getProtocol().add(convertUri(t));
if (src.hasSummary())
tgt.setSummaryElement(convertString(src.getSummaryElement()));
for (org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding())
tgt.addFinding(convertClinicalImpressionFindingComponent(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPrognosisCodeableConcept())
tgt.addPrognosisCodeableConcept(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getPrognosisReference())
tgt.addPrognosisReference(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(convertReference(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.r5.model.ClinicalImpression src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClinicalImpression tgt = new org.hl7.fhir.r4.model.ClinicalImpression();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertClinicalImpressionStatus(src.getStatus()));
if (src.hasStatusReason())
tgt.setStatusReason(convertCodeableConcept(src.getStatusReason()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasEffective())
tgt.setEffective(convertType(src.getEffective()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasAssessor())
tgt.setAssessor(convertReference(src.getAssessor()));
if (src.hasPrevious())
tgt.setPrevious(convertReference(src.getPrevious()));
for (org.hl7.fhir.r5.model.Reference t : src.getProblem())
tgt.addProblem(convertReference(t));
for (org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionInvestigationComponent t : src.getInvestigation())
tgt.addInvestigation(convertClinicalImpressionInvestigationComponent(t));
for (org.hl7.fhir.r5.model.UriType t : src.getProtocol())
tgt.getProtocol().add(convertUri(t));
if (src.hasSummary())
tgt.setSummaryElement(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(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getPrognosisReference())
tgt.addPrognosisReference(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionStatus convertClinicalImpressionStatus(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case INPROGRESS: return org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionStatus.INPROGRESS;
case COMPLETED: return org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus convertClinicalImpressionStatus(org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case INPROGRESS: return org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.INPROGRESS;
case COMPLETED: return org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionInvestigationComponent convertClinicalImpressionInvestigationComponent(org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionInvestigationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionInvestigationComponent tgt = new org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionInvestigationComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r4.model.Reference t : src.getItem())
tgt.addItem(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionInvestigationComponent convertClinicalImpressionInvestigationComponent(org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionInvestigationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionInvestigationComponent tgt = new org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionInvestigationComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r5.model.Reference t : src.getItem())
tgt.addItem(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasItemCodeableConcept())
tgt.setItemCodeableConcept(convertCodeableConcept(src.getItemCodeableConcept()));
if (src.hasItemReference())
tgt.setItemReference(convertReference(src.getItemReference()));
if (src.hasBasis())
tgt.setBasisElement(convertString(src.getBasisElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.r5.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent tgt = new org.hl7.fhir.r4.model.ClinicalImpression.ClinicalImpressionFindingComponent();
copyElement(src, tgt);
if (src.hasItemCodeableConcept())
tgt.setItemCodeableConcept(convertCodeableConcept(src.getItemCodeableConcept()));
if (src.hasItemReference())
tgt.setItemReference(convertReference(src.getItemReference()));
if (src.hasBasis())
tgt.setBasisElement(convertString(src.getBasisElement()));
return tgt;
}
}

View File

@ -0,0 +1,433 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CodeSystem extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.CodeSystem convertCodeSystem(org.hl7.fhir.r4.model.CodeSystem src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CodeSystem tgt = new org.hl7.fhir.r5.model.CodeSystem();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasCaseSensitive())
tgt.setCaseSensitiveElement(convertBoolean(src.getCaseSensitiveElement()));
if (src.hasValueSet())
tgt.setValueSetElement(convertCanonical(src.getValueSetElement()));
if (src.hasHierarchyMeaning())
tgt.setHierarchyMeaning(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaning()));
if (src.hasCompositional())
tgt.setCompositionalElement(convertBoolean(src.getCompositionalElement()));
if (src.hasVersionNeeded())
tgt.setVersionNeededElement(convertBoolean(src.getVersionNeededElement()));
if (src.hasContent())
tgt.setContent(convertCodeSystemContentMode(src.getContent()));
if (src.hasSupplements())
tgt.setSupplementsElement(convertCanonical(src.getSupplementsElement()));
if (src.hasCount())
tgt.setCountElement(convertUnsignedInt(src.getCountElement()));
for (org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent t : src.getFilter())
tgt.addFilter(convertCodeSystemFilterComponent(t));
for (org.hl7.fhir.r4.model.CodeSystem.PropertyComponent t : src.getProperty())
tgt.addProperty(convertPropertyComponent(t));
for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept())
tgt.addConcept(convertConceptDefinitionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CodeSystem convertCodeSystem(org.hl7.fhir.r5.model.CodeSystem src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CodeSystem tgt = new org.hl7.fhir.r4.model.CodeSystem();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasCaseSensitive())
tgt.setCaseSensitiveElement(convertBoolean(src.getCaseSensitiveElement()));
if (src.hasValueSet())
tgt.setValueSetElement(convertCanonical(src.getValueSetElement()));
if (src.hasHierarchyMeaning())
tgt.setHierarchyMeaning(convertCodeSystemHierarchyMeaning(src.getHierarchyMeaning()));
if (src.hasCompositional())
tgt.setCompositionalElement(convertBoolean(src.getCompositionalElement()));
if (src.hasVersionNeeded())
tgt.setVersionNeededElement(convertBoolean(src.getVersionNeededElement()));
if (src.hasContent())
tgt.setContent(convertCodeSystemContentMode(src.getContent()));
if (src.hasSupplements())
tgt.setSupplementsElement(convertCanonical(src.getSupplementsElement()));
if (src.hasCount())
tgt.setCountElement(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;
}
public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning convertCodeSystemHierarchyMeaning(org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case GROUPEDBY: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY;
case ISA: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.ISA;
case PARTOF: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF;
case CLASSIFIEDWITH: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH;
default: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning.NULL;
}
}
public static org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning convertCodeSystemHierarchyMeaning(org.hl7.fhir.r5.model.CodeSystem.CodeSystemHierarchyMeaning src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case GROUPEDBY: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.GROUPEDBY;
case ISA: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.ISA;
case PARTOF: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.PARTOF;
case CLASSIFIEDWITH: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.CLASSIFIEDWITH;
default: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemHierarchyMeaning.NULL;
}
}
public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode convertCodeSystemContentMode(org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case NOTPRESENT: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.NOTPRESENT;
case EXAMPLE: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.EXAMPLE;
case FRAGMENT: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.FRAGMENT;
case COMPLETE: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.COMPLETE;
case SUPPLEMENT: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT;
default: return org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode.NULL;
}
}
public static org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode convertCodeSystemContentMode(org.hl7.fhir.r5.model.CodeSystem.CodeSystemContentMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case NOTPRESENT: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NOTPRESENT;
case EXAMPLE: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.EXAMPLE;
case FRAGMENT: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.FRAGMENT;
case COMPLETE: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.COMPLETE;
case SUPPLEMENT: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.SUPPLEMENT;
default: return org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode.NULL;
}
}
public static org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CodeSystem.FilterOperator> t : src.getOperator())
tgt.addOperator(convertFilterOperator(t.getValue()));
if (src.hasValue())
tgt.setValueElement(convertString(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent convertCodeSystemFilterComponent(org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.CodeSystemFilterComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CodeSystem.FilterOperator> t : src.getOperator())
tgt.addOperator(convertFilterOperator(t.getValue()));
if (src.hasValue())
tgt.setValueElement(convertString(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CodeSystem.FilterOperator convertFilterOperator(org.hl7.fhir.r4.model.CodeSystem.FilterOperator src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case EQUAL: return org.hl7.fhir.r5.model.CodeSystem.FilterOperator.EQUAL;
case ISA: return org.hl7.fhir.r5.model.CodeSystem.FilterOperator.ISA;
case DESCENDENTOF: return org.hl7.fhir.r5.model.CodeSystem.FilterOperator.DESCENDENTOF;
case ISNOTA: return org.hl7.fhir.r5.model.CodeSystem.FilterOperator.ISNOTA;
case REGEX: return org.hl7.fhir.r5.model.CodeSystem.FilterOperator.REGEX;
case IN: return org.hl7.fhir.r5.model.CodeSystem.FilterOperator.IN;
case NOTIN: return org.hl7.fhir.r5.model.CodeSystem.FilterOperator.NOTIN;
case GENERALIZES: return org.hl7.fhir.r5.model.CodeSystem.FilterOperator.GENERALIZES;
case EXISTS: return org.hl7.fhir.r5.model.CodeSystem.FilterOperator.EXISTS;
default: return org.hl7.fhir.r5.model.CodeSystem.FilterOperator.NULL;
}
}
public static org.hl7.fhir.r4.model.CodeSystem.FilterOperator convertFilterOperator(org.hl7.fhir.r5.model.CodeSystem.FilterOperator src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case EQUAL: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EQUAL;
case ISA: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISA;
case DESCENDENTOF: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.DESCENDENTOF;
case ISNOTA: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.ISNOTA;
case REGEX: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.REGEX;
case IN: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.IN;
case NOTIN: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NOTIN;
case GENERALIZES: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.GENERALIZES;
case EXISTS: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.EXISTS;
default: return org.hl7.fhir.r4.model.CodeSystem.FilterOperator.NULL;
}
}
public static org.hl7.fhir.r5.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasUri())
tgt.setUriElement(convertUri(src.getUriElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasType())
tgt.setType(convertPropertyType(src.getType()));
return tgt;
}
public static org.hl7.fhir.r4.model.CodeSystem.PropertyComponent convertPropertyComponent(org.hl7.fhir.r5.model.CodeSystem.PropertyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CodeSystem.PropertyComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.PropertyComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasUri())
tgt.setUriElement(convertUri(src.getUriElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasType())
tgt.setType(convertPropertyType(src.getType()));
return tgt;
}
public static org.hl7.fhir.r5.model.CodeSystem.PropertyType convertPropertyType(org.hl7.fhir.r4.model.CodeSystem.PropertyType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case CODE: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODE;
case CODING: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.CODING;
case STRING: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.STRING;
case INTEGER: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.INTEGER;
case BOOLEAN: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.BOOLEAN;
case DATETIME: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.DATETIME;
case DECIMAL: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.DECIMAL;
default: return org.hl7.fhir.r5.model.CodeSystem.PropertyType.NULL;
}
}
public static org.hl7.fhir.r4.model.CodeSystem.PropertyType convertPropertyType(org.hl7.fhir.r5.model.CodeSystem.PropertyType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case CODE: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODE;
case CODING: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.CODING;
case STRING: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.STRING;
case INTEGER: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.INTEGER;
case BOOLEAN: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.BOOLEAN;
case DATETIME: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.DATETIME;
case DECIMAL: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.DECIMAL;
default: return org.hl7.fhir.r4.model.CodeSystem.PropertyType.NULL;
}
}
public static org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(convertString(src.getDisplayElement()));
if (src.hasDefinition())
tgt.setDefinitionElement(convertString(src.getDefinitionElement()));
for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent t : src.getDesignation())
tgt.addDesignation(convertConceptDefinitionDesignationComponent(t));
for (org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent t : src.getProperty())
tgt.addProperty(convertConceptPropertyComponent(t));
for (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent t : src.getConcept())
tgt.addConcept(convertConceptDefinitionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent convertConceptDefinitionComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(convertString(src.getDisplayElement()));
if (src.hasDefinition())
tgt.setDefinitionElement(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.r4.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();
copyElement(src, tgt);
if (src.hasLanguage())
tgt.setLanguageElement(convertCode(src.getLanguageElement()));
if (src.hasUse())
tgt.setUse(convertCoding(src.getUse()));
if (src.hasValue())
tgt.setValueElement(convertString(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent convertConceptDefinitionDesignationComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent();
copyElement(src, tgt);
if (src.hasLanguage())
tgt.setLanguageElement(convertCode(src.getLanguageElement()));
if (src.hasUse())
tgt.setUse(convertCoding(src.getUse()));
if (src.hasValue())
tgt.setValueElement(convertString(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent convertConceptPropertyComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptPropertyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent tgt = new org.hl7.fhir.r4.model.CodeSystem.ConceptPropertyComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
return tgt;
}
}

View File

@ -0,0 +1,227 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Communication extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Communication convertCommunication(org.hl7.fhir.r4.model.Communication src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Communication tgt = new org.hl7.fhir.r5.model.Communication();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(convertCanonical(t));
for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(convertUri(t));
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getPartOf())
tgt.addPartOf(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getInResponseTo())
tgt.addInResponseTo(convertReference(t));
if (src.hasStatus())
tgt.setStatus(convertCommunicationStatus(src.getStatus()));
if (src.hasStatusReason())
tgt.setStatusReason(convertCodeableConcept(src.getStatusReason()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasPriority())
tgt.setPriority(convertCommunicationPriority(src.getPriority()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getMedium())
tgt.addMedium(convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasTopic())
tgt.setTopic(convertCodeableConcept(src.getTopic()));
for (org.hl7.fhir.r4.model.Reference t : src.getAbout())
tgt.addAbout(convertReference(t));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasSent())
tgt.setSentElement(convertDateTime(src.getSentElement()));
if (src.hasReceived())
tgt.setReceivedElement(convertDateTime(src.getReceivedElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getRecipient())
tgt.addRecipient(convertReference(t));
if (src.hasSender())
tgt.setSender(convertReference(src.getSender()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent t : src.getPayload())
tgt.addPayload(convertCommunicationPayloadComponent(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Communication convertCommunication(org.hl7.fhir.r5.model.Communication src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Communication tgt = new org.hl7.fhir.r4.model.Communication();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(convertCanonical(t));
for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(convertUri(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getPartOf())
tgt.addPartOf(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getInResponseTo())
tgt.addInResponseTo(convertReference(t));
if (src.hasStatus())
tgt.setStatus(convertCommunicationStatus(src.getStatus()));
if (src.hasStatusReason())
tgt.setStatusReason(convertCodeableConcept(src.getStatusReason()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasPriority())
tgt.setPriority(convertCommunicationPriority(src.getPriority()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium())
tgt.addMedium(convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasTopic())
tgt.setTopic(convertCodeableConcept(src.getTopic()));
for (org.hl7.fhir.r5.model.Reference t : src.getAbout())
tgt.addAbout(convertReference(t));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasSent())
tgt.setSentElement(convertDateTime(src.getSentElement()));
if (src.hasReceived())
tgt.setReceivedElement(convertDateTime(src.getReceivedElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getRecipient())
tgt.addRecipient(convertReference(t));
if (src.hasSender())
tgt.setSender(convertReference(src.getSender()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
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(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Communication.CommunicationStatus convertCommunicationStatus(org.hl7.fhir.r4.model.Communication.CommunicationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PREPARATION: return org.hl7.fhir.r5.model.Communication.CommunicationStatus.PREPARATION;
case INPROGRESS: return org.hl7.fhir.r5.model.Communication.CommunicationStatus.INPROGRESS;
case NOTDONE: return org.hl7.fhir.r5.model.Communication.CommunicationStatus.NOTDONE;
case ONHOLD: return org.hl7.fhir.r5.model.Communication.CommunicationStatus.ONHOLD;
case STOPPED: return org.hl7.fhir.r5.model.Communication.CommunicationStatus.STOPPED;
case COMPLETED: return org.hl7.fhir.r5.model.Communication.CommunicationStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Communication.CommunicationStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r5.model.Communication.CommunicationStatus.UNKNOWN;
default: return org.hl7.fhir.r5.model.Communication.CommunicationStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Communication.CommunicationStatus convertCommunicationStatus(org.hl7.fhir.r5.model.Communication.CommunicationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PREPARATION: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.PREPARATION;
case INPROGRESS: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.INPROGRESS;
case NOTDONE: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.NOTDONE;
case ONHOLD: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.ONHOLD;
case STOPPED: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.STOPPED;
case COMPLETED: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.UNKNOWN;
default: return org.hl7.fhir.r4.model.Communication.CommunicationStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Communication.CommunicationPriority convertCommunicationPriority(org.hl7.fhir.r4.model.Communication.CommunicationPriority src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ROUTINE: return org.hl7.fhir.r5.model.Communication.CommunicationPriority.ROUTINE;
case URGENT: return org.hl7.fhir.r5.model.Communication.CommunicationPriority.URGENT;
case ASAP: return org.hl7.fhir.r5.model.Communication.CommunicationPriority.ASAP;
case STAT: return org.hl7.fhir.r5.model.Communication.CommunicationPriority.STAT;
default: return org.hl7.fhir.r5.model.Communication.CommunicationPriority.NULL;
}
}
public static org.hl7.fhir.r4.model.Communication.CommunicationPriority convertCommunicationPriority(org.hl7.fhir.r5.model.Communication.CommunicationPriority src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ROUTINE: return org.hl7.fhir.r4.model.Communication.CommunicationPriority.ROUTINE;
case URGENT: return org.hl7.fhir.r4.model.Communication.CommunicationPriority.URGENT;
case ASAP: return org.hl7.fhir.r4.model.Communication.CommunicationPriority.ASAP;
case STAT: return org.hl7.fhir.r4.model.Communication.CommunicationPriority.STAT;
default: return org.hl7.fhir.r4.model.Communication.CommunicationPriority.NULL;
}
}
public static org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.r5.model.Communication.CommunicationPayloadComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.r4.model.Communication.CommunicationPayloadComponent();
copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(convertType(src.getContent()));
return tgt;
}
}

View File

@ -0,0 +1,221 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CommunicationRequest extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.CommunicationRequest convertCommunicationRequest(org.hl7.fhir.r4.model.CommunicationRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CommunicationRequest tgt = new org.hl7.fhir.r5.model.CommunicationRequest();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReplaces())
tgt.addReplaces(convertReference(t));
if (src.hasGroupIdentifier())
tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier()));
if (src.hasStatus())
tgt.setStatus(convertCommunicationRequestStatus(src.getStatus()));
if (src.hasStatusReason())
tgt.setStatusReason(convertCodeableConcept(src.getStatusReason()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasPriority())
tgt.setPriority(convertCommunicationPriority(src.getPriority()));
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getMedium())
tgt.addMedium(convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
for (org.hl7.fhir.r4.model.Reference t : src.getAbout())
tgt.addAbout(convertReference(t));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
for (org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload())
tgt.addPayload(convertCommunicationRequestPayloadComponent(t));
if (src.hasOccurrence())
tgt.setOccurrence(convertType(src.getOccurrence()));
if (src.hasAuthoredOn())
tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement()));
if (src.hasRequester())
tgt.setRequester(convertReference(src.getRequester()));
for (org.hl7.fhir.r4.model.Reference t : src.getRecipient())
tgt.addRecipient(convertReference(t));
if (src.hasSender())
tgt.setSender(convertReference(src.getSender()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CommunicationRequest convertCommunicationRequest(org.hl7.fhir.r5.model.CommunicationRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CommunicationRequest tgt = new org.hl7.fhir.r4.model.CommunicationRequest();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReplaces())
tgt.addReplaces(convertReference(t));
if (src.hasGroupIdentifier())
tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier()));
if (src.hasStatus())
tgt.setStatus(convertCommunicationRequestStatus(src.getStatus()));
if (src.hasStatusReason())
tgt.setStatusReason(convertCodeableConcept(src.getStatusReason()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasPriority())
tgt.setPriority(convertCommunicationPriority(src.getPriority()));
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getMedium())
tgt.addMedium(convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
for (org.hl7.fhir.r5.model.Reference t : src.getAbout())
tgt.addAbout(convertReference(t));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
for (org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload())
tgt.addPayload(convertCommunicationRequestPayloadComponent(t));
if (src.hasOccurrence())
tgt.setOccurrence(convertType(src.getOccurrence()));
if (src.hasAuthoredOn())
tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement()));
if (src.hasRequester())
tgt.setRequester(convertReference(src.getRequester()));
for (org.hl7.fhir.r5.model.Reference t : src.getRecipient())
tgt.addRecipient(convertReference(t));
if (src.hasSender())
tgt.setSender(convertReference(src.getSender()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestStatus convertCommunicationRequestStatus(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DRAFT: return org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestStatus.DRAFT;
case ACTIVE: return org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE;
case ONHOLD: return org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestStatus.ONHOLD;
case REVOKED: return org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestStatus.REVOKED;
case COMPLETED: return org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestStatus.UNKNOWN;
default: return org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus convertCommunicationRequestStatus(org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DRAFT: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.DRAFT;
case ACTIVE: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE;
case ONHOLD: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ONHOLD;
case REVOKED: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.REVOKED;
case COMPLETED: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.UNKNOWN;
default: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.CommunicationRequest.CommunicationPriority convertCommunicationPriority(org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ROUTINE: return org.hl7.fhir.r5.model.CommunicationRequest.CommunicationPriority.ROUTINE;
case URGENT: return org.hl7.fhir.r5.model.CommunicationRequest.CommunicationPriority.URGENT;
case ASAP: return org.hl7.fhir.r5.model.CommunicationRequest.CommunicationPriority.ASAP;
case STAT: return org.hl7.fhir.r5.model.CommunicationRequest.CommunicationPriority.STAT;
default: return org.hl7.fhir.r5.model.CommunicationRequest.CommunicationPriority.NULL;
}
}
public static org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority convertCommunicationPriority(org.hl7.fhir.r5.model.CommunicationRequest.CommunicationPriority src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ROUTINE: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.ROUTINE;
case URGENT: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.URGENT;
case ASAP: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.ASAP;
case STAT: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.STAT;
default: return org.hl7.fhir.r4.model.CommunicationRequest.CommunicationPriority.NULL;
}
}
public static org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.r5.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.r4.model.CommunicationRequest.CommunicationRequestPayloadComponent();
copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(convertType(src.getContent()));
return tgt;
}
}

View File

@ -0,0 +1,169 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CompartmentDefinition extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.CompartmentDefinition convertCompartmentDefinition(org.hl7.fhir.r4.model.CompartmentDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CompartmentDefinition tgt = new org.hl7.fhir.r5.model.CompartmentDefinition();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasCode())
tgt.setCode(convertCompartmentType(src.getCode()));
if (src.hasSearch())
tgt.setSearchElement(convertBoolean(src.getSearchElement()));
for (org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource())
tgt.addResource(convertCompartmentDefinitionResourceComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CompartmentDefinition convertCompartmentDefinition(org.hl7.fhir.r5.model.CompartmentDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CompartmentDefinition tgt = new org.hl7.fhir.r4.model.CompartmentDefinition();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasCode())
tgt.setCode(convertCompartmentType(src.getCode()));
if (src.hasSearch())
tgt.setSearchElement(convertBoolean(src.getSearchElement()));
for (org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent t : src.getResource())
tgt.addResource(convertCompartmentDefinitionResourceComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentType convertCompartmentType(org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PATIENT: return org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentType.PATIENT;
case ENCOUNTER: return org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentType.ENCOUNTER;
case RELATEDPERSON: return org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentType.RELATEDPERSON;
case PRACTITIONER: return org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentType.PRACTITIONER;
case DEVICE: return org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentType.DEVICE;
default: return org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentType.NULL;
}
}
public static org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType convertCompartmentType(org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PATIENT: return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.PATIENT;
case ENCOUNTER: return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.ENCOUNTER;
case RELATEDPERSON: return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.RELATEDPERSON;
case PRACTITIONER: return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.PRACTITIONER;
case DEVICE: return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.DEVICE;
default: return org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentType.NULL;
}
}
public static org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent convertCompartmentDefinitionResourceComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
for (org.hl7.fhir.r4.model.StringType t : src.getParam())
tgt.getParam().add(convertString(t));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertString(src.getDocumentationElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent convertCompartmentDefinitionResourceComponent(org.hl7.fhir.r5.model.CompartmentDefinition.CompartmentDefinitionResourceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent tgt = new org.hl7.fhir.r4.model.CompartmentDefinition.CompartmentDefinitionResourceComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getParam())
tgt.getParam().add(convertString(t));
if (src.hasDocumentation())
tgt.setDocumentationElement(convertString(src.getDocumentationElement()));
return tgt;
}
}

View File

@ -0,0 +1,377 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Composition extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Composition convertComposition(org.hl7.fhir.r4.model.Composition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Composition tgt = new org.hl7.fhir.r5.model.Composition();
copyDomainResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasStatus())
tgt.setStatus(convertCompositionStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getAuthor())
tgt.addAuthor(convertReference(t));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasConfidentiality())
tgt.setConfidentiality(convertDocumentConfidentiality(src.getConfidentiality()));
for (org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent t : src.getAttester())
tgt.addAttester(convertCompositionAttesterComponent(t));
if (src.hasCustodian())
tgt.setCustodian(convertReference(src.getCustodian()));
for (org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo())
tgt.addRelatesTo(convertCompositionRelatesToComponent(t));
for (org.hl7.fhir.r4.model.Composition.CompositionEventComponent t : src.getEvent())
tgt.addEvent(convertCompositionEventComponent(t));
for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection())
tgt.addSection(convertSectionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Composition convertComposition(org.hl7.fhir.r5.model.Composition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Composition tgt = new org.hl7.fhir.r4.model.Composition();
copyDomainResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasStatus())
tgt.setStatus(convertCompositionStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getAuthor())
tgt.addAuthor(convertReference(t));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasConfidentiality())
tgt.setConfidentiality(convertDocumentConfidentiality(src.getConfidentiality()));
for (org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent t : src.getAttester())
tgt.addAttester(convertCompositionAttesterComponent(t));
if (src.hasCustodian())
tgt.setCustodian(convertReference(src.getCustodian()));
for (org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent 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;
}
public static org.hl7.fhir.r5.model.Composition.CompositionStatus convertCompositionStatus(org.hl7.fhir.r4.model.Composition.CompositionStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PRELIMINARY: return org.hl7.fhir.r5.model.Composition.CompositionStatus.PRELIMINARY;
case FINAL: return org.hl7.fhir.r5.model.Composition.CompositionStatus.FINAL;
case AMENDED: return org.hl7.fhir.r5.model.Composition.CompositionStatus.AMENDED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Composition.CompositionStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.Composition.CompositionStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Composition.CompositionStatus convertCompositionStatus(org.hl7.fhir.r5.model.Composition.CompositionStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PRELIMINARY: return org.hl7.fhir.r4.model.Composition.CompositionStatus.PRELIMINARY;
case FINAL: return org.hl7.fhir.r4.model.Composition.CompositionStatus.FINAL;
case AMENDED: return org.hl7.fhir.r4.model.Composition.CompositionStatus.AMENDED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Composition.CompositionStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.Composition.CompositionStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Composition.DocumentConfidentiality convertDocumentConfidentiality(org.hl7.fhir.r4.model.Composition.DocumentConfidentiality src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case U: return org.hl7.fhir.r5.model.Composition.DocumentConfidentiality.U;
case L: return org.hl7.fhir.r5.model.Composition.DocumentConfidentiality.L;
case M: return org.hl7.fhir.r5.model.Composition.DocumentConfidentiality.M;
case N: return org.hl7.fhir.r5.model.Composition.DocumentConfidentiality.N;
case R: return org.hl7.fhir.r5.model.Composition.DocumentConfidentiality.R;
case V: return org.hl7.fhir.r5.model.Composition.DocumentConfidentiality.V;
default: return org.hl7.fhir.r5.model.Composition.DocumentConfidentiality.NULL;
}
}
public static org.hl7.fhir.r4.model.Composition.DocumentConfidentiality convertDocumentConfidentiality(org.hl7.fhir.r5.model.Composition.DocumentConfidentiality src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case U: return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.U;
case L: return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.L;
case M: return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.M;
case N: return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.N;
case R: return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.R;
case V: return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.V;
default: return org.hl7.fhir.r4.model.Composition.DocumentConfidentiality.NULL;
}
}
public static org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasMode())
tgt.setMode(convertCompositionAttestationMode(src.getMode()));
if (src.hasTime())
tgt.setTimeElement(convertDateTime(src.getTimeElement()));
if (src.hasParty())
tgt.setParty(convertReference(src.getParty()));
return tgt;
}
public static org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent();
copyElement(src, tgt);
if (src.hasMode())
tgt.setMode(convertCompositionAttestationMode(src.getMode()));
if (src.hasTime())
tgt.setTimeElement(convertDateTime(src.getTimeElement()));
if (src.hasParty())
tgt.setParty(convertReference(src.getParty()));
return tgt;
}
public static org.hl7.fhir.r5.model.Composition.CompositionAttestationMode convertCompositionAttestationMode(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PERSONAL: return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.PERSONAL;
case PROFESSIONAL: return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.PROFESSIONAL;
case LEGAL: return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.LEGAL;
case OFFICIAL: return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.OFFICIAL;
default: return org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.NULL;
}
}
public static org.hl7.fhir.r4.model.Composition.CompositionAttestationMode convertCompositionAttestationMode(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PERSONAL: return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PERSONAL;
case PROFESSIONAL: return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PROFESSIONAL;
case LEGAL: return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.LEGAL;
case OFFICIAL: return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.OFFICIAL;
default: return org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.NULL;
}
}
public static org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertDocumentRelationshipType(src.getCode()));
if (src.hasTarget())
tgt.setTarget(convertType(src.getTarget()));
return tgt;
}
public static org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertDocumentRelationshipType(src.getCode()));
if (src.hasTarget())
tgt.setTarget(convertType(src.getTarget()));
return tgt;
}
public static org.hl7.fhir.r5.model.Composition.DocumentRelationshipType convertDocumentRelationshipType(org.hl7.fhir.r4.model.Composition.DocumentRelationshipType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case REPLACES: return org.hl7.fhir.r5.model.Composition.DocumentRelationshipType.REPLACES;
case TRANSFORMS: return org.hl7.fhir.r5.model.Composition.DocumentRelationshipType.TRANSFORMS;
case SIGNS: return org.hl7.fhir.r5.model.Composition.DocumentRelationshipType.SIGNS;
case APPENDS: return org.hl7.fhir.r5.model.Composition.DocumentRelationshipType.APPENDS;
default: return org.hl7.fhir.r5.model.Composition.DocumentRelationshipType.NULL;
}
}
public static org.hl7.fhir.r4.model.Composition.DocumentRelationshipType convertDocumentRelationshipType(org.hl7.fhir.r5.model.Composition.DocumentRelationshipType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case REPLACES: return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.REPLACES;
case TRANSFORMS: return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.TRANSFORMS;
case SIGNS: return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.SIGNS;
case APPENDS: return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.APPENDS;
default: return org.hl7.fhir.r4.model.Composition.DocumentRelationshipType.NULL;
}
}
public static org.hl7.fhir.r5.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode())
tgt.addCode(convertCodeableConcept(t));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r4.model.Reference t : src.getDetail())
tgt.addDetail(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.r5.model.Composition.CompositionEventComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionEventComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode())
tgt.addCode(convertCodeableConcept(t));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r5.model.Reference t : src.getDetail())
tgt.addDetail(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r4.model.Reference t : src.getAuthor())
tgt.addAuthor(convertReference(t));
if (src.hasFocus())
tgt.setFocus(convertReference(src.getFocus()));
if (src.hasText())
tgt.setText(convertNarrative(src.getText()));
if (src.hasMode())
tgt.setMode(convertSectionMode(src.getMode()));
if (src.hasOrderedBy())
tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy()));
for (org.hl7.fhir.r4.model.Reference t : src.getEntry())
tgt.addEntry(convertReference(t));
if (src.hasEmptyReason())
tgt.setEmptyReason(convertCodeableConcept(src.getEmptyReason()));
for (org.hl7.fhir.r4.model.Composition.SectionComponent t : src.getSection())
tgt.addSection(convertSectionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.r5.model.Composition.SectionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Composition.SectionComponent tgt = new org.hl7.fhir.r4.model.Composition.SectionComponent();
copyElement(src, tgt);
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r5.model.Reference t : src.getAuthor())
tgt.addAuthor(convertReference(t));
if (src.hasFocus())
tgt.setFocus(convertReference(src.getFocus()));
if (src.hasText())
tgt.setText(convertNarrative(src.getText()));
if (src.hasMode())
tgt.setMode(convertSectionMode(src.getMode()));
if (src.hasOrderedBy())
tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy()));
for (org.hl7.fhir.r5.model.Reference t : src.getEntry())
tgt.addEntry(convertReference(t));
if (src.hasEmptyReason())
tgt.setEmptyReason(convertCodeableConcept(src.getEmptyReason()));
for (org.hl7.fhir.r5.model.Composition.SectionComponent t : src.getSection())
tgt.addSection(convertSectionComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Composition.SectionMode convertSectionMode(org.hl7.fhir.r4.model.Composition.SectionMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case WORKING: return org.hl7.fhir.r5.model.Composition.SectionMode.WORKING;
case SNAPSHOT: return org.hl7.fhir.r5.model.Composition.SectionMode.SNAPSHOT;
case CHANGES: return org.hl7.fhir.r5.model.Composition.SectionMode.CHANGES;
default: return org.hl7.fhir.r5.model.Composition.SectionMode.NULL;
}
}
public static org.hl7.fhir.r4.model.Composition.SectionMode convertSectionMode(org.hl7.fhir.r5.model.Composition.SectionMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case WORKING: return org.hl7.fhir.r4.model.Composition.SectionMode.WORKING;
case SNAPSHOT: return org.hl7.fhir.r4.model.Composition.SectionMode.SNAPSHOT;
case CHANGES: return org.hl7.fhir.r4.model.Composition.SectionMode.CHANGES;
default: return org.hl7.fhir.r4.model.Composition.SectionMode.NULL;
}
}
}

View File

@ -0,0 +1,325 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ConceptMap extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.ConceptMap convertConceptMap(org.hl7.fhir.r4.model.ConceptMap src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ConceptMap tgt = new org.hl7.fhir.r5.model.ConceptMap();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasSource())
tgt.setSource(convertType(src.getSource()));
if (src.hasTarget())
tgt.setTarget(convertType(src.getTarget()));
for (org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent t : src.getGroup())
tgt.addGroup(convertConceptMapGroupComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ConceptMap convertConceptMap(org.hl7.fhir.r5.model.ConceptMap src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ConceptMap tgt = new org.hl7.fhir.r4.model.ConceptMap();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasSource())
tgt.setSource(convertType(src.getSource()));
if (src.hasTarget())
tgt.setTarget(convertType(src.getTarget()));
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.r4.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();
copyElement(src, tgt);
if (src.hasSource())
tgt.setSourceElement(convertUri(src.getSourceElement()));
if (src.hasSourceVersion())
tgt.setSourceVersionElement(convertString(src.getSourceVersionElement()));
if (src.hasTarget())
tgt.setTargetElement(convertUri(src.getTargetElement()));
if (src.hasTargetVersion())
tgt.setTargetVersionElement(convertString(src.getTargetVersionElement()));
for (org.hl7.fhir.r4.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.r4.model.ConceptMap.ConceptMapGroupComponent convertConceptMapGroupComponent(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupComponent();
copyElement(src, tgt);
if (src.hasSource())
tgt.setSourceElement(convertUri(src.getSourceElement()));
if (src.hasSourceVersion())
tgt.setSourceVersionElement(convertString(src.getSourceVersionElement()));
if (src.hasTarget())
tgt.setTargetElement(convertUri(src.getTargetElement()));
if (src.hasTargetVersion())
tgt.setTargetVersionElement(convertString(src.getTargetVersionElement()));
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.r4.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();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(convertString(src.getDisplayElement()));
for (org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent t : src.getTarget())
tgt.addTarget(convertTargetElementComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(convertString(src.getDisplayElement()));
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.r4.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();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(convertString(src.getDisplayElement()));
if (src.hasEquivalence())
tgt.setEquivalence(Enumerations.convertConceptMapEquivalence(src.getEquivalence()));
if (src.hasComment())
tgt.setCommentElement(convertString(src.getCommentElement()));
for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getDependsOn())
tgt.addDependsOn(convertOtherElementComponent(t));
for (org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent t : src.getProduct())
tgt.addProduct(convertOtherElementComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.TargetElementComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(convertString(src.getDisplayElement()));
if (src.hasEquivalence())
tgt.setEquivalence(Enumerations.convertConceptMapEquivalence(src.getEquivalence()));
if (src.hasComment())
tgt.setCommentElement(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.r5.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasProperty())
tgt.setPropertyElement(convertUri(src.getPropertyElement()));
if (src.hasSystem())
tgt.setSystemElement(convertCanonical(src.getSystemElement()));
if (src.hasValue())
tgt.setValueElement(convertString(src.getValueElement()));
if (src.hasDisplay())
tgt.setDisplayElement(convertString(src.getDisplayElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.r5.model.ConceptMap.OtherElementComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.OtherElementComponent();
copyElement(src, tgt);
if (src.hasProperty())
tgt.setPropertyElement(convertUri(src.getPropertyElement()));
if (src.hasSystem())
tgt.setSystemElement(convertCanonical(src.getSystemElement()));
if (src.hasValue())
tgt.setValueElement(convertString(src.getValueElement()));
if (src.hasDisplay())
tgt.setDisplayElement(convertString(src.getDisplayElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent convertConceptMapGroupUnmappedComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasMode())
tgt.setMode(convertConceptMapGroupUnmappedMode(src.getMode()));
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(convertString(src.getDisplayElement()));
if (src.hasUrl())
tgt.setUrlElement(convertCanonical(src.getUrlElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent convertConceptMapGroupUnmappedComponent(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent tgt = new org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedComponent();
copyElement(src, tgt);
if (src.hasMode())
tgt.setMode(convertConceptMapGroupUnmappedMode(src.getMode()));
if (src.hasCode())
tgt.setCodeElement(convertCode(src.getCodeElement()));
if (src.hasDisplay())
tgt.setDisplayElement(convertString(src.getDisplayElement()));
if (src.hasUrl())
tgt.setUrlElement(convertCanonical(src.getUrlElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode convertConceptMapGroupUnmappedMode(org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROVIDED: return org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED;
case FIXED: return org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED;
case OTHERMAP: return org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP;
default: return org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL;
}
}
public static org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode convertConceptMapGroupUnmappedMode(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROVIDED: return org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED;
case FIXED: return org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED;
case OTHERMAP: return org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP;
default: return org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL;
}
}
}

View File

@ -0,0 +1,179 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Condition extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Condition convertCondition(org.hl7.fhir.r4.model.Condition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Condition tgt = new org.hl7.fhir.r5.model.Condition();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasClinicalStatus())
tgt.setClinicalStatus(convertCodeableConcept(src.getClinicalStatus()));
if (src.hasVerificationStatus())
tgt.setVerificationStatus(convertCodeableConcept(src.getVerificationStatus()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasSeverity())
tgt.setSeverity(convertCodeableConcept(src.getSeverity()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getBodySite())
tgt.addBodySite(convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasOnset())
tgt.setOnset(convertType(src.getOnset()));
if (src.hasAbatement())
tgt.setAbatement(convertType(src.getAbatement()));
if (src.hasRecordedDate())
tgt.setRecordedDateElement(convertDateTime(src.getRecordedDateElement()));
if (src.hasRecorder())
tgt.setRecorder(convertReference(src.getRecorder()));
if (src.hasAsserter())
tgt.setAsserter(convertReference(src.getAsserter()));
for (org.hl7.fhir.r4.model.Condition.ConditionStageComponent t : src.getStage())
tgt.addStage(convertConditionStageComponent(t));
for (org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent t : src.getEvidence())
tgt.addEvidence(convertConditionEvidenceComponent(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Condition convertCondition(org.hl7.fhir.r5.model.Condition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Condition tgt = new org.hl7.fhir.r4.model.Condition();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasClinicalStatus())
tgt.setClinicalStatus(convertCodeableConcept(src.getClinicalStatus()));
if (src.hasVerificationStatus())
tgt.setVerificationStatus(convertCodeableConcept(src.getVerificationStatus()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasSeverity())
tgt.setSeverity(convertCodeableConcept(src.getSeverity()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySite())
tgt.addBodySite(convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasOnset())
tgt.setOnset(convertType(src.getOnset()));
if (src.hasAbatement())
tgt.setAbatement(convertType(src.getAbatement()));
if (src.hasRecordedDate())
tgt.setRecordedDateElement(convertDateTime(src.getRecordedDateElement()));
if (src.hasRecorder())
tgt.setRecorder(convertReference(src.getRecorder()));
if (src.hasAsserter())
tgt.setAsserter(convertReference(src.getAsserter()));
for (org.hl7.fhir.r5.model.Condition.ConditionStageComponent t : src.getStage())
tgt.addStage(convertConditionStageComponent(t));
for (org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent t : src.getEvidence())
tgt.addEvidence(convertConditionEvidenceComponent(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasSummary())
tgt.setSummary(convertCodeableConcept(src.getSummary()));
for (org.hl7.fhir.r4.model.Reference t : src.getAssessment())
tgt.addAssessment(convertReference(t));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
return tgt;
}
public static org.hl7.fhir.r4.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.r5.model.Condition.ConditionStageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.r4.model.Condition.ConditionStageComponent();
copyElement(src, tgt);
if (src.hasSummary())
tgt.setSummary(convertCodeableConcept(src.getSummary()));
for (org.hl7.fhir.r5.model.Reference t : src.getAssessment())
tgt.addAssessment(convertReference(t));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
return tgt;
}
public static org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent convertConditionEvidenceComponent(org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode())
tgt.addCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getDetail())
tgt.addDetail(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent convertConditionEvidenceComponent(org.hl7.fhir.r5.model.Condition.ConditionEvidenceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.r4.model.Condition.ConditionEvidenceComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode())
tgt.addCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getDetail())
tgt.addDetail(convertReference(t));
return tgt;
}
}

View File

@ -0,0 +1,343 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Consent extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Consent convertConsent(org.hl7.fhir.r4.model.Consent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Consent tgt = new org.hl7.fhir.r5.model.Consent();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertConsentState(src.getStatus()));
if (src.hasScope())
tgt.setScope(convertCodeableConcept(src.getScope()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasDateTime())
tgt.setDateTimeElement(convertDateTime(src.getDateTimeElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getPerformer())
tgt.addPerformer(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getOrganization())
tgt.addOrganization(convertReference(t));
if (src.hasSource())
tgt.setSource(convertType(src.getSource()));
for (org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent t : src.getPolicy())
tgt.addPolicy(convertConsentPolicyComponent(t));
if (src.hasPolicyRule())
tgt.setPolicyRule(convertCodeableConcept(src.getPolicyRule()));
for (org.hl7.fhir.r4.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.r4.model.Consent convertConsent(org.hl7.fhir.r5.model.Consent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Consent tgt = new org.hl7.fhir.r4.model.Consent();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertConsentState(src.getStatus()));
if (src.hasScope())
tgt.setScope(convertCodeableConcept(src.getScope()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasDateTime())
tgt.setDateTimeElement(convertDateTime(src.getDateTimeElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getPerformer())
tgt.addPerformer(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getOrganization())
tgt.addOrganization(convertReference(t));
if (src.hasSource())
tgt.setSource(convertType(src.getSource()));
for (org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent t : src.getPolicy())
tgt.addPolicy(convertConsentPolicyComponent(t));
if (src.hasPolicyRule())
tgt.setPolicyRule(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;
}
public static org.hl7.fhir.r5.model.Consent.ConsentState convertConsentState(org.hl7.fhir.r4.model.Consent.ConsentState src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DRAFT: return org.hl7.fhir.r5.model.Consent.ConsentState.DRAFT;
case PROPOSED: return org.hl7.fhir.r5.model.Consent.ConsentState.PROPOSED;
case ACTIVE: return org.hl7.fhir.r5.model.Consent.ConsentState.ACTIVE;
case REJECTED: return org.hl7.fhir.r5.model.Consent.ConsentState.REJECTED;
case INACTIVE: return org.hl7.fhir.r5.model.Consent.ConsentState.INACTIVE;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Consent.ConsentState.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.Consent.ConsentState.NULL;
}
}
public static org.hl7.fhir.r4.model.Consent.ConsentState convertConsentState(org.hl7.fhir.r5.model.Consent.ConsentState src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DRAFT: return org.hl7.fhir.r4.model.Consent.ConsentState.DRAFT;
case PROPOSED: return org.hl7.fhir.r4.model.Consent.ConsentState.PROPOSED;
case ACTIVE: return org.hl7.fhir.r4.model.Consent.ConsentState.ACTIVE;
case REJECTED: return org.hl7.fhir.r4.model.Consent.ConsentState.REJECTED;
case INACTIVE: return org.hl7.fhir.r4.model.Consent.ConsentState.INACTIVE;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Consent.ConsentState.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.Consent.ConsentState.NULL;
}
}
public static org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent convertConsentPolicyComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasAuthority())
tgt.setAuthorityElement(convertUri(src.getAuthorityElement()));
if (src.hasUri())
tgt.setUriElement(convertUri(src.getUriElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent convertConsentPolicyComponent(org.hl7.fhir.r5.model.Consent.ConsentPolicyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent tgt = new org.hl7.fhir.r4.model.Consent.ConsentPolicyComponent();
copyElement(src, tgt);
if (src.hasAuthority())
tgt.setAuthorityElement(convertUri(src.getAuthorityElement()));
if (src.hasUri())
tgt.setUriElement(convertUri(src.getUriElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent convertConsentVerificationComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasVerified())
tgt.setVerifiedElement(convertBoolean(src.getVerifiedElement()));
if (src.hasVerifiedWith())
tgt.setVerifiedWith(convertReference(src.getVerifiedWith()));
if (src.hasVerificationDate())
tgt.setVerificationDateElement(convertDateTime(src.getVerificationDateElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Consent.ConsentVerificationComponent convertConsentVerificationComponent(org.hl7.fhir.r5.model.Consent.ConsentVerificationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Consent.ConsentVerificationComponent tgt = new org.hl7.fhir.r4.model.Consent.ConsentVerificationComponent();
copyElement(src, tgt);
if (src.hasVerified())
tgt.setVerifiedElement(convertBoolean(src.getVerifiedElement()));
if (src.hasVerifiedWith())
tgt.setVerifiedWith(convertReference(src.getVerifiedWith()));
if (src.hasVerificationDate())
tgt.setVerificationDateElement(convertDateTime(src.getVerificationDateElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Consent.provisionComponent convertprovisionComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertConsentProvisionType(src.getType()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r4.model.Consent.provisionActorComponent t : src.getActor())
tgt.addActor(convertprovisionActorComponent(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAction())
tgt.addAction(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel())
tgt.addSecurityLabel(convertCoding(t));
for (org.hl7.fhir.r4.model.Coding t : src.getPurpose())
tgt.addPurpose(convertCoding(t));
for (org.hl7.fhir.r4.model.Coding t : src.getClass_())
tgt.addClass_(convertCoding(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode())
tgt.addCode(convertCodeableConcept(t));
if (src.hasDataPeriod())
tgt.setDataPeriod(convertPeriod(src.getDataPeriod()));
for (org.hl7.fhir.r4.model.Consent.provisionDataComponent t : src.getData())
tgt.addData(convertprovisionDataComponent(t));
for (org.hl7.fhir.r4.model.Consent.provisionComponent t : src.getProvision())
tgt.addProvision(convertprovisionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Consent.provisionComponent convertprovisionComponent(org.hl7.fhir.r5.model.Consent.provisionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Consent.provisionComponent tgt = new org.hl7.fhir.r4.model.Consent.provisionComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertConsentProvisionType(src.getType()));
if (src.hasPeriod())
tgt.setPeriod(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(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel())
tgt.addSecurityLabel(convertCoding(t));
for (org.hl7.fhir.r5.model.Coding t : src.getPurpose())
tgt.addPurpose(convertCoding(t));
for (org.hl7.fhir.r5.model.Coding t : src.getClass_())
tgt.addClass_(convertCoding(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode())
tgt.addCode(convertCodeableConcept(t));
if (src.hasDataPeriod())
tgt.setDataPeriod(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;
}
public static org.hl7.fhir.r5.model.Consent.ConsentProvisionType convertConsentProvisionType(org.hl7.fhir.r4.model.Consent.ConsentProvisionType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DENY: return org.hl7.fhir.r5.model.Consent.ConsentProvisionType.DENY;
case PERMIT: return org.hl7.fhir.r5.model.Consent.ConsentProvisionType.PERMIT;
default: return org.hl7.fhir.r5.model.Consent.ConsentProvisionType.NULL;
}
}
public static org.hl7.fhir.r4.model.Consent.ConsentProvisionType convertConsentProvisionType(org.hl7.fhir.r5.model.Consent.ConsentProvisionType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DENY: return org.hl7.fhir.r4.model.Consent.ConsentProvisionType.DENY;
case PERMIT: return org.hl7.fhir.r4.model.Consent.ConsentProvisionType.PERMIT;
default: return org.hl7.fhir.r4.model.Consent.ConsentProvisionType.NULL;
}
}
public static org.hl7.fhir.r5.model.Consent.provisionActorComponent convertprovisionActorComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasRole())
tgt.setRole(convertCodeableConcept(src.getRole()));
if (src.hasReference())
tgt.setReference(convertReference(src.getReference()));
return tgt;
}
public static org.hl7.fhir.r4.model.Consent.provisionActorComponent convertprovisionActorComponent(org.hl7.fhir.r5.model.Consent.provisionActorComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Consent.provisionActorComponent tgt = new org.hl7.fhir.r4.model.Consent.provisionActorComponent();
copyElement(src, tgt);
if (src.hasRole())
tgt.setRole(convertCodeableConcept(src.getRole()));
if (src.hasReference())
tgt.setReference(convertReference(src.getReference()));
return tgt;
}
public static org.hl7.fhir.r5.model.Consent.provisionDataComponent convertprovisionDataComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasMeaning())
tgt.setMeaning(convertConsentDataMeaning(src.getMeaning()));
if (src.hasReference())
tgt.setReference(convertReference(src.getReference()));
return tgt;
}
public static org.hl7.fhir.r4.model.Consent.provisionDataComponent convertprovisionDataComponent(org.hl7.fhir.r5.model.Consent.provisionDataComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Consent.provisionDataComponent tgt = new org.hl7.fhir.r4.model.Consent.provisionDataComponent();
copyElement(src, tgt);
if (src.hasMeaning())
tgt.setMeaning(convertConsentDataMeaning(src.getMeaning()));
if (src.hasReference())
tgt.setReference(convertReference(src.getReference()));
return tgt;
}
public static org.hl7.fhir.r5.model.Consent.ConsentDataMeaning convertConsentDataMeaning(org.hl7.fhir.r4.model.Consent.ConsentDataMeaning src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case INSTANCE: return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.INSTANCE;
case RELATED: return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.RELATED;
case DEPENDENTS: return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.DEPENDENTS;
case AUTHOREDBY: return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.AUTHOREDBY;
default: return org.hl7.fhir.r5.model.Consent.ConsentDataMeaning.NULL;
}
}
public static org.hl7.fhir.r4.model.Consent.ConsentDataMeaning convertConsentDataMeaning(org.hl7.fhir.r5.model.Consent.ConsentDataMeaning src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case INSTANCE: return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.INSTANCE;
case RELATED: return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.RELATED;
case DEPENDENTS: return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.DEPENDENTS;
case AUTHOREDBY: return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.AUTHOREDBY;
default: return org.hl7.fhir.r4.model.Consent.ConsentDataMeaning.NULL;
}
}
}

View File

@ -0,0 +1,907 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Contract extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Contract convertContract(org.hl7.fhir.r4.model.Contract src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Contract tgt = new org.hl7.fhir.r5.model.Contract();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasStatus())
tgt.setStatus(convertContractStatus(src.getStatus()));
if (src.hasLegalState())
tgt.setLegalState(convertCodeableConcept(src.getLegalState()));
if (src.hasInstantiatesCanonical())
tgt.setInstantiatesCanonical(convertReference(src.getInstantiatesCanonical()));
if (src.hasInstantiatesUri())
tgt.setInstantiatesUriElement(convertUri(src.getInstantiatesUriElement()));
if (src.hasContentDerivative())
tgt.setContentDerivative(convertCodeableConcept(src.getContentDerivative()));
if (src.hasIssued())
tgt.setIssuedElement(convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(convertPeriod(src.getApplies()));
if (src.hasExpirationType())
tgt.setExpirationType(convertCodeableConcept(src.getExpirationType()));
for (org.hl7.fhir.r4.model.Reference t : src.getSubject())
tgt.addSubject(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getAuthority())
tgt.addAuthority(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getDomain())
tgt.addDomain(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getSite())
tgt.addSite(convertReference(t));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
for (org.hl7.fhir.r4.model.StringType t : src.getAlias())
tgt.getAlias().add(convertString(t));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
if (src.hasScope())
tgt.setScope(convertCodeableConcept(src.getScope()));
if (src.hasTopic())
tgt.setTopic(convertType(src.getTopic()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubType())
tgt.addSubType(convertCodeableConcept(t));
if (src.hasContentDefinition())
tgt.setContentDefinition(convertContentDefinitionComponent(src.getContentDefinition()));
for (org.hl7.fhir.r4.model.Contract.TermComponent t : src.getTerm())
tgt.addTerm(convertTermComponent(t));
for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getRelevantHistory())
tgt.addRelevantHistory(convertReference(t));
for (org.hl7.fhir.r4.model.Contract.SignatoryComponent t : src.getSigner())
tgt.addSigner(convertSignatoryComponent(t));
for (org.hl7.fhir.r4.model.Contract.FriendlyLanguageComponent t : src.getFriendly())
tgt.addFriendly(convertFriendlyLanguageComponent(t));
for (org.hl7.fhir.r4.model.Contract.LegalLanguageComponent t : src.getLegal())
tgt.addLegal(convertLegalLanguageComponent(t));
for (org.hl7.fhir.r4.model.Contract.ComputableLanguageComponent t : src.getRule())
tgt.addRule(convertComputableLanguageComponent(t));
if (src.hasLegallyBinding())
tgt.setLegallyBinding(convertType(src.getLegallyBinding()));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract convertContract(org.hl7.fhir.r5.model.Contract src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract tgt = new org.hl7.fhir.r4.model.Contract();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasStatus())
tgt.setStatus(convertContractStatus(src.getStatus()));
if (src.hasLegalState())
tgt.setLegalState(convertCodeableConcept(src.getLegalState()));
if (src.hasInstantiatesCanonical())
tgt.setInstantiatesCanonical(convertReference(src.getInstantiatesCanonical()));
if (src.hasInstantiatesUri())
tgt.setInstantiatesUriElement(convertUri(src.getInstantiatesUriElement()));
if (src.hasContentDerivative())
tgt.setContentDerivative(convertCodeableConcept(src.getContentDerivative()));
if (src.hasIssued())
tgt.setIssuedElement(convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(convertPeriod(src.getApplies()));
if (src.hasExpirationType())
tgt.setExpirationType(convertCodeableConcept(src.getExpirationType()));
for (org.hl7.fhir.r5.model.Reference t : src.getSubject())
tgt.addSubject(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getAuthority())
tgt.addAuthority(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getDomain())
tgt.addDomain(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSite())
tgt.addSite(convertReference(t));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getAlias())
tgt.getAlias().add(convertString(t));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
if (src.hasScope())
tgt.setScope(convertCodeableConcept(src.getScope()));
if (src.hasTopic())
tgt.setTopic(convertType(src.getTopic()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubType())
tgt.addSubType(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(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory())
tgt.addRelevantHistory(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(convertType(src.getLegallyBinding()));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ContractStatus convertContractStatus(org.hl7.fhir.r4.model.Contract.ContractStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case AMENDED: return org.hl7.fhir.r5.model.Contract.ContractStatus.AMENDED;
case APPENDED: return org.hl7.fhir.r5.model.Contract.ContractStatus.APPENDED;
case CANCELLED: return org.hl7.fhir.r5.model.Contract.ContractStatus.CANCELLED;
case DISPUTED: return org.hl7.fhir.r5.model.Contract.ContractStatus.DISPUTED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Contract.ContractStatus.ENTEREDINERROR;
case EXECUTABLE: return org.hl7.fhir.r5.model.Contract.ContractStatus.EXECUTABLE;
case EXECUTED: return org.hl7.fhir.r5.model.Contract.ContractStatus.EXECUTED;
case NEGOTIABLE: return org.hl7.fhir.r5.model.Contract.ContractStatus.NEGOTIABLE;
case OFFERED: return org.hl7.fhir.r5.model.Contract.ContractStatus.OFFERED;
case POLICY: return org.hl7.fhir.r5.model.Contract.ContractStatus.POLICY;
case REJECTED: return org.hl7.fhir.r5.model.Contract.ContractStatus.REJECTED;
case RENEWED: return org.hl7.fhir.r5.model.Contract.ContractStatus.RENEWED;
case REVOKED: return org.hl7.fhir.r5.model.Contract.ContractStatus.REVOKED;
case RESOLVED: return org.hl7.fhir.r5.model.Contract.ContractStatus.RESOLVED;
case TERMINATED: return org.hl7.fhir.r5.model.Contract.ContractStatus.TERMINATED;
default: return org.hl7.fhir.r5.model.Contract.ContractStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Contract.ContractStatus convertContractStatus(org.hl7.fhir.r5.model.Contract.ContractStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case AMENDED: return org.hl7.fhir.r4.model.Contract.ContractStatus.AMENDED;
case APPENDED: return org.hl7.fhir.r4.model.Contract.ContractStatus.APPENDED;
case CANCELLED: return org.hl7.fhir.r4.model.Contract.ContractStatus.CANCELLED;
case DISPUTED: return org.hl7.fhir.r4.model.Contract.ContractStatus.DISPUTED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Contract.ContractStatus.ENTEREDINERROR;
case EXECUTABLE: return org.hl7.fhir.r4.model.Contract.ContractStatus.EXECUTABLE;
case EXECUTED: return org.hl7.fhir.r4.model.Contract.ContractStatus.EXECUTED;
case NEGOTIABLE: return org.hl7.fhir.r4.model.Contract.ContractStatus.NEGOTIABLE;
case OFFERED: return org.hl7.fhir.r4.model.Contract.ContractStatus.OFFERED;
case POLICY: return org.hl7.fhir.r4.model.Contract.ContractStatus.POLICY;
case REJECTED: return org.hl7.fhir.r4.model.Contract.ContractStatus.REJECTED;
case RENEWED: return org.hl7.fhir.r4.model.Contract.ContractStatus.RENEWED;
case REVOKED: return org.hl7.fhir.r4.model.Contract.ContractStatus.REVOKED;
case RESOLVED: return org.hl7.fhir.r4.model.Contract.ContractStatus.RESOLVED;
case TERMINATED: return org.hl7.fhir.r4.model.Contract.ContractStatus.TERMINATED;
default: return org.hl7.fhir.r4.model.Contract.ContractStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent convertContentDefinitionComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(convertCodeableConcept(src.getSubType()));
if (src.hasPublisher())
tgt.setPublisher(convertReference(src.getPublisher()));
if (src.hasPublicationDate())
tgt.setPublicationDateElement(convertDateTime(src.getPublicationDateElement()));
if (src.hasPublicationStatus())
tgt.setPublicationStatus(convertContractPublicationStatus(src.getPublicationStatus()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.ContentDefinitionComponent convertContentDefinitionComponent(org.hl7.fhir.r5.model.Contract.ContentDefinitionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.ContentDefinitionComponent tgt = new org.hl7.fhir.r4.model.Contract.ContentDefinitionComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(convertCodeableConcept(src.getSubType()));
if (src.hasPublisher())
tgt.setPublisher(convertReference(src.getPublisher()));
if (src.hasPublicationDate())
tgt.setPublicationDateElement(convertDateTime(src.getPublicationDateElement()));
if (src.hasPublicationStatus())
tgt.setPublicationStatus(convertContractPublicationStatus(src.getPublicationStatus()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ContractPublicationStatus convertContractPublicationStatus(org.hl7.fhir.r4.model.Contract.ContractPublicationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case AMENDED: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.AMENDED;
case APPENDED: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.APPENDED;
case CANCELLED: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.CANCELLED;
case DISPUTED: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.DISPUTED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.ENTEREDINERROR;
case EXECUTABLE: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.EXECUTABLE;
case EXECUTED: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.EXECUTED;
case NEGOTIABLE: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.NEGOTIABLE;
case OFFERED: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.OFFERED;
case POLICY: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.POLICY;
case REJECTED: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.REJECTED;
case RENEWED: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.RENEWED;
case REVOKED: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.REVOKED;
case RESOLVED: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.RESOLVED;
case TERMINATED: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.TERMINATED;
default: return org.hl7.fhir.r5.model.Contract.ContractPublicationStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Contract.ContractPublicationStatus convertContractPublicationStatus(org.hl7.fhir.r5.model.Contract.ContractPublicationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case AMENDED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.AMENDED;
case APPENDED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.APPENDED;
case CANCELLED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.CANCELLED;
case DISPUTED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.DISPUTED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.ENTEREDINERROR;
case EXECUTABLE: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.EXECUTABLE;
case EXECUTED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.EXECUTED;
case NEGOTIABLE: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.NEGOTIABLE;
case OFFERED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.OFFERED;
case POLICY: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.POLICY;
case REJECTED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.REJECTED;
case RENEWED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.RENEWED;
case REVOKED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.REVOKED;
case RESOLVED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.RESOLVED;
case TERMINATED: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.TERMINATED;
default: return org.hl7.fhir.r4.model.Contract.ContractPublicationStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasIssued())
tgt.setIssuedElement(convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(convertPeriod(src.getApplies()));
if (src.hasTopic())
tgt.setTopic(convertType(src.getTopic()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(convertCodeableConcept(src.getSubType()));
if (src.hasText())
tgt.setTextElement(convertString(src.getTextElement()));
for (org.hl7.fhir.r4.model.Contract.SecurityLabelComponent t : src.getSecurityLabel())
tgt.addSecurityLabel(convertSecurityLabelComponent(t));
if (src.hasOffer())
tgt.setOffer(convertContractOfferComponent(src.getOffer()));
for (org.hl7.fhir.r4.model.Contract.ContractAssetComponent t : src.getAsset())
tgt.addAsset(convertContractAssetComponent(t));
for (org.hl7.fhir.r4.model.Contract.ActionComponent t : src.getAction())
tgt.addAction(convertActionComponent(t));
for (org.hl7.fhir.r4.model.Contract.TermComponent t : src.getGroup())
tgt.addGroup(convertTermComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.r5.model.Contract.TermComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.TermComponent tgt = new org.hl7.fhir.r4.model.Contract.TermComponent();
copyElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasIssued())
tgt.setIssuedElement(convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(convertPeriod(src.getApplies()));
if (src.hasTopic())
tgt.setTopic(convertType(src.getTopic()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(convertCodeableConcept(src.getSubType()));
if (src.hasText())
tgt.setTextElement(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.r4.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();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getNumber())
tgt.getNumber().add(convertUnsignedInt(t));
if (src.hasClassification())
tgt.setClassification(convertCoding(src.getClassification()));
for (org.hl7.fhir.r4.model.Coding t : src.getCategory())
tgt.addCategory(convertCoding(t));
for (org.hl7.fhir.r4.model.Coding t : src.getControl())
tgt.addControl(convertCoding(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.SecurityLabelComponent convertSecurityLabelComponent(org.hl7.fhir.r5.model.Contract.SecurityLabelComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.SecurityLabelComponent tgt = new org.hl7.fhir.r4.model.Contract.SecurityLabelComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getNumber())
tgt.getNumber().add(convertUnsignedInt(t));
if (src.hasClassification())
tgt.setClassification(convertCoding(src.getClassification()));
for (org.hl7.fhir.r5.model.Coding t : src.getCategory())
tgt.addCategory(convertCoding(t));
for (org.hl7.fhir.r5.model.Coding t : src.getControl())
tgt.addControl(convertCoding(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ContractOfferComponent convertContractOfferComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.Contract.ContractPartyComponent t : src.getParty())
tgt.addParty(convertContractPartyComponent(t));
if (src.hasTopic())
tgt.setTopic(convertReference(src.getTopic()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasDecision())
tgt.setDecision(convertCodeableConcept(src.getDecision()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDecisionMode())
tgt.addDecisionMode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Contract.AnswerComponent t : src.getAnswer())
tgt.addAnswer(convertAnswerComponent(t));
if (src.hasText())
tgt.setTextElement(convertString(src.getTextElement()));
for (org.hl7.fhir.r4.model.StringType t : src.getLinkId())
tgt.getLinkId().add(convertString(t));
for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(convertUnsignedInt(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.ContractOfferComponent convertContractOfferComponent(org.hl7.fhir.r5.model.Contract.ContractOfferComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.ContractOfferComponent tgt = new org.hl7.fhir.r4.model.Contract.ContractOfferComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.Contract.ContractPartyComponent t : src.getParty())
tgt.addParty(convertContractPartyComponent(t));
if (src.hasTopic())
tgt.setTopic(convertReference(src.getTopic()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasDecision())
tgt.setDecision(convertCodeableConcept(src.getDecision()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDecisionMode())
tgt.addDecisionMode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Contract.AnswerComponent t : src.getAnswer())
tgt.addAnswer(convertAnswerComponent(t));
if (src.hasText())
tgt.setTextElement(convertString(src.getTextElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getLinkId())
tgt.getLinkId().add(convertString(t));
for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(convertUnsignedInt(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ContractPartyComponent convertContractPartyComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.Reference t : src.getReference())
tgt.addReference(convertReference(t));
if (src.hasRole())
tgt.setRole(convertCodeableConcept(src.getRole()));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.ContractPartyComponent convertContractPartyComponent(org.hl7.fhir.r5.model.Contract.ContractPartyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.ContractPartyComponent tgt = new org.hl7.fhir.r4.model.Contract.ContractPartyComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.Reference t : src.getReference())
tgt.addReference(convertReference(t));
if (src.hasRole())
tgt.setRole(convertCodeableConcept(src.getRole()));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.AnswerComponent convertAnswerComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.AnswerComponent convertAnswerComponent(org.hl7.fhir.r5.model.Contract.AnswerComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.AnswerComponent tgt = new org.hl7.fhir.r4.model.Contract.AnswerComponent();
copyElement(src, tgt);
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ContractAssetComponent convertContractAssetComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasScope())
tgt.setScope(convertCodeableConcept(src.getScope()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getTypeReference())
tgt.addTypeReference(convertReference(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubtype())
tgt.addSubtype(convertCodeableConcept(t));
if (src.hasRelationship())
tgt.setRelationship(convertCoding(src.getRelationship()));
for (org.hl7.fhir.r4.model.Contract.AssetContextComponent t : src.getContext())
tgt.addContext(convertAssetContextComponent(t));
if (src.hasCondition())
tgt.setConditionElement(convertString(src.getConditionElement()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPeriodType())
tgt.addPeriodType(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Period t : src.getPeriod())
tgt.addPeriod(convertPeriod(t));
for (org.hl7.fhir.r4.model.Period t : src.getUsePeriod())
tgt.addUsePeriod(convertPeriod(t));
if (src.hasText())
tgt.setTextElement(convertString(src.getTextElement()));
for (org.hl7.fhir.r4.model.StringType t : src.getLinkId())
tgt.getLinkId().add(convertString(t));
for (org.hl7.fhir.r4.model.Contract.AnswerComponent t : src.getAnswer())
tgt.addAnswer(convertAnswerComponent(t));
for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(convertUnsignedInt(t));
for (org.hl7.fhir.r4.model.Contract.ValuedItemComponent t : src.getValuedItem())
tgt.addValuedItem(convertValuedItemComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.ContractAssetComponent convertContractAssetComponent(org.hl7.fhir.r5.model.Contract.ContractAssetComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.ContractAssetComponent tgt = new org.hl7.fhir.r4.model.Contract.ContractAssetComponent();
copyElement(src, tgt);
if (src.hasScope())
tgt.setScope(convertCodeableConcept(src.getScope()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getTypeReference())
tgt.addTypeReference(convertReference(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubtype())
tgt.addSubtype(convertCodeableConcept(t));
if (src.hasRelationship())
tgt.setRelationship(convertCoding(src.getRelationship()));
for (org.hl7.fhir.r5.model.Contract.AssetContextComponent t : src.getContext())
tgt.addContext(convertAssetContextComponent(t));
if (src.hasCondition())
tgt.setConditionElement(convertString(src.getConditionElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPeriodType())
tgt.addPeriodType(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Period t : src.getPeriod())
tgt.addPeriod(convertPeriod(t));
for (org.hl7.fhir.r5.model.Period t : src.getUsePeriod())
tgt.addUsePeriod(convertPeriod(t));
if (src.hasText())
tgt.setTextElement(convertString(src.getTextElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getLinkId())
tgt.getLinkId().add(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(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.r4.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();
copyElement(src, tgt);
if (src.hasReference())
tgt.setReference(convertReference(src.getReference()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode())
tgt.addCode(convertCodeableConcept(t));
if (src.hasText())
tgt.setTextElement(convertString(src.getTextElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.AssetContextComponent convertAssetContextComponent(org.hl7.fhir.r5.model.Contract.AssetContextComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.AssetContextComponent tgt = new org.hl7.fhir.r4.model.Contract.AssetContextComponent();
copyElement(src, tgt);
if (src.hasReference())
tgt.setReference(convertReference(src.getReference()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode())
tgt.addCode(convertCodeableConcept(t));
if (src.hasText())
tgt.setTextElement(convertString(src.getTextElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasEntity())
tgt.setEntity(convertType(src.getEntity()));
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasEffectiveTime())
tgt.setEffectiveTimeElement(convertDateTime(src.getEffectiveTimeElement()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasPoints())
tgt.setPointsElement(convertDecimal(src.getPointsElement()));
if (src.hasNet())
tgt.setNet(convertMoney(src.getNet()));
if (src.hasPayment())
tgt.setPaymentElement(convertString(src.getPaymentElement()));
if (src.hasPaymentDate())
tgt.setPaymentDateElement(convertDateTime(src.getPaymentDateElement()));
if (src.hasResponsible())
tgt.setResponsible(convertReference(src.getResponsible()));
if (src.hasRecipient())
tgt.setRecipient(convertReference(src.getRecipient()));
for (org.hl7.fhir.r4.model.StringType t : src.getLinkId())
tgt.getLinkId().add(convertString(t));
for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(convertUnsignedInt(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.r5.model.Contract.ValuedItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.r4.model.Contract.ValuedItemComponent();
copyElement(src, tgt);
if (src.hasEntity())
tgt.setEntity(convertType(src.getEntity()));
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasEffectiveTime())
tgt.setEffectiveTimeElement(convertDateTime(src.getEffectiveTimeElement()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasPoints())
tgt.setPointsElement(convertDecimal(src.getPointsElement()));
if (src.hasNet())
tgt.setNet(convertMoney(src.getNet()));
if (src.hasPayment())
tgt.setPaymentElement(convertString(src.getPaymentElement()));
if (src.hasPaymentDate())
tgt.setPaymentDateElement(convertDateTime(src.getPaymentDateElement()));
if (src.hasResponsible())
tgt.setResponsible(convertReference(src.getResponsible()));
if (src.hasRecipient())
tgt.setRecipient(convertReference(src.getRecipient()));
for (org.hl7.fhir.r5.model.StringType t : src.getLinkId())
tgt.getLinkId().add(convertString(t));
for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(convertUnsignedInt(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ActionComponent convertActionComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.Contract.ActionSubjectComponent t : src.getSubject())
tgt.addSubject(convertActionSubjectComponent(t));
if (src.hasIntent())
tgt.setIntent(convertCodeableConcept(src.getIntent()));
for (org.hl7.fhir.r4.model.StringType t : src.getLinkId())
tgt.getLinkId().add(convertString(t));
if (src.hasStatus())
tgt.setStatus(convertCodeableConcept(src.getStatus()));
if (src.hasContext())
tgt.setContext(convertReference(src.getContext()));
for (org.hl7.fhir.r4.model.StringType t : src.getContextLinkId())
tgt.getContextLinkId().add(convertString(t));
if (src.hasOccurrence())
tgt.setOccurrence(convertType(src.getOccurrence()));
for (org.hl7.fhir.r4.model.Reference t : src.getRequester())
tgt.addRequester(convertReference(t));
for (org.hl7.fhir.r4.model.StringType t : src.getRequesterLinkId())
tgt.getRequesterLinkId().add(convertString(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPerformerType())
tgt.addPerformerType(convertCodeableConcept(t));
if (src.hasPerformerRole())
tgt.setPerformerRole(convertCodeableConcept(src.getPerformerRole()));
if (src.hasPerformer())
tgt.setPerformer(convertReference(src.getPerformer()));
for (org.hl7.fhir.r4.model.StringType t : src.getPerformerLinkId())
tgt.getPerformerLinkId().add(convertString(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r4.model.StringType t : src.getReason())
tgt.getReason().add(convertString(t));
for (org.hl7.fhir.r4.model.StringType t : src.getReasonLinkId())
tgt.getReasonLinkId().add(convertString(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(convertUnsignedInt(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.ActionComponent convertActionComponent(org.hl7.fhir.r5.model.Contract.ActionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.ActionComponent tgt = new org.hl7.fhir.r4.model.Contract.ActionComponent();
copyElement(src, tgt);
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.Contract.ActionSubjectComponent t : src.getSubject())
tgt.addSubject(convertActionSubjectComponent(t));
if (src.hasIntent())
tgt.setIntent(convertCodeableConcept(src.getIntent()));
for (org.hl7.fhir.r5.model.StringType t : src.getLinkId())
tgt.getLinkId().add(convertString(t));
if (src.hasStatus())
tgt.setStatus(convertCodeableConcept(src.getStatus()));
if (src.hasContext())
tgt.setContext(convertReference(src.getContext()));
for (org.hl7.fhir.r5.model.StringType t : src.getContextLinkId())
tgt.getContextLinkId().add(convertString(t));
if (src.hasOccurrence())
tgt.setOccurrence(convertType(src.getOccurrence()));
for (org.hl7.fhir.r5.model.Reference t : src.getRequester())
tgt.addRequester(convertReference(t));
for (org.hl7.fhir.r5.model.StringType t : src.getRequesterLinkId())
tgt.getRequesterLinkId().add(convertString(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPerformerType())
tgt.addPerformerType(convertCodeableConcept(t));
if (src.hasPerformerRole())
tgt.setPerformerRole(convertCodeableConcept(src.getPerformerRole()));
if (src.hasPerformer())
tgt.setPerformer(convertReference(src.getPerformer()));
for (org.hl7.fhir.r5.model.StringType t : src.getPerformerLinkId())
tgt.getPerformerLinkId().add(convertString(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r5.model.StringType t : src.getReason())
tgt.getReason().add(convertString(t));
for (org.hl7.fhir.r5.model.StringType t : src.getReasonLinkId())
tgt.getReasonLinkId().add(convertString(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.UnsignedIntType t : src.getSecurityLabelNumber())
tgt.getSecurityLabelNumber().add(convertUnsignedInt(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ActionSubjectComponent convertActionSubjectComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.Reference t : src.getReference())
tgt.addReference(convertReference(t));
if (src.hasRole())
tgt.setRole(convertCodeableConcept(src.getRole()));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.ActionSubjectComponent convertActionSubjectComponent(org.hl7.fhir.r5.model.Contract.ActionSubjectComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.ActionSubjectComponent tgt = new org.hl7.fhir.r4.model.Contract.ActionSubjectComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.Reference t : src.getReference())
tgt.addReference(convertReference(t));
if (src.hasRole())
tgt.setRole(convertCodeableConcept(src.getRole()));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCoding(src.getType()));
if (src.hasParty())
tgt.setParty(convertReference(src.getParty()));
for (org.hl7.fhir.r4.model.Signature t : src.getSignature())
tgt.addSignature(convertSignature(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.r5.model.Contract.SignatoryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.r4.model.Contract.SignatoryComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCoding(src.getType()));
if (src.hasParty())
tgt.setParty(convertReference(src.getParty()));
for (org.hl7.fhir.r5.model.Signature t : src.getSignature())
tgt.addSignature(convertSignature(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.r5.model.Contract.FriendlyLanguageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.r4.model.Contract.FriendlyLanguageComponent();
copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.r5.model.Contract.LegalLanguageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.r4.model.Contract.LegalLanguageComponent();
copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.r4.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.r5.model.Contract.ComputableLanguageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.r4.model.Contract.ComputableLanguageComponent();
copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(convertType(src.getContent()));
return tgt;
}
}

View File

@ -0,0 +1,231 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Coverage extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Coverage convertCoverage(org.hl7.fhir.r4.model.Coverage src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Coverage tgt = new org.hl7.fhir.r5.model.Coverage();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertCoverageStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasPolicyHolder())
tgt.setPolicyHolder(convertReference(src.getPolicyHolder()));
if (src.hasSubscriber())
tgt.setSubscriber(convertReference(src.getSubscriber()));
if (src.hasSubscriberId())
tgt.setSubscriberIdElement(convertString(src.getSubscriberIdElement()));
if (src.hasBeneficiary())
tgt.setBeneficiary(convertReference(src.getBeneficiary()));
if (src.hasDependent())
tgt.setDependentElement(convertString(src.getDependentElement()));
if (src.hasRelationship())
tgt.setRelationship(convertCodeableConcept(src.getRelationship()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r4.model.Reference t : src.getPayor())
tgt.addPayor(convertReference(t));
for (org.hl7.fhir.r4.model.Coverage.ClassComponent t : src.getClass_())
tgt.addClass_(convertClassComponent(t));
if (src.hasOrder())
tgt.setOrderElement(convertPositiveInt(src.getOrderElement()));
if (src.hasNetwork())
tgt.setNetworkElement(convertString(src.getNetworkElement()));
for (org.hl7.fhir.r4.model.Coverage.CostToBeneficiaryComponent t : src.getCostToBeneficiary())
tgt.addCostToBeneficiary(convertCostToBeneficiaryComponent(t));
if (src.hasSubrogation())
tgt.setSubrogationElement(convertBoolean(src.getSubrogationElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getContract())
tgt.addContract(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Coverage convertCoverage(org.hl7.fhir.r5.model.Coverage src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Coverage tgt = new org.hl7.fhir.r4.model.Coverage();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertCoverageStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasPolicyHolder())
tgt.setPolicyHolder(convertReference(src.getPolicyHolder()));
if (src.hasSubscriber())
tgt.setSubscriber(convertReference(src.getSubscriber()));
if (src.hasSubscriberId())
tgt.setSubscriberIdElement(convertString(src.getSubscriberIdElement()));
if (src.hasBeneficiary())
tgt.setBeneficiary(convertReference(src.getBeneficiary()));
if (src.hasDependent())
tgt.setDependentElement(convertString(src.getDependentElement()));
if (src.hasRelationship())
tgt.setRelationship(convertCodeableConcept(src.getRelationship()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r5.model.Reference t : src.getPayor())
tgt.addPayor(convertReference(t));
for (org.hl7.fhir.r5.model.Coverage.ClassComponent t : src.getClass_())
tgt.addClass_(convertClassComponent(t));
if (src.hasOrder())
tgt.setOrderElement(convertPositiveInt(src.getOrderElement()));
if (src.hasNetwork())
tgt.setNetworkElement(convertString(src.getNetworkElement()));
for (org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent t : src.getCostToBeneficiary())
tgt.addCostToBeneficiary(convertCostToBeneficiaryComponent(t));
if (src.hasSubrogation())
tgt.setSubrogationElement(convertBoolean(src.getSubrogationElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getContract())
tgt.addContract(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Coverage.CoverageStatus convertCoverageStatus(org.hl7.fhir.r4.model.Coverage.CoverageStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.Coverage.CoverageStatus.ACTIVE;
case CANCELLED: return org.hl7.fhir.r5.model.Coverage.CoverageStatus.CANCELLED;
case DRAFT: return org.hl7.fhir.r5.model.Coverage.CoverageStatus.DRAFT;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Coverage.CoverageStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.Coverage.CoverageStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Coverage.CoverageStatus convertCoverageStatus(org.hl7.fhir.r5.model.Coverage.CoverageStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.Coverage.CoverageStatus.ACTIVE;
case CANCELLED: return org.hl7.fhir.r4.model.Coverage.CoverageStatus.CANCELLED;
case DRAFT: return org.hl7.fhir.r4.model.Coverage.CoverageStatus.DRAFT;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Coverage.CoverageStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.Coverage.CoverageStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Coverage.ClassComponent convertClassComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasValue())
tgt.setValueElement(convertString(src.getValueElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Coverage.ClassComponent convertClassComponent(org.hl7.fhir.r5.model.Coverage.ClassComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Coverage.ClassComponent tgt = new org.hl7.fhir.r4.model.Coverage.ClassComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasValue())
tgt.setValueElement(convertString(src.getValueElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent convertCostToBeneficiaryComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
for (org.hl7.fhir.r4.model.Coverage.ExemptionComponent t : src.getException())
tgt.addException(convertExemptionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Coverage.CostToBeneficiaryComponent convertCostToBeneficiaryComponent(org.hl7.fhir.r5.model.Coverage.CostToBeneficiaryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Coverage.CostToBeneficiaryComponent tgt = new org.hl7.fhir.r4.model.Coverage.CostToBeneficiaryComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasValue())
tgt.setValue(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.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4.model.Coverage.ExemptionComponent convertExemptionComponent(org.hl7.fhir.r5.model.Coverage.ExemptionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Coverage.ExemptionComponent tgt = new org.hl7.fhir.r4.model.Coverage.ExemptionComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
}

View File

@ -0,0 +1,295 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CoverageEligibilityRequest extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.CoverageEligibilityRequest convertCoverageEligibilityRequest(org.hl7.fhir.r4.model.CoverageEligibilityRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CoverageEligibilityRequest tgt = new org.hl7.fhir.r5.model.CoverageEligibilityRequest();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertEligibilityRequestStatus(src.getStatus()));
if (src.hasPriority())
tgt.setPriority(convertCodeableConcept(src.getPriority()));
for (org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose> t : src.getPurpose())
tgt.addPurpose(convertEligibilityRequestPurpose(t.getValue()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasServiced())
tgt.setServiced(convertType(src.getServiced()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasEnterer())
tgt.setEnterer(convertReference(src.getEnterer()));
if (src.hasProvider())
tgt.setProvider(convertReference(src.getProvider()));
if (src.hasInsurer())
tgt.setInsurer(convertReference(src.getInsurer()));
if (src.hasFacility())
tgt.setFacility(convertReference(src.getFacility()));
for (org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent t : src.getSupportingInfo())
tgt.addSupportingInfo(convertSupportingInformationComponent(t));
for (org.hl7.fhir.r4.model.CoverageEligibilityRequest.InsuranceComponent t : src.getInsurance())
tgt.addInsurance(convertInsuranceComponent(t));
for (org.hl7.fhir.r4.model.CoverageEligibilityRequest.DetailsComponent t : src.getItem())
tgt.addItem(convertDetailsComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CoverageEligibilityRequest convertCoverageEligibilityRequest(org.hl7.fhir.r5.model.CoverageEligibilityRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CoverageEligibilityRequest tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertEligibilityRequestStatus(src.getStatus()));
if (src.hasPriority())
tgt.setPriority(convertCodeableConcept(src.getPriority()));
for (org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose> t : src.getPurpose())
tgt.addPurpose(convertEligibilityRequestPurpose(t.getValue()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasServiced())
tgt.setServiced(convertType(src.getServiced()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasEnterer())
tgt.setEnterer(convertReference(src.getEnterer()));
if (src.hasProvider())
tgt.setProvider(convertReference(src.getProvider()));
if (src.hasInsurer())
tgt.setInsurer(convertReference(src.getInsurer()));
if (src.hasFacility())
tgt.setFacility(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;
}
public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestStatus convertEligibilityRequestStatus(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestStatus.ACTIVE;
case CANCELLED: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestStatus.CANCELLED;
case DRAFT: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestStatus.DRAFT;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus convertEligibilityRequestStatus(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.ACTIVE;
case CANCELLED: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.CANCELLED;
case DRAFT: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.DRAFT;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose convertEligibilityRequestPurpose(org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case AUTHREQUIREMENTS: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS;
case BENEFITS: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS;
case DISCOVERY: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY;
case VALIDATION: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION;
default: return org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose.NULL;
}
}
public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose convertEligibilityRequestPurpose(org.hl7.fhir.r5.model.CoverageEligibilityRequest.EligibilityRequestPurpose src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case AUTHREQUIREMENTS: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.AUTHREQUIREMENTS;
case BENEFITS: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.BENEFITS;
case DISCOVERY: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.DISCOVERY;
case VALIDATION: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.VALIDATION;
default: return org.hl7.fhir.r4.model.CoverageEligibilityRequest.EligibilityRequestPurpose.NULL;
}
}
public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasInformation())
tgt.setInformation(convertReference(src.getInformation()));
if (src.hasAppliesToAll())
tgt.setAppliesToAllElement(convertBoolean(src.getAppliesToAllElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent convertSupportingInformationComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.SupportingInformationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest.SupportingInformationComponent();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasInformation())
tgt.setInformation(convertReference(src.getInformation()));
if (src.hasAppliesToAll())
tgt.setAppliesToAllElement(convertBoolean(src.getAppliesToAllElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasFocal())
tgt.setFocalElement(convertBoolean(src.getFocalElement()));
if (src.hasCoverage())
tgt.setCoverage(convertReference(src.getCoverage()));
if (src.hasBusinessArrangement())
tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.InsuranceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CoverageEligibilityRequest.InsuranceComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest.InsuranceComponent();
copyElement(src, tgt);
if (src.hasFocal())
tgt.setFocalElement(convertBoolean(src.getFocalElement()));
if (src.hasCoverage())
tgt.setCoverage(convertReference(src.getCoverage()));
if (src.hasBusinessArrangement())
tgt.setBusinessArrangementElement(convertString(src.getBusinessArrangementElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent convertDetailsComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.PositiveIntType t : src.getSupportingInfoSequence())
tgt.getSupportingInfoSequence().add(convertPositiveInt(t));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
if (src.hasProvider())
tgt.setProvider(convertReference(src.getProvider()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFacility())
tgt.setFacility(convertReference(src.getFacility()));
for (org.hl7.fhir.r4.model.CoverageEligibilityRequest.DiagnosisComponent t : src.getDiagnosis())
tgt.addDiagnosis(convertDiagnosisComponent(t));
for (org.hl7.fhir.r4.model.Reference t : src.getDetail())
tgt.addDetail(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.DetailsComponent convertDetailsComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.DetailsComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CoverageEligibilityRequest.DetailsComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest.DetailsComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.PositiveIntType t : src.getSupportingInfoSequence())
tgt.getSupportingInfoSequence().add(convertPositiveInt(t));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
if (src.hasProvider())
tgt.setProvider(convertReference(src.getProvider()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(convertMoney(src.getUnitPrice()));
if (src.hasFacility())
tgt.setFacility(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(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasDiagnosis())
tgt.setDiagnosis(convertType(src.getDiagnosis()));
return tgt;
}
public static org.hl7.fhir.r4.model.CoverageEligibilityRequest.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.CoverageEligibilityRequest.DiagnosisComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CoverageEligibilityRequest.DiagnosisComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityRequest.DiagnosisComponent();
copyElement(src, tgt);
if (src.hasDiagnosis())
tgt.setDiagnosis(convertType(src.getDiagnosis()));
return tgt;
}
}

View File

@ -0,0 +1,343 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class CoverageEligibilityResponse extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.CoverageEligibilityResponse convertCoverageEligibilityResponse(org.hl7.fhir.r4.model.CoverageEligibilityResponse src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CoverageEligibilityResponse tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertEligibilityResponseStatus(src.getStatus()));
for (org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose> t : src.getPurpose())
tgt.addPurpose(convertEligibilityResponsePurpose(t.getValue()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasServiced())
tgt.setServiced(convertType(src.getServiced()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasRequestor())
tgt.setRequestor(convertReference(src.getRequestor()));
if (src.hasRequest())
tgt.setRequest(convertReference(src.getRequest()));
if (src.hasOutcome())
tgt.setOutcome(convertRemittanceOutcome(src.getOutcome()));
if (src.hasDisposition())
tgt.setDispositionElement(convertString(src.getDispositionElement()));
if (src.hasInsurer())
tgt.setInsurer(convertReference(src.getInsurer()));
for (org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent t : src.getInsurance())
tgt.addInsurance(convertInsuranceComponent(t));
if (src.hasPreAuthRef())
tgt.setPreAuthRefElement(convertString(src.getPreAuthRefElement()));
if (src.hasForm())
tgt.setForm(convertCodeableConcept(src.getForm()));
for (org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent t : src.getError())
tgt.addError(convertErrorsComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CoverageEligibilityResponse convertCoverageEligibilityResponse(org.hl7.fhir.r5.model.CoverageEligibilityResponse src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CoverageEligibilityResponse tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertEligibilityResponseStatus(src.getStatus()));
for (org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose> t : src.getPurpose())
tgt.addPurpose(convertEligibilityResponsePurpose(t.getValue()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasServiced())
tgt.setServiced(convertType(src.getServiced()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasRequestor())
tgt.setRequestor(convertReference(src.getRequestor()));
if (src.hasRequest())
tgt.setRequest(convertReference(src.getRequest()));
if (src.hasOutcome())
tgt.setOutcome(convertRemittanceOutcome(src.getOutcome()));
if (src.hasDisposition())
tgt.setDispositionElement(convertString(src.getDispositionElement()));
if (src.hasInsurer())
tgt.setInsurer(convertReference(src.getInsurer()));
for (org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent t : src.getInsurance())
tgt.addInsurance(convertInsuranceComponent(t));
if (src.hasPreAuthRef())
tgt.setPreAuthRefElement(convertString(src.getPreAuthRefElement()));
if (src.hasForm())
tgt.setForm(convertCodeableConcept(src.getForm()));
for (org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent t : src.getError())
tgt.addError(convertErrorsComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponseStatus convertEligibilityResponseStatus(org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponseStatus.ACTIVE;
case CANCELLED: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponseStatus.CANCELLED;
case DRAFT: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponseStatus.DRAFT;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponseStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponseStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus convertEligibilityResponseStatus(org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponseStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.ACTIVE;
case CANCELLED: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.CANCELLED;
case DRAFT: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.DRAFT;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponseStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose convertEligibilityResponsePurpose(org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case AUTHREQUIREMENTS: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.AUTHREQUIREMENTS;
case BENEFITS: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.BENEFITS;
case DISCOVERY: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.DISCOVERY;
case VALIDATION: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.VALIDATION;
default: return org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose.NULL;
}
}
public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose convertEligibilityResponsePurpose(org.hl7.fhir.r5.model.CoverageEligibilityResponse.EligibilityResponsePurpose src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case AUTHREQUIREMENTS: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.AUTHREQUIREMENTS;
case BENEFITS: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.BENEFITS;
case DISCOVERY: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.DISCOVERY;
case VALIDATION: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.VALIDATION;
default: return org.hl7.fhir.r4.model.CoverageEligibilityResponse.EligibilityResponsePurpose.NULL;
}
}
public static org.hl7.fhir.r5.model.Enumerations.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case QUEUED: return org.hl7.fhir.r5.model.Enumerations.RemittanceOutcome.QUEUED;
case COMPLETE: return org.hl7.fhir.r5.model.Enumerations.RemittanceOutcome.COMPLETE;
case ERROR: return org.hl7.fhir.r5.model.Enumerations.RemittanceOutcome.ERROR;
case PARTIAL: return org.hl7.fhir.r5.model.Enumerations.RemittanceOutcome.PARTIAL;
default: return org.hl7.fhir.r5.model.Enumerations.RemittanceOutcome.NULL;
}
}
public static org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumerations.RemittanceOutcome src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case QUEUED: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.QUEUED;
case COMPLETE: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.COMPLETE;
case ERROR: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.ERROR;
case PARTIAL: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.PARTIAL;
default: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.NULL;
}
}
public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent();
copyElement(src, tgt);
if (src.hasCoverage())
tgt.setCoverage(convertReference(src.getCoverage()));
if (src.hasInforce())
tgt.setInforceElement(convertBoolean(src.getInforceElement()));
if (src.hasBenefitPeriod())
tgt.setBenefitPeriod(convertPeriod(src.getBenefitPeriod()));
for (org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent t : src.getItem())
tgt.addItem(convertItemsComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.CoverageEligibilityResponse.InsuranceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse.InsuranceComponent();
copyElement(src, tgt);
if (src.hasCoverage())
tgt.setCoverage(convertReference(src.getCoverage()));
if (src.hasInforce())
tgt.setInforceElement(convertBoolean(src.getInforceElement()));
if (src.hasBenefitPeriod())
tgt.setBenefitPeriod(convertPeriod(src.getBenefitPeriod()));
for (org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent t : src.getItem())
tgt.addItem(convertItemsComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent convertItemsComponent(org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent();
copyElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
if (src.hasProvider())
tgt.setProvider(convertReference(src.getProvider()));
if (src.hasExcluded())
tgt.setExcludedElement(convertBoolean(src.getExcludedElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasNetwork())
tgt.setNetwork(convertCodeableConcept(src.getNetwork()));
if (src.hasUnit())
tgt.setUnit(convertCodeableConcept(src.getUnit()));
if (src.hasTerm())
tgt.setTerm(convertCodeableConcept(src.getTerm()));
for (org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent t : src.getBenefit())
tgt.addBenefit(convertBenefitComponent(t));
if (src.hasAuthorizationRequired())
tgt.setAuthorizationRequiredElement(convertBoolean(src.getAuthorizationRequiredElement()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getAuthorizationSupporting())
tgt.addAuthorizationSupporting(convertCodeableConcept(t));
if (src.hasAuthorizationUrl())
tgt.setAuthorizationUrlElement(convertUri(src.getAuthorizationUrlElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent convertItemsComponent(org.hl7.fhir.r5.model.CoverageEligibilityResponse.ItemsComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse.ItemsComponent();
copyElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasProductOrService())
tgt.setProductOrService(convertCodeableConcept(src.getProductOrService()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
tgt.addModifier(convertCodeableConcept(t));
if (src.hasProvider())
tgt.setProvider(convertReference(src.getProvider()));
if (src.hasExcluded())
tgt.setExcludedElement(convertBoolean(src.getExcludedElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasNetwork())
tgt.setNetwork(convertCodeableConcept(src.getNetwork()));
if (src.hasUnit())
tgt.setUnit(convertCodeableConcept(src.getUnit()));
if (src.hasTerm())
tgt.setTerm(convertCodeableConcept(src.getTerm()));
for (org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent t : src.getBenefit())
tgt.addBenefit(convertBenefitComponent(t));
if (src.hasAuthorizationRequired())
tgt.setAuthorizationRequiredElement(convertBoolean(src.getAuthorizationRequiredElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorizationSupporting())
tgt.addAuthorizationSupporting(convertCodeableConcept(t));
if (src.hasAuthorizationUrl())
tgt.setAuthorizationUrlElement(convertUri(src.getAuthorizationUrlElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent convertBenefitComponent(org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasAllowed())
tgt.setAllowed(convertType(src.getAllowed()));
if (src.hasUsed())
tgt.setUsed(convertType(src.getUsed()));
return tgt;
}
public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent convertBenefitComponent(org.hl7.fhir.r5.model.CoverageEligibilityResponse.BenefitComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse.BenefitComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasAllowed())
tgt.setAllowed(convertType(src.getAllowed()));
if (src.hasUsed())
tgt.setUsed(convertType(src.getUsed()));
return tgt;
}
public static org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent convertErrorsComponent(org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent tgt = new org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
return tgt;
}
public static org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent convertErrorsComponent(org.hl7.fhir.r5.model.CoverageEligibilityResponse.ErrorsComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent tgt = new org.hl7.fhir.r4.model.CoverageEligibilityResponse.ErrorsComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
return tgt;
}
}

View File

@ -0,0 +1,213 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class DetectedIssue extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.r4.model.DetectedIssue src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DetectedIssue tgt = new org.hl7.fhir.r5.model.DetectedIssue();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertDetectedIssueStatus(src.getStatus()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasSeverity())
tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasIdentified())
tgt.setIdentified(convertType(src.getIdentified()));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
for (org.hl7.fhir.r4.model.Reference t : src.getImplicated())
tgt.addImplicated(convertReference(t));
for (org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent t : src.getEvidence())
tgt.addEvidence(convertDetectedIssueEvidenceComponent(t));
if (src.hasDetail())
tgt.setDetailElement(convertString(src.getDetailElement()));
if (src.hasReference())
tgt.setReferenceElement(convertUri(src.getReferenceElement()));
for (org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation())
tgt.addMitigation(convertDetectedIssueMitigationComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.r5.model.DetectedIssue src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DetectedIssue tgt = new org.hl7.fhir.r4.model.DetectedIssue();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertDetectedIssueStatus(src.getStatus()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasSeverity())
tgt.setSeverity(convertDetectedIssueSeverity(src.getSeverity()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasIdentified())
tgt.setIdentified(convertType(src.getIdentified()));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
for (org.hl7.fhir.r5.model.Reference t : src.getImplicated())
tgt.addImplicated(convertReference(t));
for (org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent t : src.getEvidence())
tgt.addEvidence(convertDetectedIssueEvidenceComponent(t));
if (src.hasDetail())
tgt.setDetailElement(convertString(src.getDetailElement()));
if (src.hasReference())
tgt.setReferenceElement(convertUri(src.getReferenceElement()));
for (org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation())
tgt.addMitigation(convertDetectedIssueMitigationComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus convertDetectedIssueStatus(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case REGISTERED: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.REGISTERED;
case PRELIMINARY: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY;
case FINAL: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.FINAL;
case AMENDED: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.AMENDED;
case CORRECTED: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.CORRECTED;
case CANCELLED: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.CANCELLED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.UNKNOWN;
default: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus convertDetectedIssueStatus(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case REGISTERED: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.REGISTERED;
case PRELIMINARY: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.PRELIMINARY;
case FINAL: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.FINAL;
case AMENDED: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.AMENDED;
case CORRECTED: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.CORRECTED;
case CANCELLED: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.CANCELLED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.UNKNOWN;
default: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity convertDetectedIssueSeverity(org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case HIGH: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.HIGH;
case MODERATE: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.MODERATE;
case LOW: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.LOW;
default: return org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity.NULL;
}
}
public static org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity convertDetectedIssueSeverity(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueSeverity src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case HIGH: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.HIGH;
case MODERATE: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.MODERATE;
case LOW: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.LOW;
default: return org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueSeverity.NULL;
}
}
public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent convertDetectedIssueEvidenceComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode())
tgt.addCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getDetail())
tgt.addDetail(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent convertDetectedIssueEvidenceComponent(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueEvidenceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent tgt = new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueEvidenceComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode())
tgt.addCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getDetail())
tgt.addDetail(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasAction())
tgt.setAction(convertCodeableConcept(src.getAction()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
return tgt;
}
public static org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.r5.model.DetectedIssue.DetectedIssueMitigationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.r4.model.DetectedIssue.DetectedIssueMitigationComponent();
copyElement(src, tgt);
if (src.hasAction())
tgt.setAction(convertCodeableConcept(src.getAction()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
return tgt;
}
}

View File

@ -0,0 +1,387 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Device extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Device convertDevice(org.hl7.fhir.r4.model.Device src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Device tgt = new org.hl7.fhir.r5.model.Device();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasDefinition())
tgt.setDefinition(convertReference(src.getDefinition()));
for (org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent t : src.getUdiCarrier())
tgt.addUdiCarrier(convertDeviceUdiCarrierComponent(t));
if (src.hasStatus())
tgt.setStatus(convertFHIRDeviceStatus(src.getStatus()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getStatusReason())
tgt.addStatusReason(convertCodeableConcept(t));
if (src.hasDistinctIdentifier())
tgt.setDistinctIdentifierElement(convertString(src.getDistinctIdentifierElement()));
if (src.hasManufacturer())
tgt.setManufacturerElement(convertString(src.getManufacturerElement()));
if (src.hasManufactureDate())
tgt.setManufactureDateElement(convertDateTime(src.getManufactureDateElement()));
if (src.hasExpirationDate())
tgt.setExpirationDateElement(convertDateTime(src.getExpirationDateElement()));
if (src.hasLotNumber())
tgt.setLotNumberElement(convertString(src.getLotNumberElement()));
if (src.hasSerialNumber())
tgt.setSerialNumberElement(convertString(src.getSerialNumberElement()));
for (org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent t : src.getDeviceName())
tgt.addDeviceName(convertDeviceDeviceNameComponent(t));
if (src.hasModelNumber())
tgt.setModelNumberElement(convertString(src.getModelNumberElement()));
if (src.hasPartNumber())
tgt.setPartNumberElement(convertString(src.getPartNumberElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent t : src.getSpecialization())
tgt.addSpecialization(convertDeviceSpecializationComponent(t));
for (org.hl7.fhir.r4.model.Device.DeviceVersionComponent t : src.getVersion())
tgt.addVersion(convertDeviceVersionComponent(t));
for (org.hl7.fhir.r4.model.Device.DevicePropertyComponent t : src.getProperty())
tgt.addProperty(convertDevicePropertyComponent(t));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasOwner())
tgt.setOwner(convertReference(src.getOwner()));
for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact())
tgt.addContact(convertContactPoint(t));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSafety())
tgt.addSafety(convertCodeableConcept(t));
if (src.hasParent())
tgt.setParent(convertReference(src.getParent()));
return tgt;
}
public static org.hl7.fhir.r4.model.Device convertDevice(org.hl7.fhir.r5.model.Device src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Device tgt = new org.hl7.fhir.r4.model.Device();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasDefinition())
tgt.setDefinition(convertReference(src.getDefinition()));
for (org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent t : src.getUdiCarrier())
tgt.addUdiCarrier(convertDeviceUdiCarrierComponent(t));
if (src.hasStatus())
tgt.setStatus(convertFHIRDeviceStatus(src.getStatus()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason())
tgt.addStatusReason(convertCodeableConcept(t));
if (src.hasDistinctIdentifier())
tgt.setDistinctIdentifierElement(convertString(src.getDistinctIdentifierElement()));
if (src.hasManufacturer())
tgt.setManufacturerElement(convertString(src.getManufacturerElement()));
if (src.hasManufactureDate())
tgt.setManufactureDateElement(convertDateTime(src.getManufactureDateElement()));
if (src.hasExpirationDate())
tgt.setExpirationDateElement(convertDateTime(src.getExpirationDateElement()));
if (src.hasLotNumber())
tgt.setLotNumberElement(convertString(src.getLotNumberElement()));
if (src.hasSerialNumber())
tgt.setSerialNumberElement(convertString(src.getSerialNumberElement()));
for (org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent t : src.getDeviceName())
tgt.addDeviceName(convertDeviceDeviceNameComponent(t));
if (src.hasModelNumber())
tgt.setModelNumberElement(convertString(src.getModelNumberElement()));
if (src.hasPartNumber())
tgt.setPartNumberElement(convertString(src.getPartNumberElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
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.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasOwner())
tgt.setOwner(convertReference(src.getOwner()));
for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact())
tgt.addContact(convertContactPoint(t));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSafety())
tgt.addSafety(convertCodeableConcept(t));
if (src.hasParent())
tgt.setParent(convertReference(src.getParent()));
return tgt;
}
public static org.hl7.fhir.r5.model.Device.FHIRDeviceStatus convertFHIRDeviceStatus(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.ACTIVE;
case INACTIVE: return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.INACTIVE;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.UNKNOWN;
default: return org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Device.FHIRDeviceStatus convertFHIRDeviceStatus(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ACTIVE;
case INACTIVE: return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.INACTIVE;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.UNKNOWN;
default: return org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent convertDeviceUdiCarrierComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasDeviceIdentifier())
tgt.setDeviceIdentifierElement(convertString(src.getDeviceIdentifierElement()));
if (src.hasIssuer())
tgt.setIssuerElement(convertUri(src.getIssuerElement()));
if (src.hasJurisdiction())
tgt.setJurisdictionElement(convertUri(src.getJurisdictionElement()));
if (src.hasCarrierAIDC())
tgt.setCarrierAIDCElement(convertBase64Binary(src.getCarrierAIDCElement()));
if (src.hasCarrierHRF())
tgt.setCarrierHRFElement(convertString(src.getCarrierHRFElement()));
if (src.hasEntryType())
tgt.setEntryType(convertUDIEntryType(src.getEntryType()));
return tgt;
}
public static org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent convertDeviceUdiCarrierComponent(org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent tgt = new org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent();
copyElement(src, tgt);
if (src.hasDeviceIdentifier())
tgt.setDeviceIdentifierElement(convertString(src.getDeviceIdentifierElement()));
if (src.hasIssuer())
tgt.setIssuerElement(convertUri(src.getIssuerElement()));
if (src.hasJurisdiction())
tgt.setJurisdictionElement(convertUri(src.getJurisdictionElement()));
if (src.hasCarrierAIDC())
tgt.setCarrierAIDCElement(convertBase64Binary(src.getCarrierAIDCElement()));
if (src.hasCarrierHRF())
tgt.setCarrierHRFElement(convertString(src.getCarrierHRFElement()));
if (src.hasEntryType())
tgt.setEntryType(convertUDIEntryType(src.getEntryType()));
return tgt;
}
public static org.hl7.fhir.r5.model.Device.UDIEntryType convertUDIEntryType(org.hl7.fhir.r4.model.Device.UDIEntryType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case BARCODE: return org.hl7.fhir.r5.model.Device.UDIEntryType.BARCODE;
case RFID: return org.hl7.fhir.r5.model.Device.UDIEntryType.RFID;
case MANUAL: return org.hl7.fhir.r5.model.Device.UDIEntryType.MANUAL;
case CARD: return org.hl7.fhir.r5.model.Device.UDIEntryType.CARD;
case SELFREPORTED: return org.hl7.fhir.r5.model.Device.UDIEntryType.SELFREPORTED;
case UNKNOWN: return org.hl7.fhir.r5.model.Device.UDIEntryType.UNKNOWN;
default: return org.hl7.fhir.r5.model.Device.UDIEntryType.NULL;
}
}
public static org.hl7.fhir.r4.model.Device.UDIEntryType convertUDIEntryType(org.hl7.fhir.r5.model.Device.UDIEntryType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case BARCODE: return org.hl7.fhir.r4.model.Device.UDIEntryType.BARCODE;
case RFID: return org.hl7.fhir.r4.model.Device.UDIEntryType.RFID;
case MANUAL: return org.hl7.fhir.r4.model.Device.UDIEntryType.MANUAL;
case CARD: return org.hl7.fhir.r4.model.Device.UDIEntryType.CARD;
case SELFREPORTED: return org.hl7.fhir.r4.model.Device.UDIEntryType.SELFREPORTED;
case UNKNOWN: return org.hl7.fhir.r4.model.Device.UDIEntryType.UNKNOWN;
default: return org.hl7.fhir.r4.model.Device.UDIEntryType.NULL;
}
}
public static org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent convertDeviceDeviceNameComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasType())
tgt.setType(convertDeviceNameType(src.getType()));
return tgt;
}
public static org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent convertDeviceDeviceNameComponent(org.hl7.fhir.r5.model.Device.DeviceDeviceNameComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent tgt = new org.hl7.fhir.r4.model.Device.DeviceDeviceNameComponent();
copyElement(src, tgt);
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasType())
tgt.setType(convertDeviceNameType(src.getType()));
return tgt;
}
public static org.hl7.fhir.r5.model.Device.DeviceNameType convertDeviceNameType(org.hl7.fhir.r4.model.Device.DeviceNameType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case UDILABELNAME: return org.hl7.fhir.r5.model.Device.DeviceNameType.UDILABELNAME;
case USERFRIENDLYNAME: return org.hl7.fhir.r5.model.Device.DeviceNameType.USERFRIENDLYNAME;
case PATIENTREPORTEDNAME: return org.hl7.fhir.r5.model.Device.DeviceNameType.PATIENTREPORTEDNAME;
case MANUFACTURERNAME: return org.hl7.fhir.r5.model.Device.DeviceNameType.MANUFACTURERNAME;
case MODELNAME: return org.hl7.fhir.r5.model.Device.DeviceNameType.MODELNAME;
case OTHER: return org.hl7.fhir.r5.model.Device.DeviceNameType.OTHER;
default: return org.hl7.fhir.r5.model.Device.DeviceNameType.NULL;
}
}
public static org.hl7.fhir.r4.model.Device.DeviceNameType convertDeviceNameType(org.hl7.fhir.r5.model.Device.DeviceNameType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case UDILABELNAME: return org.hl7.fhir.r4.model.Device.DeviceNameType.UDILABELNAME;
case USERFRIENDLYNAME: return org.hl7.fhir.r4.model.Device.DeviceNameType.USERFRIENDLYNAME;
case PATIENTREPORTEDNAME: return org.hl7.fhir.r4.model.Device.DeviceNameType.PATIENTREPORTEDNAME;
case MANUFACTURERNAME: return org.hl7.fhir.r4.model.Device.DeviceNameType.MANUFACTURERNAME;
case MODELNAME: return org.hl7.fhir.r4.model.Device.DeviceNameType.MODELNAME;
case OTHER: return org.hl7.fhir.r4.model.Device.DeviceNameType.OTHER;
default: return org.hl7.fhir.r4.model.Device.DeviceNameType.NULL;
}
}
public static org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasSystemType())
tgt.setSystemType(convertCodeableConcept(src.getSystemType()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent tgt = new org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent();
copyElement(src, tgt);
if (src.hasSystemType())
tgt.setSystemType(convertCodeableConcept(src.getSystemType()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Device.DeviceVersionComponent convertDeviceVersionComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasComponent())
tgt.setComponent(convertIdentifier(src.getComponent()));
if (src.hasValue())
tgt.setValueElement(convertString(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Device.DeviceVersionComponent convertDeviceVersionComponent(org.hl7.fhir.r5.model.Device.DeviceVersionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Device.DeviceVersionComponent tgt = new org.hl7.fhir.r4.model.Device.DeviceVersionComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasComponent())
tgt.setComponent(convertIdentifier(src.getComponent()));
if (src.hasValue())
tgt.setValueElement(convertString(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Device.DevicePropertyComponent convertDevicePropertyComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.Quantity t : src.getValueQuantity())
tgt.addValueQuantity(convertQuantity(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getValueCode())
tgt.addValueCode(convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Device.DevicePropertyComponent convertDevicePropertyComponent(org.hl7.fhir.r5.model.Device.DevicePropertyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Device.DevicePropertyComponent tgt = new org.hl7.fhir.r4.model.Device.DevicePropertyComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.Quantity t : src.getValueQuantity())
tgt.addValueQuantity(convertQuantity(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getValueCode())
tgt.addValueCode(convertCodeableConcept(t));
return tgt;
}
}

View File

@ -0,0 +1,331 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class DeviceDefinition extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.DeviceDefinition convertDeviceDefinition(org.hl7.fhir.r4.model.DeviceDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DeviceDefinition tgt = new org.hl7.fhir.r5.model.DeviceDefinition();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent t : src.getUdiDeviceIdentifier())
tgt.addUdiDeviceIdentifier(convertDeviceDefinitionUdiDeviceIdentifierComponent(t));
if (src.hasManufacturer())
tgt.setManufacturer(convertType(src.getManufacturer()));
for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent t : src.getDeviceName())
tgt.addDeviceName(convertDeviceDefinitionDeviceNameComponent(t));
if (src.hasModelNumber())
tgt.setModelNumberElement(convertString(src.getModelNumberElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent t : src.getSpecialization())
tgt.addSpecialization(convertDeviceDefinitionSpecializationComponent(t));
for (org.hl7.fhir.r4.model.StringType t : src.getVersion())
tgt.getVersion().add(convertString(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSafety())
tgt.addSafety(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.ProductShelfLife t : src.getShelfLifeStorage())
tgt.addShelfLifeStorage(convertProductShelfLife(t));
if (src.hasPhysicalCharacteristics())
tgt.setPhysicalCharacteristics(convertProdCharacteristic(src.getPhysicalCharacteristics()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getLanguageCode())
tgt.addLanguageCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent t : src.getCapability())
tgt.addCapability(convertDeviceDefinitionCapabilityComponent(t));
for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent t : src.getProperty())
tgt.addProperty(convertDeviceDefinitionPropertyComponent(t));
if (src.hasOwner())
tgt.setOwner(convertReference(src.getOwner()));
for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact())
tgt.addContact(convertContactPoint(t));
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
if (src.hasOnlineInformation())
tgt.setOnlineInformationElement(convertUri(src.getOnlineInformationElement()));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
if (src.hasQuantity())
tgt.setQuantity(convertQuantity(src.getQuantity()));
if (src.hasParentDevice())
tgt.setParentDevice(convertReference(src.getParentDevice()));
for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionMaterialComponent t : src.getMaterial())
tgt.addMaterial(convertDeviceDefinitionMaterialComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.DeviceDefinition convertDeviceDefinition(org.hl7.fhir.r5.model.DeviceDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DeviceDefinition tgt = new org.hl7.fhir.r4.model.DeviceDefinition();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent t : src.getUdiDeviceIdentifier())
tgt.addUdiDeviceIdentifier(convertDeviceDefinitionUdiDeviceIdentifierComponent(t));
if (src.hasManufacturer())
tgt.setManufacturer(convertType(src.getManufacturer()));
for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent t : src.getDeviceName())
tgt.addDeviceName(convertDeviceDefinitionDeviceNameComponent(t));
if (src.hasModelNumber())
tgt.setModelNumberElement(convertString(src.getModelNumberElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent t : src.getSpecialization())
tgt.addSpecialization(convertDeviceDefinitionSpecializationComponent(t));
for (org.hl7.fhir.r5.model.StringType t : src.getVersion())
tgt.getVersion().add(convertString(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSafety())
tgt.addSafety(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.ProductShelfLife t : src.getShelfLifeStorage())
tgt.addShelfLifeStorage(convertProductShelfLife(t));
if (src.hasPhysicalCharacteristics())
tgt.setPhysicalCharacteristics(convertProdCharacteristic(src.getPhysicalCharacteristics()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLanguageCode())
tgt.addLanguageCode(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(convertReference(src.getOwner()));
for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact())
tgt.addContact(convertContactPoint(t));
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
if (src.hasOnlineInformation())
tgt.setOnlineInformationElement(convertUri(src.getOnlineInformationElement()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
if (src.hasQuantity())
tgt.setQuantity(convertQuantity(src.getQuantity()));
if (src.hasParentDevice())
tgt.setParentDevice(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.r4.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();
copyElement(src, tgt);
if (src.hasDeviceIdentifier())
tgt.setDeviceIdentifierElement(convertString(src.getDeviceIdentifierElement()));
if (src.hasIssuer())
tgt.setIssuerElement(convertUri(src.getIssuerElement()));
if (src.hasJurisdiction())
tgt.setJurisdictionElement(convertUri(src.getJurisdictionElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent convertDeviceDefinitionUdiDeviceIdentifierComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionUdiDeviceIdentifierComponent();
copyElement(src, tgt);
if (src.hasDeviceIdentifier())
tgt.setDeviceIdentifierElement(convertString(src.getDeviceIdentifierElement()));
if (src.hasIssuer())
tgt.setIssuerElement(convertUri(src.getIssuerElement()));
if (src.hasJurisdiction())
tgt.setJurisdictionElement(convertUri(src.getJurisdictionElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent convertDeviceDefinitionDeviceNameComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasType())
tgt.setType(convertDeviceNameType(src.getType()));
return tgt;
}
public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent convertDeviceDefinitionDeviceNameComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionDeviceNameComponent();
copyElement(src, tgt);
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasType())
tgt.setType(convertDeviceNameType(src.getType()));
return tgt;
}
public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceNameType convertDeviceNameType(org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case UDILABELNAME: return org.hl7.fhir.r5.model.DeviceDefinition.DeviceNameType.UDILABELNAME;
case USERFRIENDLYNAME: return org.hl7.fhir.r5.model.DeviceDefinition.DeviceNameType.USERFRIENDLYNAME;
case PATIENTREPORTEDNAME: return org.hl7.fhir.r5.model.DeviceDefinition.DeviceNameType.PATIENTREPORTEDNAME;
case MANUFACTURERNAME: return org.hl7.fhir.r5.model.DeviceDefinition.DeviceNameType.MANUFACTURERNAME;
case MODELNAME: return org.hl7.fhir.r5.model.DeviceDefinition.DeviceNameType.MODELNAME;
case OTHER: return org.hl7.fhir.r5.model.DeviceDefinition.DeviceNameType.OTHER;
default: return org.hl7.fhir.r5.model.DeviceDefinition.DeviceNameType.NULL;
}
}
public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType convertDeviceNameType(org.hl7.fhir.r5.model.DeviceDefinition.DeviceNameType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case UDILABELNAME: return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.UDILABELNAME;
case USERFRIENDLYNAME: return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.USERFRIENDLYNAME;
case PATIENTREPORTEDNAME: return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.PATIENTREPORTEDNAME;
case MANUFACTURERNAME: return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.MANUFACTURERNAME;
case MODELNAME: return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.MODELNAME;
case OTHER: return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.OTHER;
default: return org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.NULL;
}
}
public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasSystemType())
tgt.setSystemTypeElement(convertString(src.getSystemTypeElement()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent();
copyElement(src, tgt);
if (src.hasSystemType())
tgt.setSystemTypeElement(convertString(src.getSystemTypeElement()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent convertDeviceDefinitionCapabilityComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDescription())
tgt.addDescription(convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent convertDeviceDefinitionCapabilityComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDescription())
tgt.addDescription(convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent convertDeviceDefinitionPropertyComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.Quantity t : src.getValueQuantity())
tgt.addValueQuantity(convertQuantity(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getValueCode())
tgt.addValueCode(convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent convertDeviceDefinitionPropertyComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.Quantity t : src.getValueQuantity())
tgt.addValueQuantity(convertQuantity(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getValueCode())
tgt.addValueCode(convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent convertDeviceDefinitionMaterialComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasSubstance())
tgt.setSubstance(convertCodeableConcept(src.getSubstance()));
if (src.hasAlternate())
tgt.setAlternateElement(convertBoolean(src.getAlternateElement()));
if (src.hasAllergenicIndicator())
tgt.setAllergenicIndicatorElement(convertBoolean(src.getAllergenicIndicatorElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionMaterialComponent convertDeviceDefinitionMaterialComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionMaterialComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionMaterialComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionMaterialComponent();
copyElement(src, tgt);
if (src.hasSubstance())
tgt.setSubstance(convertCodeableConcept(src.getSubstance()));
if (src.hasAlternate())
tgt.setAlternateElement(convertBoolean(src.getAlternateElement()));
if (src.hasAllergenicIndicator())
tgt.setAllergenicIndicatorElement(convertBoolean(src.getAllergenicIndicatorElement()));
return tgt;
}
}

View File

@ -0,0 +1,255 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class DeviceMetric extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.r4.model.DeviceMetric src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DeviceMetric tgt = new org.hl7.fhir.r5.model.DeviceMetric();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasUnit())
tgt.setUnit(convertCodeableConcept(src.getUnit()));
if (src.hasSource())
tgt.setSource(convertReference(src.getSource()));
if (src.hasParent())
tgt.setParent(convertReference(src.getParent()));
if (src.hasOperationalStatus())
tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus()));
if (src.hasColor())
tgt.setColor(convertDeviceMetricColor(src.getColor()));
if (src.hasCategory())
tgt.setCategory(convertDeviceMetricCategory(src.getCategory()));
if (src.hasMeasurementPeriod())
tgt.setMeasurementPeriod(convertTiming(src.getMeasurementPeriod()));
for (org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration())
tgt.addCalibration(convertDeviceMetricCalibrationComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.r5.model.DeviceMetric src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DeviceMetric tgt = new org.hl7.fhir.r4.model.DeviceMetric();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasUnit())
tgt.setUnit(convertCodeableConcept(src.getUnit()));
if (src.hasSource())
tgt.setSource(convertReference(src.getSource()));
if (src.hasParent())
tgt.setParent(convertReference(src.getParent()));
if (src.hasOperationalStatus())
tgt.setOperationalStatus(convertDeviceMetricOperationalStatus(src.getOperationalStatus()));
if (src.hasColor())
tgt.setColor(convertDeviceMetricColor(src.getColor()));
if (src.hasCategory())
tgt.setCategory(convertDeviceMetricCategory(src.getCategory()));
if (src.hasMeasurementPeriod())
tgt.setMeasurementPeriod(convertTiming(src.getMeasurementPeriod()));
for (org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration())
tgt.addCalibration(convertDeviceMetricCalibrationComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus convertDeviceMetricOperationalStatus(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ON: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.ON;
case OFF: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.OFF;
case STANDBY: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus convertDeviceMetricOperationalStatus(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricOperationalStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ON: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.ON;
case OFF: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.OFF;
case STANDBY: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricOperationalStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor convertDeviceMetricColor(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case BLACK: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.BLACK;
case RED: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.RED;
case GREEN: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.GREEN;
case YELLOW: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.YELLOW;
case BLUE: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.BLUE;
case MAGENTA: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.MAGENTA;
case CYAN: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.CYAN;
case WHITE: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.WHITE;
default: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor.NULL;
}
}
public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor convertDeviceMetricColor(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricColor src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case BLACK: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.BLACK;
case RED: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.RED;
case GREEN: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.GREEN;
case YELLOW: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.YELLOW;
case BLUE: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.BLUE;
case MAGENTA: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.MAGENTA;
case CYAN: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.CYAN;
case WHITE: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.WHITE;
default: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricColor.NULL;
}
}
public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory convertDeviceMetricCategory(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case MEASUREMENT: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT;
case SETTING: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.SETTING;
case CALCULATION: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.CALCULATION;
case UNSPECIFIED: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED;
default: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory.NULL;
}
}
public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory convertDeviceMetricCategory(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCategory src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case MEASUREMENT: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT;
case SETTING: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.SETTING;
case CALCULATION: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.CALCULATION;
case UNSPECIFIED: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED;
default: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCategory.NULL;
}
}
public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertDeviceMetricCalibrationType(src.getType()));
if (src.hasState())
tgt.setState(convertDeviceMetricCalibrationState(src.getState()));
if (src.hasTime())
tgt.setTimeElement(convertInstant(src.getTimeElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertDeviceMetricCalibrationType(src.getType()));
if (src.hasState())
tgt.setState(convertDeviceMetricCalibrationState(src.getState()));
if (src.hasTime())
tgt.setTimeElement(convertInstant(src.getTimeElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType convertDeviceMetricCalibrationType(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case UNSPECIFIED: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED;
case OFFSET: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET;
case GAIN: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.GAIN;
case TWOPOINT: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT;
default: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType.NULL;
}
}
public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType convertDeviceMetricCalibrationType(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case UNSPECIFIED: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED;
case OFFSET: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET;
case GAIN: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.GAIN;
case TWOPOINT: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT;
default: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationType.NULL;
}
}
public static org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState convertDeviceMetricCalibrationState(org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case NOTCALIBRATED: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED;
case CALIBRATIONREQUIRED: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED;
case CALIBRATED: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED;
case UNSPECIFIED: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED;
default: return org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState.NULL;
}
}
public static org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState convertDeviceMetricCalibrationState(org.hl7.fhir.r5.model.DeviceMetric.DeviceMetricCalibrationState src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case NOTCALIBRATED: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED;
case CALIBRATIONREQUIRED: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED;
case CALIBRATED: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED;
case UNSPECIFIED: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED;
default: return org.hl7.fhir.r4.model.DeviceMetric.DeviceMetricCalibrationState.NULL;
}
}
}

View File

@ -0,0 +1,267 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class DeviceRequest extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.DeviceRequest convertDeviceRequest(org.hl7.fhir.r4.model.DeviceRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DeviceRequest tgt = new org.hl7.fhir.r5.model.DeviceRequest();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(convertCanonical(t));
for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(convertUri(t));
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getPriorRequest())
tgt.addPriorRequest(convertReference(t));
if (src.hasGroupIdentifier())
tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier()));
if (src.hasStatus())
tgt.setStatus(convertDeviceRequestStatus(src.getStatus()));
if (src.hasIntent())
tgt.setIntent(convertRequestIntent(src.getIntent()));
if (src.hasPriority())
tgt.setPriority(convertRequestPriority(src.getPriority()));
if (src.hasCode())
tgt.setCode(convertType(src.getCode()));
for (org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent t : src.getParameter())
tgt.addParameter(convertDeviceRequestParameterComponent(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasOccurrence())
tgt.setOccurrence(convertType(src.getOccurrence()));
if (src.hasAuthoredOn())
tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement()));
if (src.hasRequester())
tgt.setRequester(convertReference(src.getRequester()));
if (src.hasPerformerType())
tgt.setPerformerType(convertCodeableConcept(src.getPerformerType()));
if (src.hasPerformer())
tgt.setPerformer(convertReference(src.getPerformer()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getInsurance())
tgt.addInsurance(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(convertReference(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.Reference t : src.getRelevantHistory())
tgt.addRelevantHistory(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.DeviceRequest convertDeviceRequest(org.hl7.fhir.r5.model.DeviceRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DeviceRequest tgt = new org.hl7.fhir.r4.model.DeviceRequest();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(convertCanonical(t));
for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(convertUri(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getPriorRequest())
tgt.addPriorRequest(convertReference(t));
if (src.hasGroupIdentifier())
tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier()));
if (src.hasStatus())
tgt.setStatus(convertDeviceRequestStatus(src.getStatus()));
if (src.hasIntent())
tgt.setIntent(convertRequestIntent(src.getIntent()));
if (src.hasPriority())
tgt.setPriority(convertRequestPriority(src.getPriority()));
if (src.hasCode())
tgt.setCode(convertType(src.getCode()));
for (org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent t : src.getParameter())
tgt.addParameter(convertDeviceRequestParameterComponent(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasOccurrence())
tgt.setOccurrence(convertType(src.getOccurrence()));
if (src.hasAuthoredOn())
tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement()));
if (src.hasRequester())
tgt.setRequester(convertReference(src.getRequester()));
if (src.hasPerformerType())
tgt.setPerformerType(convertCodeableConcept(src.getPerformerType()));
if (src.hasPerformer())
tgt.setPerformer(convertReference(src.getPerformer()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getInsurance())
tgt.addInsurance(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInfo())
tgt.addSupportingInfo(convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.Reference t : src.getRelevantHistory())
tgt.addRelevantHistory(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestStatus convertDeviceRequestStatus(org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DRAFT: return org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestStatus.DRAFT;
case ACTIVE: return org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestStatus.ACTIVE;
case ONHOLD: return org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestStatus.ONHOLD;
case REVOKED: return org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestStatus.REVOKED;
case COMPLETED: return org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestStatus.UNKNOWN;
default: return org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus convertDeviceRequestStatus(org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DRAFT: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.DRAFT;
case ACTIVE: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.ACTIVE;
case ONHOLD: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.ONHOLD;
case REVOKED: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.REVOKED;
case COMPLETED: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.UNKNOWN;
default: return org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.DeviceRequest.RequestIntent convertRequestIntent(org.hl7.fhir.r4.model.DeviceRequest.RequestIntent src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROPOSAL: return org.hl7.fhir.r5.model.DeviceRequest.RequestIntent.PROPOSAL;
case PLAN: return org.hl7.fhir.r5.model.DeviceRequest.RequestIntent.PLAN;
case DIRECTIVE: return org.hl7.fhir.r5.model.DeviceRequest.RequestIntent.DIRECTIVE;
case ORDER: return org.hl7.fhir.r5.model.DeviceRequest.RequestIntent.ORDER;
case ORIGINALORDER: return org.hl7.fhir.r5.model.DeviceRequest.RequestIntent.ORIGINALORDER;
case REFLEXORDER: return org.hl7.fhir.r5.model.DeviceRequest.RequestIntent.REFLEXORDER;
case FILLERORDER: return org.hl7.fhir.r5.model.DeviceRequest.RequestIntent.FILLERORDER;
case INSTANCEORDER: return org.hl7.fhir.r5.model.DeviceRequest.RequestIntent.INSTANCEORDER;
case OPTION: return org.hl7.fhir.r5.model.DeviceRequest.RequestIntent.OPTION;
default: return org.hl7.fhir.r5.model.DeviceRequest.RequestIntent.NULL;
}
}
public static org.hl7.fhir.r4.model.DeviceRequest.RequestIntent convertRequestIntent(org.hl7.fhir.r5.model.DeviceRequest.RequestIntent src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROPOSAL: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.PROPOSAL;
case PLAN: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.PLAN;
case DIRECTIVE: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.DIRECTIVE;
case ORDER: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.ORDER;
case ORIGINALORDER: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.ORIGINALORDER;
case REFLEXORDER: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.REFLEXORDER;
case FILLERORDER: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.FILLERORDER;
case INSTANCEORDER: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.INSTANCEORDER;
case OPTION: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.OPTION;
default: return org.hl7.fhir.r4.model.DeviceRequest.RequestIntent.NULL;
}
}
public static org.hl7.fhir.r5.model.DeviceRequest.RequestPriority convertRequestPriority(org.hl7.fhir.r4.model.DeviceRequest.RequestPriority src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ROUTINE: return org.hl7.fhir.r5.model.DeviceRequest.RequestPriority.ROUTINE;
case URGENT: return org.hl7.fhir.r5.model.DeviceRequest.RequestPriority.URGENT;
case ASAP: return org.hl7.fhir.r5.model.DeviceRequest.RequestPriority.ASAP;
case STAT: return org.hl7.fhir.r5.model.DeviceRequest.RequestPriority.STAT;
default: return org.hl7.fhir.r5.model.DeviceRequest.RequestPriority.NULL;
}
}
public static org.hl7.fhir.r4.model.DeviceRequest.RequestPriority convertRequestPriority(org.hl7.fhir.r5.model.DeviceRequest.RequestPriority src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ROUTINE: return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.ROUTINE;
case URGENT: return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.URGENT;
case ASAP: return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.ASAP;
case STAT: return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.STAT;
default: return org.hl7.fhir.r4.model.DeviceRequest.RequestPriority.NULL;
}
}
public static org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent convertDeviceRequestParameterComponent(org.hl7.fhir.r4.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();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent convertDeviceRequestParameterComponent(org.hl7.fhir.r5.model.DeviceRequest.DeviceRequestParameterComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent tgt = new org.hl7.fhir.r4.model.DeviceRequest.DeviceRequestParameterComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
return tgt;
}
}

View File

@ -0,0 +1,139 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class DeviceUseStatement extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.DeviceUseStatement convertDeviceUseStatement(org.hl7.fhir.r4.model.DeviceUseStatement src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DeviceUseStatement tgt = new org.hl7.fhir.r5.model.DeviceUseStatement();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
if (src.hasStatus())
tgt.setStatus(convertDeviceUseStatementStatus(src.getStatus()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom())
tgt.addDerivedFrom(convertReference(t));
if (src.hasTiming())
tgt.setTiming(convertType(src.getTiming()));
if (src.hasRecordedOn())
tgt.setRecordedOnElement(convertDateTime(src.getRecordedOnElement()));
if (src.hasSource())
tgt.setSource(convertReference(src.getSource()));
if (src.hasDevice())
tgt.setDevice(convertReference(src.getDevice()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
if (src.hasBodySite())
tgt.setBodySite(convertCodeableConcept(src.getBodySite()));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4.model.DeviceUseStatement convertDeviceUseStatement(org.hl7.fhir.r5.model.DeviceUseStatement src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DeviceUseStatement tgt = new org.hl7.fhir.r4.model.DeviceUseStatement();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
if (src.hasStatus())
tgt.setStatus(convertDeviceUseStatementStatus(src.getStatus()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom())
tgt.addDerivedFrom(convertReference(t));
if (src.hasTiming())
tgt.setTiming(convertType(src.getTiming()));
if (src.hasRecordedOn())
tgt.setRecordedOnElement(convertDateTime(src.getRecordedOnElement()));
if (src.hasSource())
tgt.setSource(convertReference(src.getSource()));
if (src.hasDevice())
tgt.setDevice(convertReference(src.getDevice()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
if (src.hasBodySite())
tgt.setBodySite(convertCodeableConcept(src.getBodySite()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus convertDeviceUseStatementStatus(org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.ACTIVE;
case COMPLETED: return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR;
case INTENDED: return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.INTENDED;
case STOPPED: return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.STOPPED;
case ONHOLD: return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.ONHOLD;
default: return org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus convertDeviceUseStatementStatus(org.hl7.fhir.r5.model.DeviceUseStatement.DeviceUseStatementStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ACTIVE;
case COMPLETED: return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ENTEREDINERROR;
case INTENDED: return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.INTENDED;
case STOPPED: return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.STOPPED;
case ONHOLD: return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.ONHOLD;
default: return org.hl7.fhir.r4.model.DeviceUseStatement.DeviceUseStatementStatus.NULL;
}
}
}

View File

@ -0,0 +1,191 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class DiagnosticReport extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.DiagnosticReport convertDiagnosticReport(org.hl7.fhir.r4.model.DiagnosticReport src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DiagnosticReport tgt = new org.hl7.fhir.r5.model.DiagnosticReport();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
if (src.hasStatus())
tgt.setStatus(convertDiagnosticReportStatus(src.getStatus()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasEffective())
tgt.setEffective(convertType(src.getEffective()));
if (src.hasIssued())
tgt.setIssuedElement(convertInstant(src.getIssuedElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getPerformer())
tgt.addPerformer(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getResultsInterpreter())
tgt.addResultsInterpreter(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getSpecimen())
tgt.addSpecimen(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getResult())
tgt.addResult(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getImagingStudy())
tgt.addImagingStudy(convertReference(t));
for (org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia())
tgt.addMedia(convertDiagnosticReportMediaComponent(t));
if (src.hasConclusion())
tgt.setConclusionElement(convertString(src.getConclusionElement()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getConclusionCode())
tgt.addConclusionCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Attachment t : src.getPresentedForm())
tgt.addPresentedForm(convertAttachment(t));
return tgt;
}
public static org.hl7.fhir.r4.model.DiagnosticReport convertDiagnosticReport(org.hl7.fhir.r5.model.DiagnosticReport src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DiagnosticReport tgt = new org.hl7.fhir.r4.model.DiagnosticReport();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
if (src.hasStatus())
tgt.setStatus(convertDiagnosticReportStatus(src.getStatus()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasEffective())
tgt.setEffective(convertType(src.getEffective()));
if (src.hasIssued())
tgt.setIssuedElement(convertInstant(src.getIssuedElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getPerformer())
tgt.addPerformer(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getResultsInterpreter())
tgt.addResultsInterpreter(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen())
tgt.addSpecimen(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getResult())
tgt.addResult(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getImagingStudy())
tgt.addImagingStudy(convertReference(t));
for (org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent t : src.getMedia())
tgt.addMedia(convertDiagnosticReportMediaComponent(t));
if (src.hasConclusion())
tgt.setConclusionElement(convertString(src.getConclusionElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getConclusionCode())
tgt.addConclusionCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Attachment t : src.getPresentedForm())
tgt.addPresentedForm(convertAttachment(t));
return tgt;
}
public static org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus convertDiagnosticReportStatus(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case REGISTERED: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED;
case PARTIAL: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL;
case PRELIMINARY: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY;
case FINAL: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.FINAL;
case AMENDED: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.AMENDED;
case CORRECTED: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED;
case APPENDED: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.APPENDED;
case CANCELLED: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN;
default: return org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus convertDiagnosticReportStatus(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case REGISTERED: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.REGISTERED;
case PARTIAL: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.PARTIAL;
case PRELIMINARY: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.PRELIMINARY;
case FINAL: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.FINAL;
case AMENDED: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.AMENDED;
case CORRECTED: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.CORRECTED;
case APPENDED: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.APPENDED;
case CANCELLED: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.CANCELLED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.UNKNOWN;
default: return org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent convertDiagnosticReportMediaComponent(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent tgt = new org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent();
copyElement(src, tgt);
if (src.hasComment())
tgt.setCommentElement(convertString(src.getCommentElement()));
if (src.hasLink())
tgt.setLink(convertReference(src.getLink()));
return tgt;
}
public static org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent convertDiagnosticReportMediaComponent(org.hl7.fhir.r5.model.DiagnosticReport.DiagnosticReportMediaComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent tgt = new org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportMediaComponent();
copyElement(src, tgt);
if (src.hasComment())
tgt.setCommentElement(convertString(src.getCommentElement()));
if (src.hasLink())
tgt.setLink(convertReference(src.getLink()));
return tgt;
}
}

View File

@ -0,0 +1,131 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class DocumentManifest extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.DocumentManifest convertDocumentManifest(org.hl7.fhir.r4.model.DocumentManifest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DocumentManifest tgt = new org.hl7.fhir.r5.model.DocumentManifest();
copyDomainResource(src, tgt);
if (src.hasMasterIdentifier())
tgt.setMasterIdentifier(convertIdentifier(src.getMasterIdentifier()));
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertDocumentReferenceStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getAuthor())
tgt.addAuthor(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getRecipient())
tgt.addRecipient(convertReference(t));
if (src.hasSource())
tgt.setSourceElement(convertUri(src.getSourceElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getContent())
tgt.addContent(convertReference(t));
for (org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent t : src.getRelated())
tgt.addRelated(convertDocumentManifestRelatedComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.DocumentManifest convertDocumentManifest(org.hl7.fhir.r5.model.DocumentManifest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DocumentManifest tgt = new org.hl7.fhir.r4.model.DocumentManifest();
copyDomainResource(src, tgt);
if (src.hasMasterIdentifier())
tgt.setMasterIdentifier(convertIdentifier(src.getMasterIdentifier()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertDocumentReferenceStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getAuthor())
tgt.addAuthor(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getRecipient())
tgt.addRecipient(convertReference(t));
if (src.hasSource())
tgt.setSourceElement(convertUri(src.getSourceElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getContent())
tgt.addContent(convertReference(t));
for (org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent t : src.getRelated())
tgt.addRelated(convertDocumentManifestRelatedComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent convertDocumentManifestRelatedComponent(org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent tgt = new org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent();
copyElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasRef())
tgt.setRef(convertReference(src.getRef()));
return tgt;
}
public static org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent convertDocumentManifestRelatedComponent(org.hl7.fhir.r5.model.DocumentManifest.DocumentManifestRelatedComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent tgt = new org.hl7.fhir.r4.model.DocumentManifest.DocumentManifestRelatedComponent();
copyElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasRef())
tgt.setRef(convertReference(src.getRef()));
return tgt;
}
}

View File

@ -0,0 +1,263 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class DocumentReference extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.DocumentReference convertDocumentReference(org.hl7.fhir.r4.model.DocumentReference src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DocumentReference tgt = new org.hl7.fhir.r5.model.DocumentReference();
copyDomainResource(src, tgt);
if (src.hasMasterIdentifier())
tgt.setMasterIdentifier(convertIdentifier(src.getMasterIdentifier()));
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertDocumentReferenceStatus(src.getStatus()));
if (src.hasDocStatus())
tgt.setDocStatus(convertReferredDocumentStatus(src.getDocStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(convertInstant(src.getDateElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getAuthor())
tgt.addAuthor(convertReference(t));
if (src.hasAuthenticator())
tgt.setAuthenticator(convertReference(src.getAuthenticator()));
if (src.hasCustodian())
tgt.setCustodian(convertReference(src.getCustodian()));
for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo())
tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSecurityLabel())
tgt.addSecurityLabel(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent())
tgt.addContent(convertDocumentReferenceContentComponent(t));
if (src.hasContext())
tgt.setContext(convertDocumentReferenceContextComponent(src.getContext()));
return tgt;
}
public static org.hl7.fhir.r4.model.DocumentReference convertDocumentReference(org.hl7.fhir.r5.model.DocumentReference src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DocumentReference tgt = new org.hl7.fhir.r4.model.DocumentReference();
copyDomainResource(src, tgt);
if (src.hasMasterIdentifier())
tgt.setMasterIdentifier(convertIdentifier(src.getMasterIdentifier()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertDocumentReferenceStatus(src.getStatus()));
if (src.hasDocStatus())
tgt.setDocStatus(convertReferredDocumentStatus(src.getDocStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(convertInstant(src.getDateElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getAuthor())
tgt.addAuthor(convertReference(t));
if (src.hasAuthenticator())
tgt.setAuthenticator(convertReference(src.getAuthenticator()));
if (src.hasCustodian())
tgt.setCustodian(convertReference(src.getCustodian()));
for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent t : src.getRelatesTo())
tgt.addRelatesTo(convertDocumentReferenceRelatesToComponent(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSecurityLabel())
tgt.addSecurityLabel(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent t : src.getContent())
tgt.addContent(convertDocumentReferenceContentComponent(t));
if (src.hasContext())
tgt.setContext(convertDocumentReferenceContextComponent(src.getContext()));
return tgt;
}
public static org.hl7.fhir.r5.model.DocumentReference.ReferredDocumentStatus convertReferredDocumentStatus(org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PRELIMINARY: return org.hl7.fhir.r5.model.DocumentReference.ReferredDocumentStatus.PRELIMINARY;
case FINAL: return org.hl7.fhir.r5.model.DocumentReference.ReferredDocumentStatus.FINAL;
case AMENDED: return org.hl7.fhir.r5.model.DocumentReference.ReferredDocumentStatus.AMENDED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.DocumentReference.ReferredDocumentStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.DocumentReference.ReferredDocumentStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus convertReferredDocumentStatus(org.hl7.fhir.r5.model.DocumentReference.ReferredDocumentStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PRELIMINARY: return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.PRELIMINARY;
case FINAL: return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.FINAL;
case AMENDED: return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.AMENDED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.DocumentReference.ReferredDocumentStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent convertDocumentReferenceRelatesToComponent(org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertDocumentRelationshipType(src.getCode()));
if (src.hasTarget())
tgt.setTarget(convertReference(src.getTarget()));
return tgt;
}
public static org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent convertDocumentReferenceRelatesToComponent(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertDocumentRelationshipType(src.getCode()));
if (src.hasTarget())
tgt.setTarget(convertReference(src.getTarget()));
return tgt;
}
public static org.hl7.fhir.r5.model.DocumentReference.DocumentRelationshipType convertDocumentRelationshipType(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case REPLACES: return org.hl7.fhir.r5.model.DocumentReference.DocumentRelationshipType.REPLACES;
case TRANSFORMS: return org.hl7.fhir.r5.model.DocumentReference.DocumentRelationshipType.TRANSFORMS;
case SIGNS: return org.hl7.fhir.r5.model.DocumentReference.DocumentRelationshipType.SIGNS;
case APPENDS: return org.hl7.fhir.r5.model.DocumentReference.DocumentRelationshipType.APPENDS;
default: return org.hl7.fhir.r5.model.DocumentReference.DocumentRelationshipType.NULL;
}
}
public static org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType convertDocumentRelationshipType(org.hl7.fhir.r5.model.DocumentReference.DocumentRelationshipType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case REPLACES: return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.REPLACES;
case TRANSFORMS: return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.TRANSFORMS;
case SIGNS: return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.SIGNS;
case APPENDS: return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.APPENDS;
default: return org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.NULL;
}
}
public static org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent convertDocumentReferenceContentComponent(org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent();
copyElement(src, tgt);
if (src.hasAttachment())
tgt.setAttachment(convertAttachment(src.getAttachment()));
if (src.hasFormat())
tgt.setFormat(convertCoding(src.getFormat()));
return tgt;
}
public static org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent convertDocumentReferenceContentComponent(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContentComponent();
copyElement(src, tgt);
if (src.hasAttachment())
tgt.setAttachment(convertAttachment(src.getAttachment()));
if (src.hasFormat())
tgt.setFormat(convertCoding(src.getFormat()));
return tgt;
}
public static org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContextComponent convertDocumentReferenceContextComponent(org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContextComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContextComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.Reference t : src.getEncounter())
tgt.addEncounter(convertReference(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getEvent())
tgt.addEvent(convertCodeableConcept(t));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasFacilityType())
tgt.setFacilityType(convertCodeableConcept(src.getFacilityType()));
if (src.hasPracticeSetting())
tgt.setPracticeSetting(convertCodeableConcept(src.getPracticeSetting()));
if (src.hasSourcePatientInfo())
tgt.setSourcePatientInfo(convertReference(src.getSourcePatientInfo()));
for (org.hl7.fhir.r4.model.Reference t : src.getRelated())
tgt.addRelated(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent convertDocumentReferenceContextComponent(org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceContextComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceContextComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.Reference t : src.getEncounter())
tgt.addEncounter(convertReference(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getEvent())
tgt.addEvent(convertCodeableConcept(t));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasFacilityType())
tgt.setFacilityType(convertCodeableConcept(src.getFacilityType()));
if (src.hasPracticeSetting())
tgt.setPracticeSetting(convertCodeableConcept(src.getPracticeSetting()));
if (src.hasSourcePatientInfo())
tgt.setSourcePatientInfo(convertReference(src.getSourcePatientInfo()));
for (org.hl7.fhir.r5.model.Reference t : src.getRelated())
tgt.addRelated(convertReference(t));
return tgt;
}
}

View File

@ -0,0 +1,399 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class EffectEvidenceSynthesis extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.EffectEvidenceSynthesis convertEffectEvidenceSynthesis(org.hl7.fhir.r4.model.EffectEvidenceSynthesis src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EffectEvidenceSynthesis tgt = new org.hl7.fhir.r5.model.EffectEvidenceSynthesis();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic())
tgt.addTopic(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor())
tgt.addEditor(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(convertContactDetail(t));
for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(convertRelatedArtifact(t));
if (src.hasSynthesisType())
tgt.setSynthesisType(convertCodeableConcept(src.getSynthesisType()));
if (src.hasStudyType())
tgt.setStudyType(convertCodeableConcept(src.getStudyType()));
if (src.hasPopulation())
tgt.setPopulation(convertReference(src.getPopulation()));
if (src.hasExposure())
tgt.setExposure(convertReference(src.getExposure()));
if (src.hasExposureAlternative())
tgt.setExposureAlternative(convertReference(src.getExposureAlternative()));
if (src.hasOutcome())
tgt.setOutcome(convertReference(src.getOutcome()));
if (src.hasSampleSize())
tgt.setSampleSize(convertEffectEvidenceSynthesisSampleSizeComponent(src.getSampleSize()));
for (org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent t : src.getResultsByExposure())
tgt.addResultsByExposure(convertEffectEvidenceSynthesisResultsByExposureComponent(t));
for (org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent t : src.getEffectEstimate())
tgt.addEffectEstimate(convertEffectEvidenceSynthesisEffectEstimateComponent(t));
for (org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent t : src.getCertainty())
tgt.addCertainty(convertEffectEvidenceSynthesisCertaintyComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.EffectEvidenceSynthesis convertEffectEvidenceSynthesis(org.hl7.fhir.r5.model.EffectEvidenceSynthesis src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EffectEvidenceSynthesis tgt = new org.hl7.fhir.r4.model.EffectEvidenceSynthesis();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic())
tgt.addTopic(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor())
tgt.addEditor(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(convertContactDetail(t));
for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(convertRelatedArtifact(t));
if (src.hasSynthesisType())
tgt.setSynthesisType(convertCodeableConcept(src.getSynthesisType()));
if (src.hasStudyType())
tgt.setStudyType(convertCodeableConcept(src.getStudyType()));
if (src.hasPopulation())
tgt.setPopulation(convertReference(src.getPopulation()));
if (src.hasExposure())
tgt.setExposure(convertReference(src.getExposure()));
if (src.hasExposureAlternative())
tgt.setExposureAlternative(convertReference(src.getExposureAlternative()));
if (src.hasOutcome())
tgt.setOutcome(convertReference(src.getOutcome()));
if (src.hasSampleSize())
tgt.setSampleSize(convertEffectEvidenceSynthesisSampleSizeComponent(src.getSampleSize()));
for (org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent t : src.getResultsByExposure())
tgt.addResultsByExposure(convertEffectEvidenceSynthesisResultsByExposureComponent(t));
for (org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent t : src.getEffectEstimate())
tgt.addEffectEstimate(convertEffectEvidenceSynthesisEffectEstimateComponent(t));
for (org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent t : src.getCertainty())
tgt.addCertainty(convertEffectEvidenceSynthesisCertaintyComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent convertEffectEvidenceSynthesisSampleSizeComponent(org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent tgt = new org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasNumberOfStudies())
tgt.setNumberOfStudiesElement(convertInteger(src.getNumberOfStudiesElement()));
if (src.hasNumberOfParticipants())
tgt.setNumberOfParticipantsElement(convertInteger(src.getNumberOfParticipantsElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent convertEffectEvidenceSynthesisSampleSizeComponent(org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent tgt = new org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisSampleSizeComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasNumberOfStudies())
tgt.setNumberOfStudiesElement(convertInteger(src.getNumberOfStudiesElement()));
if (src.hasNumberOfParticipants())
tgt.setNumberOfParticipantsElement(convertInteger(src.getNumberOfParticipantsElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent convertEffectEvidenceSynthesisResultsByExposureComponent(org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent tgt = new org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasExposureState())
tgt.setExposureState(convertExposureState(src.getExposureState()));
if (src.hasVariantState())
tgt.setVariantState(convertCodeableConcept(src.getVariantState()));
if (src.hasRiskEvidenceSynthesis())
tgt.setRiskEvidenceSynthesis(convertReference(src.getRiskEvidenceSynthesis()));
return tgt;
}
public static org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent convertEffectEvidenceSynthesisResultsByExposureComponent(org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent tgt = new org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisResultsByExposureComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasExposureState())
tgt.setExposureState(convertExposureState(src.getExposureState()));
if (src.hasVariantState())
tgt.setVariantState(convertCodeableConcept(src.getVariantState()));
if (src.hasRiskEvidenceSynthesis())
tgt.setRiskEvidenceSynthesis(convertReference(src.getRiskEvidenceSynthesis()));
return tgt;
}
public static org.hl7.fhir.r5.model.EffectEvidenceSynthesis.ExposureState convertExposureState(org.hl7.fhir.r4.model.EffectEvidenceSynthesis.ExposureState src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case EXPOSURE: return org.hl7.fhir.r5.model.EffectEvidenceSynthesis.ExposureState.EXPOSURE;
case EXPOSUREALTERNATIVE: return org.hl7.fhir.r5.model.EffectEvidenceSynthesis.ExposureState.EXPOSUREALTERNATIVE;
default: return org.hl7.fhir.r5.model.EffectEvidenceSynthesis.ExposureState.NULL;
}
}
public static org.hl7.fhir.r4.model.EffectEvidenceSynthesis.ExposureState convertExposureState(org.hl7.fhir.r5.model.EffectEvidenceSynthesis.ExposureState src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case EXPOSURE: return org.hl7.fhir.r4.model.EffectEvidenceSynthesis.ExposureState.EXPOSURE;
case EXPOSUREALTERNATIVE: return org.hl7.fhir.r4.model.EffectEvidenceSynthesis.ExposureState.EXPOSUREALTERNATIVE;
default: return org.hl7.fhir.r4.model.EffectEvidenceSynthesis.ExposureState.NULL;
}
}
public static org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent convertEffectEvidenceSynthesisEffectEstimateComponent(org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent tgt = new org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasVariantState())
tgt.setVariantState(convertCodeableConcept(src.getVariantState()));
if (src.hasValue())
tgt.setValueElement(convertDecimal(src.getValueElement()));
if (src.hasUnitOfMeasure())
tgt.setUnitOfMeasure(convertCodeableConcept(src.getUnitOfMeasure()));
for (org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent t : src.getPrecisionEstimate())
tgt.addPrecisionEstimate(convertEffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent convertEffectEvidenceSynthesisEffectEstimateComponent(org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent tgt = new org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimateComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasVariantState())
tgt.setVariantState(convertCodeableConcept(src.getVariantState()));
if (src.hasValue())
tgt.setValueElement(convertDecimal(src.getValueElement()));
if (src.hasUnitOfMeasure())
tgt.setUnitOfMeasure(convertCodeableConcept(src.getUnitOfMeasure()));
for (org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent t : src.getPrecisionEstimate())
tgt.addPrecisionEstimate(convertEffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent convertEffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent(org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent tgt = new org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasLevel())
tgt.setLevelElement(convertDecimal(src.getLevelElement()));
if (src.hasFrom())
tgt.setFromElement(convertDecimal(src.getFromElement()));
if (src.hasTo())
tgt.setToElement(convertDecimal(src.getToElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent convertEffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent(org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent tgt = new org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisEffectEstimatePrecisionEstimateComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasLevel())
tgt.setLevelElement(convertDecimal(src.getLevelElement()));
if (src.hasFrom())
tgt.setFromElement(convertDecimal(src.getFromElement()));
if (src.hasTo())
tgt.setToElement(convertDecimal(src.getToElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent convertEffectEvidenceSynthesisCertaintyComponent(org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent tgt = new org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRating())
tgt.addRating(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent t : src.getCertaintySubcomponent())
tgt.addCertaintySubcomponent(convertEffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent convertEffectEvidenceSynthesisCertaintyComponent(org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent tgt = new org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRating())
tgt.addRating(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent t : src.getCertaintySubcomponent())
tgt.addCertaintySubcomponent(convertEffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent convertEffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent(org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent tgt = new org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getRating())
tgt.addRating(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent convertEffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent(org.hl7.fhir.r5.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent tgt = new org.hl7.fhir.r4.model.EffectEvidenceSynthesis.EffectEvidenceSynthesisCertaintyCertaintySubcomponentComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getRating())
tgt.addRating(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
}

View File

@ -0,0 +1,397 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Encounter extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Encounter convertEncounter(org.hl7.fhir.r4.model.Encounter src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Encounter tgt = new org.hl7.fhir.r5.model.Encounter();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertEncounterStatus(src.getStatus()));
for (org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent t : src.getStatusHistory())
tgt.addStatusHistory(convertStatusHistoryComponent(t));
if (src.hasClass_())
tgt.setClass_(convertCoding(src.getClass_()));
for (org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent t : src.getClassHistory())
tgt.addClassHistory(convertClassHistoryComponent(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
if (src.hasServiceType())
tgt.setServiceType(convertCodeableConcept(src.getServiceType()));
if (src.hasPriority())
tgt.setPriority(convertCodeableConcept(src.getPriority()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
for (org.hl7.fhir.r4.model.Reference t : src.getEpisodeOfCare())
tgt.addEpisodeOfCare(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertEncounterParticipantComponent(t));
for (org.hl7.fhir.r4.model.Reference t : src.getAppointment())
tgt.addAppointment(convertReference(t));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasLength())
tgt.setLength(convertDuration(src.getLength()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r4.model.Encounter.DiagnosisComponent t : src.getDiagnosis())
tgt.addDiagnosis(convertDiagnosisComponent(t));
for (org.hl7.fhir.r4.model.Reference t : src.getAccount())
tgt.addAccount(convertReference(t));
if (src.hasHospitalization())
tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization()));
for (org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent t : src.getLocation())
tgt.addLocation(convertEncounterLocationComponent(t));
if (src.hasServiceProvider())
tgt.setServiceProvider(convertReference(src.getServiceProvider()));
if (src.hasPartOf())
tgt.setPartOf(convertReference(src.getPartOf()));
return tgt;
}
public static org.hl7.fhir.r4.model.Encounter convertEncounter(org.hl7.fhir.r5.model.Encounter src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Encounter tgt = new org.hl7.fhir.r4.model.Encounter();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertEncounterStatus(src.getStatus()));
for (org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent t : src.getStatusHistory())
tgt.addStatusHistory(convertStatusHistoryComponent(t));
if (src.hasClass_())
tgt.setClass_(convertCoding(src.getClass_()));
for (org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent t : src.getClassHistory())
tgt.addClassHistory(convertClassHistoryComponent(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
if (src.hasServiceType())
tgt.setServiceType(convertCodeableConcept(src.getServiceType()));
if (src.hasPriority())
tgt.setPriority(convertCodeableConcept(src.getPriority()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
for (org.hl7.fhir.r5.model.Reference t : src.getEpisodeOfCare())
tgt.addEpisodeOfCare(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertEncounterParticipantComponent(t));
for (org.hl7.fhir.r5.model.Reference t : src.getAppointment())
tgt.addAppointment(convertReference(t));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasLength())
tgt.setLength(convertDuration(src.getLength()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r5.model.Encounter.DiagnosisComponent t : src.getDiagnosis())
tgt.addDiagnosis(convertDiagnosisComponent(t));
for (org.hl7.fhir.r5.model.Reference t : src.getAccount())
tgt.addAccount(convertReference(t));
if (src.hasHospitalization())
tgt.setHospitalization(convertEncounterHospitalizationComponent(src.getHospitalization()));
for (org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent t : src.getLocation())
tgt.addLocation(convertEncounterLocationComponent(t));
if (src.hasServiceProvider())
tgt.setServiceProvider(convertReference(src.getServiceProvider()));
if (src.hasPartOf())
tgt.setPartOf(convertReference(src.getPartOf()));
return tgt;
}
public static org.hl7.fhir.r5.model.Encounter.EncounterStatus convertEncounterStatus(org.hl7.fhir.r4.model.Encounter.EncounterStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PLANNED: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.PLANNED;
case ARRIVED: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.ARRIVED;
case TRIAGED: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.TRIAGED;
case INPROGRESS: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.INPROGRESS;
case ONLEAVE: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.ONLEAVE;
case FINISHED: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.FINISHED;
case CANCELLED: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.CANCELLED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.UNKNOWN;
default: return org.hl7.fhir.r5.model.Encounter.EncounterStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Encounter.EncounterStatus convertEncounterStatus(org.hl7.fhir.r5.model.Encounter.EncounterStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PLANNED: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.PLANNED;
case ARRIVED: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.ARRIVED;
case TRIAGED: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.TRIAGED;
case INPROGRESS: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.INPROGRESS;
case ONLEAVE: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.ONLEAVE;
case FINISHED: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.FINISHED;
case CANCELLED: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.CANCELLED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.UNKNOWN;
default: return org.hl7.fhir.r4.model.Encounter.EncounterStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent convertStatusHistoryComponent(org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent tgt = new org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent();
copyElement(src, tgt);
if (src.hasStatus())
tgt.setStatus(convertEncounterStatus(src.getStatus()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent convertStatusHistoryComponent(org.hl7.fhir.r5.model.Encounter.StatusHistoryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent tgt = new org.hl7.fhir.r4.model.Encounter.StatusHistoryComponent();
copyElement(src, tgt);
if (src.hasStatus())
tgt.setStatus(convertEncounterStatus(src.getStatus()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent convertClassHistoryComponent(org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent tgt = new org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent();
copyElement(src, tgt);
if (src.hasClass_())
tgt.setClass_(convertCoding(src.getClass_()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent convertClassHistoryComponent(org.hl7.fhir.r5.model.Encounter.ClassHistoryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent tgt = new org.hl7.fhir.r4.model.Encounter.ClassHistoryComponent();
copyElement(src, tgt);
if (src.hasClass_())
tgt.setClass_(convertCoding(src.getClass_()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasIndividual())
tgt.setIndividual(convertReference(src.getIndividual()));
return tgt;
}
public static org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent convertEncounterParticipantComponent(org.hl7.fhir.r5.model.Encounter.EncounterParticipantComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent tgt = new org.hl7.fhir.r4.model.Encounter.EncounterParticipantComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasIndividual())
tgt.setIndividual(convertReference(src.getIndividual()));
return tgt;
}
public static org.hl7.fhir.r5.model.Encounter.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4.model.Encounter.DiagnosisComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Encounter.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.Encounter.DiagnosisComponent();
copyElement(src, tgt);
if (src.hasCondition())
tgt.setCondition(convertReference(src.getCondition()));
if (src.hasUse())
tgt.setUse(convertCodeableConcept(src.getUse()));
if (src.hasRank())
tgt.setRankElement(convertPositiveInt(src.getRankElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Encounter.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.Encounter.DiagnosisComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Encounter.DiagnosisComponent tgt = new org.hl7.fhir.r4.model.Encounter.DiagnosisComponent();
copyElement(src, tgt);
if (src.hasCondition())
tgt.setCondition(convertReference(src.getCondition()));
if (src.hasUse())
tgt.setUse(convertCodeableConcept(src.getUse()));
if (src.hasRank())
tgt.setRankElement(convertPositiveInt(src.getRankElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent convertEncounterHospitalizationComponent(org.hl7.fhir.r4.model.Encounter.EncounterHospitalizationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent();
copyElement(src, tgt);
if (src.hasPreAdmissionIdentifier())
tgt.setPreAdmissionIdentifier(convertIdentifier(src.getPreAdmissionIdentifier()));
if (src.hasOrigin())
tgt.setOrigin(convertReference(src.getOrigin()));
if (src.hasAdmitSource())
tgt.setAdmitSource(convertCodeableConcept(src.getAdmitSource()));
if (src.hasReAdmission())
tgt.setReAdmission(convertCodeableConcept(src.getReAdmission()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDietPreference())
tgt.addDietPreference(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialCourtesy())
tgt.addSpecialCourtesy(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialArrangement())
tgt.addSpecialArrangement(convertCodeableConcept(t));
if (src.hasDestination())
tgt.setDestination(convertReference(src.getDestination()));
if (src.hasDischargeDisposition())
tgt.setDischargeDisposition(convertCodeableConcept(src.getDischargeDisposition()));
return tgt;
}
public static org.hl7.fhir.r4.model.Encounter.EncounterHospitalizationComponent convertEncounterHospitalizationComponent(org.hl7.fhir.r5.model.Encounter.EncounterHospitalizationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Encounter.EncounterHospitalizationComponent tgt = new org.hl7.fhir.r4.model.Encounter.EncounterHospitalizationComponent();
copyElement(src, tgt);
if (src.hasPreAdmissionIdentifier())
tgt.setPreAdmissionIdentifier(convertIdentifier(src.getPreAdmissionIdentifier()));
if (src.hasOrigin())
tgt.setOrigin(convertReference(src.getOrigin()));
if (src.hasAdmitSource())
tgt.setAdmitSource(convertCodeableConcept(src.getAdmitSource()));
if (src.hasReAdmission())
tgt.setReAdmission(convertCodeableConcept(src.getReAdmission()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDietPreference())
tgt.addDietPreference(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialCourtesy())
tgt.addSpecialCourtesy(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialArrangement())
tgt.addSpecialArrangement(convertCodeableConcept(t));
if (src.hasDestination())
tgt.setDestination(convertReference(src.getDestination()));
if (src.hasDischargeDisposition())
tgt.setDischargeDisposition(convertCodeableConcept(src.getDischargeDisposition()));
return tgt;
}
public static org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent convertEncounterLocationComponent(org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent tgt = new org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent();
copyElement(src, tgt);
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
if (src.hasStatus())
tgt.setStatus(convertEncounterLocationStatus(src.getStatus()));
if (src.hasPhysicalType())
tgt.setPhysicalType(convertCodeableConcept(src.getPhysicalType()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent convertEncounterLocationComponent(org.hl7.fhir.r5.model.Encounter.EncounterLocationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent tgt = new org.hl7.fhir.r4.model.Encounter.EncounterLocationComponent();
copyElement(src, tgt);
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
if (src.hasStatus())
tgt.setStatus(convertEncounterLocationStatus(src.getStatus()));
if (src.hasPhysicalType())
tgt.setPhysicalType(convertCodeableConcept(src.getPhysicalType()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus convertEncounterLocationStatus(org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PLANNED: return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.PLANNED;
case ACTIVE: return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.ACTIVE;
case RESERVED: return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.RESERVED;
case COMPLETED: return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.COMPLETED;
default: return org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus convertEncounterLocationStatus(org.hl7.fhir.r5.model.Encounter.EncounterLocationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PLANNED: return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.PLANNED;
case ACTIVE: return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.ACTIVE;
case RESERVED: return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.RESERVED;
case COMPLETED: return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.COMPLETED;
default: return org.hl7.fhir.r4.model.Encounter.EncounterLocationStatus.NULL;
}
}
}

View File

@ -0,0 +1,131 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Endpoint extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Endpoint convertEndpoint(org.hl7.fhir.r4.model.Endpoint src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Endpoint tgt = new org.hl7.fhir.r5.model.Endpoint();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertEndpointStatus(src.getStatus()));
if (src.hasConnectionType())
tgt.setConnectionType(convertCoding(src.getConnectionType()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasManagingOrganization())
tgt.setManagingOrganization(convertReference(src.getManagingOrganization()));
for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact())
tgt.addContact(convertContactPoint(t));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPayloadType())
tgt.addPayloadType(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeType t : src.getPayloadMimeType())
tgt.getPayloadMimeType().add(convertCode(t));
if (src.hasAddress())
tgt.setAddressElement(convertUrl(src.getAddressElement()));
for (org.hl7.fhir.r4.model.StringType t : src.getHeader())
tgt.getHeader().add(convertString(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Endpoint convertEndpoint(org.hl7.fhir.r5.model.Endpoint src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Endpoint tgt = new org.hl7.fhir.r4.model.Endpoint();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertEndpointStatus(src.getStatus()));
if (src.hasConnectionType())
tgt.setConnectionType(convertCoding(src.getConnectionType()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasManagingOrganization())
tgt.setManagingOrganization(convertReference(src.getManagingOrganization()));
for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact())
tgt.addContact(convertContactPoint(t));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPayloadType())
tgt.addPayloadType(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeType t : src.getPayloadMimeType())
tgt.getPayloadMimeType().add(convertCode(t));
if (src.hasAddress())
tgt.setAddressElement(convertUrl(src.getAddressElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getHeader())
tgt.getHeader().add(convertString(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Endpoint.EndpointStatus convertEndpointStatus(org.hl7.fhir.r4.model.Endpoint.EndpointStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ACTIVE;
case SUSPENDED: return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.SUSPENDED;
case ERROR: return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ERROR;
case OFF: return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.OFF;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.ENTEREDINERROR;
case TEST: return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.TEST;
default: return org.hl7.fhir.r5.model.Endpoint.EndpointStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Endpoint.EndpointStatus convertEndpointStatus(org.hl7.fhir.r5.model.Endpoint.EndpointStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ACTIVE;
case SUSPENDED: return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.SUSPENDED;
case ERROR: return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ERROR;
case OFF: return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.OFF;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.ENTEREDINERROR;
case TEST: return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.TEST;
default: return org.hl7.fhir.r4.model.Endpoint.EndpointStatus.NULL;
}
}
}

View File

@ -0,0 +1,111 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class EnrollmentRequest extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.EnrollmentRequest convertEnrollmentRequest(org.hl7.fhir.r4.model.EnrollmentRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EnrollmentRequest tgt = new org.hl7.fhir.r5.model.EnrollmentRequest();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertEnrollmentRequestStatus(src.getStatus()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasInsurer())
tgt.setInsurer(convertReference(src.getInsurer()));
if (src.hasProvider())
tgt.setProvider(convertReference(src.getProvider()));
if (src.hasCandidate())
tgt.setCandidate(convertReference(src.getCandidate()));
if (src.hasCoverage())
tgt.setCoverage(convertReference(src.getCoverage()));
return tgt;
}
public static org.hl7.fhir.r4.model.EnrollmentRequest convertEnrollmentRequest(org.hl7.fhir.r5.model.EnrollmentRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EnrollmentRequest tgt = new org.hl7.fhir.r4.model.EnrollmentRequest();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertEnrollmentRequestStatus(src.getStatus()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasInsurer())
tgt.setInsurer(convertReference(src.getInsurer()));
if (src.hasProvider())
tgt.setProvider(convertReference(src.getProvider()));
if (src.hasCandidate())
tgt.setCandidate(convertReference(src.getCandidate()));
if (src.hasCoverage())
tgt.setCoverage(convertReference(src.getCoverage()));
return tgt;
}
public static org.hl7.fhir.r5.model.EnrollmentRequest.EnrollmentRequestStatus convertEnrollmentRequestStatus(org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.EnrollmentRequest.EnrollmentRequestStatus.ACTIVE;
case CANCELLED: return org.hl7.fhir.r5.model.EnrollmentRequest.EnrollmentRequestStatus.CANCELLED;
case DRAFT: return org.hl7.fhir.r5.model.EnrollmentRequest.EnrollmentRequestStatus.DRAFT;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.EnrollmentRequest.EnrollmentRequestStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.EnrollmentRequest.EnrollmentRequestStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus convertEnrollmentRequestStatus(org.hl7.fhir.r5.model.EnrollmentRequest.EnrollmentRequestStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.ACTIVE;
case CANCELLED: return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.CANCELLED;
case DRAFT: return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.DRAFT;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.EnrollmentRequest.EnrollmentRequestStatus.NULL;
}
}
}

View File

@ -0,0 +1,139 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class EnrollmentResponse extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.EnrollmentResponse convertEnrollmentResponse(org.hl7.fhir.r4.model.EnrollmentResponse src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EnrollmentResponse tgt = new org.hl7.fhir.r5.model.EnrollmentResponse();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertEnrollmentResponseStatus(src.getStatus()));
if (src.hasRequest())
tgt.setRequest(convertReference(src.getRequest()));
if (src.hasOutcome())
tgt.setOutcome(convertRemittanceOutcome(src.getOutcome()));
if (src.hasDisposition())
tgt.setDispositionElement(convertString(src.getDispositionElement()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasOrganization())
tgt.setOrganization(convertReference(src.getOrganization()));
if (src.hasRequestProvider())
tgt.setRequestProvider(convertReference(src.getRequestProvider()));
return tgt;
}
public static org.hl7.fhir.r4.model.EnrollmentResponse convertEnrollmentResponse(org.hl7.fhir.r5.model.EnrollmentResponse src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EnrollmentResponse tgt = new org.hl7.fhir.r4.model.EnrollmentResponse();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertEnrollmentResponseStatus(src.getStatus()));
if (src.hasRequest())
tgt.setRequest(convertReference(src.getRequest()));
if (src.hasOutcome())
tgt.setOutcome(convertRemittanceOutcome(src.getOutcome()));
if (src.hasDisposition())
tgt.setDispositionElement(convertString(src.getDispositionElement()));
if (src.hasCreated())
tgt.setCreatedElement(convertDateTime(src.getCreatedElement()));
if (src.hasOrganization())
tgt.setOrganization(convertReference(src.getOrganization()));
if (src.hasRequestProvider())
tgt.setRequestProvider(convertReference(src.getRequestProvider()));
return tgt;
}
public static org.hl7.fhir.r5.model.EnrollmentResponse.EnrollmentResponseStatus convertEnrollmentResponseStatus(org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.EnrollmentResponse.EnrollmentResponseStatus.ACTIVE;
case CANCELLED: return org.hl7.fhir.r5.model.EnrollmentResponse.EnrollmentResponseStatus.CANCELLED;
case DRAFT: return org.hl7.fhir.r5.model.EnrollmentResponse.EnrollmentResponseStatus.DRAFT;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.EnrollmentResponse.EnrollmentResponseStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.EnrollmentResponse.EnrollmentResponseStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus convertEnrollmentResponseStatus(org.hl7.fhir.r5.model.EnrollmentResponse.EnrollmentResponseStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.ACTIVE;
case CANCELLED: return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.CANCELLED;
case DRAFT: return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.DRAFT;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.EnrollmentResponse.EnrollmentResponseStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Enumerations.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case QUEUED: return org.hl7.fhir.r5.model.Enumerations.RemittanceOutcome.QUEUED;
case COMPLETE: return org.hl7.fhir.r5.model.Enumerations.RemittanceOutcome.COMPLETE;
case ERROR: return org.hl7.fhir.r5.model.Enumerations.RemittanceOutcome.ERROR;
case PARTIAL: return org.hl7.fhir.r5.model.Enumerations.RemittanceOutcome.PARTIAL;
default: return org.hl7.fhir.r5.model.Enumerations.RemittanceOutcome.NULL;
}
}
public static org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumerations.RemittanceOutcome src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case QUEUED: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.QUEUED;
case COMPLETE: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.COMPLETE;
case ERROR: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.ERROR;
case PARTIAL: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.PARTIAL;
default: return org.hl7.fhir.r4.model.Enumerations.RemittanceOutcome.NULL;
}
}
}

View File

@ -0,0 +1,287 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Enumerations extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Enumerations.BindingStrength convertBindingStrength(org.hl7.fhir.r4.model.Enumerations.BindingStrength src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case REQUIRED: return org.hl7.fhir.r5.model.Enumerations.BindingStrength.REQUIRED;
case EXTENSIBLE: return org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXTENSIBLE;
case PREFERRED: return org.hl7.fhir.r5.model.Enumerations.BindingStrength.PREFERRED;
case EXAMPLE: return org.hl7.fhir.r5.model.Enumerations.BindingStrength.EXAMPLE;
default: return org.hl7.fhir.r5.model.Enumerations.BindingStrength.NULL;
}
}
public static org.hl7.fhir.r4.model.Enumerations.BindingStrength convertBindingStrength(org.hl7.fhir.r5.model.Enumerations.BindingStrength src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case REQUIRED: return org.hl7.fhir.r4.model.Enumerations.BindingStrength.REQUIRED;
case EXTENSIBLE: return org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXTENSIBLE;
case PREFERRED: return org.hl7.fhir.r4.model.Enumerations.BindingStrength.PREFERRED;
case EXAMPLE: return org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXAMPLE;
default: return org.hl7.fhir.r4.model.Enumerations.BindingStrength.NULL;
}
}
public static org.hl7.fhir.r5.model.Enumerations.PublicationStatus convertPublicationStatus(org.hl7.fhir.r4.model.Enumerations.PublicationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DRAFT: return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.DRAFT;
case ACTIVE: return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.ACTIVE;
case RETIRED: return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.RETIRED;
case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.UNKNOWN;
default: return org.hl7.fhir.r5.model.Enumerations.PublicationStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Enumerations.PublicationStatus convertPublicationStatus(org.hl7.fhir.r5.model.Enumerations.PublicationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DRAFT: return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.DRAFT;
case ACTIVE: return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.ACTIVE;
case RETIRED: return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.RETIRED;
case UNKNOWN: return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.UNKNOWN;
default: return org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Enumerations.FHIRVersion convertFHIRVersion(org.hl7.fhir.r4.model.Enumerations.FHIRVersion src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case _0_01: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_01;
case _0_05: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_05;
case _0_06: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_06;
case _0_11: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_11;
case _0_0_80: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_80;
case _0_0_81: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_81;
case _0_0_82: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_0_82;
case _0_4_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_4_0;
case _0_5_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._0_5_0;
case _1_0_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_0;
case _1_0_1: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_1;
case _1_0_2: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_0_2;
case _1_1_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_1_0;
case _1_4_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_4_0;
case _1_6_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_6_0;
case _1_8_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._1_8_0;
case _3_0_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_0;
case _3_0_1: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_0_1;
case _3_3_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_3_0;
case _3_5_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._3_5_0;
case _4_0_0: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_0_0;
default: return org.hl7.fhir.r5.model.Enumerations.FHIRVersion.NULL;
}
}
public static org.hl7.fhir.r4.model.Enumerations.FHIRVersion convertFHIRVersion(org.hl7.fhir.r5.model.Enumerations.FHIRVersion src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case _0_01: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_01;
case _0_05: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_05;
case _0_06: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_06;
case _0_11: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_11;
case _0_0_80: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_80;
case _0_0_81: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_81;
case _0_0_82: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_0_82;
case _0_4_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_4_0;
case _0_5_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._0_5_0;
case _1_0_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_0;
case _1_0_1: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_1;
case _1_0_2: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_0_2;
case _1_1_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_1_0;
case _1_4_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_4_0;
case _1_6_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_6_0;
case _1_8_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._1_8_0;
case _3_0_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_0;
case _3_0_1: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_0_1;
case _3_3_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_3_0;
case _3_5_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._3_5_0;
case _4_0_0: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_0_0;
default: return org.hl7.fhir.r4.model.Enumerations.FHIRVersion.NULL;
}
}
public static org.hl7.fhir.r5.model.Enumerations.SearchParamType convertSearchParamType(org.hl7.fhir.r4.model.Enumerations.SearchParamType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case NUMBER: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.NUMBER;
case DATE: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.DATE;
case STRING: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.STRING;
case TOKEN: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.TOKEN;
case REFERENCE: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.REFERENCE;
case COMPOSITE: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.COMPOSITE;
case QUANTITY: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.QUANTITY;
case URI: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.URI;
case SPECIAL: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.SPECIAL;
default: return org.hl7.fhir.r5.model.Enumerations.SearchParamType.NULL;
}
}
public static org.hl7.fhir.r4.model.Enumerations.SearchParamType convertSearchParamType(org.hl7.fhir.r5.model.Enumerations.SearchParamType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case NUMBER: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.NUMBER;
case DATE: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.DATE;
case STRING: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.STRING;
case TOKEN: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.TOKEN;
case REFERENCE: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.REFERENCE;
case COMPOSITE: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.COMPOSITE;
case QUANTITY: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.QUANTITY;
case URI: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.URI;
case SPECIAL: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.SPECIAL;
default: return org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL;
}
}
public static org.hl7.fhir.r5.model.Enumerations.NoteType convertNoteType(org.hl7.fhir.r4.model.Enumerations.NoteType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DISPLAY: return org.hl7.fhir.r5.model.Enumerations.NoteType.DISPLAY;
case PRINT: return org.hl7.fhir.r5.model.Enumerations.NoteType.PRINT;
case PRINTOPER: return org.hl7.fhir.r5.model.Enumerations.NoteType.PRINTOPER;
default: return org.hl7.fhir.r5.model.Enumerations.NoteType.NULL;
}
}
public static org.hl7.fhir.r4.model.Enumerations.NoteType convertNoteType(org.hl7.fhir.r5.model.Enumerations.NoteType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DISPLAY: return org.hl7.fhir.r4.model.Enumerations.NoteType.DISPLAY;
case PRINT: return org.hl7.fhir.r4.model.Enumerations.NoteType.PRINT;
case PRINTOPER: return org.hl7.fhir.r4.model.Enumerations.NoteType.PRINTOPER;
default: return org.hl7.fhir.r4.model.Enumerations.NoteType.NULL;
}
}
public static org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence convertConceptMapEquivalence(org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case RELATEDTO: return org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence.RELATEDTO;
case EQUIVALENT: return org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence.EQUIVALENT;
case EQUAL: return org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence.EQUAL;
case WIDER: return org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence.WIDER;
case SUBSUMES: return org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence.SUBSUMES;
case NARROWER: return org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence.NARROWER;
case SPECIALIZES: return org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence.SPECIALIZES;
case INEXACT: return org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence.INEXACT;
case UNMATCHED: return org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence.UNMATCHED;
case DISJOINT: return org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence.DISJOINT;
default: return org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence.NULL;
}
}
public static org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence convertConceptMapEquivalence(org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case RELATEDTO: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.RELATEDTO;
case EQUIVALENT: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUIVALENT;
case EQUAL: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.EQUAL;
case WIDER: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.WIDER;
case SUBSUMES: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.SUBSUMES;
case NARROWER: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NARROWER;
case SPECIALIZES: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.SPECIALIZES;
case INEXACT: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.INEXACT;
case UNMATCHED: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.UNMATCHED;
case DISJOINT: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.DISJOINT;
default: return org.hl7.fhir.r4.model.Enumerations.ConceptMapEquivalence.NULL;
}
}
public static org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus convertDocumentReferenceStatus(org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case CURRENT: return org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.CURRENT;
case SUPERSEDED: return org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.SUPERSEDED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus convertDocumentReferenceStatus(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case CURRENT: return org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.CURRENT;
case SUPERSEDED: return org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.SUPERSEDED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.Enumerations.DocumentReferenceStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Enumerations.AdministrativeGender convertAdministrativeGender(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case MALE: return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.MALE;
case FEMALE: return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.FEMALE;
case OTHER: return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.OTHER;
case UNKNOWN: return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.UNKNOWN;
default: return org.hl7.fhir.r5.model.Enumerations.AdministrativeGender.NULL;
}
}
public static org.hl7.fhir.r4.model.Enumerations.AdministrativeGender convertAdministrativeGender(org.hl7.fhir.r5.model.Enumerations.AdministrativeGender src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case MALE: return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.MALE;
case FEMALE: return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.FEMALE;
case OTHER: return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.OTHER;
case UNKNOWN: return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.UNKNOWN;
default: return org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.NULL;
}
}
}

View File

@ -0,0 +1,189 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class EpisodeOfCare extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.EpisodeOfCare convertEpisodeOfCare(org.hl7.fhir.r4.model.EpisodeOfCare src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EpisodeOfCare tgt = new org.hl7.fhir.r5.model.EpisodeOfCare();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus()));
for (org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory())
tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis())
tgt.addDiagnosis(convertDiagnosisComponent(t));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasManagingOrganization())
tgt.setManagingOrganization(convertReference(src.getManagingOrganization()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r4.model.Reference t : src.getReferralRequest())
tgt.addReferralRequest(convertReference(t));
if (src.hasCareManager())
tgt.setCareManager(convertReference(src.getCareManager()));
for (org.hl7.fhir.r4.model.Reference t : src.getTeam())
tgt.addTeam(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getAccount())
tgt.addAccount(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.EpisodeOfCare convertEpisodeOfCare(org.hl7.fhir.r5.model.EpisodeOfCare src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EpisodeOfCare tgt = new org.hl7.fhir.r4.model.EpisodeOfCare();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus()));
for (org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent t : src.getStatusHistory())
tgt.addStatusHistory(convertEpisodeOfCareStatusHistoryComponent(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent t : src.getDiagnosis())
tgt.addDiagnosis(convertDiagnosisComponent(t));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasManagingOrganization())
tgt.setManagingOrganization(convertReference(src.getManagingOrganization()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
for (org.hl7.fhir.r5.model.Reference t : src.getReferralRequest())
tgt.addReferralRequest(convertReference(t));
if (src.hasCareManager())
tgt.setCareManager(convertReference(src.getCareManager()));
for (org.hl7.fhir.r5.model.Reference t : src.getTeam())
tgt.addTeam(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getAccount())
tgt.addAccount(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus convertEpisodeOfCareStatus(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PLANNED: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED;
case WAITLIST: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST;
case ACTIVE: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE;
case ONHOLD: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD;
case FINISHED: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED;
case CANCELLED: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus convertEpisodeOfCareStatus(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PLANNED: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.PLANNED;
case WAITLIST: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.WAITLIST;
case ACTIVE: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ACTIVE;
case ONHOLD: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ONHOLD;
case FINISHED: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.FINISHED;
case CANCELLED: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.CANCELLED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent tgt = new org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent();
copyElement(src, tgt);
if (src.hasStatus())
tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent convertEpisodeOfCareStatusHistoryComponent(org.hl7.fhir.r5.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent tgt = new org.hl7.fhir.r4.model.EpisodeOfCare.EpisodeOfCareStatusHistoryComponent();
copyElement(src, tgt);
if (src.hasStatus())
tgt.setStatus(convertEpisodeOfCareStatus(src.getStatus()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent tgt = new org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent();
copyElement(src, tgt);
if (src.hasCondition())
tgt.setCondition(convertReference(src.getCondition()));
if (src.hasRole())
tgt.setRole(convertCodeableConcept(src.getRole()));
if (src.hasRank())
tgt.setRankElement(convertPositiveInt(src.getRankElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent convertDiagnosisComponent(org.hl7.fhir.r5.model.EpisodeOfCare.DiagnosisComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent tgt = new org.hl7.fhir.r4.model.EpisodeOfCare.DiagnosisComponent();
copyElement(src, tgt);
if (src.hasCondition())
tgt.setCondition(convertReference(src.getCondition()));
if (src.hasRole())
tgt.setRole(convertCodeableConcept(src.getRole()));
if (src.hasRank())
tgt.setRankElement(convertPositiveInt(src.getRankElement()));
return tgt;
}
}

View File

@ -0,0 +1,171 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class EventDefinition extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.EventDefinition convertEventDefinition(org.hl7.fhir.r4.model.EventDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EventDefinition tgt = new org.hl7.fhir.r5.model.EventDefinition();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasSubject())
tgt.setSubject(convertType(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasUsage())
tgt.setUsageElement(convertString(src.getUsageElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic())
tgt.addTopic(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor())
tgt.addEditor(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(convertContactDetail(t));
for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(convertRelatedArtifact(t));
for (org.hl7.fhir.r4.model.TriggerDefinition t : src.getTrigger())
tgt.addTrigger(convertTriggerDefinition(t));
return tgt;
}
public static org.hl7.fhir.r4.model.EventDefinition convertEventDefinition(org.hl7.fhir.r5.model.EventDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EventDefinition tgt = new org.hl7.fhir.r4.model.EventDefinition();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasSubject())
tgt.setSubject(convertType(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasUsage())
tgt.setUsageElement(convertString(src.getUsageElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic())
tgt.addTopic(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor())
tgt.addEditor(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(convertContactDetail(t));
for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(convertRelatedArtifact(t));
for (org.hl7.fhir.r5.model.TriggerDefinition t : src.getTrigger())
tgt.addTrigger(convertTriggerDefinition(t));
return tgt;
}
}

View File

@ -0,0 +1,171 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Evidence extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Evidence convertEvidence(org.hl7.fhir.r4.model.Evidence src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Evidence tgt = new org.hl7.fhir.r5.model.Evidence();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasShortTitle())
tgt.setShortTitleElement(convertString(src.getShortTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic())
tgt.addTopic(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor())
tgt.addEditor(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(convertContactDetail(t));
for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(convertRelatedArtifact(t));
if (src.hasExposureBackground())
tgt.setExposureBackground(convertReference(src.getExposureBackground()));
for (org.hl7.fhir.r4.model.Reference t : src.getExposureVariant())
tgt.addExposureVariant(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getOutcome())
tgt.addOutcome(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Evidence convertEvidence(org.hl7.fhir.r5.model.Evidence src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Evidence tgt = new org.hl7.fhir.r4.model.Evidence();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasShortTitle())
tgt.setShortTitleElement(convertString(src.getShortTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic())
tgt.addTopic(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor())
tgt.addEditor(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(convertContactDetail(t));
for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(convertRelatedArtifact(t));
if (src.hasExposureBackground())
tgt.setExposureBackground(convertReference(src.getExposureBackground()));
for (org.hl7.fhir.r5.model.Reference t : src.getExposureVariant())
tgt.addExposureVariant(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getOutcome())
tgt.addOutcome(convertReference(t));
return tgt;
}
}

View File

@ -0,0 +1,261 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class EvidenceVariable extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.EvidenceVariable convertEvidenceVariable(org.hl7.fhir.r4.model.EvidenceVariable src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EvidenceVariable tgt = new org.hl7.fhir.r5.model.EvidenceVariable();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasShortTitle())
tgt.setShortTitleElement(convertString(src.getShortTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic())
tgt.addTopic(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor())
tgt.addEditor(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(convertContactDetail(t));
for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(convertRelatedArtifact(t));
if (src.hasType())
tgt.setType(convertEvidenceVariableType(src.getType()));
for (org.hl7.fhir.r4.model.EvidenceVariable.EvidenceVariableCharacteristicComponent t : src.getCharacteristic())
tgt.addCharacteristic(convertEvidenceVariableCharacteristicComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.EvidenceVariable convertEvidenceVariable(org.hl7.fhir.r5.model.EvidenceVariable src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EvidenceVariable tgt = new org.hl7.fhir.r4.model.EvidenceVariable();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasShortTitle())
tgt.setShortTitleElement(convertString(src.getShortTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic())
tgt.addTopic(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor())
tgt.addEditor(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(convertContactDetail(t));
for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(convertRelatedArtifact(t));
if (src.hasType())
tgt.setType(convertEvidenceVariableType(src.getType()));
for (org.hl7.fhir.r5.model.EvidenceVariable.EvidenceVariableCharacteristicComponent t : src.getCharacteristic())
tgt.addCharacteristic(convertEvidenceVariableCharacteristicComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.EvidenceVariable.EvidenceVariableType convertEvidenceVariableType(org.hl7.fhir.r4.model.EvidenceVariable.EvidenceVariableType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DICHOTOMOUS: return org.hl7.fhir.r5.model.EvidenceVariable.EvidenceVariableType.DICHOTOMOUS;
case CONTINUOUS: return org.hl7.fhir.r5.model.EvidenceVariable.EvidenceVariableType.CONTINUOUS;
case DESCRIPTIVE: return org.hl7.fhir.r5.model.EvidenceVariable.EvidenceVariableType.DESCRIPTIVE;
default: return org.hl7.fhir.r5.model.EvidenceVariable.EvidenceVariableType.NULL;
}
}
public static org.hl7.fhir.r4.model.EvidenceVariable.EvidenceVariableType convertEvidenceVariableType(org.hl7.fhir.r5.model.EvidenceVariable.EvidenceVariableType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DICHOTOMOUS: return org.hl7.fhir.r4.model.EvidenceVariable.EvidenceVariableType.DICHOTOMOUS;
case CONTINUOUS: return org.hl7.fhir.r4.model.EvidenceVariable.EvidenceVariableType.CONTINUOUS;
case DESCRIPTIVE: return org.hl7.fhir.r4.model.EvidenceVariable.EvidenceVariableType.DESCRIPTIVE;
default: return org.hl7.fhir.r4.model.EvidenceVariable.EvidenceVariableType.NULL;
}
}
public static org.hl7.fhir.r5.model.EvidenceVariable.EvidenceVariableCharacteristicComponent convertEvidenceVariableCharacteristicComponent(org.hl7.fhir.r4.model.EvidenceVariable.EvidenceVariableCharacteristicComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.EvidenceVariable.EvidenceVariableCharacteristicComponent tgt = new org.hl7.fhir.r5.model.EvidenceVariable.EvidenceVariableCharacteristicComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasDefinition())
tgt.setDefinition(convertType(src.getDefinition()));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUsageContext())
tgt.addUsageContext(convertUsageContext(t));
if (src.hasExclude())
tgt.setExcludeElement(convertBoolean(src.getExcludeElement()));
if (src.hasParticipantEffective())
tgt.setParticipantEffective(convertType(src.getParticipantEffective()));
if (src.hasTimeFromStart())
tgt.setTimeFromStart(convertDuration(src.getTimeFromStart()));
if (src.hasGroupMeasure())
tgt.setGroupMeasure(convertGroupMeasure(src.getGroupMeasure()));
return tgt;
}
public static org.hl7.fhir.r4.model.EvidenceVariable.EvidenceVariableCharacteristicComponent convertEvidenceVariableCharacteristicComponent(org.hl7.fhir.r5.model.EvidenceVariable.EvidenceVariableCharacteristicComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.EvidenceVariable.EvidenceVariableCharacteristicComponent tgt = new org.hl7.fhir.r4.model.EvidenceVariable.EvidenceVariableCharacteristicComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasDefinition())
tgt.setDefinition(convertType(src.getDefinition()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUsageContext())
tgt.addUsageContext(convertUsageContext(t));
if (src.hasExclude())
tgt.setExcludeElement(convertBoolean(src.getExcludeElement()));
if (src.hasParticipantEffective())
tgt.setParticipantEffective(convertType(src.getParticipantEffective()));
if (src.hasTimeFromStart())
tgt.setTimeFromStart(convertDuration(src.getTimeFromStart()));
if (src.hasGroupMeasure())
tgt.setGroupMeasure(convertGroupMeasure(src.getGroupMeasure()));
return tgt;
}
public static org.hl7.fhir.r5.model.EvidenceVariable.GroupMeasure convertGroupMeasure(org.hl7.fhir.r4.model.EvidenceVariable.GroupMeasure src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case MEAN: return org.hl7.fhir.r5.model.EvidenceVariable.GroupMeasure.MEAN;
case MEDIAN: return org.hl7.fhir.r5.model.EvidenceVariable.GroupMeasure.MEDIAN;
case MEANOFMEAN: return org.hl7.fhir.r5.model.EvidenceVariable.GroupMeasure.MEANOFMEAN;
case MEANOFMEDIAN: return org.hl7.fhir.r5.model.EvidenceVariable.GroupMeasure.MEANOFMEDIAN;
case MEDIANOFMEAN: return org.hl7.fhir.r5.model.EvidenceVariable.GroupMeasure.MEDIANOFMEAN;
case MEDIANOFMEDIAN: return org.hl7.fhir.r5.model.EvidenceVariable.GroupMeasure.MEDIANOFMEDIAN;
default: return org.hl7.fhir.r5.model.EvidenceVariable.GroupMeasure.NULL;
}
}
public static org.hl7.fhir.r4.model.EvidenceVariable.GroupMeasure convertGroupMeasure(org.hl7.fhir.r5.model.EvidenceVariable.GroupMeasure src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case MEAN: return org.hl7.fhir.r4.model.EvidenceVariable.GroupMeasure.MEAN;
case MEDIAN: return org.hl7.fhir.r4.model.EvidenceVariable.GroupMeasure.MEDIAN;
case MEANOFMEAN: return org.hl7.fhir.r4.model.EvidenceVariable.GroupMeasure.MEANOFMEAN;
case MEANOFMEDIAN: return org.hl7.fhir.r4.model.EvidenceVariable.GroupMeasure.MEANOFMEDIAN;
case MEDIANOFMEAN: return org.hl7.fhir.r4.model.EvidenceVariable.GroupMeasure.MEDIANOFMEAN;
case MEDIANOFMEDIAN: return org.hl7.fhir.r4.model.EvidenceVariable.GroupMeasure.MEDIANOFMEDIAN;
default: return org.hl7.fhir.r4.model.EvidenceVariable.GroupMeasure.NULL;
}
}
}

View File

@ -0,0 +1,731 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ExampleScenario extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.ExampleScenario convertExampleScenario(org.hl7.fhir.r4.model.ExampleScenario src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ExampleScenario tgt = new org.hl7.fhir.r5.model.ExampleScenario();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent t : src.getActor())
tgt.addActor(convertExampleScenarioActorComponent(t));
for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent t : src.getInstance())
tgt.addInstance(convertExampleScenarioInstanceComponent(t));
for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess())
tgt.addProcess(convertExampleScenarioProcessComponent(t));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getWorkflow())
tgt.getWorkflow().add(convertCanonical(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ExampleScenario convertExampleScenario(org.hl7.fhir.r5.model.ExampleScenario src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ExampleScenario tgt = new org.hl7.fhir.r4.model.ExampleScenario();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent t : src.getActor())
tgt.addActor(convertExampleScenarioActorComponent(t));
for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent t : src.getInstance())
tgt.addInstance(convertExampleScenarioInstanceComponent(t));
for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess())
tgt.addProcess(convertExampleScenarioProcessComponent(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getWorkflow())
tgt.getWorkflow().add(convertCanonical(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent convertExampleScenarioActorComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent();
copyElement(src, tgt);
if (src.hasActorId())
tgt.setActorIdElement(convertString(src.getActorIdElement()));
if (src.hasType())
tgt.setType(convertExampleScenarioActorType(src.getType()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent convertExampleScenarioActorComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorComponent();
copyElement(src, tgt);
if (src.hasActorId())
tgt.setActorIdElement(convertString(src.getActorIdElement()));
if (src.hasType())
tgt.setType(convertExampleScenarioActorType(src.getType()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType convertExampleScenarioActorType(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PERSON: return org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType.PERSON;
case ENTITY: return org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType.ENTITY;
default: return org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType.NULL;
}
}
public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType convertExampleScenarioActorType(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioActorType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PERSON: return org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType.PERSON;
case ENTITY: return org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType.ENTITY;
default: return org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioActorType.NULL;
}
}
public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent convertExampleScenarioInstanceComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent();
copyElement(src, tgt);
if (src.hasResourceId())
tgt.setResourceIdElement(convertString(src.getResourceIdElement()));
if (src.hasResourceType())
tgt.setResourceType(convertFHIRResourceType(src.getResourceType()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent t : src.getVersion())
tgt.addVersion(convertExampleScenarioInstanceVersionComponent(t));
for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent t : src.getContainedInstance())
tgt.addContainedInstance(convertExampleScenarioInstanceContainedInstanceComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent convertExampleScenarioInstanceComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceComponent();
copyElement(src, tgt);
if (src.hasResourceId())
tgt.setResourceIdElement(convertString(src.getResourceIdElement()));
if (src.hasResourceType())
tgt.setResourceType(convertFHIRResourceType(src.getResourceType()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent t : src.getVersion())
tgt.addVersion(convertExampleScenarioInstanceVersionComponent(t));
for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent t : src.getContainedInstance())
tgt.addContainedInstance(convertExampleScenarioInstanceContainedInstanceComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType convertFHIRResourceType(org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACCOUNT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.ACCOUNT;
case ACTIVITYDEFINITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.ACTIVITYDEFINITION;
case ADVERSEEVENT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.ADVERSEEVENT;
case ALLERGYINTOLERANCE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.ALLERGYINTOLERANCE;
case APPOINTMENT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.APPOINTMENT;
case APPOINTMENTRESPONSE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.APPOINTMENTRESPONSE;
case AUDITEVENT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.AUDITEVENT;
case BASIC: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.BASIC;
case BINARY: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.BINARY;
case BIOLOGICALLYDERIVEDPRODUCT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.BIOLOGICALLYDERIVEDPRODUCT;
case BODYSTRUCTURE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.BODYSTRUCTURE;
case BUNDLE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.BUNDLE;
case CAPABILITYSTATEMENT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.CAPABILITYSTATEMENT;
case CAREPLAN: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.CAREPLAN;
case CARETEAM: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.CARETEAM;
case CATALOGENTRY: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.CATALOGENTRY;
case CHARGEITEM: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.CHARGEITEM;
case CHARGEITEMDEFINITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.CHARGEITEMDEFINITION;
case CLAIM: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.CLAIM;
case CLAIMRESPONSE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.CLAIMRESPONSE;
case CLINICALIMPRESSION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.CLINICALIMPRESSION;
case CODESYSTEM: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.CODESYSTEM;
case COMMUNICATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.COMMUNICATION;
case COMMUNICATIONREQUEST: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.COMMUNICATIONREQUEST;
case COMPARTMENTDEFINITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.COMPARTMENTDEFINITION;
case COMPOSITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.COMPOSITION;
case CONCEPTMAP: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.CONCEPTMAP;
case CONDITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.CONDITION;
case CONSENT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.CONSENT;
case CONTRACT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.CONTRACT;
case COVERAGE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.COVERAGE;
case COVERAGEELIGIBILITYREQUEST: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.COVERAGEELIGIBILITYREQUEST;
case COVERAGEELIGIBILITYRESPONSE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.COVERAGEELIGIBILITYRESPONSE;
case DETECTEDISSUE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.DETECTEDISSUE;
case DEVICE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.DEVICE;
case DEVICEDEFINITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.DEVICEDEFINITION;
case DEVICEMETRIC: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.DEVICEMETRIC;
case DEVICEREQUEST: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.DEVICEREQUEST;
case DEVICEUSESTATEMENT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.DEVICEUSESTATEMENT;
case DIAGNOSTICREPORT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.DIAGNOSTICREPORT;
case DOCUMENTMANIFEST: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.DOCUMENTMANIFEST;
case DOCUMENTREFERENCE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.DOCUMENTREFERENCE;
case DOMAINRESOURCE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.DOMAINRESOURCE;
case EFFECTEVIDENCESYNTHESIS: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.EFFECTEVIDENCESYNTHESIS;
case ENCOUNTER: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.ENCOUNTER;
case ENDPOINT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.ENDPOINT;
case ENROLLMENTREQUEST: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.ENROLLMENTREQUEST;
case ENROLLMENTRESPONSE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.ENROLLMENTRESPONSE;
case EPISODEOFCARE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.EPISODEOFCARE;
case EVENTDEFINITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.EVENTDEFINITION;
case EVIDENCE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.EVIDENCE;
case EVIDENCEVARIABLE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.EVIDENCEVARIABLE;
case EXAMPLESCENARIO: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.EXAMPLESCENARIO;
case EXPLANATIONOFBENEFIT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.EXPLANATIONOFBENEFIT;
case FAMILYMEMBERHISTORY: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.FAMILYMEMBERHISTORY;
case FLAG: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.FLAG;
case GOAL: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.GOAL;
case GRAPHDEFINITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.GRAPHDEFINITION;
case GROUP: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.GROUP;
case GUIDANCERESPONSE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.GUIDANCERESPONSE;
case HEALTHCARESERVICE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.HEALTHCARESERVICE;
case IMAGINGSTUDY: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.IMAGINGSTUDY;
case IMMUNIZATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.IMMUNIZATION;
case IMMUNIZATIONEVALUATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.IMMUNIZATIONEVALUATION;
case IMMUNIZATIONRECOMMENDATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.IMMUNIZATIONRECOMMENDATION;
case IMPLEMENTATIONGUIDE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.IMPLEMENTATIONGUIDE;
case INSURANCEPLAN: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.INSURANCEPLAN;
case INVOICE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.INVOICE;
case LIBRARY: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.LIBRARY;
case LINKAGE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.LINKAGE;
case LIST: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.LIST;
case LOCATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.LOCATION;
case MEASURE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEASURE;
case MEASUREREPORT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEASUREREPORT;
case MEDIA: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDIA;
case MEDICATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICATION;
case MEDICATIONADMINISTRATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICATIONADMINISTRATION;
case MEDICATIONDISPENSE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICATIONDISPENSE;
case MEDICATIONKNOWLEDGE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICATIONKNOWLEDGE;
case MEDICATIONREQUEST: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICATIONREQUEST;
case MEDICATIONSTATEMENT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICATIONSTATEMENT;
case MEDICINALPRODUCT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCT;
case MEDICINALPRODUCTAUTHORIZATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTAUTHORIZATION;
case MEDICINALPRODUCTCONTRAINDICATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTCONTRAINDICATION;
case MEDICINALPRODUCTINDICATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTINDICATION;
case MEDICINALPRODUCTINGREDIENT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTINGREDIENT;
case MEDICINALPRODUCTINTERACTION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTINTERACTION;
case MEDICINALPRODUCTMANUFACTURED: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTMANUFACTURED;
case MEDICINALPRODUCTPACKAGED: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTPACKAGED;
case MEDICINALPRODUCTPHARMACEUTICAL: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTPHARMACEUTICAL;
case MEDICINALPRODUCTUNDESIRABLEEFFECT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTUNDESIRABLEEFFECT;
case MESSAGEDEFINITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MESSAGEDEFINITION;
case MESSAGEHEADER: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MESSAGEHEADER;
case MOLECULARSEQUENCE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.MOLECULARSEQUENCE;
case NAMINGSYSTEM: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.NAMINGSYSTEM;
case NUTRITIONORDER: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.NUTRITIONORDER;
case OBSERVATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.OBSERVATION;
case OBSERVATIONDEFINITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.OBSERVATIONDEFINITION;
case OPERATIONDEFINITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.OPERATIONDEFINITION;
case OPERATIONOUTCOME: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.OPERATIONOUTCOME;
case ORGANIZATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.ORGANIZATION;
case ORGANIZATIONAFFILIATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.ORGANIZATIONAFFILIATION;
case PARAMETERS: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.PARAMETERS;
case PATIENT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.PATIENT;
case PAYMENTNOTICE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.PAYMENTNOTICE;
case PAYMENTRECONCILIATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.PAYMENTRECONCILIATION;
case PERSON: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.PERSON;
case PLANDEFINITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.PLANDEFINITION;
case PRACTITIONER: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.PRACTITIONER;
case PRACTITIONERROLE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.PRACTITIONERROLE;
case PROCEDURE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.PROCEDURE;
case PROVENANCE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.PROVENANCE;
case QUESTIONNAIRE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.QUESTIONNAIRE;
case QUESTIONNAIRERESPONSE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.QUESTIONNAIRERESPONSE;
case RELATEDPERSON: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.RELATEDPERSON;
case REQUESTGROUP: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.REQUESTGROUP;
case RESEARCHDEFINITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.RESEARCHDEFINITION;
case RESEARCHELEMENTDEFINITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.RESEARCHELEMENTDEFINITION;
case RESEARCHSTUDY: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.RESEARCHSTUDY;
case RESEARCHSUBJECT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.RESEARCHSUBJECT;
case RESOURCE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.RESOURCE;
case RISKASSESSMENT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.RISKASSESSMENT;
case RISKEVIDENCESYNTHESIS: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.RISKEVIDENCESYNTHESIS;
case SCHEDULE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SCHEDULE;
case SEARCHPARAMETER: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SEARCHPARAMETER;
case SERVICEREQUEST: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SERVICEREQUEST;
case SLOT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SLOT;
case SPECIMEN: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SPECIMEN;
case SPECIMENDEFINITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SPECIMENDEFINITION;
case STRUCTUREDEFINITION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.STRUCTUREDEFINITION;
case STRUCTUREMAP: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.STRUCTUREMAP;
case SUBSCRIPTION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SUBSCRIPTION;
case SUBSTANCE: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SUBSTANCE;
case SUBSTANCENUCLEICACID: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SUBSTANCENUCLEICACID;
case SUBSTANCEPOLYMER: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SUBSTANCEPOLYMER;
case SUBSTANCEPROTEIN: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SUBSTANCEPROTEIN;
case SUBSTANCEREFERENCEINFORMATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SUBSTANCEREFERENCEINFORMATION;
case SUBSTANCESOURCEMATERIAL: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SUBSTANCESOURCEMATERIAL;
case SUBSTANCESPECIFICATION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SUBSTANCESPECIFICATION;
case SUPPLYDELIVERY: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SUPPLYDELIVERY;
case SUPPLYREQUEST: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.SUPPLYREQUEST;
case TASK: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.TASK;
case TERMINOLOGYCAPABILITIES: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.TERMINOLOGYCAPABILITIES;
case TESTREPORT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.TESTREPORT;
case TESTSCRIPT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.TESTSCRIPT;
case VALUESET: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.VALUESET;
case VERIFICATIONRESULT: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.VERIFICATIONRESULT;
case VISIONPRESCRIPTION: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.VISIONPRESCRIPTION;
default: return org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType.NULL;
}
}
public static org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType convertFHIRResourceType(org.hl7.fhir.r5.model.ExampleScenario.FHIRResourceType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACCOUNT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.ACCOUNT;
case ACTIVITYDEFINITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.ACTIVITYDEFINITION;
case ADVERSEEVENT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.ADVERSEEVENT;
case ALLERGYINTOLERANCE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.ALLERGYINTOLERANCE;
case APPOINTMENT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.APPOINTMENT;
case APPOINTMENTRESPONSE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.APPOINTMENTRESPONSE;
case AUDITEVENT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.AUDITEVENT;
case BASIC: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.BASIC;
case BINARY: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.BINARY;
case BIOLOGICALLYDERIVEDPRODUCT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.BIOLOGICALLYDERIVEDPRODUCT;
case BODYSTRUCTURE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.BODYSTRUCTURE;
case BUNDLE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.BUNDLE;
case CAPABILITYSTATEMENT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.CAPABILITYSTATEMENT;
case CAREPLAN: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.CAREPLAN;
case CARETEAM: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.CARETEAM;
case CATALOGENTRY: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.CATALOGENTRY;
case CHARGEITEM: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.CHARGEITEM;
case CHARGEITEMDEFINITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.CHARGEITEMDEFINITION;
case CLAIM: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.CLAIM;
case CLAIMRESPONSE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.CLAIMRESPONSE;
case CLINICALIMPRESSION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.CLINICALIMPRESSION;
case CODESYSTEM: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.CODESYSTEM;
case COMMUNICATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.COMMUNICATION;
case COMMUNICATIONREQUEST: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.COMMUNICATIONREQUEST;
case COMPARTMENTDEFINITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.COMPARTMENTDEFINITION;
case COMPOSITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.COMPOSITION;
case CONCEPTMAP: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.CONCEPTMAP;
case CONDITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.CONDITION;
case CONSENT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.CONSENT;
case CONTRACT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.CONTRACT;
case COVERAGE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.COVERAGE;
case COVERAGEELIGIBILITYREQUEST: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.COVERAGEELIGIBILITYREQUEST;
case COVERAGEELIGIBILITYRESPONSE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.COVERAGEELIGIBILITYRESPONSE;
case DETECTEDISSUE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.DETECTEDISSUE;
case DEVICE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.DEVICE;
case DEVICEDEFINITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.DEVICEDEFINITION;
case DEVICEMETRIC: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.DEVICEMETRIC;
case DEVICEREQUEST: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.DEVICEREQUEST;
case DEVICEUSESTATEMENT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.DEVICEUSESTATEMENT;
case DIAGNOSTICREPORT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.DIAGNOSTICREPORT;
case DOCUMENTMANIFEST: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.DOCUMENTMANIFEST;
case DOCUMENTREFERENCE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.DOCUMENTREFERENCE;
case DOMAINRESOURCE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.DOMAINRESOURCE;
case EFFECTEVIDENCESYNTHESIS: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.EFFECTEVIDENCESYNTHESIS;
case ENCOUNTER: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.ENCOUNTER;
case ENDPOINT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.ENDPOINT;
case ENROLLMENTREQUEST: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.ENROLLMENTREQUEST;
case ENROLLMENTRESPONSE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.ENROLLMENTRESPONSE;
case EPISODEOFCARE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.EPISODEOFCARE;
case EVENTDEFINITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.EVENTDEFINITION;
case EVIDENCE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.EVIDENCE;
case EVIDENCEVARIABLE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.EVIDENCEVARIABLE;
case EXAMPLESCENARIO: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.EXAMPLESCENARIO;
case EXPLANATIONOFBENEFIT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.EXPLANATIONOFBENEFIT;
case FAMILYMEMBERHISTORY: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.FAMILYMEMBERHISTORY;
case FLAG: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.FLAG;
case GOAL: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.GOAL;
case GRAPHDEFINITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.GRAPHDEFINITION;
case GROUP: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.GROUP;
case GUIDANCERESPONSE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.GUIDANCERESPONSE;
case HEALTHCARESERVICE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.HEALTHCARESERVICE;
case IMAGINGSTUDY: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.IMAGINGSTUDY;
case IMMUNIZATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.IMMUNIZATION;
case IMMUNIZATIONEVALUATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.IMMUNIZATIONEVALUATION;
case IMMUNIZATIONRECOMMENDATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.IMMUNIZATIONRECOMMENDATION;
case IMPLEMENTATIONGUIDE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.IMPLEMENTATIONGUIDE;
case INSURANCEPLAN: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.INSURANCEPLAN;
case INVOICE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.INVOICE;
case LIBRARY: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.LIBRARY;
case LINKAGE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.LINKAGE;
case LIST: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.LIST;
case LOCATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.LOCATION;
case MEASURE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEASURE;
case MEASUREREPORT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEASUREREPORT;
case MEDIA: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDIA;
case MEDICATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICATION;
case MEDICATIONADMINISTRATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICATIONADMINISTRATION;
case MEDICATIONDISPENSE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICATIONDISPENSE;
case MEDICATIONKNOWLEDGE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICATIONKNOWLEDGE;
case MEDICATIONREQUEST: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICATIONREQUEST;
case MEDICATIONSTATEMENT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICATIONSTATEMENT;
case MEDICINALPRODUCT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCT;
case MEDICINALPRODUCTAUTHORIZATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTAUTHORIZATION;
case MEDICINALPRODUCTCONTRAINDICATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTCONTRAINDICATION;
case MEDICINALPRODUCTINDICATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTINDICATION;
case MEDICINALPRODUCTINGREDIENT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTINGREDIENT;
case MEDICINALPRODUCTINTERACTION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTINTERACTION;
case MEDICINALPRODUCTMANUFACTURED: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTMANUFACTURED;
case MEDICINALPRODUCTPACKAGED: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTPACKAGED;
case MEDICINALPRODUCTPHARMACEUTICAL: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTPHARMACEUTICAL;
case MEDICINALPRODUCTUNDESIRABLEEFFECT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MEDICINALPRODUCTUNDESIRABLEEFFECT;
case MESSAGEDEFINITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MESSAGEDEFINITION;
case MESSAGEHEADER: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MESSAGEHEADER;
case MOLECULARSEQUENCE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.MOLECULARSEQUENCE;
case NAMINGSYSTEM: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.NAMINGSYSTEM;
case NUTRITIONORDER: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.NUTRITIONORDER;
case OBSERVATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.OBSERVATION;
case OBSERVATIONDEFINITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.OBSERVATIONDEFINITION;
case OPERATIONDEFINITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.OPERATIONDEFINITION;
case OPERATIONOUTCOME: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.OPERATIONOUTCOME;
case ORGANIZATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.ORGANIZATION;
case ORGANIZATIONAFFILIATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.ORGANIZATIONAFFILIATION;
case PARAMETERS: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.PARAMETERS;
case PATIENT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.PATIENT;
case PAYMENTNOTICE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.PAYMENTNOTICE;
case PAYMENTRECONCILIATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.PAYMENTRECONCILIATION;
case PERSON: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.PERSON;
case PLANDEFINITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.PLANDEFINITION;
case PRACTITIONER: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.PRACTITIONER;
case PRACTITIONERROLE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.PRACTITIONERROLE;
case PROCEDURE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.PROCEDURE;
case PROVENANCE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.PROVENANCE;
case QUESTIONNAIRE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.QUESTIONNAIRE;
case QUESTIONNAIRERESPONSE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.QUESTIONNAIRERESPONSE;
case RELATEDPERSON: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.RELATEDPERSON;
case REQUESTGROUP: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.REQUESTGROUP;
case RESEARCHDEFINITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.RESEARCHDEFINITION;
case RESEARCHELEMENTDEFINITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.RESEARCHELEMENTDEFINITION;
case RESEARCHSTUDY: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.RESEARCHSTUDY;
case RESEARCHSUBJECT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.RESEARCHSUBJECT;
case RESOURCE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.RESOURCE;
case RISKASSESSMENT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.RISKASSESSMENT;
case RISKEVIDENCESYNTHESIS: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.RISKEVIDENCESYNTHESIS;
case SCHEDULE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SCHEDULE;
case SEARCHPARAMETER: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SEARCHPARAMETER;
case SERVICEREQUEST: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SERVICEREQUEST;
case SLOT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SLOT;
case SPECIMEN: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SPECIMEN;
case SPECIMENDEFINITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SPECIMENDEFINITION;
case STRUCTUREDEFINITION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.STRUCTUREDEFINITION;
case STRUCTUREMAP: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.STRUCTUREMAP;
case SUBSCRIPTION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SUBSCRIPTION;
case SUBSTANCE: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SUBSTANCE;
case SUBSTANCENUCLEICACID: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SUBSTANCENUCLEICACID;
case SUBSTANCEPOLYMER: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SUBSTANCEPOLYMER;
case SUBSTANCEPROTEIN: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SUBSTANCEPROTEIN;
case SUBSTANCEREFERENCEINFORMATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SUBSTANCEREFERENCEINFORMATION;
case SUBSTANCESOURCEMATERIAL: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SUBSTANCESOURCEMATERIAL;
case SUBSTANCESPECIFICATION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SUBSTANCESPECIFICATION;
case SUPPLYDELIVERY: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SUPPLYDELIVERY;
case SUPPLYREQUEST: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.SUPPLYREQUEST;
case TASK: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.TASK;
case TERMINOLOGYCAPABILITIES: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.TERMINOLOGYCAPABILITIES;
case TESTREPORT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.TESTREPORT;
case TESTSCRIPT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.TESTSCRIPT;
case VALUESET: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.VALUESET;
case VERIFICATIONRESULT: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.VERIFICATIONRESULT;
case VISIONPRESCRIPTION: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.VISIONPRESCRIPTION;
default: return org.hl7.fhir.r4.model.ExampleScenario.FHIRResourceType.NULL;
}
}
public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent convertExampleScenarioInstanceVersionComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent();
copyElement(src, tgt);
if (src.hasVersionId())
tgt.setVersionIdElement(convertString(src.getVersionIdElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent convertExampleScenarioInstanceVersionComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceVersionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceVersionComponent();
copyElement(src, tgt);
if (src.hasVersionId())
tgt.setVersionIdElement(convertString(src.getVersionIdElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent convertExampleScenarioInstanceContainedInstanceComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent();
copyElement(src, tgt);
if (src.hasResourceId())
tgt.setResourceIdElement(convertString(src.getResourceIdElement()));
if (src.hasVersionId())
tgt.setVersionIdElement(convertString(src.getVersionIdElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent convertExampleScenarioInstanceContainedInstanceComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioInstanceContainedInstanceComponent();
copyElement(src, tgt);
if (src.hasResourceId())
tgt.setResourceIdElement(convertString(src.getResourceIdElement()));
if (src.hasVersionId())
tgt.setVersionIdElement(convertString(src.getVersionIdElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent convertExampleScenarioProcessComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent();
copyElement(src, tgt);
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
if (src.hasPreConditions())
tgt.setPreConditionsElement(convertMarkdown(src.getPreConditionsElement()));
if (src.hasPostConditions())
tgt.setPostConditionsElement(convertMarkdown(src.getPostConditionsElement()));
for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep())
tgt.addStep(convertExampleScenarioProcessStepComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent convertExampleScenarioProcessComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent();
copyElement(src, tgt);
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
if (src.hasPreConditions())
tgt.setPreConditionsElement(convertMarkdown(src.getPreConditionsElement()));
if (src.hasPostConditions())
tgt.setPostConditionsElement(convertMarkdown(src.getPostConditionsElement()));
for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep())
tgt.addStep(convertExampleScenarioProcessStepComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent convertExampleScenarioProcessStepComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess())
tgt.addProcess(convertExampleScenarioProcessComponent(t));
if (src.hasPause())
tgt.setPauseElement(convertBoolean(src.getPauseElement()));
if (src.hasOperation())
tgt.setOperation(convertExampleScenarioProcessStepOperationComponent(src.getOperation()));
for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent t : src.getAlternative())
tgt.addAlternative(convertExampleScenarioProcessStepAlternativeComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent convertExampleScenarioProcessStepComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessComponent t : src.getProcess())
tgt.addProcess(convertExampleScenarioProcessComponent(t));
if (src.hasPause())
tgt.setPauseElement(convertBoolean(src.getPauseElement()));
if (src.hasOperation())
tgt.setOperation(convertExampleScenarioProcessStepOperationComponent(src.getOperation()));
for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent t : src.getAlternative())
tgt.addAlternative(convertExampleScenarioProcessStepAlternativeComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent convertExampleScenarioProcessStepOperationComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent();
copyElement(src, tgt);
if (src.hasNumber())
tgt.setNumberElement(convertString(src.getNumberElement()));
if (src.hasType())
tgt.setTypeElement(convertString(src.getTypeElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasInitiator())
tgt.setInitiatorElement(convertString(src.getInitiatorElement()));
if (src.hasReceiver())
tgt.setReceiverElement(convertString(src.getReceiverElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
if (src.hasInitiatorActive())
tgt.setInitiatorActiveElement(convertBoolean(src.getInitiatorActiveElement()));
if (src.hasReceiverActive())
tgt.setReceiverActiveElement(convertBoolean(src.getReceiverActiveElement()));
if (src.hasRequest())
tgt.setRequest(convertExampleScenarioInstanceContainedInstanceComponent(src.getRequest()));
if (src.hasResponse())
tgt.setResponse(convertExampleScenarioInstanceContainedInstanceComponent(src.getResponse()));
return tgt;
}
public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent convertExampleScenarioProcessStepOperationComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepOperationComponent();
copyElement(src, tgt);
if (src.hasNumber())
tgt.setNumberElement(convertString(src.getNumberElement()));
if (src.hasType())
tgt.setTypeElement(convertString(src.getTypeElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasInitiator())
tgt.setInitiatorElement(convertString(src.getInitiatorElement()));
if (src.hasReceiver())
tgt.setReceiverElement(convertString(src.getReceiverElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
if (src.hasInitiatorActive())
tgt.setInitiatorActiveElement(convertBoolean(src.getInitiatorActiveElement()));
if (src.hasReceiverActive())
tgt.setReceiverActiveElement(convertBoolean(src.getReceiverActiveElement()));
if (src.hasRequest())
tgt.setRequest(convertExampleScenarioInstanceContainedInstanceComponent(src.getRequest()));
if (src.hasResponse())
tgt.setResponse(convertExampleScenarioInstanceContainedInstanceComponent(src.getResponse()));
return tgt;
}
public static org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent convertExampleScenarioProcessStepAlternativeComponent(org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent tgt = new org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent();
copyElement(src, tgt);
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep())
tgt.addStep(convertExampleScenarioProcessStepComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent convertExampleScenarioProcessStepAlternativeComponent(org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent tgt = new org.hl7.fhir.r4.model.ExampleScenario.ExampleScenarioProcessStepAlternativeComponent();
copyElement(src, tgt);
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.ExampleScenario.ExampleScenarioProcessStepComponent t : src.getStep())
tgt.addStep(convertExampleScenarioProcessStepComponent(t));
return tgt;
}
}

View File

@ -0,0 +1,191 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class FamilyMemberHistory extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.FamilyMemberHistory convertFamilyMemberHistory(org.hl7.fhir.r4.model.FamilyMemberHistory src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.FamilyMemberHistory tgt = new org.hl7.fhir.r5.model.FamilyMemberHistory();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(convertCanonical(t));
for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(convertUri(t));
if (src.hasStatus())
tgt.setStatus(convertFamilyHistoryStatus(src.getStatus()));
if (src.hasDataAbsentReason())
tgt.setDataAbsentReason(convertCodeableConcept(src.getDataAbsentReason()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasRelationship())
tgt.setRelationship(convertCodeableConcept(src.getRelationship()));
if (src.hasSex())
tgt.setSex(convertCodeableConcept(src.getSex()));
if (src.hasBorn())
tgt.setBorn(convertType(src.getBorn()));
if (src.hasAge())
tgt.setAge(convertType(src.getAge()));
if (src.hasEstimatedAge())
tgt.setEstimatedAgeElement(convertBoolean(src.getEstimatedAgeElement()));
if (src.hasDeceased())
tgt.setDeceased(convertType(src.getDeceased()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition())
tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.FamilyMemberHistory convertFamilyMemberHistory(org.hl7.fhir.r5.model.FamilyMemberHistory src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.FamilyMemberHistory tgt = new org.hl7.fhir.r4.model.FamilyMemberHistory();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(convertCanonical(t));
for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(convertUri(t));
if (src.hasStatus())
tgt.setStatus(convertFamilyHistoryStatus(src.getStatus()));
if (src.hasDataAbsentReason())
tgt.setDataAbsentReason(convertCodeableConcept(src.getDataAbsentReason()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasRelationship())
tgt.setRelationship(convertCodeableConcept(src.getRelationship()));
if (src.hasSex())
tgt.setSex(convertCodeableConcept(src.getSex()));
if (src.hasBorn())
tgt.setBorn(convertType(src.getBorn()));
if (src.hasAge())
tgt.setAge(convertType(src.getAge()));
if (src.hasEstimatedAge())
tgt.setEstimatedAgeElement(convertBoolean(src.getEstimatedAgeElement()));
if (src.hasDeceased())
tgt.setDeceased(convertType(src.getDeceased()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent t : src.getCondition())
tgt.addCondition(convertFamilyMemberHistoryConditionComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus convertFamilyHistoryStatus(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PARTIAL: return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL;
case COMPLETED: return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR;
case HEALTHUNKNOWN: return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN;
default: return org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus convertFamilyHistoryStatus(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyHistoryStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PARTIAL: return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.PARTIAL;
case COMPLETED: return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.ENTEREDINERROR;
case HEALTHUNKNOWN: return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.HEALTHUNKNOWN;
default: return org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyHistoryStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent convertFamilyMemberHistoryConditionComponent(org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent tgt = new org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasOutcome())
tgt.setOutcome(convertCodeableConcept(src.getOutcome()));
if (src.hasContributedToDeath())
tgt.setContributedToDeathElement(convertBoolean(src.getContributedToDeathElement()));
if (src.hasOnset())
tgt.setOnset(convertType(src.getOnset()));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent convertFamilyMemberHistoryConditionComponent(org.hl7.fhir.r5.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent tgt = new org.hl7.fhir.r4.model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasOutcome())
tgt.setOutcome(convertCodeableConcept(src.getOutcome()));
if (src.hasContributedToDeath())
tgt.setContributedToDeathElement(convertBoolean(src.getContributedToDeathElement()));
if (src.hasOnset())
tgt.setOnset(convertType(src.getOnset()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
}

View File

@ -0,0 +1,113 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Flag extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Flag convertFlag(org.hl7.fhir.r4.model.Flag src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Flag tgt = new org.hl7.fhir.r5.model.Flag();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertFlagStatus(src.getStatus()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
return tgt;
}
public static org.hl7.fhir.r4.model.Flag convertFlag(org.hl7.fhir.r5.model.Flag src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Flag tgt = new org.hl7.fhir.r4.model.Flag();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertFlagStatus(src.getStatus()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
return tgt;
}
public static org.hl7.fhir.r5.model.Flag.FlagStatus convertFlagStatus(org.hl7.fhir.r4.model.Flag.FlagStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.Flag.FlagStatus.ACTIVE;
case INACTIVE: return org.hl7.fhir.r5.model.Flag.FlagStatus.INACTIVE;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Flag.FlagStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.Flag.FlagStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Flag.FlagStatus convertFlagStatus(org.hl7.fhir.r5.model.Flag.FlagStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.Flag.FlagStatus.ACTIVE;
case INACTIVE: return org.hl7.fhir.r4.model.Flag.FlagStatus.INACTIVE;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Flag.FlagStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.Flag.FlagStatus.NULL;
}
}
}

View File

@ -0,0 +1,185 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Goal extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Goal convertGoal(org.hl7.fhir.r4.model.Goal src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Goal tgt = new org.hl7.fhir.r5.model.Goal();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasLifecycleStatus())
tgt.setLifecycleStatus(convertGoalLifecycleStatus(src.getLifecycleStatus()));
if (src.hasAchievementStatus())
tgt.setAchievementStatus(convertCodeableConcept(src.getAchievementStatus()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasPriority())
tgt.setPriority(convertCodeableConcept(src.getPriority()));
if (src.hasDescription())
tgt.setDescription(convertCodeableConcept(src.getDescription()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasStart())
tgt.setStart(convertType(src.getStart()));
for (org.hl7.fhir.r4.model.Goal.GoalTargetComponent t : src.getTarget())
tgt.addTarget(convertGoalTargetComponent(t));
if (src.hasStatusDate())
tgt.setStatusDateElement(convertDate(src.getStatusDateElement()));
if (src.hasStatusReason())
tgt.setStatusReasonElement(convertString(src.getStatusReasonElement()));
if (src.hasExpressedBy())
tgt.setExpressedBy(convertReference(src.getExpressedBy()));
for (org.hl7.fhir.r4.model.Reference t : src.getAddresses())
tgt.addAddresses(convertReference(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getOutcomeCode())
tgt.addOutcomeCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getOutcomeReference())
tgt.addOutcomeReference(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Goal convertGoal(org.hl7.fhir.r5.model.Goal src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Goal tgt = new org.hl7.fhir.r4.model.Goal();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasLifecycleStatus())
tgt.setLifecycleStatus(convertGoalLifecycleStatus(src.getLifecycleStatus()));
if (src.hasAchievementStatus())
tgt.setAchievementStatus(convertCodeableConcept(src.getAchievementStatus()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasPriority())
tgt.setPriority(convertCodeableConcept(src.getPriority()));
if (src.hasDescription())
tgt.setDescription(convertCodeableConcept(src.getDescription()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasStart())
tgt.setStart(convertType(src.getStart()));
for (org.hl7.fhir.r5.model.Goal.GoalTargetComponent t : src.getTarget())
tgt.addTarget(convertGoalTargetComponent(t));
if (src.hasStatusDate())
tgt.setStatusDateElement(convertDate(src.getStatusDateElement()));
if (src.hasStatusReason())
tgt.setStatusReasonElement(convertString(src.getStatusReasonElement()));
if (src.hasExpressedBy())
tgt.setExpressedBy(convertReference(src.getExpressedBy()));
for (org.hl7.fhir.r5.model.Reference t : src.getAddresses())
tgt.addAddresses(convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getOutcomeCode())
tgt.addOutcomeCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getOutcomeReference())
tgt.addOutcomeReference(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus convertGoalLifecycleStatus(org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROPOSED: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.PROPOSED;
case PLANNED: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.PLANNED;
case ACCEPTED: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACCEPTED;
case ACTIVE: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ACTIVE;
case ONHOLD: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ONHOLD;
case COMPLETED: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.COMPLETED;
case CANCELLED: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.CANCELLED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.ENTEREDINERROR;
case REJECTED: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.REJECTED;
default: return org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus convertGoalLifecycleStatus(org.hl7.fhir.r5.model.Goal.GoalLifecycleStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROPOSED: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.PROPOSED;
case PLANNED: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.PLANNED;
case ACCEPTED: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACCEPTED;
case ACTIVE: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ACTIVE;
case ONHOLD: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ONHOLD;
case COMPLETED: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.COMPLETED;
case CANCELLED: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.CANCELLED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.ENTEREDINERROR;
case REJECTED: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.REJECTED;
default: return org.hl7.fhir.r4.model.Goal.GoalLifecycleStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Goal.GoalTargetComponent convertGoalTargetComponent(org.hl7.fhir.r4.model.Goal.GoalTargetComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Goal.GoalTargetComponent tgt = new org.hl7.fhir.r5.model.Goal.GoalTargetComponent();
copyElement(src, tgt);
if (src.hasMeasure())
tgt.setMeasure(convertCodeableConcept(src.getMeasure()));
if (src.hasDetail())
tgt.setDetail(convertType(src.getDetail()));
if (src.hasDue())
tgt.setDue(convertType(src.getDue()));
return tgt;
}
public static org.hl7.fhir.r4.model.Goal.GoalTargetComponent convertGoalTargetComponent(org.hl7.fhir.r5.model.Goal.GoalTargetComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Goal.GoalTargetComponent tgt = new org.hl7.fhir.r4.model.Goal.GoalTargetComponent();
copyElement(src, tgt);
if (src.hasMeasure())
tgt.setMeasure(convertCodeableConcept(src.getMeasure()));
if (src.hasDetail())
tgt.setDetail(convertType(src.getDetail()));
if (src.hasDue())
tgt.setDue(convertType(src.getDue()));
return tgt;
}
}

View File

@ -0,0 +1,301 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class GraphDefinition extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.GraphDefinition convertGraphDefinition(org.hl7.fhir.r4.model.GraphDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.GraphDefinition tgt = new org.hl7.fhir.r5.model.GraphDefinition();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasStart())
tgt.setStartElement(convertCode(src.getStartElement()));
if (src.hasProfile())
tgt.setProfileElement(convertCanonical(src.getProfileElement()));
for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink())
tgt.addLink(convertGraphDefinitionLinkComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.GraphDefinition convertGraphDefinition(org.hl7.fhir.r5.model.GraphDefinition src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.GraphDefinition tgt = new org.hl7.fhir.r4.model.GraphDefinition();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasStart())
tgt.setStartElement(convertCode(src.getStartElement()));
if (src.hasProfile())
tgt.setProfileElement(convertCanonical(src.getProfileElement()));
for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink())
tgt.addLink(convertGraphDefinitionLinkComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent convertGraphDefinitionLinkComponent(org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent();
copyElement(src, tgt);
if (src.hasPath())
tgt.setPathElement(convertString(src.getPathElement()));
if (src.hasSliceName())
tgt.setSliceNameElement(convertString(src.getSliceNameElement()));
if (src.hasMin())
tgt.setMinElement(convertInteger(src.getMinElement()));
if (src.hasMax())
tgt.setMaxElement(convertString(src.getMaxElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget())
tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent convertGraphDefinitionLinkComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent tgt = new org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent();
copyElement(src, tgt);
if (src.hasPath())
tgt.setPathElement(convertString(src.getPathElement()));
if (src.hasSliceName())
tgt.setSliceNameElement(convertString(src.getSliceNameElement()));
if (src.hasMin())
tgt.setMinElement(convertInteger(src.getMinElement()));
if (src.hasMax())
tgt.setMaxElement(convertString(src.getMaxElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent t : src.getTarget())
tgt.addTarget(convertGraphDefinitionLinkTargetComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent convertGraphDefinitionLinkTargetComponent(org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertCode(src.getTypeElement()));
if (src.hasParams())
tgt.setParamsElement(convertString(src.getParamsElement()));
if (src.hasProfile())
tgt.setProfileElement(convertCanonical(src.getProfileElement()));
for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment())
tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t));
for (org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink())
tgt.addLink(convertGraphDefinitionLinkComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent convertGraphDefinitionLinkTargetComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent tgt = new org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertCode(src.getTypeElement()));
if (src.hasParams())
tgt.setParamsElement(convertString(src.getParamsElement()));
if (src.hasProfile())
tgt.setProfileElement(convertCanonical(src.getProfileElement()));
for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent t : src.getCompartment())
tgt.addCompartment(convertGraphDefinitionLinkTargetCompartmentComponent(t));
for (org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkComponent t : src.getLink())
tgt.addLink(convertGraphDefinitionLinkComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent convertGraphDefinitionLinkTargetCompartmentComponent(org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent tgt = new org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent();
copyElement(src, tgt);
if (src.hasUse())
tgt.setUse(convertGraphCompartmentUse(src.getUse()));
if (src.hasCode())
tgt.setCode(convertCompartmentCode(src.getCode()));
if (src.hasRule())
tgt.setRule(convertGraphCompartmentRule(src.getRule()));
if (src.hasExpression())
tgt.setExpressionElement(convertString(src.getExpressionElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent convertGraphDefinitionLinkTargetCompartmentComponent(org.hl7.fhir.r5.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent tgt = new org.hl7.fhir.r4.model.GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent();
copyElement(src, tgt);
if (src.hasUse())
tgt.setUse(convertGraphCompartmentUse(src.getUse()));
if (src.hasCode())
tgt.setCode(convertCompartmentCode(src.getCode()));
if (src.hasRule())
tgt.setRule(convertGraphCompartmentRule(src.getRule()));
if (src.hasExpression())
tgt.setExpressionElement(convertString(src.getExpressionElement()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse convertGraphCompartmentUse(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case CONDITION: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.CONDITION;
case REQUIREMENT: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.REQUIREMENT;
default: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse.NULL;
}
}
public static org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse convertGraphCompartmentUse(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentUse src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case CONDITION: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse.CONDITION;
case REQUIREMENT: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse.REQUIREMENT;
default: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentUse.NULL;
}
}
public static org.hl7.fhir.r5.model.GraphDefinition.CompartmentCode convertCompartmentCode(org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PATIENT: return org.hl7.fhir.r5.model.GraphDefinition.CompartmentCode.PATIENT;
case ENCOUNTER: return org.hl7.fhir.r5.model.GraphDefinition.CompartmentCode.ENCOUNTER;
case RELATEDPERSON: return org.hl7.fhir.r5.model.GraphDefinition.CompartmentCode.RELATEDPERSON;
case PRACTITIONER: return org.hl7.fhir.r5.model.GraphDefinition.CompartmentCode.PRACTITIONER;
case DEVICE: return org.hl7.fhir.r5.model.GraphDefinition.CompartmentCode.DEVICE;
default: return org.hl7.fhir.r5.model.GraphDefinition.CompartmentCode.NULL;
}
}
public static org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode convertCompartmentCode(org.hl7.fhir.r5.model.GraphDefinition.CompartmentCode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PATIENT: return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.PATIENT;
case ENCOUNTER: return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.ENCOUNTER;
case RELATEDPERSON: return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.RELATEDPERSON;
case PRACTITIONER: return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.PRACTITIONER;
case DEVICE: return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.DEVICE;
default: return org.hl7.fhir.r4.model.GraphDefinition.CompartmentCode.NULL;
}
}
public static org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule convertGraphCompartmentRule(org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case IDENTICAL: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.IDENTICAL;
case MATCHING: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.MATCHING;
case DIFFERENT: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.DIFFERENT;
case CUSTOM: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.CUSTOM;
default: return org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule.NULL;
}
}
public static org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule convertGraphCompartmentRule(org.hl7.fhir.r5.model.GraphDefinition.GraphCompartmentRule src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case IDENTICAL: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.IDENTICAL;
case MATCHING: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.MATCHING;
case DIFFERENT: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.DIFFERENT;
case CUSTOM: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.CUSTOM;
default: return org.hl7.fhir.r4.model.GraphDefinition.GraphCompartmentRule.NULL;
}
}
}

View File

@ -0,0 +1,187 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Group extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Group convertGroup(org.hl7.fhir.r4.model.Group src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Group tgt = new org.hl7.fhir.r5.model.Group();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasActive())
tgt.setActiveElement(convertBoolean(src.getActiveElement()));
if (src.hasType())
tgt.setType(convertGroupType(src.getType()));
if (src.hasActual())
tgt.setActualElement(convertBoolean(src.getActualElement()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasQuantity())
tgt.setQuantityElement(convertUnsignedInt(src.getQuantityElement()));
if (src.hasManagingEntity())
tgt.setManagingEntity(convertReference(src.getManagingEntity()));
for (org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent t : src.getCharacteristic())
tgt.addCharacteristic(convertGroupCharacteristicComponent(t));
for (org.hl7.fhir.r4.model.Group.GroupMemberComponent t : src.getMember())
tgt.addMember(convertGroupMemberComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Group convertGroup(org.hl7.fhir.r5.model.Group src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Group tgt = new org.hl7.fhir.r4.model.Group();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasActive())
tgt.setActiveElement(convertBoolean(src.getActiveElement()));
if (src.hasType())
tgt.setType(convertGroupType(src.getType()));
if (src.hasActual())
tgt.setActualElement(convertBoolean(src.getActualElement()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasQuantity())
tgt.setQuantityElement(convertUnsignedInt(src.getQuantityElement()));
if (src.hasManagingEntity())
tgt.setManagingEntity(convertReference(src.getManagingEntity()));
for (org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent t : src.getCharacteristic())
tgt.addCharacteristic(convertGroupCharacteristicComponent(t));
for (org.hl7.fhir.r5.model.Group.GroupMemberComponent t : src.getMember())
tgt.addMember(convertGroupMemberComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Group.GroupType convertGroupType(org.hl7.fhir.r4.model.Group.GroupType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PERSON: return org.hl7.fhir.r5.model.Group.GroupType.PERSON;
case ANIMAL: return org.hl7.fhir.r5.model.Group.GroupType.ANIMAL;
case PRACTITIONER: return org.hl7.fhir.r5.model.Group.GroupType.PRACTITIONER;
case DEVICE: return org.hl7.fhir.r5.model.Group.GroupType.DEVICE;
case MEDICATION: return org.hl7.fhir.r5.model.Group.GroupType.MEDICATION;
case SUBSTANCE: return org.hl7.fhir.r5.model.Group.GroupType.SUBSTANCE;
default: return org.hl7.fhir.r5.model.Group.GroupType.NULL;
}
}
public static org.hl7.fhir.r4.model.Group.GroupType convertGroupType(org.hl7.fhir.r5.model.Group.GroupType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PERSON: return org.hl7.fhir.r4.model.Group.GroupType.PERSON;
case ANIMAL: return org.hl7.fhir.r4.model.Group.GroupType.ANIMAL;
case PRACTITIONER: return org.hl7.fhir.r4.model.Group.GroupType.PRACTITIONER;
case DEVICE: return org.hl7.fhir.r4.model.Group.GroupType.DEVICE;
case MEDICATION: return org.hl7.fhir.r4.model.Group.GroupType.MEDICATION;
case SUBSTANCE: return org.hl7.fhir.r4.model.Group.GroupType.SUBSTANCE;
default: return org.hl7.fhir.r4.model.Group.GroupType.NULL;
}
}
public static org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent convertGroupCharacteristicComponent(org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent tgt = new org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
if (src.hasExclude())
tgt.setExcludeElement(convertBoolean(src.getExcludeElement()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent convertGroupCharacteristicComponent(org.hl7.fhir.r5.model.Group.GroupCharacteristicComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent tgt = new org.hl7.fhir.r4.model.Group.GroupCharacteristicComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
if (src.hasExclude())
tgt.setExcludeElement(convertBoolean(src.getExcludeElement()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r5.model.Group.GroupMemberComponent convertGroupMemberComponent(org.hl7.fhir.r4.model.Group.GroupMemberComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Group.GroupMemberComponent tgt = new org.hl7.fhir.r5.model.Group.GroupMemberComponent();
copyElement(src, tgt);
if (src.hasEntity())
tgt.setEntity(convertReference(src.getEntity()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasInactive())
tgt.setInactiveElement(convertBoolean(src.getInactiveElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Group.GroupMemberComponent convertGroupMemberComponent(org.hl7.fhir.r5.model.Group.GroupMemberComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Group.GroupMemberComponent tgt = new org.hl7.fhir.r4.model.Group.GroupMemberComponent();
copyElement(src, tgt);
if (src.hasEntity())
tgt.setEntity(convertReference(src.getEntity()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasInactive())
tgt.setInactiveElement(convertBoolean(src.getInactiveElement()));
return tgt;
}
}

View File

@ -0,0 +1,147 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class GuidanceResponse extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.GuidanceResponse convertGuidanceResponse(org.hl7.fhir.r4.model.GuidanceResponse src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.GuidanceResponse tgt = new org.hl7.fhir.r5.model.GuidanceResponse();
copyDomainResource(src, tgt);
if (src.hasRequestIdentifier())
tgt.setRequestIdentifier(convertIdentifier(src.getRequestIdentifier()));
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasModule())
tgt.setModule(convertType(src.getModule()));
if (src.hasStatus())
tgt.setStatus(convertGuidanceResponseStatus(src.getStatus()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasOccurrenceDateTime())
tgt.setOccurrenceDateTimeElement(convertDateTime(src.getOccurrenceDateTimeElement()));
if (src.hasPerformer())
tgt.setPerformer(convertReference(src.getPerformer()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.Reference t : src.getEvaluationMessage())
tgt.addEvaluationMessage(convertReference(t));
if (src.hasOutputParameters())
tgt.setOutputParameters(convertReference(src.getOutputParameters()));
if (src.hasResult())
tgt.setResult(convertReference(src.getResult()));
for (org.hl7.fhir.r4.model.DataRequirement t : src.getDataRequirement())
tgt.addDataRequirement(convertDataRequirement(t));
return tgt;
}
public static org.hl7.fhir.r4.model.GuidanceResponse convertGuidanceResponse(org.hl7.fhir.r5.model.GuidanceResponse src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.GuidanceResponse tgt = new org.hl7.fhir.r4.model.GuidanceResponse();
copyDomainResource(src, tgt);
if (src.hasRequestIdentifier())
tgt.setRequestIdentifier(convertIdentifier(src.getRequestIdentifier()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasModule())
tgt.setModule(convertType(src.getModule()));
if (src.hasStatus())
tgt.setStatus(convertGuidanceResponseStatus(src.getStatus()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasOccurrenceDateTime())
tgt.setOccurrenceDateTimeElement(convertDateTime(src.getOccurrenceDateTimeElement()));
if (src.hasPerformer())
tgt.setPerformer(convertReference(src.getPerformer()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.Reference t : src.getEvaluationMessage())
tgt.addEvaluationMessage(convertReference(t));
if (src.hasOutputParameters())
tgt.setOutputParameters(convertReference(src.getOutputParameters()));
if (src.hasResult())
tgt.setResult(convertReference(src.getResult()));
for (org.hl7.fhir.r5.model.DataRequirement t : src.getDataRequirement())
tgt.addDataRequirement(convertDataRequirement(t));
return tgt;
}
public static org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus convertGuidanceResponseStatus(org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case SUCCESS: return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.SUCCESS;
case DATAREQUESTED: return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUESTED;
case DATAREQUIRED: return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUIRED;
case INPROGRESS: return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.INPROGRESS;
case FAILURE: return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.FAILURE;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus convertGuidanceResponseStatus(org.hl7.fhir.r5.model.GuidanceResponse.GuidanceResponseStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case SUCCESS: return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.SUCCESS;
case DATAREQUESTED: return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUESTED;
case DATAREQUIRED: return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.DATAREQUIRED;
case INPROGRESS: return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.INPROGRESS;
case FAILURE: return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.FAILURE;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.GuidanceResponse.GuidanceResponseStatus.NULL;
}
}
}

View File

@ -0,0 +1,265 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class HealthcareService extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.HealthcareService convertHealthcareService(org.hl7.fhir.r4.model.HealthcareService src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.HealthcareService tgt = new org.hl7.fhir.r5.model.HealthcareService();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasActive())
tgt.setActiveElement(convertBoolean(src.getActiveElement()));
if (src.hasProvidedBy())
tgt.setProvidedBy(convertReference(src.getProvidedBy()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty())
tgt.addSpecialty(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getLocation())
tgt.addLocation(convertReference(t));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasComment())
tgt.setCommentElement(convertString(src.getCommentElement()));
if (src.hasExtraDetails())
tgt.setExtraDetailsElement(convertMarkdown(src.getExtraDetailsElement()));
if (src.hasPhoto())
tgt.setPhoto(convertAttachment(src.getPhoto()));
for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(convertContactPoint(t));
for (org.hl7.fhir.r4.model.Reference t : src.getCoverageArea())
tgt.addCoverageArea(convertReference(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceProvisionCode())
tgt.addServiceProvisionCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent t : src.getEligibility())
tgt.addEligibility(convertHealthcareServiceEligibilityComponent(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgram())
tgt.addProgram(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCharacteristic())
tgt.addCharacteristic(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCommunication())
tgt.addCommunication(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReferralMethod())
tgt.addReferralMethod(convertCodeableConcept(t));
if (src.hasAppointmentRequired())
tgt.setAppointmentRequiredElement(convertBoolean(src.getAppointmentRequiredElement()));
for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime())
tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t));
for (org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable())
tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t));
if (src.hasAvailabilityExceptions())
tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint())
tgt.addEndpoint(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.HealthcareService convertHealthcareService(org.hl7.fhir.r5.model.HealthcareService src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.HealthcareService tgt = new org.hl7.fhir.r4.model.HealthcareService();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasActive())
tgt.setActiveElement(convertBoolean(src.getActiveElement()));
if (src.hasProvidedBy())
tgt.setProvidedBy(convertReference(src.getProvidedBy()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty())
tgt.addSpecialty(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getLocation())
tgt.addLocation(convertReference(t));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasComment())
tgt.setCommentElement(convertString(src.getCommentElement()));
if (src.hasExtraDetails())
tgt.setExtraDetailsElement(convertMarkdown(src.getExtraDetailsElement()));
if (src.hasPhoto())
tgt.setPhoto(convertAttachment(src.getPhoto()));
for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(convertContactPoint(t));
for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea())
tgt.addCoverageArea(convertReference(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceProvisionCode())
tgt.addServiceProvisionCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent t : src.getEligibility())
tgt.addEligibility(convertHealthcareServiceEligibilityComponent(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgram())
tgt.addProgram(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCharacteristic())
tgt.addCharacteristic(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCommunication())
tgt.addCommunication(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReferralMethod())
tgt.addReferralMethod(convertCodeableConcept(t));
if (src.hasAppointmentRequired())
tgt.setAppointmentRequiredElement(convertBoolean(src.getAppointmentRequiredElement()));
for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent t : src.getAvailableTime())
tgt.addAvailableTime(convertHealthcareServiceAvailableTimeComponent(t));
for (org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent t : src.getNotAvailable())
tgt.addNotAvailable(convertHealthcareServiceNotAvailableComponent(t));
if (src.hasAvailabilityExceptions())
tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint())
tgt.addEndpoint(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent convertHealthcareServiceEligibilityComponent(org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasComment())
tgt.setCommentElement(convertMarkdown(src.getCommentElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent convertHealthcareServiceEligibilityComponent(org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceEligibilityComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasComment())
tgt.setCommentElement(convertMarkdown(src.getCommentElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent convertHealthcareServiceAvailableTimeComponent(org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek> t : src.getDaysOfWeek())
tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue()));
if (src.hasAllDay())
tgt.setAllDayElement(convertBoolean(src.getAllDayElement()));
if (src.hasAvailableStartTime())
tgt.setAvailableStartTimeElement(convertTime(src.getAvailableStartTimeElement()));
if (src.hasAvailableEndTime())
tgt.setAvailableEndTimeElement(convertTime(src.getAvailableEndTimeElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent convertHealthcareServiceAvailableTimeComponent(org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceAvailableTimeComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceAvailableTimeComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.HealthcareService.DaysOfWeek> t : src.getDaysOfWeek())
tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue()));
if (src.hasAllDay())
tgt.setAllDayElement(convertBoolean(src.getAllDayElement()));
if (src.hasAvailableStartTime())
tgt.setAvailableStartTimeElement(convertTime(src.getAvailableStartTimeElement()));
if (src.hasAvailableEndTime())
tgt.setAvailableEndTimeElement(convertTime(src.getAvailableEndTimeElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.HealthcareService.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case MON: return org.hl7.fhir.r5.model.HealthcareService.DaysOfWeek.MON;
case TUE: return org.hl7.fhir.r5.model.HealthcareService.DaysOfWeek.TUE;
case WED: return org.hl7.fhir.r5.model.HealthcareService.DaysOfWeek.WED;
case THU: return org.hl7.fhir.r5.model.HealthcareService.DaysOfWeek.THU;
case FRI: return org.hl7.fhir.r5.model.HealthcareService.DaysOfWeek.FRI;
case SAT: return org.hl7.fhir.r5.model.HealthcareService.DaysOfWeek.SAT;
case SUN: return org.hl7.fhir.r5.model.HealthcareService.DaysOfWeek.SUN;
default: return org.hl7.fhir.r5.model.HealthcareService.DaysOfWeek.NULL;
}
}
public static org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r5.model.HealthcareService.DaysOfWeek src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case MON: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.MON;
case TUE: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.TUE;
case WED: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.WED;
case THU: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.THU;
case FRI: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.FRI;
case SAT: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.SAT;
case SUN: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.SUN;
default: return org.hl7.fhir.r4.model.HealthcareService.DaysOfWeek.NULL;
}
}
public static org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent convertHealthcareServiceNotAvailableComponent(org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt = new org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasDuring())
tgt.setDuring(convertPeriod(src.getDuring()));
return tgt;
}
public static org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent convertHealthcareServiceNotAvailableComponent(org.hl7.fhir.r5.model.HealthcareService.HealthcareServiceNotAvailableComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent tgt = new org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceNotAvailableComponent();
copyElement(src, tgt);
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasDuring())
tgt.setDuring(convertPeriod(src.getDuring()));
return tgt;
}
}

View File

@ -0,0 +1,285 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ImagingStudy extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.ImagingStudy convertImagingStudy(org.hl7.fhir.r4.model.ImagingStudy src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ImagingStudy tgt = new org.hl7.fhir.r5.model.ImagingStudy();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertImagingStudyStatus(src.getStatus()));
for (org.hl7.fhir.r4.model.Coding t : src.getModality())
tgt.addModality(convertCoding(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasStarted())
tgt.setStartedElement(convertDateTime(src.getStartedElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
if (src.hasReferrer())
tgt.setReferrer(convertReference(src.getReferrer()));
for (org.hl7.fhir.r4.model.Reference t : src.getInterpreter())
tgt.addInterpreter(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint())
tgt.addEndpoint(convertReference(t));
if (src.hasNumberOfSeries())
tgt.setNumberOfSeriesElement(convertUnsignedInt(src.getNumberOfSeriesElement()));
if (src.hasNumberOfInstances())
tgt.setNumberOfInstancesElement(convertUnsignedInt(src.getNumberOfInstancesElement()));
if (src.hasProcedureReference())
tgt.setProcedureReference(convertReference(src.getProcedureReference()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProcedureCode())
tgt.addProcedureCode(convertCodeableConcept(t));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries())
tgt.addSeries(convertImagingStudySeriesComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ImagingStudy convertImagingStudy(org.hl7.fhir.r5.model.ImagingStudy src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ImagingStudy tgt = new org.hl7.fhir.r4.model.ImagingStudy();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertImagingStudyStatus(src.getStatus()));
for (org.hl7.fhir.r5.model.Coding t : src.getModality())
tgt.addModality(convertCoding(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasStarted())
tgt.setStartedElement(convertDateTime(src.getStartedElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
if (src.hasReferrer())
tgt.setReferrer(convertReference(src.getReferrer()));
for (org.hl7.fhir.r5.model.Reference t : src.getInterpreter())
tgt.addInterpreter(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint())
tgt.addEndpoint(convertReference(t));
if (src.hasNumberOfSeries())
tgt.setNumberOfSeriesElement(convertUnsignedInt(src.getNumberOfSeriesElement()));
if (src.hasNumberOfInstances())
tgt.setNumberOfInstancesElement(convertUnsignedInt(src.getNumberOfInstancesElement()));
if (src.hasProcedureReference())
tgt.setProcedureReference(convertReference(src.getProcedureReference()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProcedureCode())
tgt.addProcedureCode(convertCodeableConcept(t));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent t : src.getSeries())
tgt.addSeries(convertImagingStudySeriesComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus convertImagingStudyStatus(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case REGISTERED: return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.REGISTERED;
case AVAILABLE: return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.AVAILABLE;
case CANCELLED: return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.CANCELLED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.UNKNOWN;
default: return org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus convertImagingStudyStatus(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case REGISTERED: return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.REGISTERED;
case AVAILABLE: return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.AVAILABLE;
case CANCELLED: return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.CANCELLED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.UNKNOWN;
default: return org.hl7.fhir.r4.model.ImagingStudy.ImagingStudyStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent convertImagingStudySeriesComponent(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent tgt = new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent();
copyElement(src, tgt);
if (src.hasUid())
tgt.setUidElement(convertId(src.getUidElement()));
if (src.hasNumber())
tgt.setNumberElement(convertUnsignedInt(src.getNumberElement()));
if (src.hasModality())
tgt.setModality(convertCoding(src.getModality()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasNumberOfInstances())
tgt.setNumberOfInstancesElement(convertUnsignedInt(src.getNumberOfInstancesElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint())
tgt.addEndpoint(convertReference(t));
if (src.hasBodySite())
tgt.setBodySite(convertCoding(src.getBodySite()));
if (src.hasLaterality())
tgt.setLaterality(convertCoding(src.getLaterality()));
for (org.hl7.fhir.r4.model.Reference t : src.getSpecimen())
tgt.addSpecimen(convertReference(t));
if (src.hasStarted())
tgt.setStartedElement(convertDateTime(src.getStartedElement()));
for (org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent t : src.getPerformer())
tgt.addPerformer(convertImagingStudySeriesPerformerComponent(t));
for (org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance())
tgt.addInstance(convertImagingStudySeriesInstanceComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent convertImagingStudySeriesComponent(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent tgt = new org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesComponent();
copyElement(src, tgt);
if (src.hasUid())
tgt.setUidElement(convertId(src.getUidElement()));
if (src.hasNumber())
tgt.setNumberElement(convertUnsignedInt(src.getNumberElement()));
if (src.hasModality())
tgt.setModality(convertCoding(src.getModality()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasNumberOfInstances())
tgt.setNumberOfInstancesElement(convertUnsignedInt(src.getNumberOfInstancesElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint())
tgt.addEndpoint(convertReference(t));
if (src.hasBodySite())
tgt.setBodySite(convertCoding(src.getBodySite()));
if (src.hasLaterality())
tgt.setLaterality(convertCoding(src.getLaterality()));
for (org.hl7.fhir.r5.model.Reference t : src.getSpecimen())
tgt.addSpecimen(convertReference(t));
if (src.hasStarted())
tgt.setStartedElement(convertDateTime(src.getStartedElement()));
for (org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent t : src.getPerformer())
tgt.addPerformer(convertImagingStudySeriesPerformerComponent(t));
for (org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent t : src.getInstance())
tgt.addInstance(convertImagingStudySeriesInstanceComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent convertImagingStudySeriesPerformerComponent(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent tgt = new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent();
copyElement(src, tgt);
if (src.hasFunction())
tgt.setFunction(convertCodeableConcept(src.getFunction()));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
return tgt;
}
public static org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent convertImagingStudySeriesPerformerComponent(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesPerformerComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent tgt = new org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesPerformerComponent();
copyElement(src, tgt);
if (src.hasFunction())
tgt.setFunction(convertCodeableConcept(src.getFunction()));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
return tgt;
}
public static org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent convertImagingStudySeriesInstanceComponent(org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent tgt = new org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent();
copyElement(src, tgt);
if (src.hasUid())
tgt.setUidElement(convertId(src.getUidElement()));
if (src.hasSopClass())
tgt.setSopClass(convertCoding(src.getSopClass()));
if (src.hasNumber())
tgt.setNumberElement(convertUnsignedInt(src.getNumberElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent convertImagingStudySeriesInstanceComponent(org.hl7.fhir.r5.model.ImagingStudy.ImagingStudySeriesInstanceComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent tgt = new org.hl7.fhir.r4.model.ImagingStudy.ImagingStudySeriesInstanceComponent();
copyElement(src, tgt);
if (src.hasUid())
tgt.setUidElement(convertId(src.getUidElement()));
if (src.hasSopClass())
tgt.setSopClass(convertCoding(src.getSopClass()));
if (src.hasNumber())
tgt.setNumberElement(convertUnsignedInt(src.getNumberElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
return tgt;
}
}

View File

@ -0,0 +1,313 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Immunization extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Immunization convertImmunization(org.hl7.fhir.r4.model.Immunization src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Immunization tgt = new org.hl7.fhir.r5.model.Immunization();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertImmunizationStatus(src.getStatus()));
if (src.hasStatusReason())
tgt.setStatusReason(convertCodeableConcept(src.getStatusReason()));
if (src.hasVaccineCode())
tgt.setVaccineCode(convertCodeableConcept(src.getVaccineCode()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasOccurrence())
tgt.setOccurrence(convertType(src.getOccurrence()));
if (src.hasRecorded())
tgt.setRecordedElement(convertDateTime(src.getRecordedElement()));
if (src.hasPrimarySource())
tgt.setPrimarySourceElement(convertBoolean(src.getPrimarySourceElement()));
if (src.hasReportOrigin())
tgt.setReportOrigin(convertCodeableConcept(src.getReportOrigin()));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
if (src.hasManufacturer())
tgt.setManufacturer(convertReference(src.getManufacturer()));
if (src.hasLotNumber())
tgt.setLotNumberElement(convertString(src.getLotNumberElement()));
if (src.hasExpirationDate())
tgt.setExpirationDateElement(convertDate(src.getExpirationDateElement()));
if (src.hasSite())
tgt.setSite(convertCodeableConcept(src.getSite()));
if (src.hasRoute())
tgt.setRoute(convertCodeableConcept(src.getRoute()));
if (src.hasDoseQuantity())
tgt.setDoseQuantity(convertSimpleQuantity(src.getDoseQuantity()));
for (org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent t : src.getPerformer())
tgt.addPerformer(convertImmunizationPerformerComponent(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
if (src.hasIsSubpotent())
tgt.setIsSubpotentElement(convertBoolean(src.getIsSubpotentElement()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSubpotentReason())
tgt.addSubpotentReason(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent t : src.getEducation())
tgt.addEducation(convertImmunizationEducationComponent(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProgramEligibility())
tgt.addProgramEligibility(convertCodeableConcept(t));
if (src.hasFundingSource())
tgt.setFundingSource(convertCodeableConcept(src.getFundingSource()));
for (org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent t : src.getReaction())
tgt.addReaction(convertImmunizationReactionComponent(t));
for (org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent t : src.getProtocolApplied())
tgt.addProtocolApplied(convertImmunizationProtocolAppliedComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Immunization convertImmunization(org.hl7.fhir.r5.model.Immunization src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Immunization tgt = new org.hl7.fhir.r4.model.Immunization();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertImmunizationStatus(src.getStatus()));
if (src.hasStatusReason())
tgt.setStatusReason(convertCodeableConcept(src.getStatusReason()));
if (src.hasVaccineCode())
tgt.setVaccineCode(convertCodeableConcept(src.getVaccineCode()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasOccurrence())
tgt.setOccurrence(convertType(src.getOccurrence()));
if (src.hasRecorded())
tgt.setRecordedElement(convertDateTime(src.getRecordedElement()));
if (src.hasPrimarySource())
tgt.setPrimarySourceElement(convertBoolean(src.getPrimarySourceElement()));
if (src.hasReportOrigin())
tgt.setReportOrigin(convertCodeableConcept(src.getReportOrigin()));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
if (src.hasManufacturer())
tgt.setManufacturer(convertReference(src.getManufacturer()));
if (src.hasLotNumber())
tgt.setLotNumberElement(convertString(src.getLotNumberElement()));
if (src.hasExpirationDate())
tgt.setExpirationDateElement(convertDate(src.getExpirationDateElement()));
if (src.hasSite())
tgt.setSite(convertCodeableConcept(src.getSite()));
if (src.hasRoute())
tgt.setRoute(convertCodeableConcept(src.getRoute()));
if (src.hasDoseQuantity())
tgt.setDoseQuantity(convertSimpleQuantity(src.getDoseQuantity()));
for (org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent t : src.getPerformer())
tgt.addPerformer(convertImmunizationPerformerComponent(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
if (src.hasIsSubpotent())
tgt.setIsSubpotentElement(convertBoolean(src.getIsSubpotentElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSubpotentReason())
tgt.addSubpotentReason(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent t : src.getEducation())
tgt.addEducation(convertImmunizationEducationComponent(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramEligibility())
tgt.addProgramEligibility(convertCodeableConcept(t));
if (src.hasFundingSource())
tgt.setFundingSource(convertCodeableConcept(src.getFundingSource()));
for (org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent t : src.getReaction())
tgt.addReaction(convertImmunizationReactionComponent(t));
for (org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent t : src.getProtocolApplied())
tgt.addProtocolApplied(convertImmunizationProtocolAppliedComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Immunization.ImmunizationStatus convertImmunizationStatus(org.hl7.fhir.r4.model.Immunization.ImmunizationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case COMPLETED: return org.hl7.fhir.r5.model.Immunization.ImmunizationStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Immunization.ImmunizationStatus.ENTEREDINERROR;
case NOTDONE: return org.hl7.fhir.r5.model.Immunization.ImmunizationStatus.NOTDONE;
default: return org.hl7.fhir.r5.model.Immunization.ImmunizationStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Immunization.ImmunizationStatus convertImmunizationStatus(org.hl7.fhir.r5.model.Immunization.ImmunizationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case COMPLETED: return org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.ENTEREDINERROR;
case NOTDONE: return org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.NOTDONE;
default: return org.hl7.fhir.r4.model.Immunization.ImmunizationStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent convertImmunizationPerformerComponent(org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent();
copyElement(src, tgt);
if (src.hasFunction())
tgt.setFunction(convertCodeableConcept(src.getFunction()));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
return tgt;
}
public static org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent convertImmunizationPerformerComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent tgt = new org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent();
copyElement(src, tgt);
if (src.hasFunction())
tgt.setFunction(convertCodeableConcept(src.getFunction()));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
return tgt;
}
public static org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent convertImmunizationEducationComponent(org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent();
copyElement(src, tgt);
if (src.hasDocumentType())
tgt.setDocumentTypeElement(convertString(src.getDocumentTypeElement()));
if (src.hasReference())
tgt.setReferenceElement(convertUri(src.getReferenceElement()));
if (src.hasPublicationDate())
tgt.setPublicationDateElement(convertDateTime(src.getPublicationDateElement()));
if (src.hasPresentationDate())
tgt.setPresentationDateElement(convertDateTime(src.getPresentationDateElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent convertImmunizationEducationComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationEducationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent tgt = new org.hl7.fhir.r4.model.Immunization.ImmunizationEducationComponent();
copyElement(src, tgt);
if (src.hasDocumentType())
tgt.setDocumentTypeElement(convertString(src.getDocumentTypeElement()));
if (src.hasReference())
tgt.setReferenceElement(convertUri(src.getReferenceElement()));
if (src.hasPublicationDate())
tgt.setPublicationDateElement(convertDateTime(src.getPublicationDateElement()));
if (src.hasPresentationDate())
tgt.setPresentationDateElement(convertDateTime(src.getPresentationDateElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent convertImmunizationReactionComponent(org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent();
copyElement(src, tgt);
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasDetail())
tgt.setDetail(convertReference(src.getDetail()));
if (src.hasReported())
tgt.setReportedElement(convertBoolean(src.getReportedElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent convertImmunizationReactionComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationReactionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent tgt = new org.hl7.fhir.r4.model.Immunization.ImmunizationReactionComponent();
copyElement(src, tgt);
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasDetail())
tgt.setDetail(convertReference(src.getDetail()));
if (src.hasReported())
tgt.setReportedElement(convertBoolean(src.getReportedElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent convertImmunizationProtocolAppliedComponent(org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent tgt = new org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent();
copyElement(src, tgt);
if (src.hasSeries())
tgt.setSeriesElement(convertString(src.getSeriesElement()));
if (src.hasAuthority())
tgt.setAuthority(convertReference(src.getAuthority()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTargetDisease())
tgt.addTargetDisease(convertCodeableConcept(t));
if (src.hasDoseNumber())
tgt.setDoseNumber(convertType(src.getDoseNumber()));
if (src.hasSeriesDoses())
tgt.setSeriesDoses(convertType(src.getSeriesDoses()));
return tgt;
}
public static org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent convertImmunizationProtocolAppliedComponent(org.hl7.fhir.r5.model.Immunization.ImmunizationProtocolAppliedComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent tgt = new org.hl7.fhir.r4.model.Immunization.ImmunizationProtocolAppliedComponent();
copyElement(src, tgt);
if (src.hasSeries())
tgt.setSeriesElement(convertString(src.getSeriesElement()));
if (src.hasAuthority())
tgt.setAuthority(convertReference(src.getAuthority()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTargetDisease())
tgt.addTargetDisease(convertCodeableConcept(t));
if (src.hasDoseNumber())
tgt.setDoseNumber(convertType(src.getDoseNumber()));
if (src.hasSeriesDoses())
tgt.setSeriesDoses(convertType(src.getSeriesDoses()));
return tgt;
}
}

View File

@ -0,0 +1,131 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ImmunizationEvaluation extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.ImmunizationEvaluation convertImmunizationEvaluation(org.hl7.fhir.r4.model.ImmunizationEvaluation src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ImmunizationEvaluation tgt = new org.hl7.fhir.r5.model.ImmunizationEvaluation();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertImmunizationEvaluationStatus(src.getStatus()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasAuthority())
tgt.setAuthority(convertReference(src.getAuthority()));
if (src.hasTargetDisease())
tgt.setTargetDisease(convertCodeableConcept(src.getTargetDisease()));
if (src.hasImmunizationEvent())
tgt.setImmunizationEvent(convertReference(src.getImmunizationEvent()));
if (src.hasDoseStatus())
tgt.setDoseStatus(convertCodeableConcept(src.getDoseStatus()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDoseStatusReason())
tgt.addDoseStatusReason(convertCodeableConcept(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasSeries())
tgt.setSeriesElement(convertString(src.getSeriesElement()));
if (src.hasDoseNumber())
tgt.setDoseNumber(convertType(src.getDoseNumber()));
if (src.hasSeriesDoses())
tgt.setSeriesDoses(convertType(src.getSeriesDoses()));
return tgt;
}
public static org.hl7.fhir.r4.model.ImmunizationEvaluation convertImmunizationEvaluation(org.hl7.fhir.r5.model.ImmunizationEvaluation src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ImmunizationEvaluation tgt = new org.hl7.fhir.r4.model.ImmunizationEvaluation();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertImmunizationEvaluationStatus(src.getStatus()));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasAuthority())
tgt.setAuthority(convertReference(src.getAuthority()));
if (src.hasTargetDisease())
tgt.setTargetDisease(convertCodeableConcept(src.getTargetDisease()));
if (src.hasImmunizationEvent())
tgt.setImmunizationEvent(convertReference(src.getImmunizationEvent()));
if (src.hasDoseStatus())
tgt.setDoseStatus(convertCodeableConcept(src.getDoseStatus()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDoseStatusReason())
tgt.addDoseStatusReason(convertCodeableConcept(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasSeries())
tgt.setSeriesElement(convertString(src.getSeriesElement()));
if (src.hasDoseNumber())
tgt.setDoseNumber(convertType(src.getDoseNumber()));
if (src.hasSeriesDoses())
tgt.setSeriesDoses(convertType(src.getSeriesDoses()));
return tgt;
}
public static org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatus convertImmunizationEvaluationStatus(org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case COMPLETED: return org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus convertImmunizationEvaluationStatus(org.hl7.fhir.r5.model.ImmunizationEvaluation.ImmunizationEvaluationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case COMPLETED: return org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.ImmunizationEvaluation.ImmunizationEvaluationStatus.NULL;
}
}
}

View File

@ -0,0 +1,167 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ImmunizationRecommendation extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.ImmunizationRecommendation convertImmunizationRecommendation(org.hl7.fhir.r4.model.ImmunizationRecommendation src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ImmunizationRecommendation tgt = new org.hl7.fhir.r5.model.ImmunizationRecommendation();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasAuthority())
tgt.setAuthority(convertReference(src.getAuthority()));
for (org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent t : src.getRecommendation())
tgt.addRecommendation(convertImmunizationRecommendationRecommendationComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ImmunizationRecommendation convertImmunizationRecommendation(org.hl7.fhir.r5.model.ImmunizationRecommendation src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ImmunizationRecommendation tgt = new org.hl7.fhir.r4.model.ImmunizationRecommendation();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasPatient())
tgt.setPatient(convertReference(src.getPatient()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasAuthority())
tgt.setAuthority(convertReference(src.getAuthority()));
for (org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent t : src.getRecommendation())
tgt.addRecommendation(convertImmunizationRecommendationRecommendationComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent convertImmunizationRecommendationRecommendationComponent(org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent tgt = new org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getVaccineCode())
tgt.addVaccineCode(convertCodeableConcept(t));
if (src.hasTargetDisease())
tgt.setTargetDisease(convertCodeableConcept(src.getTargetDisease()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getContraindicatedVaccineCode())
tgt.addContraindicatedVaccineCode(convertCodeableConcept(t));
if (src.hasForecastStatus())
tgt.setForecastStatus(convertCodeableConcept(src.getForecastStatus()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getForecastReason())
tgt.addForecastReason(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent t : src.getDateCriterion())
tgt.addDateCriterion(convertImmunizationRecommendationRecommendationDateCriterionComponent(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasSeries())
tgt.setSeriesElement(convertString(src.getSeriesElement()));
if (src.hasDoseNumber())
tgt.setDoseNumber(convertType(src.getDoseNumber()));
if (src.hasSeriesDoses())
tgt.setSeriesDoses(convertType(src.getSeriesDoses()));
for (org.hl7.fhir.r4.model.Reference t : src.getSupportingImmunization())
tgt.addSupportingImmunization(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getSupportingPatientInformation())
tgt.addSupportingPatientInformation(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent convertImmunizationRecommendationRecommendationComponent(org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent tgt = new org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getVaccineCode())
tgt.addVaccineCode(convertCodeableConcept(t));
if (src.hasTargetDisease())
tgt.setTargetDisease(convertCodeableConcept(src.getTargetDisease()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getContraindicatedVaccineCode())
tgt.addContraindicatedVaccineCode(convertCodeableConcept(t));
if (src.hasForecastStatus())
tgt.setForecastStatus(convertCodeableConcept(src.getForecastStatus()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getForecastReason())
tgt.addForecastReason(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent t : src.getDateCriterion())
tgt.addDateCriterion(convertImmunizationRecommendationRecommendationDateCriterionComponent(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasSeries())
tgt.setSeriesElement(convertString(src.getSeriesElement()));
if (src.hasDoseNumber())
tgt.setDoseNumber(convertType(src.getDoseNumber()));
if (src.hasSeriesDoses())
tgt.setSeriesDoses(convertType(src.getSeriesDoses()));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingImmunization())
tgt.addSupportingImmunization(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingPatientInformation())
tgt.addSupportingPatientInformation(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent convertImmunizationRecommendationRecommendationDateCriterionComponent(org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent tgt = new org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasValue())
tgt.setValueElement(convertDateTime(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent convertImmunizationRecommendationRecommendationDateCriterionComponent(org.hl7.fhir.r5.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent tgt = new org.hl7.fhir.r4.model.ImmunizationRecommendation.ImmunizationRecommendationRecommendationDateCriterionComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasValue())
tgt.setValueElement(convertDateTime(src.getValueElement()));
return tgt;
}
}

View File

@ -0,0 +1,379 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class InsurancePlan extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.InsurancePlan convertInsurancePlan(org.hl7.fhir.r4.model.InsurancePlan src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.InsurancePlan tgt = new org.hl7.fhir.r5.model.InsurancePlan();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
for (org.hl7.fhir.r4.model.StringType t : src.getAlias())
tgt.getAlias().add(convertString(t));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasOwnedBy())
tgt.setOwnedBy(convertReference(src.getOwnedBy()));
if (src.hasAdministeredBy())
tgt.setAdministeredBy(convertReference(src.getAdministeredBy()));
for (org.hl7.fhir.r4.model.Reference t : src.getCoverageArea())
tgt.addCoverageArea(convertReference(t));
for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent t : src.getContact())
tgt.addContact(convertInsurancePlanContactComponent(t));
for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint())
tgt.addEndpoint(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getNetwork())
tgt.addNetwork(convertReference(t));
for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent t : src.getCoverage())
tgt.addCoverage(convertInsurancePlanCoverageComponent(t));
for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent t : src.getPlan())
tgt.addPlan(convertInsurancePlanPlanComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.InsurancePlan convertInsurancePlan(org.hl7.fhir.r5.model.InsurancePlan src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.InsurancePlan tgt = new org.hl7.fhir.r4.model.InsurancePlan();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getAlias())
tgt.getAlias().add(convertString(t));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasOwnedBy())
tgt.setOwnedBy(convertReference(src.getOwnedBy()));
if (src.hasAdministeredBy())
tgt.setAdministeredBy(convertReference(src.getAdministeredBy()));
for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea())
tgt.addCoverageArea(convertReference(t));
for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent t : src.getContact())
tgt.addContact(convertInsurancePlanContactComponent(t));
for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint())
tgt.addEndpoint(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getNetwork())
tgt.addNetwork(convertReference(t));
for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent t : src.getCoverage())
tgt.addCoverage(convertInsurancePlanCoverageComponent(t));
for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent t : src.getPlan())
tgt.addPlan(convertInsurancePlanPlanComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent convertInsurancePlanContactComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent();
copyElement(src, tgt);
if (src.hasPurpose())
tgt.setPurpose(convertCodeableConcept(src.getPurpose()));
if (src.hasName())
tgt.setName(convertHumanName(src.getName()));
for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(convertContactPoint(t));
if (src.hasAddress())
tgt.setAddress(convertAddress(src.getAddress()));
return tgt;
}
public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent convertInsurancePlanContactComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanContactComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanContactComponent();
copyElement(src, tgt);
if (src.hasPurpose())
tgt.setPurpose(convertCodeableConcept(src.getPurpose()));
if (src.hasName())
tgt.setName(convertHumanName(src.getName()));
for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(convertContactPoint(t));
if (src.hasAddress())
tgt.setAddress(convertAddress(src.getAddress()));
return tgt;
}
public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent convertInsurancePlanCoverageComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.Reference t : src.getNetwork())
tgt.addNetwork(convertReference(t));
for (org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent t : src.getBenefit())
tgt.addBenefit(convertCoverageBenefitComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent convertInsurancePlanCoverageComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanCoverageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanCoverageComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.Reference t : src.getNetwork())
tgt.addNetwork(convertReference(t));
for (org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent t : src.getBenefit())
tgt.addBenefit(convertCoverageBenefitComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent convertCoverageBenefitComponent(org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasRequirement())
tgt.setRequirementElement(convertString(src.getRequirementElement()));
for (org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent t : src.getLimit())
tgt.addLimit(convertCoverageBenefitLimitComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent convertCoverageBenefitComponent(org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasRequirement())
tgt.setRequirementElement(convertString(src.getRequirementElement()));
for (org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent t : src.getLimit())
tgt.addLimit(convertCoverageBenefitLimitComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent convertCoverageBenefitLimitComponent(org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent();
copyElement(src, tgt);
if (src.hasValue())
tgt.setValue(convertQuantity(src.getValue()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
return tgt;
}
public static org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent convertCoverageBenefitLimitComponent(org.hl7.fhir.r5.model.InsurancePlan.CoverageBenefitLimitComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.CoverageBenefitLimitComponent();
copyElement(src, tgt);
if (src.hasValue())
tgt.setValue(convertQuantity(src.getValue()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
return tgt;
}
public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent convertInsurancePlanPlanComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.Reference t : src.getCoverageArea())
tgt.addCoverageArea(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getNetwork())
tgt.addNetwork(convertReference(t));
for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent t : src.getGeneralCost())
tgt.addGeneralCost(convertInsurancePlanPlanGeneralCostComponent(t));
for (org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent t : src.getSpecificCost())
tgt.addSpecificCost(convertInsurancePlanPlanSpecificCostComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent convertInsurancePlanPlanComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.Reference t : src.getCoverageArea())
tgt.addCoverageArea(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getNetwork())
tgt.addNetwork(convertReference(t));
for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent t : src.getGeneralCost())
tgt.addGeneralCost(convertInsurancePlanPlanGeneralCostComponent(t));
for (org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent t : src.getSpecificCost())
tgt.addSpecificCost(convertInsurancePlanPlanSpecificCostComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent convertInsurancePlanPlanGeneralCostComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasGroupSize())
tgt.setGroupSizeElement(convertPositiveInt(src.getGroupSizeElement()));
if (src.hasCost())
tgt.setCost(convertMoney(src.getCost()));
if (src.hasComment())
tgt.setCommentElement(convertString(src.getCommentElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent convertInsurancePlanPlanGeneralCostComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanGeneralCostComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasGroupSize())
tgt.setGroupSizeElement(convertPositiveInt(src.getGroupSizeElement()));
if (src.hasCost())
tgt.setCost(convertMoney(src.getCost()));
if (src.hasComment())
tgt.setCommentElement(convertString(src.getCommentElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent convertInsurancePlanPlanSpecificCostComponent(org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent();
copyElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
for (org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent t : src.getBenefit())
tgt.addBenefit(convertPlanBenefitComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent convertInsurancePlanPlanSpecificCostComponent(org.hl7.fhir.r5.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.InsurancePlanPlanSpecificCostComponent();
copyElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
for (org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent t : src.getBenefit())
tgt.addBenefit(convertPlanBenefitComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent convertPlanBenefitComponent(org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent t : src.getCost())
tgt.addCost(convertPlanBenefitCostComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent convertPlanBenefitComponent(org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent t : src.getCost())
tgt.addCost(convertPlanBenefitCostComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent convertPlanBenefitCostComponent(org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent tgt = new org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasApplicability())
tgt.setApplicability(convertCodeableConcept(src.getApplicability()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getQualifiers())
tgt.addQualifiers(convertCodeableConcept(t));
if (src.hasValue())
tgt.setValue(convertQuantity(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent convertPlanBenefitCostComponent(org.hl7.fhir.r5.model.InsurancePlan.PlanBenefitCostComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent tgt = new org.hl7.fhir.r4.model.InsurancePlan.PlanBenefitCostComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasApplicability())
tgt.setApplicability(convertCodeableConcept(src.getApplicability()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getQualifiers())
tgt.addQualifiers(convertCodeableConcept(t));
if (src.hasValue())
tgt.setValue(convertQuantity(src.getValue()));
return tgt;
}
}

View File

@ -0,0 +1,261 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Invoice extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Invoice convertInvoice(org.hl7.fhir.r4.model.Invoice src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Invoice tgt = new org.hl7.fhir.r5.model.Invoice();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertInvoiceStatus(src.getStatus()));
if (src.hasCancelledReason())
tgt.setCancelledReasonElement(convertString(src.getCancelledReasonElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasRecipient())
tgt.setRecipient(convertReference(src.getRecipient()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
for (org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertInvoiceParticipantComponent(t));
if (src.hasIssuer())
tgt.setIssuer(convertReference(src.getIssuer()));
if (src.hasAccount())
tgt.setAccount(convertReference(src.getAccount()));
for (org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent t : src.getLineItem())
tgt.addLineItem(convertInvoiceLineItemComponent(t));
for (org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getTotalPriceComponent())
tgt.addTotalPriceComponent(convertInvoiceLineItemPriceComponentComponent(t));
if (src.hasTotalNet())
tgt.setTotalNet(convertMoney(src.getTotalNet()));
if (src.hasTotalGross())
tgt.setTotalGross(convertMoney(src.getTotalGross()));
if (src.hasPaymentTerms())
tgt.setPaymentTermsElement(convertMarkdown(src.getPaymentTermsElement()));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Invoice convertInvoice(org.hl7.fhir.r5.model.Invoice src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Invoice tgt = new org.hl7.fhir.r4.model.Invoice();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertInvoiceStatus(src.getStatus()));
if (src.hasCancelledReason())
tgt.setCancelledReasonElement(convertString(src.getCancelledReasonElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasRecipient())
tgt.setRecipient(convertReference(src.getRecipient()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
for (org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertInvoiceParticipantComponent(t));
if (src.hasIssuer())
tgt.setIssuer(convertReference(src.getIssuer()));
if (src.hasAccount())
tgt.setAccount(convertReference(src.getAccount()));
for (org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent t : src.getLineItem())
tgt.addLineItem(convertInvoiceLineItemComponent(t));
for (org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getTotalPriceComponent())
tgt.addTotalPriceComponent(convertInvoiceLineItemPriceComponentComponent(t));
if (src.hasTotalNet())
tgt.setTotalNet(convertMoney(src.getTotalNet()));
if (src.hasTotalGross())
tgt.setTotalGross(convertMoney(src.getTotalGross()));
if (src.hasPaymentTerms())
tgt.setPaymentTermsElement(convertMarkdown(src.getPaymentTermsElement()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Invoice.InvoiceStatus convertInvoiceStatus(org.hl7.fhir.r4.model.Invoice.InvoiceStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DRAFT: return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.DRAFT;
case ISSUED: return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.ISSUED;
case BALANCED: return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.BALANCED;
case CANCELLED: return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.CANCELLED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.Invoice.InvoiceStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Invoice.InvoiceStatus convertInvoiceStatus(org.hl7.fhir.r5.model.Invoice.InvoiceStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case DRAFT: return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.DRAFT;
case ISSUED: return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.ISSUED;
case BALANCED: return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.BALANCED;
case CANCELLED: return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.CANCELLED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.Invoice.InvoiceStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent convertInvoiceParticipantComponent(org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent tgt = new org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent();
copyElement(src, tgt);
if (src.hasRole())
tgt.setRole(convertCodeableConcept(src.getRole()));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
return tgt;
}
public static org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent convertInvoiceParticipantComponent(org.hl7.fhir.r5.model.Invoice.InvoiceParticipantComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent tgt = new org.hl7.fhir.r4.model.Invoice.InvoiceParticipantComponent();
copyElement(src, tgt);
if (src.hasRole())
tgt.setRole(convertCodeableConcept(src.getRole()));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
return tgt;
}
public static org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent convertInvoiceLineItemComponent(org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent tgt = new org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasChargeItem())
tgt.setChargeItem(convertType(src.getChargeItem()));
for (org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getPriceComponent())
tgt.addPriceComponent(convertInvoiceLineItemPriceComponentComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent convertInvoiceLineItemComponent(org.hl7.fhir.r5.model.Invoice.InvoiceLineItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent tgt = new org.hl7.fhir.r4.model.Invoice.InvoiceLineItemComponent();
copyElement(src, tgt);
if (src.hasSequence())
tgt.setSequenceElement(convertPositiveInt(src.getSequenceElement()));
if (src.hasChargeItem())
tgt.setChargeItem(convertType(src.getChargeItem()));
for (org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent t : src.getPriceComponent())
tgt.addPriceComponent(convertInvoiceLineItemPriceComponentComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent convertInvoiceLineItemPriceComponentComponent(org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent tgt = new org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertInvoicePriceComponentType(src.getType()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasAmount())
tgt.setAmount(convertMoney(src.getAmount()));
return tgt;
}
public static org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent convertInvoiceLineItemPriceComponentComponent(org.hl7.fhir.r5.model.Invoice.InvoiceLineItemPriceComponentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent tgt = new org.hl7.fhir.r4.model.Invoice.InvoiceLineItemPriceComponentComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertInvoicePriceComponentType(src.getType()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasFactor())
tgt.setFactorElement(convertDecimal(src.getFactorElement()));
if (src.hasAmount())
tgt.setAmount(convertMoney(src.getAmount()));
return tgt;
}
public static org.hl7.fhir.r5.model.Invoice.InvoicePriceComponentType convertInvoicePriceComponentType(org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case BASE: return org.hl7.fhir.r5.model.Invoice.InvoicePriceComponentType.BASE;
case SURCHARGE: return org.hl7.fhir.r5.model.Invoice.InvoicePriceComponentType.SURCHARGE;
case DEDUCTION: return org.hl7.fhir.r5.model.Invoice.InvoicePriceComponentType.DEDUCTION;
case DISCOUNT: return org.hl7.fhir.r5.model.Invoice.InvoicePriceComponentType.DISCOUNT;
case TAX: return org.hl7.fhir.r5.model.Invoice.InvoicePriceComponentType.TAX;
case INFORMATIONAL: return org.hl7.fhir.r5.model.Invoice.InvoicePriceComponentType.INFORMATIONAL;
default: return org.hl7.fhir.r5.model.Invoice.InvoicePriceComponentType.NULL;
}
}
public static org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType convertInvoicePriceComponentType(org.hl7.fhir.r5.model.Invoice.InvoicePriceComponentType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case BASE: return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.BASE;
case SURCHARGE: return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.SURCHARGE;
case DEDUCTION: return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.DEDUCTION;
case DISCOUNT: return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.DISCOUNT;
case TAX: return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.TAX;
case INFORMATIONAL: return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.INFORMATIONAL;
default: return org.hl7.fhir.r4.model.Invoice.InvoicePriceComponentType.NULL;
}
}
}

View File

@ -0,0 +1,183 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Library extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Library convertLibrary(org.hl7.fhir.r4.model.Library src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Library tgt = new org.hl7.fhir.r5.model.Library();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSubject())
tgt.setSubject(convertType(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasUsage())
tgt.setUsageElement(convertString(src.getUsageElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic())
tgt.addTopic(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor())
tgt.addEditor(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(convertContactDetail(t));
for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(convertRelatedArtifact(t));
for (org.hl7.fhir.r4.model.ParameterDefinition t : src.getParameter())
tgt.addParameter(convertParameterDefinition(t));
for (org.hl7.fhir.r4.model.DataRequirement t : src.getDataRequirement())
tgt.addDataRequirement(convertDataRequirement(t));
for (org.hl7.fhir.r4.model.Attachment t : src.getContent())
tgt.addContent(convertAttachment(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Library convertLibrary(org.hl7.fhir.r5.model.Library src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Library tgt = new org.hl7.fhir.r4.model.Library();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSubject())
tgt.setSubject(convertType(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasUsage())
tgt.setUsageElement(convertString(src.getUsageElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic())
tgt.addTopic(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor())
tgt.addEditor(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(convertContactDetail(t));
for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(convertRelatedArtifact(t));
for (org.hl7.fhir.r5.model.ParameterDefinition t : src.getParameter())
tgt.addParameter(convertParameterDefinition(t));
for (org.hl7.fhir.r5.model.DataRequirement t : src.getDataRequirement())
tgt.addDataRequirement(convertDataRequirement(t));
for (org.hl7.fhir.r5.model.Attachment t : src.getContent())
tgt.addContent(convertAttachment(t));
return tgt;
}
}

View File

@ -0,0 +1,117 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Linkage extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Linkage convertLinkage(org.hl7.fhir.r4.model.Linkage src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Linkage tgt = new org.hl7.fhir.r5.model.Linkage();
copyDomainResource(src, tgt);
if (src.hasActive())
tgt.setActiveElement(convertBoolean(src.getActiveElement()));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
for (org.hl7.fhir.r4.model.Linkage.LinkageItemComponent t : src.getItem())
tgt.addItem(convertLinkageItemComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Linkage convertLinkage(org.hl7.fhir.r5.model.Linkage src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Linkage tgt = new org.hl7.fhir.r4.model.Linkage();
copyDomainResource(src, tgt);
if (src.hasActive())
tgt.setActiveElement(convertBoolean(src.getActiveElement()));
if (src.hasAuthor())
tgt.setAuthor(convertReference(src.getAuthor()));
for (org.hl7.fhir.r5.model.Linkage.LinkageItemComponent t : src.getItem())
tgt.addItem(convertLinkageItemComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Linkage.LinkageItemComponent convertLinkageItemComponent(org.hl7.fhir.r4.model.Linkage.LinkageItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Linkage.LinkageItemComponent tgt = new org.hl7.fhir.r5.model.Linkage.LinkageItemComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertLinkageType(src.getType()));
if (src.hasResource())
tgt.setResource(convertReference(src.getResource()));
return tgt;
}
public static org.hl7.fhir.r4.model.Linkage.LinkageItemComponent convertLinkageItemComponent(org.hl7.fhir.r5.model.Linkage.LinkageItemComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Linkage.LinkageItemComponent tgt = new org.hl7.fhir.r4.model.Linkage.LinkageItemComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertLinkageType(src.getType()));
if (src.hasResource())
tgt.setResource(convertReference(src.getResource()));
return tgt;
}
public static org.hl7.fhir.r5.model.Linkage.LinkageType convertLinkageType(org.hl7.fhir.r4.model.Linkage.LinkageType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case SOURCE: return org.hl7.fhir.r5.model.Linkage.LinkageType.SOURCE;
case ALTERNATE: return org.hl7.fhir.r5.model.Linkage.LinkageType.ALTERNATE;
case HISTORICAL: return org.hl7.fhir.r5.model.Linkage.LinkageType.HISTORICAL;
default: return org.hl7.fhir.r5.model.Linkage.LinkageType.NULL;
}
}
public static org.hl7.fhir.r4.model.Linkage.LinkageType convertLinkageType(org.hl7.fhir.r5.model.Linkage.LinkageType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case SOURCE: return org.hl7.fhir.r4.model.Linkage.LinkageType.SOURCE;
case ALTERNATE: return org.hl7.fhir.r4.model.Linkage.LinkageType.ALTERNATE;
case HISTORICAL: return org.hl7.fhir.r4.model.Linkage.LinkageType.HISTORICAL;
default: return org.hl7.fhir.r4.model.Linkage.LinkageType.NULL;
}
}
}

View File

@ -0,0 +1,187 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class ListResource extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.ListResource convertListResource(org.hl7.fhir.r4.model.ListResource src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ListResource tgt = new org.hl7.fhir.r5.model.ListResource();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertListStatus(src.getStatus()));
if (src.hasMode())
tgt.setMode(convertListMode(src.getMode()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasSource())
tgt.setSource(convertReference(src.getSource()));
if (src.hasOrderedBy())
tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy()));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.ListResource.ListEntryComponent t : src.getEntry())
tgt.addEntry(convertListEntryComponent(t));
if (src.hasEmptyReason())
tgt.setEmptyReason(convertCodeableConcept(src.getEmptyReason()));
return tgt;
}
public static org.hl7.fhir.r4.model.ListResource convertListResource(org.hl7.fhir.r5.model.ListResource src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ListResource tgt = new org.hl7.fhir.r4.model.ListResource();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertListStatus(src.getStatus()));
if (src.hasMode())
tgt.setMode(convertListMode(src.getMode()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasSource())
tgt.setSource(convertReference(src.getSource()));
if (src.hasOrderedBy())
tgt.setOrderedBy(convertCodeableConcept(src.getOrderedBy()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.ListResource.ListEntryComponent t : src.getEntry())
tgt.addEntry(convertListEntryComponent(t));
if (src.hasEmptyReason())
tgt.setEmptyReason(convertCodeableConcept(src.getEmptyReason()));
return tgt;
}
public static org.hl7.fhir.r5.model.ListResource.ListStatus convertListStatus(org.hl7.fhir.r4.model.ListResource.ListStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case CURRENT: return org.hl7.fhir.r5.model.ListResource.ListStatus.CURRENT;
case RETIRED: return org.hl7.fhir.r5.model.ListResource.ListStatus.RETIRED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.ListResource.ListStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.ListResource.ListStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.ListResource.ListStatus convertListStatus(org.hl7.fhir.r5.model.ListResource.ListStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case CURRENT: return org.hl7.fhir.r4.model.ListResource.ListStatus.CURRENT;
case RETIRED: return org.hl7.fhir.r4.model.ListResource.ListStatus.RETIRED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.ListResource.ListStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.ListResource.ListStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.ListResource.ListMode convertListMode(org.hl7.fhir.r4.model.ListResource.ListMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case WORKING: return org.hl7.fhir.r5.model.ListResource.ListMode.WORKING;
case SNAPSHOT: return org.hl7.fhir.r5.model.ListResource.ListMode.SNAPSHOT;
case CHANGES: return org.hl7.fhir.r5.model.ListResource.ListMode.CHANGES;
default: return org.hl7.fhir.r5.model.ListResource.ListMode.NULL;
}
}
public static org.hl7.fhir.r4.model.ListResource.ListMode convertListMode(org.hl7.fhir.r5.model.ListResource.ListMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case WORKING: return org.hl7.fhir.r4.model.ListResource.ListMode.WORKING;
case SNAPSHOT: return org.hl7.fhir.r4.model.ListResource.ListMode.SNAPSHOT;
case CHANGES: return org.hl7.fhir.r4.model.ListResource.ListMode.CHANGES;
default: return org.hl7.fhir.r4.model.ListResource.ListMode.NULL;
}
}
public static org.hl7.fhir.r5.model.ListResource.ListEntryComponent convertListEntryComponent(org.hl7.fhir.r4.model.ListResource.ListEntryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.ListResource.ListEntryComponent tgt = new org.hl7.fhir.r5.model.ListResource.ListEntryComponent();
copyElement(src, tgt);
if (src.hasFlag())
tgt.setFlag(convertCodeableConcept(src.getFlag()));
if (src.hasDeleted())
tgt.setDeletedElement(convertBoolean(src.getDeletedElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasItem())
tgt.setItem(convertReference(src.getItem()));
return tgt;
}
public static org.hl7.fhir.r4.model.ListResource.ListEntryComponent convertListEntryComponent(org.hl7.fhir.r5.model.ListResource.ListEntryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.ListResource.ListEntryComponent tgt = new org.hl7.fhir.r4.model.ListResource.ListEntryComponent();
copyElement(src, tgt);
if (src.hasFlag())
tgt.setFlag(convertCodeableConcept(src.getFlag()));
if (src.hasDeleted())
tgt.setDeletedElement(convertBoolean(src.getDeletedElement()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasItem())
tgt.setItem(convertReference(src.getItem()));
return tgt;
}
}

View File

@ -0,0 +1,259 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Location extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Location convertLocation(org.hl7.fhir.r4.model.Location src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Location tgt = new org.hl7.fhir.r5.model.Location();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertLocationStatus(src.getStatus()));
if (src.hasOperationalStatus())
tgt.setOperationalStatus(convertCoding(src.getOperationalStatus()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
for (org.hl7.fhir.r4.model.StringType t : src.getAlias())
tgt.getAlias().add(convertString(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasMode())
tgt.setMode(convertLocationMode(src.getMode()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(convertContactPoint(t));
if (src.hasAddress())
tgt.setAddress(convertAddress(src.getAddress()));
if (src.hasPhysicalType())
tgt.setPhysicalType(convertCodeableConcept(src.getPhysicalType()));
if (src.hasPosition())
tgt.setPosition(convertLocationPositionComponent(src.getPosition()));
if (src.hasManagingOrganization())
tgt.setManagingOrganization(convertReference(src.getManagingOrganization()));
if (src.hasPartOf())
tgt.setPartOf(convertReference(src.getPartOf()));
for (org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent t : src.getHoursOfOperation())
tgt.addHoursOfOperation(convertLocationHoursOfOperationComponent(t));
if (src.hasAvailabilityExceptions())
tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement()));
for (org.hl7.fhir.r4.model.Reference t : src.getEndpoint())
tgt.addEndpoint(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Location convertLocation(org.hl7.fhir.r5.model.Location src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Location tgt = new org.hl7.fhir.r4.model.Location();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertLocationStatus(src.getStatus()));
if (src.hasOperationalStatus())
tgt.setOperationalStatus(convertCoding(src.getOperationalStatus()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
for (org.hl7.fhir.r5.model.StringType t : src.getAlias())
tgt.getAlias().add(convertString(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasMode())
tgt.setMode(convertLocationMode(src.getMode()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(convertContactPoint(t));
if (src.hasAddress())
tgt.setAddress(convertAddress(src.getAddress()));
if (src.hasPhysicalType())
tgt.setPhysicalType(convertCodeableConcept(src.getPhysicalType()));
if (src.hasPosition())
tgt.setPosition(convertLocationPositionComponent(src.getPosition()));
if (src.hasManagingOrganization())
tgt.setManagingOrganization(convertReference(src.getManagingOrganization()));
if (src.hasPartOf())
tgt.setPartOf(convertReference(src.getPartOf()));
for (org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent t : src.getHoursOfOperation())
tgt.addHoursOfOperation(convertLocationHoursOfOperationComponent(t));
if (src.hasAvailabilityExceptions())
tgt.setAvailabilityExceptionsElement(convertString(src.getAvailabilityExceptionsElement()));
for (org.hl7.fhir.r5.model.Reference t : src.getEndpoint())
tgt.addEndpoint(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Location.LocationStatus convertLocationStatus(org.hl7.fhir.r4.model.Location.LocationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.Location.LocationStatus.ACTIVE;
case SUSPENDED: return org.hl7.fhir.r5.model.Location.LocationStatus.SUSPENDED;
case INACTIVE: return org.hl7.fhir.r5.model.Location.LocationStatus.INACTIVE;
default: return org.hl7.fhir.r5.model.Location.LocationStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Location.LocationStatus convertLocationStatus(org.hl7.fhir.r5.model.Location.LocationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.Location.LocationStatus.ACTIVE;
case SUSPENDED: return org.hl7.fhir.r4.model.Location.LocationStatus.SUSPENDED;
case INACTIVE: return org.hl7.fhir.r4.model.Location.LocationStatus.INACTIVE;
default: return org.hl7.fhir.r4.model.Location.LocationStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Location.LocationMode convertLocationMode(org.hl7.fhir.r4.model.Location.LocationMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case INSTANCE: return org.hl7.fhir.r5.model.Location.LocationMode.INSTANCE;
case KIND: return org.hl7.fhir.r5.model.Location.LocationMode.KIND;
default: return org.hl7.fhir.r5.model.Location.LocationMode.NULL;
}
}
public static org.hl7.fhir.r4.model.Location.LocationMode convertLocationMode(org.hl7.fhir.r5.model.Location.LocationMode src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case INSTANCE: return org.hl7.fhir.r4.model.Location.LocationMode.INSTANCE;
case KIND: return org.hl7.fhir.r4.model.Location.LocationMode.KIND;
default: return org.hl7.fhir.r4.model.Location.LocationMode.NULL;
}
}
public static org.hl7.fhir.r5.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.r4.model.Location.LocationPositionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Location.LocationPositionComponent tgt = new org.hl7.fhir.r5.model.Location.LocationPositionComponent();
copyElement(src, tgt);
if (src.hasLongitude())
tgt.setLongitudeElement(convertDecimal(src.getLongitudeElement()));
if (src.hasLatitude())
tgt.setLatitudeElement(convertDecimal(src.getLatitudeElement()));
if (src.hasAltitude())
tgt.setAltitudeElement(convertDecimal(src.getAltitudeElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Location.LocationPositionComponent convertLocationPositionComponent(org.hl7.fhir.r5.model.Location.LocationPositionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Location.LocationPositionComponent tgt = new org.hl7.fhir.r4.model.Location.LocationPositionComponent();
copyElement(src, tgt);
if (src.hasLongitude())
tgt.setLongitudeElement(convertDecimal(src.getLongitudeElement()));
if (src.hasLatitude())
tgt.setLatitudeElement(convertDecimal(src.getLatitudeElement()));
if (src.hasAltitude())
tgt.setAltitudeElement(convertDecimal(src.getAltitudeElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent convertLocationHoursOfOperationComponent(org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent tgt = new org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Location.DaysOfWeek> t : src.getDaysOfWeek())
tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue()));
if (src.hasAllDay())
tgt.setAllDayElement(convertBoolean(src.getAllDayElement()));
if (src.hasOpeningTime())
tgt.setOpeningTimeElement(convertTime(src.getOpeningTimeElement()));
if (src.hasClosingTime())
tgt.setClosingTimeElement(convertTime(src.getClosingTimeElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent convertLocationHoursOfOperationComponent(org.hl7.fhir.r5.model.Location.LocationHoursOfOperationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent tgt = new org.hl7.fhir.r4.model.Location.LocationHoursOfOperationComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Location.DaysOfWeek> t : src.getDaysOfWeek())
tgt.addDaysOfWeek(convertDaysOfWeek(t.getValue()));
if (src.hasAllDay())
tgt.setAllDayElement(convertBoolean(src.getAllDayElement()));
if (src.hasOpeningTime())
tgt.setOpeningTimeElement(convertTime(src.getOpeningTimeElement()));
if (src.hasClosingTime())
tgt.setClosingTimeElement(convertTime(src.getClosingTimeElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.Location.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r4.model.Location.DaysOfWeek src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case MON: return org.hl7.fhir.r5.model.Location.DaysOfWeek.MON;
case TUE: return org.hl7.fhir.r5.model.Location.DaysOfWeek.TUE;
case WED: return org.hl7.fhir.r5.model.Location.DaysOfWeek.WED;
case THU: return org.hl7.fhir.r5.model.Location.DaysOfWeek.THU;
case FRI: return org.hl7.fhir.r5.model.Location.DaysOfWeek.FRI;
case SAT: return org.hl7.fhir.r5.model.Location.DaysOfWeek.SAT;
case SUN: return org.hl7.fhir.r5.model.Location.DaysOfWeek.SUN;
default: return org.hl7.fhir.r5.model.Location.DaysOfWeek.NULL;
}
}
public static org.hl7.fhir.r4.model.Location.DaysOfWeek convertDaysOfWeek(org.hl7.fhir.r5.model.Location.DaysOfWeek src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case MON: return org.hl7.fhir.r4.model.Location.DaysOfWeek.MON;
case TUE: return org.hl7.fhir.r4.model.Location.DaysOfWeek.TUE;
case WED: return org.hl7.fhir.r4.model.Location.DaysOfWeek.WED;
case THU: return org.hl7.fhir.r4.model.Location.DaysOfWeek.THU;
case FRI: return org.hl7.fhir.r4.model.Location.DaysOfWeek.FRI;
case SAT: return org.hl7.fhir.r4.model.Location.DaysOfWeek.SAT;
case SUN: return org.hl7.fhir.r4.model.Location.DaysOfWeek.SUN;
default: return org.hl7.fhir.r4.model.Location.DaysOfWeek.NULL;
}
}
}

View File

@ -0,0 +1,375 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Measure extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Measure convertMeasure(org.hl7.fhir.r4.model.Measure src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Measure tgt = new org.hl7.fhir.r5.model.Measure();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasSubject())
tgt.setSubject(convertType(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasUsage())
tgt.setUsageElement(convertString(src.getUsageElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getTopic())
tgt.addTopic(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getEditor())
tgt.addEditor(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(convertContactDetail(t));
for (org.hl7.fhir.r4.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(convertContactDetail(t));
for (org.hl7.fhir.r4.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(convertRelatedArtifact(t));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getLibrary())
tgt.getLibrary().add(convertCanonical(t));
if (src.hasDisclaimer())
tgt.setDisclaimerElement(convertMarkdown(src.getDisclaimerElement()));
if (src.hasScoring())
tgt.setScoring(convertCodeableConcept(src.getScoring()));
if (src.hasCompositeScoring())
tgt.setCompositeScoring(convertCodeableConcept(src.getCompositeScoring()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
if (src.hasRiskAdjustment())
tgt.setRiskAdjustmentElement(convertString(src.getRiskAdjustmentElement()));
if (src.hasRateAggregation())
tgt.setRateAggregationElement(convertString(src.getRateAggregationElement()));
if (src.hasRationale())
tgt.setRationaleElement(convertMarkdown(src.getRationaleElement()));
if (src.hasClinicalRecommendationStatement())
tgt.setClinicalRecommendationStatementElement(convertMarkdown(src.getClinicalRecommendationStatementElement()));
if (src.hasImprovementNotation())
tgt.setImprovementNotation(convertCodeableConcept(src.getImprovementNotation()));
for (org.hl7.fhir.r4.model.MarkdownType t : src.getDefinition())
tgt.getDefinition().add(convertMarkdown(t));
if (src.hasGuidance())
tgt.setGuidanceElement(convertMarkdown(src.getGuidanceElement()));
for (org.hl7.fhir.r4.model.Measure.MeasureGroupComponent t : src.getGroup())
tgt.addGroup(convertMeasureGroupComponent(t));
for (org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent t : src.getSupplementalData())
tgt.addSupplementalData(convertMeasureSupplementalDataComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Measure convertMeasure(org.hl7.fhir.r5.model.Measure src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Measure tgt = new org.hl7.fhir.r4.model.Measure();
copyDomainResource(src, tgt);
if (src.hasUrl())
tgt.setUrlElement(convertUri(src.getUrlElement()));
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasVersion())
tgt.setVersionElement(convertString(src.getVersionElement()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
if (src.hasTitle())
tgt.setTitleElement(convertString(src.getTitleElement()));
if (src.hasSubtitle())
tgt.setSubtitleElement(convertString(src.getSubtitleElement()));
if (src.hasStatus())
tgt.setStatus(Enumerations.convertPublicationStatus(src.getStatus()));
if (src.hasExperimental())
tgt.setExperimentalElement(convertBoolean(src.getExperimentalElement()));
if (src.hasSubject())
tgt.setSubject(convertType(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasPublisher())
tgt.setPublisherElement(convertString(src.getPublisherElement()));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getContact())
tgt.addContact(convertContactDetail(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertMarkdown(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.UsageContext t : src.getUseContext())
tgt.addUseContext(convertUsageContext(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setPurposeElement(convertMarkdown(src.getPurposeElement()));
if (src.hasUsage())
tgt.setUsageElement(convertString(src.getUsageElement()));
if (src.hasCopyright())
tgt.setCopyrightElement(convertMarkdown(src.getCopyrightElement()));
if (src.hasApprovalDate())
tgt.setApprovalDateElement(convertDate(src.getApprovalDateElement()));
if (src.hasLastReviewDate())
tgt.setLastReviewDateElement(convertDate(src.getLastReviewDateElement()));
if (src.hasEffectivePeriod())
tgt.setEffectivePeriod(convertPeriod(src.getEffectivePeriod()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getTopic())
tgt.addTopic(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getAuthor())
tgt.addAuthor(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEditor())
tgt.addEditor(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getReviewer())
tgt.addReviewer(convertContactDetail(t));
for (org.hl7.fhir.r5.model.ContactDetail t : src.getEndorser())
tgt.addEndorser(convertContactDetail(t));
for (org.hl7.fhir.r5.model.RelatedArtifact t : src.getRelatedArtifact())
tgt.addRelatedArtifact(convertRelatedArtifact(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getLibrary())
tgt.getLibrary().add(convertCanonical(t));
if (src.hasDisclaimer())
tgt.setDisclaimerElement(convertMarkdown(src.getDisclaimerElement()));
if (src.hasScoring())
tgt.setScoring(convertCodeableConcept(src.getScoring()));
if (src.hasCompositeScoring())
tgt.setCompositeScoring(convertCodeableConcept(src.getCompositeScoring()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
tgt.addType(convertCodeableConcept(t));
if (src.hasRiskAdjustment())
tgt.setRiskAdjustmentElement(convertString(src.getRiskAdjustmentElement()));
if (src.hasRateAggregation())
tgt.setRateAggregationElement(convertString(src.getRateAggregationElement()));
if (src.hasRationale())
tgt.setRationaleElement(convertMarkdown(src.getRationaleElement()));
if (src.hasClinicalRecommendationStatement())
tgt.setClinicalRecommendationStatementElement(convertMarkdown(src.getClinicalRecommendationStatementElement()));
if (src.hasImprovementNotation())
tgt.setImprovementNotation(convertCodeableConcept(src.getImprovementNotation()));
for (org.hl7.fhir.r5.model.MarkdownType t : src.getDefinition())
tgt.getDefinition().add(convertMarkdown(t));
if (src.hasGuidance())
tgt.setGuidanceElement(convertMarkdown(src.getGuidanceElement()));
for (org.hl7.fhir.r5.model.Measure.MeasureGroupComponent t : src.getGroup())
tgt.addGroup(convertMeasureGroupComponent(t));
for (org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent t : src.getSupplementalData())
tgt.addSupplementalData(convertMeasureSupplementalDataComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Measure.MeasureGroupComponent convertMeasureGroupComponent(org.hl7.fhir.r4.model.Measure.MeasureGroupComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Measure.MeasureGroupComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent t : src.getPopulation())
tgt.addPopulation(convertMeasureGroupPopulationComponent(t));
for (org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent t : src.getStratifier())
tgt.addStratifier(convertMeasureGroupStratifierComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Measure.MeasureGroupComponent convertMeasureGroupComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Measure.MeasureGroupComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureGroupComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
for (org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent t : src.getPopulation())
tgt.addPopulation(convertMeasureGroupPopulationComponent(t));
for (org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent t : src.getStratifier())
tgt.addStratifier(convertMeasureGroupStratifierComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent convertMeasureGroupPopulationComponent(org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasCriteria())
tgt.setCriteria(convertExpression(src.getCriteria()));
return tgt;
}
public static org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent convertMeasureGroupPopulationComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupPopulationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureGroupPopulationComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasCriteria())
tgt.setCriteria(convertExpression(src.getCriteria()));
return tgt;
}
public static org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent convertMeasureGroupStratifierComponent(org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasCriteria())
tgt.setCriteria(convertExpression(src.getCriteria()));
for (org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent t : src.getComponent())
tgt.addComponent(convertMeasureGroupStratifierComponentComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent convertMeasureGroupStratifierComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasCriteria())
tgt.setCriteria(convertExpression(src.getCriteria()));
for (org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent t : src.getComponent())
tgt.addComponent(convertMeasureGroupStratifierComponentComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent convertMeasureGroupStratifierComponentComponent(org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasCriteria())
tgt.setCriteria(convertExpression(src.getCriteria()));
return tgt;
}
public static org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent convertMeasureGroupStratifierComponentComponent(org.hl7.fhir.r5.model.Measure.MeasureGroupStratifierComponentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureGroupStratifierComponentComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasCriteria())
tgt.setCriteria(convertExpression(src.getCriteria()));
return tgt;
}
public static org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent convertMeasureSupplementalDataComponent(org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent tgt = new org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getUsage())
tgt.addUsage(convertCodeableConcept(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasCriteria())
tgt.setCriteria(convertExpression(src.getCriteria()));
return tgt;
}
public static org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent convertMeasureSupplementalDataComponent(org.hl7.fhir.r5.model.Measure.MeasureSupplementalDataComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent tgt = new org.hl7.fhir.r4.model.Measure.MeasureSupplementalDataComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getUsage())
tgt.addUsage(convertCodeableConcept(t));
if (src.hasDescription())
tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
if (src.hasCriteria())
tgt.setCriteria(convertExpression(src.getCriteria()));
return tgt;
}
}

View File

@ -0,0 +1,317 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class MeasureReport extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.MeasureReport convertMeasureReport(org.hl7.fhir.r4.model.MeasureReport src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MeasureReport tgt = new org.hl7.fhir.r5.model.MeasureReport();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertMeasureReportStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertMeasureReportType(src.getType()));
if (src.hasMeasure())
tgt.setMeasureElement(convertCanonical(src.getMeasureElement()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasReporter())
tgt.setReporter(convertReference(src.getReporter()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasImprovementNotation())
tgt.setImprovementNotation(convertCodeableConcept(src.getImprovementNotation()));
for (org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent t : src.getGroup())
tgt.addGroup(convertMeasureReportGroupComponent(t));
for (org.hl7.fhir.r4.model.Reference t : src.getEvaluatedResource())
tgt.addEvaluatedResource(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MeasureReport convertMeasureReport(org.hl7.fhir.r5.model.MeasureReport src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MeasureReport tgt = new org.hl7.fhir.r4.model.MeasureReport();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertMeasureReportStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertMeasureReportType(src.getType()));
if (src.hasMeasure())
tgt.setMeasureElement(convertCanonical(src.getMeasureElement()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasReporter())
tgt.setReporter(convertReference(src.getReporter()));
if (src.hasPeriod())
tgt.setPeriod(convertPeriod(src.getPeriod()));
if (src.hasImprovementNotation())
tgt.setImprovementNotation(convertCodeableConcept(src.getImprovementNotation()));
for (org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent t : src.getGroup())
tgt.addGroup(convertMeasureReportGroupComponent(t));
for (org.hl7.fhir.r5.model.Reference t : src.getEvaluatedResource())
tgt.addEvaluatedResource(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus convertMeasureReportStatus(org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case COMPLETE: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.COMPLETE;
case PENDING: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.PENDING;
case ERROR: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.ERROR;
default: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus convertMeasureReportStatus(org.hl7.fhir.r5.model.MeasureReport.MeasureReportStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case COMPLETE: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.COMPLETE;
case PENDING: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.PENDING;
case ERROR: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.ERROR;
default: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportType convertMeasureReportType(org.hl7.fhir.r4.model.MeasureReport.MeasureReportType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case INDIVIDUAL: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.INDIVIDUAL;
case SUBJECTLIST: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.SUBJECTLIST;
case SUMMARY: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.SUMMARY;
case DATACOLLECTION: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.DATACOLLECTION;
default: return org.hl7.fhir.r5.model.MeasureReport.MeasureReportType.NULL;
}
}
public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportType convertMeasureReportType(org.hl7.fhir.r5.model.MeasureReport.MeasureReportType src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case INDIVIDUAL: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.INDIVIDUAL;
case SUBJECTLIST: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.SUBJECTLIST;
case SUMMARY: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.SUMMARY;
case DATACOLLECTION: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.DATACOLLECTION;
default: return org.hl7.fhir.r4.model.MeasureReport.MeasureReportType.NULL;
}
}
public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent convertMeasureReportGroupComponent(org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent t : src.getPopulation())
tgt.addPopulation(convertMeasureReportGroupPopulationComponent(t));
if (src.hasMeasureScore())
tgt.setMeasureScore(convertQuantity(src.getMeasureScore()));
for (org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent t : src.getStratifier())
tgt.addStratifier(convertMeasureReportGroupStratifierComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent convertMeasureReportGroupComponent(org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent t : src.getPopulation())
tgt.addPopulation(convertMeasureReportGroupPopulationComponent(t));
if (src.hasMeasureScore())
tgt.setMeasureScore(convertQuantity(src.getMeasureScore()));
for (org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent t : src.getStratifier())
tgt.addStratifier(convertMeasureReportGroupStratifierComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent convertMeasureReportGroupPopulationComponent(org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasCount())
tgt.setCountElement(convertInteger(src.getCountElement()));
if (src.hasSubjectResults())
tgt.setSubjectResults(convertReference(src.getSubjectResults()));
return tgt;
}
public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent convertMeasureReportGroupPopulationComponent(org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupPopulationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupPopulationComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasCount())
tgt.setCountElement(convertInteger(src.getCountElement()));
if (src.hasSubjectResults())
tgt.setSubjectResults(convertReference(src.getSubjectResults()));
return tgt;
}
public static org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent convertMeasureReportGroupStratifierComponent(org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCode())
tgt.addCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent t : src.getStratum())
tgt.addStratum(convertStratifierGroupComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent convertMeasureReportGroupStratifierComponent(org.hl7.fhir.r5.model.MeasureReport.MeasureReportGroupStratifierComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.MeasureReportGroupStratifierComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCode())
tgt.addCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent t : src.getStratum())
tgt.addStratum(convertStratifierGroupComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent convertStratifierGroupComponent(org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent();
copyElement(src, tgt);
if (src.hasValue())
tgt.setValue(convertCodeableConcept(src.getValue()));
for (org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent t : src.getComponent())
tgt.addComponent(convertStratifierGroupComponentComponent(t));
for (org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent t : src.getPopulation())
tgt.addPopulation(convertStratifierGroupPopulationComponent(t));
if (src.hasMeasureScore())
tgt.setMeasureScore(convertQuantity(src.getMeasureScore()));
return tgt;
}
public static org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent convertStratifierGroupComponent(org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponent();
copyElement(src, tgt);
if (src.hasValue())
tgt.setValue(convertCodeableConcept(src.getValue()));
for (org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent t : src.getComponent())
tgt.addComponent(convertStratifierGroupComponentComponent(t));
for (org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent t : src.getPopulation())
tgt.addPopulation(convertStratifierGroupPopulationComponent(t));
if (src.hasMeasureScore())
tgt.setMeasureScore(convertQuantity(src.getMeasureScore()));
return tgt;
}
public static org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent convertStratifierGroupComponentComponent(org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasValue())
tgt.setValue(convertCodeableConcept(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent convertStratifierGroupComponentComponent(org.hl7.fhir.r5.model.MeasureReport.StratifierGroupComponentComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.StratifierGroupComponentComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasValue())
tgt.setValue(convertCodeableConcept(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent convertStratifierGroupPopulationComponent(org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent tgt = new org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasCount())
tgt.setCountElement(convertInteger(src.getCountElement()));
if (src.hasSubjectResults())
tgt.setSubjectResults(convertReference(src.getSubjectResults()));
return tgt;
}
public static org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent convertStratifierGroupPopulationComponent(org.hl7.fhir.r5.model.MeasureReport.StratifierGroupPopulationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent tgt = new org.hl7.fhir.r4.model.MeasureReport.StratifierGroupPopulationComponent();
copyElement(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasCount())
tgt.setCountElement(convertInteger(src.getCountElement()));
if (src.hasSubjectResults())
tgt.setSubjectResults(convertReference(src.getSubjectResults()));
return tgt;
}
}

View File

@ -0,0 +1,179 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Media extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Media convertMedia(org.hl7.fhir.r4.model.Media src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Media tgt = new org.hl7.fhir.r5.model.Media();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getPartOf())
tgt.addPartOf(convertReference(t));
if (src.hasStatus())
tgt.setStatus(convertMediaStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasModality())
tgt.setModality(convertCodeableConcept(src.getModality()));
if (src.hasView())
tgt.setView(convertCodeableConcept(src.getView()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasCreated())
tgt.setCreated(convertType(src.getCreated()));
if (src.hasIssued())
tgt.setIssuedElement(convertInstant(src.getIssuedElement()));
if (src.hasOperator())
tgt.setOperator(convertReference(src.getOperator()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
if (src.hasBodySite())
tgt.setBodySite(convertCodeableConcept(src.getBodySite()));
if (src.hasDeviceName())
tgt.setDeviceNameElement(convertString(src.getDeviceNameElement()));
if (src.hasDevice())
tgt.setDevice(convertReference(src.getDevice()));
if (src.hasHeight())
tgt.setHeightElement(convertPositiveInt(src.getHeightElement()));
if (src.hasWidth())
tgt.setWidthElement(convertPositiveInt(src.getWidthElement()));
if (src.hasFrames())
tgt.setFramesElement(convertPositiveInt(src.getFramesElement()));
if (src.hasDuration())
tgt.setDurationElement(convertDecimal(src.getDurationElement()));
if (src.hasContent())
tgt.setContent(convertAttachment(src.getContent()));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r4.model.Media convertMedia(org.hl7.fhir.r5.model.Media src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Media tgt = new org.hl7.fhir.r4.model.Media();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getPartOf())
tgt.addPartOf(convertReference(t));
if (src.hasStatus())
tgt.setStatus(convertMediaStatus(src.getStatus()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasModality())
tgt.setModality(convertCodeableConcept(src.getModality()));
if (src.hasView())
tgt.setView(convertCodeableConcept(src.getView()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
if (src.hasCreated())
tgt.setCreated(convertType(src.getCreated()));
if (src.hasIssued())
tgt.setIssuedElement(convertInstant(src.getIssuedElement()));
if (src.hasOperator())
tgt.setOperator(convertReference(src.getOperator()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
if (src.hasBodySite())
tgt.setBodySite(convertCodeableConcept(src.getBodySite()));
if (src.hasDeviceName())
tgt.setDeviceNameElement(convertString(src.getDeviceNameElement()));
if (src.hasDevice())
tgt.setDevice(convertReference(src.getDevice()));
if (src.hasHeight())
tgt.setHeightElement(convertPositiveInt(src.getHeightElement()));
if (src.hasWidth())
tgt.setWidthElement(convertPositiveInt(src.getWidthElement()));
if (src.hasFrames())
tgt.setFramesElement(convertPositiveInt(src.getFramesElement()));
if (src.hasDuration())
tgt.setDurationElement(convertDecimal(src.getDurationElement()));
if (src.hasContent())
tgt.setContent(convertAttachment(src.getContent()));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.r5.model.Media.MediaStatus convertMediaStatus(org.hl7.fhir.r4.model.Media.MediaStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PREPARATION: return org.hl7.fhir.r5.model.Media.MediaStatus.PREPARATION;
case INPROGRESS: return org.hl7.fhir.r5.model.Media.MediaStatus.INPROGRESS;
case NOTDONE: return org.hl7.fhir.r5.model.Media.MediaStatus.NOTDONE;
case ONHOLD: return org.hl7.fhir.r5.model.Media.MediaStatus.ONHOLD;
case STOPPED: return org.hl7.fhir.r5.model.Media.MediaStatus.STOPPED;
case COMPLETED: return org.hl7.fhir.r5.model.Media.MediaStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Media.MediaStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r5.model.Media.MediaStatus.UNKNOWN;
default: return org.hl7.fhir.r5.model.Media.MediaStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Media.MediaStatus convertMediaStatus(org.hl7.fhir.r5.model.Media.MediaStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PREPARATION: return org.hl7.fhir.r4.model.Media.MediaStatus.PREPARATION;
case INPROGRESS: return org.hl7.fhir.r4.model.Media.MediaStatus.INPROGRESS;
case NOTDONE: return org.hl7.fhir.r4.model.Media.MediaStatus.NOTDONE;
case ONHOLD: return org.hl7.fhir.r4.model.Media.MediaStatus.ONHOLD;
case STOPPED: return org.hl7.fhir.r4.model.Media.MediaStatus.STOPPED;
case COMPLETED: return org.hl7.fhir.r4.model.Media.MediaStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Media.MediaStatus.ENTEREDINERROR;
case UNKNOWN: return org.hl7.fhir.r4.model.Media.MediaStatus.UNKNOWN;
default: return org.hl7.fhir.r4.model.Media.MediaStatus.NULL;
}
}
}

View File

@ -0,0 +1,165 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class Medication extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.Medication convertMedication(org.hl7.fhir.r4.model.Medication src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Medication tgt = new org.hl7.fhir.r5.model.Medication();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasStatus())
tgt.setStatus(convertMedicationStatus(src.getStatus()));
if (src.hasManufacturer())
tgt.setManufacturer(convertReference(src.getManufacturer()));
if (src.hasForm())
tgt.setForm(convertCodeableConcept(src.getForm()));
if (src.hasAmount())
tgt.setAmount(convertRatio(src.getAmount()));
for (org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent t : src.getIngredient())
tgt.addIngredient(convertMedicationIngredientComponent(t));
if (src.hasBatch())
tgt.setBatch(convertMedicationBatchComponent(src.getBatch()));
return tgt;
}
public static org.hl7.fhir.r4.model.Medication convertMedication(org.hl7.fhir.r5.model.Medication src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Medication tgt = new org.hl7.fhir.r4.model.Medication();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasStatus())
tgt.setStatus(convertMedicationStatus(src.getStatus()));
if (src.hasManufacturer())
tgt.setManufacturer(convertReference(src.getManufacturer()));
if (src.hasForm())
tgt.setForm(convertCodeableConcept(src.getForm()));
if (src.hasAmount())
tgt.setAmount(convertRatio(src.getAmount()));
for (org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent t : src.getIngredient())
tgt.addIngredient(convertMedicationIngredientComponent(t));
if (src.hasBatch())
tgt.setBatch(convertMedicationBatchComponent(src.getBatch()));
return tgt;
}
public static org.hl7.fhir.r5.model.Medication.MedicationStatus convertMedicationStatus(org.hl7.fhir.r4.model.Medication.MedicationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.Medication.MedicationStatus.ACTIVE;
case INACTIVE: return org.hl7.fhir.r5.model.Medication.MedicationStatus.INACTIVE;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.Medication.MedicationStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r5.model.Medication.MedicationStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.Medication.MedicationStatus convertMedicationStatus(org.hl7.fhir.r5.model.Medication.MedicationStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.Medication.MedicationStatus.ACTIVE;
case INACTIVE: return org.hl7.fhir.r4.model.Medication.MedicationStatus.INACTIVE;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.Medication.MedicationStatus.ENTEREDINERROR;
default: return org.hl7.fhir.r4.model.Medication.MedicationStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent convertMedicationIngredientComponent(org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent tgt = new org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent();
copyElement(src, tgt);
if (src.hasItem())
tgt.setItem(convertType(src.getItem()));
if (src.hasIsActive())
tgt.setIsActiveElement(convertBoolean(src.getIsActiveElement()));
if (src.hasStrength())
tgt.setStrength(convertRatio(src.getStrength()));
return tgt;
}
public static org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent convertMedicationIngredientComponent(org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent tgt = new org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent();
copyElement(src, tgt);
if (src.hasItem())
tgt.setItem(convertType(src.getItem()));
if (src.hasIsActive())
tgt.setIsActiveElement(convertBoolean(src.getIsActiveElement()));
if (src.hasStrength())
tgt.setStrength(convertRatio(src.getStrength()));
return tgt;
}
public static org.hl7.fhir.r5.model.Medication.MedicationBatchComponent convertMedicationBatchComponent(org.hl7.fhir.r4.model.Medication.MedicationBatchComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Medication.MedicationBatchComponent tgt = new org.hl7.fhir.r5.model.Medication.MedicationBatchComponent();
copyElement(src, tgt);
if (src.hasLotNumber())
tgt.setLotNumberElement(convertString(src.getLotNumberElement()));
if (src.hasExpirationDate())
tgt.setExpirationDateElement(convertDateTime(src.getExpirationDateElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.Medication.MedicationBatchComponent convertMedicationBatchComponent(org.hl7.fhir.r5.model.Medication.MedicationBatchComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.Medication.MedicationBatchComponent tgt = new org.hl7.fhir.r4.model.Medication.MedicationBatchComponent();
copyElement(src, tgt);
if (src.hasLotNumber())
tgt.setLotNumberElement(convertString(src.getLotNumberElement()));
if (src.hasExpirationDate())
tgt.setExpirationDateElement(convertDateTime(src.getExpirationDateElement()));
return tgt;
}
}

View File

@ -0,0 +1,199 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class MedicationAdministration extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.MedicationAdministration convertMedicationAdministration(org.hl7.fhir.r4.model.MedicationAdministration src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationAdministration tgt = new org.hl7.fhir.r5.model.MedicationAdministration();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.UriType t : src.getInstantiates())
tgt.getInstantiates().add(convertUri(t));
for (org.hl7.fhir.r4.model.Reference t : src.getPartOf())
tgt.addPartOf(convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertCode(src.getStatusElement()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getStatusReason())
tgt.addStatusReason(convertCodeableConcept(t));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasMedication())
tgt.setMedication(convertType(src.getMedication()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasContext())
tgt.setContext(convertReference(src.getContext()));
for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation())
tgt.addSupportingInformation(convertReference(t));
if (src.hasEffective())
tgt.setEffective(convertType(src.getEffective()));
for (org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer())
tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
if (src.hasRequest())
tgt.setRequest(convertReference(src.getRequest()));
for (org.hl7.fhir.r4.model.Reference t : src.getDevice())
tgt.addDevice(convertReference(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
if (src.hasDosage())
tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage()));
for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory())
tgt.addEventHistory(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationAdministration convertMedicationAdministration(org.hl7.fhir.r5.model.MedicationAdministration src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationAdministration tgt = new org.hl7.fhir.r4.model.MedicationAdministration();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.UriType t : src.getInstantiates())
tgt.getInstantiates().add(convertUri(t));
for (org.hl7.fhir.r5.model.Reference t : src.getPartOf())
tgt.addPartOf(convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertCode(src.getStatusElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason())
tgt.addStatusReason(convertCodeableConcept(t));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasMedication())
tgt.setMedication(convertType(src.getMedication()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasContext())
tgt.setContext(convertReference(src.getContext()));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation())
tgt.addSupportingInformation(convertReference(t));
if (src.hasEffective())
tgt.setEffective(convertType(src.getEffective()));
for (org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent t : src.getPerformer())
tgt.addPerformer(convertMedicationAdministrationPerformerComponent(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
if (src.hasRequest())
tgt.setRequest(convertReference(src.getRequest()));
for (org.hl7.fhir.r5.model.Reference t : src.getDevice())
tgt.addDevice(convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
if (src.hasDosage())
tgt.setDosage(convertMedicationAdministrationDosageComponent(src.getDosage()));
for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory())
tgt.addEventHistory(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent convertMedicationAdministrationPerformerComponent(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent tgt = new org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent();
copyElement(src, tgt);
if (src.hasFunction())
tgt.setFunction(convertCodeableConcept(src.getFunction()));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent convertMedicationAdministrationPerformerComponent(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationPerformerComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent tgt = new org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationPerformerComponent();
copyElement(src, tgt);
if (src.hasFunction())
tgt.setFunction(convertCodeableConcept(src.getFunction()));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent convertMedicationAdministrationDosageComponent(org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationDosageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent tgt = new org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent();
copyElement(src, tgt);
if (src.hasText())
tgt.setTextElement(convertString(src.getTextElement()));
if (src.hasSite())
tgt.setSite(convertCodeableConcept(src.getSite()));
if (src.hasRoute())
tgt.setRoute(convertCodeableConcept(src.getRoute()));
if (src.hasMethod())
tgt.setMethod(convertCodeableConcept(src.getMethod()));
if (src.hasDose())
tgt.setDose(convertSimpleQuantity(src.getDose()));
if (src.hasRate())
tgt.setRate(convertType(src.getRate()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationDosageComponent convertMedicationAdministrationDosageComponent(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationDosageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationDosageComponent tgt = new org.hl7.fhir.r4.model.MedicationAdministration.MedicationAdministrationDosageComponent();
copyElement(src, tgt);
if (src.hasText())
tgt.setTextElement(convertString(src.getTextElement()));
if (src.hasSite())
tgt.setSite(convertCodeableConcept(src.getSite()));
if (src.hasRoute())
tgt.setRoute(convertCodeableConcept(src.getRoute()));
if (src.hasMethod())
tgt.setMethod(convertCodeableConcept(src.getMethod()));
if (src.hasDose())
tgt.setDose(convertSimpleQuantity(src.getDose()));
if (src.hasRate())
tgt.setRate(convertType(src.getRate()));
return tgt;
}
}

View File

@ -0,0 +1,211 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class MedicationDispense extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.MedicationDispense convertMedicationDispense(org.hl7.fhir.r4.model.MedicationDispense src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationDispense tgt = new org.hl7.fhir.r5.model.MedicationDispense();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.Reference t : src.getPartOf())
tgt.addPartOf(convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertCode(src.getStatusElement()));
if (src.hasStatusReason())
tgt.setStatusReason(convertType(src.getStatusReason()));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasMedication())
tgt.setMedication(convertType(src.getMedication()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasContext())
tgt.setContext(convertReference(src.getContext()));
for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation())
tgt.addSupportingInformation(convertReference(t));
for (org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer())
tgt.addPerformer(convertMedicationDispensePerformerComponent(t));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
for (org.hl7.fhir.r4.model.Reference t : src.getAuthorizingPrescription())
tgt.addAuthorizingPrescription(convertReference(t));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasDaysSupply())
tgt.setDaysSupply(convertSimpleQuantity(src.getDaysSupply()));
if (src.hasWhenPrepared())
tgt.setWhenPreparedElement(convertDateTime(src.getWhenPreparedElement()));
if (src.hasWhenHandedOver())
tgt.setWhenHandedOverElement(convertDateTime(src.getWhenHandedOverElement()));
if (src.hasDestination())
tgt.setDestination(convertReference(src.getDestination()));
for (org.hl7.fhir.r4.model.Reference t : src.getReceiver())
tgt.addReceiver(convertReference(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.Dosage t : src.getDosageInstruction())
tgt.addDosageInstruction(convertDosage(t));
if (src.hasSubstitution())
tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution()));
for (org.hl7.fhir.r4.model.Reference t : src.getDetectedIssue())
tgt.addDetectedIssue(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory())
tgt.addEventHistory(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationDispense convertMedicationDispense(org.hl7.fhir.r5.model.MedicationDispense src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationDispense tgt = new org.hl7.fhir.r4.model.MedicationDispense();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.Reference t : src.getPartOf())
tgt.addPartOf(convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertCode(src.getStatusElement()));
if (src.hasStatusReason())
tgt.setStatusReason(convertType(src.getStatusReason()));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasMedication())
tgt.setMedication(convertType(src.getMedication()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasContext())
tgt.setContext(convertReference(src.getContext()));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation())
tgt.addSupportingInformation(convertReference(t));
for (org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent t : src.getPerformer())
tgt.addPerformer(convertMedicationDispensePerformerComponent(t));
if (src.hasLocation())
tgt.setLocation(convertReference(src.getLocation()));
for (org.hl7.fhir.r5.model.Reference t : src.getAuthorizingPrescription())
tgt.addAuthorizingPrescription(convertReference(t));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasDaysSupply())
tgt.setDaysSupply(convertSimpleQuantity(src.getDaysSupply()));
if (src.hasWhenPrepared())
tgt.setWhenPreparedElement(convertDateTime(src.getWhenPreparedElement()));
if (src.hasWhenHandedOver())
tgt.setWhenHandedOverElement(convertDateTime(src.getWhenHandedOverElement()));
if (src.hasDestination())
tgt.setDestination(convertReference(src.getDestination()));
for (org.hl7.fhir.r5.model.Reference t : src.getReceiver())
tgt.addReceiver(convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction())
tgt.addDosageInstruction(convertDosage(t));
if (src.hasSubstitution())
tgt.setSubstitution(convertMedicationDispenseSubstitutionComponent(src.getSubstitution()));
for (org.hl7.fhir.r5.model.Reference t : src.getDetectedIssue())
tgt.addDetectedIssue(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory())
tgt.addEventHistory(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent convertMedicationDispensePerformerComponent(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent tgt = new org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent();
copyElement(src, tgt);
if (src.hasFunction())
tgt.setFunction(convertCodeableConcept(src.getFunction()));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent convertMedicationDispensePerformerComponent(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispensePerformerComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent tgt = new org.hl7.fhir.r4.model.MedicationDispense.MedicationDispensePerformerComponent();
copyElement(src, tgt);
if (src.hasFunction())
tgt.setFunction(convertCodeableConcept(src.getFunction()));
if (src.hasActor())
tgt.setActor(convertReference(src.getActor()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent();
copyElement(src, tgt);
if (src.hasWasSubstituted())
tgt.setWasSubstitutedElement(convertBoolean(src.getWasSubstitutedElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason())
tgt.addReason(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getResponsibleParty())
tgt.addResponsibleParty(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent convertMedicationDispenseSubstitutionComponent(org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseSubstitutionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent tgt = new org.hl7.fhir.r4.model.MedicationDispense.MedicationDispenseSubstitutionComponent();
copyElement(src, tgt);
if (src.hasWasSubstituted())
tgt.setWasSubstitutedElement(convertBoolean(src.getWasSubstitutedElement()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason())
tgt.addReason(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getResponsibleParty())
tgt.addResponsibleParty(convertReference(t));
return tgt;
}
}

View File

@ -0,0 +1,551 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class MedicationKnowledge extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.MedicationKnowledge convertMedicationKnowledge(org.hl7.fhir.r4.model.MedicationKnowledge src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge tgt = new org.hl7.fhir.r5.model.MedicationKnowledge();
copyDomainResource(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasStatus())
tgt.setStatusElement(convertCode(src.getStatusElement()));
if (src.hasManufacturer())
tgt.setManufacturer(convertReference(src.getManufacturer()));
if (src.hasDoseForm())
tgt.setDoseForm(convertCodeableConcept(src.getDoseForm()));
if (src.hasAmount())
tgt.setAmount(convertSimpleQuantity(src.getAmount()));
for (org.hl7.fhir.r4.model.StringType t : src.getSynonym())
tgt.getSynonym().add(convertString(t));
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent t : src.getRelatedMedicationKnowledge())
tgt.addRelatedMedicationKnowledge(convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(t));
for (org.hl7.fhir.r4.model.Reference t : src.getAssociatedMedication())
tgt.addAssociatedMedication(convertReference(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProductType())
tgt.addProductType(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent t : src.getMonograph())
tgt.addMonograph(convertMedicationKnowledgeMonographComponent(t));
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent t : src.getIngredient())
tgt.addIngredient(convertMedicationKnowledgeIngredientComponent(t));
if (src.hasPreparationInstruction())
tgt.setPreparationInstructionElement(convertMarkdown(src.getPreparationInstructionElement()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getIntendedRoute())
tgt.addIntendedRoute(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent t : src.getCost())
tgt.addCost(convertMedicationKnowledgeCostComponent(t));
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent t : src.getMonitoringProgram())
tgt.addMonitoringProgram(convertMedicationKnowledgeMonitoringProgramComponent(t));
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent t : src.getAdministrationGuidelines())
tgt.addAdministrationGuidelines(convertMedicationKnowledgeAdministrationGuidelinesComponent(t));
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent t : src.getMedicineClassification())
tgt.addMedicineClassification(convertMedicationKnowledgeMedicineClassificationComponent(t));
if (src.hasPackaging())
tgt.setPackaging(convertMedicationKnowledgePackagingComponent(src.getPackaging()));
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent t : src.getDrugCharacteristic())
tgt.addDrugCharacteristic(convertMedicationKnowledgeDrugCharacteristicComponent(t));
for (org.hl7.fhir.r4.model.Reference t : src.getContraindication())
tgt.addContraindication(convertReference(t));
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent t : src.getRegulatory())
tgt.addRegulatory(convertMedicationKnowledgeRegulatoryComponent(t));
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent t : src.getKinetics())
tgt.addKinetics(convertMedicationKnowledgeKineticsComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge convertMedicationKnowledge(org.hl7.fhir.r5.model.MedicationKnowledge src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge tgt = new org.hl7.fhir.r4.model.MedicationKnowledge();
copyDomainResource(src, tgt);
if (src.hasCode())
tgt.setCode(convertCodeableConcept(src.getCode()));
if (src.hasStatus())
tgt.setStatusElement(convertCode(src.getStatusElement()));
if (src.hasManufacturer())
tgt.setManufacturer(convertReference(src.getManufacturer()));
if (src.hasDoseForm())
tgt.setDoseForm(convertCodeableConcept(src.getDoseForm()));
if (src.hasAmount())
tgt.setAmount(convertSimpleQuantity(src.getAmount()));
for (org.hl7.fhir.r5.model.StringType t : src.getSynonym())
tgt.getSynonym().add(convertString(t));
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent t : src.getRelatedMedicationKnowledge())
tgt.addRelatedMedicationKnowledge(convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(t));
for (org.hl7.fhir.r5.model.Reference t : src.getAssociatedMedication())
tgt.addAssociatedMedication(convertReference(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProductType())
tgt.addProductType(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent t : src.getMonograph())
tgt.addMonograph(convertMedicationKnowledgeMonographComponent(t));
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent t : src.getIngredient())
tgt.addIngredient(convertMedicationKnowledgeIngredientComponent(t));
if (src.hasPreparationInstruction())
tgt.setPreparationInstructionElement(convertMarkdown(src.getPreparationInstructionElement()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getIntendedRoute())
tgt.addIntendedRoute(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent t : src.getCost())
tgt.addCost(convertMedicationKnowledgeCostComponent(t));
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent t : src.getMonitoringProgram())
tgt.addMonitoringProgram(convertMedicationKnowledgeMonitoringProgramComponent(t));
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent t : src.getAdministrationGuidelines())
tgt.addAdministrationGuidelines(convertMedicationKnowledgeAdministrationGuidelinesComponent(t));
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent t : src.getMedicineClassification())
tgt.addMedicineClassification(convertMedicationKnowledgeMedicineClassificationComponent(t));
if (src.hasPackaging())
tgt.setPackaging(convertMedicationKnowledgePackagingComponent(src.getPackaging()));
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent t : src.getDrugCharacteristic())
tgt.addDrugCharacteristic(convertMedicationKnowledgeDrugCharacteristicComponent(t));
for (org.hl7.fhir.r5.model.Reference t : src.getContraindication())
tgt.addContraindication(convertReference(t));
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent t : src.getRegulatory())
tgt.addRegulatory(convertMedicationKnowledgeRegulatoryComponent(t));
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent t : src.getKinetics())
tgt.addKinetics(convertMedicationKnowledgeKineticsComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.Reference t : src.getReference())
tgt.addReference(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.Reference t : src.getReference())
tgt.addReference(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent convertMedicationKnowledgeMonographComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSource())
tgt.setSource(convertReference(src.getSource()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent convertMedicationKnowledgeMonographComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSource())
tgt.setSource(convertReference(src.getSource()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent convertMedicationKnowledgeIngredientComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent();
copyElement(src, tgt);
if (src.hasItem())
tgt.setItem(convertType(src.getItem()));
if (src.hasIsActive())
tgt.setIsActiveElement(convertBoolean(src.getIsActiveElement()));
if (src.hasStrength())
tgt.setStrength(convertRatio(src.getStrength()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent convertMedicationKnowledgeIngredientComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent();
copyElement(src, tgt);
if (src.hasItem())
tgt.setItem(convertType(src.getItem()));
if (src.hasIsActive())
tgt.setIsActiveElement(convertBoolean(src.getIsActiveElement()));
if (src.hasStrength())
tgt.setStrength(convertRatio(src.getStrength()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent convertMedicationKnowledgeCostComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSource())
tgt.setSourceElement(convertString(src.getSourceElement()));
if (src.hasCost())
tgt.setCost(convertMoney(src.getCost()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent convertMedicationKnowledgeCostComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasSource())
tgt.setSourceElement(convertString(src.getSourceElement()));
if (src.hasCost())
tgt.setCost(convertMoney(src.getCost()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent convertMedicationKnowledgeMonitoringProgramComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent convertMedicationKnowledgeMonitoringProgramComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasName())
tgt.setNameElement(convertString(src.getNameElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent convertMedicationKnowledgeAdministrationGuidelinesComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent t : src.getDosage())
tgt.addDosage(convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(t));
if (src.hasIndication())
tgt.setIndication(convertType(src.getIndication()));
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent t : src.getPatientCharacteristics())
tgt.addPatientCharacteristics(convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent convertMedicationKnowledgeAdministrationGuidelinesComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent t : src.getDosage())
tgt.addDosage(convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(t));
if (src.hasIndication())
tgt.setIndication(convertType(src.getIndication()));
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent t : src.getPatientCharacteristics())
tgt.addPatientCharacteristics(convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.Dosage t : src.getDosage())
tgt.addDosage(convertDosage(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent convertMedicationKnowledgeAdministrationGuidelinesDosageComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesDosageComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.Dosage t : src.getDosage())
tgt.addDosage(convertDosage(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent();
copyElement(src, tgt);
if (src.hasCharacteristic())
tgt.setCharacteristic(convertType(src.getCharacteristic()));
for (org.hl7.fhir.r4.model.StringType t : src.getValue())
tgt.getValue().add(convertString(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent convertMedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeAdministrationGuidelinesPatientCharacteristicsComponent();
copyElement(src, tgt);
if (src.hasCharacteristic())
tgt.setCharacteristic(convertType(src.getCharacteristic()));
for (org.hl7.fhir.r5.model.StringType t : src.getValue())
tgt.getValue().add(convertString(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent convertMedicationKnowledgeMedicineClassificationComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getClassification())
tgt.addClassification(convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent convertMedicationKnowledgeMedicineClassificationComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMedicineClassificationComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getClassification())
tgt.addClassification(convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent convertMedicationKnowledgePackagingComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgePackagingComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgePackagingComponent convertMedicationKnowledgePackagingComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgePackagingComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgePackagingComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent convertMedicationKnowledgeDrugCharacteristicComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent convertMedicationKnowledgeDrugCharacteristicComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasValue())
tgt.setValue(convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent convertMedicationKnowledgeRegulatoryComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent();
copyElement(src, tgt);
if (src.hasRegulatoryAuthority())
tgt.setRegulatoryAuthority(convertReference(src.getRegulatoryAuthority()));
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent t : src.getSubstitution())
tgt.addSubstitution(convertMedicationKnowledgeRegulatorySubstitutionComponent(t));
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent t : src.getSchedule())
tgt.addSchedule(convertMedicationKnowledgeRegulatoryScheduleComponent(t));
if (src.hasMaxDispense())
tgt.setMaxDispense(convertMedicationKnowledgeRegulatoryMaxDispenseComponent(src.getMaxDispense()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent convertMedicationKnowledgeRegulatoryComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent();
copyElement(src, tgt);
if (src.hasRegulatoryAuthority())
tgt.setRegulatoryAuthority(convertReference(src.getRegulatoryAuthority()));
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent t : src.getSubstitution())
tgt.addSubstitution(convertMedicationKnowledgeRegulatorySubstitutionComponent(t));
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent t : src.getSchedule())
tgt.addSchedule(convertMedicationKnowledgeRegulatoryScheduleComponent(t));
if (src.hasMaxDispense())
tgt.setMaxDispense(convertMedicationKnowledgeRegulatoryMaxDispenseComponent(src.getMaxDispense()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent convertMedicationKnowledgeRegulatorySubstitutionComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasAllowed())
tgt.setAllowedElement(convertBoolean(src.getAllowedElement()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent convertMedicationKnowledgeRegulatorySubstitutionComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatorySubstitutionComponent();
copyElement(src, tgt);
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasAllowed())
tgt.setAllowedElement(convertBoolean(src.getAllowedElement()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent convertMedicationKnowledgeRegulatoryScheduleComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent();
copyElement(src, tgt);
if (src.hasSchedule())
tgt.setSchedule(convertCodeableConcept(src.getSchedule()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent convertMedicationKnowledgeRegulatoryScheduleComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryScheduleComponent();
copyElement(src, tgt);
if (src.hasSchedule())
tgt.setSchedule(convertCodeableConcept(src.getSchedule()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent convertMedicationKnowledgeRegulatoryMaxDispenseComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent();
copyElement(src, tgt);
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasPeriod())
tgt.setPeriod(convertDuration(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent convertMedicationKnowledgeRegulatoryMaxDispenseComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryMaxDispenseComponent();
copyElement(src, tgt);
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasPeriod())
tgt.setPeriod(convertDuration(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent convertMedicationKnowledgeKineticsComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.Quantity t : src.getAreaUnderCurve())
tgt.addAreaUnderCurve(convertSimpleQuantity(t));
for (org.hl7.fhir.r4.model.Quantity t : src.getLethalDose50())
tgt.addLethalDose50(convertSimpleQuantity(t));
if (src.hasHalfLifePeriod())
tgt.setHalfLifePeriod(convertDuration(src.getHalfLifePeriod()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent convertMedicationKnowledgeKineticsComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeKineticsComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.Quantity t : src.getAreaUnderCurve())
tgt.addAreaUnderCurve(convertSimpleQuantity(t));
for (org.hl7.fhir.r5.model.Quantity t : src.getLethalDose50())
tgt.addLethalDose50(convertSimpleQuantity(t));
if (src.hasHalfLifePeriod())
tgt.setHalfLifePeriod(convertDuration(src.getHalfLifePeriod()));
return tgt;
}
}

View File

@ -0,0 +1,367 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class MedicationRequest extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.MedicationRequest convertMedicationRequest(org.hl7.fhir.r4.model.MedicationRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationRequest tgt = new org.hl7.fhir.r5.model.MedicationRequest();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertMedicationRequestStatus(src.getStatus()));
if (src.hasStatusReason())
tgt.setStatusReason(convertCodeableConcept(src.getStatusReason()));
if (src.hasIntent())
tgt.setIntent(convertMedicationRequestIntent(src.getIntent()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasPriority())
tgt.setPriority(convertMedicationRequestPriority(src.getPriority()));
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement()));
if (src.hasReported())
tgt.setReported(convertType(src.getReported()));
if (src.hasMedication())
tgt.setMedication(convertType(src.getMedication()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation())
tgt.addSupportingInformation(convertReference(t));
if (src.hasAuthoredOn())
tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement()));
if (src.hasRequester())
tgt.setRequester(convertReference(src.getRequester()));
if (src.hasPerformer())
tgt.setPerformer(convertReference(src.getPerformer()));
if (src.hasPerformerType())
tgt.setPerformerType(convertCodeableConcept(src.getPerformerType()));
if (src.hasRecorder())
tgt.setRecorder(convertReference(src.getRecorder()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r4.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(convertCanonical(t));
for (org.hl7.fhir.r4.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(convertUri(t));
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
if (src.hasGroupIdentifier())
tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier()));
if (src.hasCourseOfTherapyType())
tgt.setCourseOfTherapyType(convertCodeableConcept(src.getCourseOfTherapyType()));
for (org.hl7.fhir.r4.model.Reference t : src.getInsurance())
tgt.addInsurance(convertReference(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.Dosage t : src.getDosageInstruction())
tgt.addDosageInstruction(convertDosage(t));
if (src.hasDispenseRequest())
tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest()));
if (src.hasSubstitution())
tgt.setSubstitution(convertMedicationRequestSubstitutionComponent(src.getSubstitution()));
if (src.hasPriorPrescription())
tgt.setPriorPrescription(convertReference(src.getPriorPrescription()));
for (org.hl7.fhir.r4.model.Reference t : src.getDetectedIssue())
tgt.addDetectedIssue(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getEventHistory())
tgt.addEventHistory(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationRequest convertMedicationRequest(org.hl7.fhir.r5.model.MedicationRequest src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationRequest tgt = new org.hl7.fhir.r4.model.MedicationRequest();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasStatus())
tgt.setStatus(convertMedicationRequestStatus(src.getStatus()));
if (src.hasStatusReason())
tgt.setStatusReason(convertCodeableConcept(src.getStatusReason()));
if (src.hasIntent())
tgt.setIntent(convertMedicationRequestIntent(src.getIntent()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
tgt.addCategory(convertCodeableConcept(t));
if (src.hasPriority())
tgt.setPriority(convertMedicationRequestPriority(src.getPriority()));
if (src.hasDoNotPerform())
tgt.setDoNotPerformElement(convertBoolean(src.getDoNotPerformElement()));
if (src.hasReported())
tgt.setReported(convertType(src.getReported()));
if (src.hasMedication())
tgt.setMedication(convertType(src.getMedication()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasEncounter())
tgt.setEncounter(convertReference(src.getEncounter()));
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation())
tgt.addSupportingInformation(convertReference(t));
if (src.hasAuthoredOn())
tgt.setAuthoredOnElement(convertDateTime(src.getAuthoredOnElement()));
if (src.hasRequester())
tgt.setRequester(convertReference(src.getRequester()));
if (src.hasPerformer())
tgt.setPerformer(convertReference(src.getPerformer()));
if (src.hasPerformerType())
tgt.setPerformerType(convertCodeableConcept(src.getPerformerType()));
if (src.hasRecorder())
tgt.setRecorder(convertReference(src.getRecorder()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r5.model.CanonicalType t : src.getInstantiatesCanonical())
tgt.getInstantiatesCanonical().add(convertCanonical(t));
for (org.hl7.fhir.r5.model.UriType t : src.getInstantiatesUri())
tgt.getInstantiatesUri().add(convertUri(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
if (src.hasGroupIdentifier())
tgt.setGroupIdentifier(convertIdentifier(src.getGroupIdentifier()));
if (src.hasCourseOfTherapyType())
tgt.setCourseOfTherapyType(convertCodeableConcept(src.getCourseOfTherapyType()));
for (org.hl7.fhir.r5.model.Reference t : src.getInsurance())
tgt.addInsurance(convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction())
tgt.addDosageInstruction(convertDosage(t));
if (src.hasDispenseRequest())
tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest()));
if (src.hasSubstitution())
tgt.setSubstitution(convertMedicationRequestSubstitutionComponent(src.getSubstitution()));
if (src.hasPriorPrescription())
tgt.setPriorPrescription(convertReference(src.getPriorPrescription()));
for (org.hl7.fhir.r5.model.Reference t : src.getDetectedIssue())
tgt.addDetectedIssue(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getEventHistory())
tgt.addEventHistory(convertReference(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestStatus convertMedicationRequestStatus(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestStatus.ACTIVE;
case ONHOLD: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestStatus.ONHOLD;
case CANCELLED: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestStatus.CANCELLED;
case COMPLETED: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestStatus.ENTEREDINERROR;
case STOPPED: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestStatus.STOPPED;
case DRAFT: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestStatus.DRAFT;
case UNKNOWN: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestStatus.UNKNOWN;
default: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus convertMedicationRequestStatus(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ACTIVE;
case ONHOLD: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ONHOLD;
case CANCELLED: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.CANCELLED;
case COMPLETED: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.ENTEREDINERROR;
case STOPPED: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.STOPPED;
case DRAFT: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.DRAFT;
case UNKNOWN: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.UNKNOWN;
default: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestStatus.NULL;
}
}
public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent convertMedicationRequestIntent(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROPOSAL: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.PROPOSAL;
case PLAN: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.PLAN;
case ORDER: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.ORDER;
case ORIGINALORDER: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.ORIGINALORDER;
case REFLEXORDER: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.REFLEXORDER;
case FILLERORDER: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.FILLERORDER;
case INSTANCEORDER: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER;
case OPTION: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.OPTION;
default: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent.NULL;
}
}
public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent convertMedicationRequestIntent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestIntent src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case PROPOSAL: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.PROPOSAL;
case PLAN: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.PLAN;
case ORDER: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.ORDER;
case ORIGINALORDER: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.ORIGINALORDER;
case REFLEXORDER: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.REFLEXORDER;
case FILLERORDER: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.FILLERORDER;
case INSTANCEORDER: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.INSTANCEORDER;
case OPTION: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.OPTION;
default: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestIntent.NULL;
}
}
public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestPriority convertMedicationRequestPriority(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ROUTINE: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestPriority.ROUTINE;
case URGENT: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestPriority.URGENT;
case ASAP: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestPriority.ASAP;
case STAT: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestPriority.STAT;
default: return org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestPriority.NULL;
}
}
public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority convertMedicationRequestPriority(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestPriority src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ROUTINE: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.ROUTINE;
case URGENT: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.URGENT;
case ASAP: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.ASAP;
case STAT: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.STAT;
default: return org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestPriority.NULL;
}
}
public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent convertMedicationRequestDispenseRequestComponent(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent tgt = new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent();
copyElement(src, tgt);
if (src.hasInitialFill())
tgt.setInitialFill(convertMedicationRequestDispenseRequestInitialFillComponent(src.getInitialFill()));
if (src.hasDispenseInterval())
tgt.setDispenseInterval(convertDuration(src.getDispenseInterval()));
if (src.hasValidityPeriod())
tgt.setValidityPeriod(convertPeriod(src.getValidityPeriod()));
if (src.hasNumberOfRepeatsAllowed())
tgt.setNumberOfRepeatsAllowedElement(convertUnsignedInt(src.getNumberOfRepeatsAllowedElement()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasExpectedSupplyDuration())
tgt.setExpectedSupplyDuration(convertDuration(src.getExpectedSupplyDuration()));
if (src.hasPerformer())
tgt.setPerformer(convertReference(src.getPerformer()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent convertMedicationRequestDispenseRequestComponent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent tgt = new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent();
copyElement(src, tgt);
if (src.hasInitialFill())
tgt.setInitialFill(convertMedicationRequestDispenseRequestInitialFillComponent(src.getInitialFill()));
if (src.hasDispenseInterval())
tgt.setDispenseInterval(convertDuration(src.getDispenseInterval()));
if (src.hasValidityPeriod())
tgt.setValidityPeriod(convertPeriod(src.getValidityPeriod()));
if (src.hasNumberOfRepeatsAllowed())
tgt.setNumberOfRepeatsAllowedElement(convertUnsignedInt(src.getNumberOfRepeatsAllowedElement()));
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasExpectedSupplyDuration())
tgt.setExpectedSupplyDuration(convertDuration(src.getExpectedSupplyDuration()));
if (src.hasPerformer())
tgt.setPerformer(convertReference(src.getPerformer()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent convertMedicationRequestDispenseRequestInitialFillComponent(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent tgt = new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent();
copyElement(src, tgt);
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasDuration())
tgt.setDuration(convertDuration(src.getDuration()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent convertMedicationRequestDispenseRequestInitialFillComponent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent tgt = new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestInitialFillComponent();
copyElement(src, tgt);
if (src.hasQuantity())
tgt.setQuantity(convertSimpleQuantity(src.getQuantity()));
if (src.hasDuration())
tgt.setDuration(convertDuration(src.getDuration()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent convertMedicationRequestSubstitutionComponent(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestSubstitutionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent tgt = new org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent();
copyElement(src, tgt);
if (src.hasAllowed())
tgt.setAllowed(convertType(src.getAllowed()));
if (src.hasReason())
tgt.setReason(convertCodeableConcept(src.getReason()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestSubstitutionComponent convertMedicationRequestSubstitutionComponent(org.hl7.fhir.r5.model.MedicationRequest.MedicationRequestSubstitutionComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestSubstitutionComponent tgt = new org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestSubstitutionComponent();
copyElement(src, tgt);
if (src.hasAllowed())
tgt.setAllowed(convertType(src.getAllowed()));
if (src.hasReason())
tgt.setReason(convertCodeableConcept(src.getReason()));
return tgt;
}
}

View File

@ -0,0 +1,159 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class MedicationStatement extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.MedicationStatement convertMedicationStatement(org.hl7.fhir.r4.model.MedicationStatement src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicationStatement tgt = new org.hl7.fhir.r5.model.MedicationStatement();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getPartOf())
tgt.addPartOf(convertReference(t));
if (src.hasStatus())
tgt.setStatus(convertMedicationStatementStatus(src.getStatus()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getStatusReason())
tgt.addStatusReason(convertCodeableConcept(t));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasMedication())
tgt.setMedication(convertType(src.getMedication()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasContext())
tgt.setContext(convertReference(src.getContext()));
if (src.hasEffective())
tgt.setEffective(convertType(src.getEffective()));
if (src.hasDateAsserted())
tgt.setDateAssertedElement(convertDateTime(src.getDateAssertedElement()));
if (src.hasInformationSource())
tgt.setInformationSource(convertReference(src.getInformationSource()));
for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom())
tgt.addDerivedFrom(convertReference(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r4.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r4.model.Dosage t : src.getDosage())
tgt.addDosage(convertDosage(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicationStatement convertMedicationStatement(org.hl7.fhir.r5.model.MedicationStatement src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicationStatement tgt = new org.hl7.fhir.r4.model.MedicationStatement();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn())
tgt.addBasedOn(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getPartOf())
tgt.addPartOf(convertReference(t));
if (src.hasStatus())
tgt.setStatus(convertMedicationStatementStatus(src.getStatus()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason())
tgt.addStatusReason(convertCodeableConcept(t));
if (src.hasCategory())
tgt.setCategory(convertCodeableConcept(src.getCategory()));
if (src.hasMedication())
tgt.setMedication(convertType(src.getMedication()));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
if (src.hasContext())
tgt.setContext(convertReference(src.getContext()));
if (src.hasEffective())
tgt.setEffective(convertType(src.getEffective()));
if (src.hasDateAsserted())
tgt.setDateAssertedElement(convertDateTime(src.getDateAssertedElement()));
if (src.hasInformationSource())
tgt.setInformationSource(convertReference(src.getInformationSource()));
for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom())
tgt.addDerivedFrom(convertReference(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getReasonReference())
tgt.addReasonReference(convertReference(t));
for (org.hl7.fhir.r5.model.Annotation t : src.getNote())
tgt.addNote(convertAnnotation(t));
for (org.hl7.fhir.r5.model.Dosage t : src.getDosage())
tgt.addDosage(convertDosage(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatus convertMedicationStatementStatus(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatus.ACTIVE;
case COMPLETED: return org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR;
case INTENDED: return org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatus.INTENDED;
case STOPPED: return org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatus.STOPPED;
case ONHOLD: return org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatus.ONHOLD;
case UNKNOWN: return org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatus.UNKNOWN;
case NOTTAKEN: return org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatus.NOTTAKEN;
default: return org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatus.NULL;
}
}
public static org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus convertMedicationStatementStatus(org.hl7.fhir.r5.model.MedicationStatement.MedicationStatementStatus src) throws FHIRException {
if (src == null)
return null;
switch (src) {
case ACTIVE: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ACTIVE;
case COMPLETED: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.COMPLETED;
case ENTEREDINERROR: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR;
case INTENDED: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.INTENDED;
case STOPPED: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.STOPPED;
case ONHOLD: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ONHOLD;
case UNKNOWN: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.UNKNOWN;
case NOTTAKEN: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.NOTTAKEN;
default: return org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.NULL;
}
}
}

View File

@ -0,0 +1,303 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class MedicinalProduct extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.MedicinalProduct convertMedicinalProduct(org.hl7.fhir.r4.model.MedicinalProduct src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicinalProduct tgt = new org.hl7.fhir.r5.model.MedicinalProduct();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasDomain())
tgt.setDomain(convertCoding(src.getDomain()));
if (src.hasCombinedPharmaceuticalDoseForm())
tgt.setCombinedPharmaceuticalDoseForm(convertCodeableConcept(src.getCombinedPharmaceuticalDoseForm()));
if (src.hasLegalStatusOfSupply())
tgt.setLegalStatusOfSupply(convertCodeableConcept(src.getLegalStatusOfSupply()));
if (src.hasAdditionalMonitoringIndicator())
tgt.setAdditionalMonitoringIndicator(convertCodeableConcept(src.getAdditionalMonitoringIndicator()));
for (org.hl7.fhir.r4.model.StringType t : src.getSpecialMeasures())
tgt.getSpecialMeasures().add(convertString(t));
if (src.hasPaediatricUseIndicator())
tgt.setPaediatricUseIndicator(convertCodeableConcept(src.getPaediatricUseIndicator()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProductClassification())
tgt.addProductClassification(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.MarketingStatus t : src.getMarketingStatus())
tgt.addMarketingStatus(convertMarketingStatus(t));
for (org.hl7.fhir.r4.model.Reference t : src.getPharmaceuticalProduct())
tgt.addPharmaceuticalProduct(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getPackagedMedicinalProduct())
tgt.addPackagedMedicinalProduct(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getAttachedDocument())
tgt.addAttachedDocument(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getMasterFile())
tgt.addMasterFile(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getContact())
tgt.addContact(convertReference(t));
for (org.hl7.fhir.r4.model.Reference t : src.getClinicalTrial())
tgt.addClinicalTrial(convertReference(t));
for (org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameComponent t : src.getName())
tgt.addName(convertMedicinalProductNameComponent(t));
for (org.hl7.fhir.r4.model.Identifier t : src.getCrossReference())
tgt.addCrossReference(convertIdentifier(t));
for (org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent t : src.getManufacturingBusinessOperation())
tgt.addManufacturingBusinessOperation(convertMedicinalProductManufacturingBusinessOperationComponent(t));
for (org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductSpecialDesignationComponent t : src.getSpecialDesignation())
tgt.addSpecialDesignation(convertMedicinalProductSpecialDesignationComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicinalProduct convertMedicinalProduct(org.hl7.fhir.r5.model.MedicinalProduct src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicinalProduct tgt = new org.hl7.fhir.r4.model.MedicinalProduct();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasDomain())
tgt.setDomain(convertCoding(src.getDomain()));
if (src.hasCombinedPharmaceuticalDoseForm())
tgt.setCombinedPharmaceuticalDoseForm(convertCodeableConcept(src.getCombinedPharmaceuticalDoseForm()));
if (src.hasLegalStatusOfSupply())
tgt.setLegalStatusOfSupply(convertCodeableConcept(src.getLegalStatusOfSupply()));
if (src.hasAdditionalMonitoringIndicator())
tgt.setAdditionalMonitoringIndicator(convertCodeableConcept(src.getAdditionalMonitoringIndicator()));
for (org.hl7.fhir.r5.model.StringType t : src.getSpecialMeasures())
tgt.getSpecialMeasures().add(convertString(t));
if (src.hasPaediatricUseIndicator())
tgt.setPaediatricUseIndicator(convertCodeableConcept(src.getPaediatricUseIndicator()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProductClassification())
tgt.addProductClassification(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.MarketingStatus t : src.getMarketingStatus())
tgt.addMarketingStatus(convertMarketingStatus(t));
for (org.hl7.fhir.r5.model.Reference t : src.getPharmaceuticalProduct())
tgt.addPharmaceuticalProduct(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getPackagedMedicinalProduct())
tgt.addPackagedMedicinalProduct(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getAttachedDocument())
tgt.addAttachedDocument(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getMasterFile())
tgt.addMasterFile(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getContact())
tgt.addContact(convertReference(t));
for (org.hl7.fhir.r5.model.Reference t : src.getClinicalTrial())
tgt.addClinicalTrial(convertReference(t));
for (org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameComponent t : src.getName())
tgt.addName(convertMedicinalProductNameComponent(t));
for (org.hl7.fhir.r5.model.Identifier t : src.getCrossReference())
tgt.addCrossReference(convertIdentifier(t));
for (org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent t : src.getManufacturingBusinessOperation())
tgt.addManufacturingBusinessOperation(convertMedicinalProductManufacturingBusinessOperationComponent(t));
for (org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductSpecialDesignationComponent t : src.getSpecialDesignation())
tgt.addSpecialDesignation(convertMedicinalProductSpecialDesignationComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameComponent convertMedicinalProductNameComponent(org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameComponent tgt = new org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameComponent();
copyElement(src, tgt);
if (src.hasProductName())
tgt.setProductNameElement(convertString(src.getProductNameElement()));
for (org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameNamePartComponent t : src.getNamePart())
tgt.addNamePart(convertMedicinalProductNameNamePartComponent(t));
for (org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameCountryLanguageComponent t : src.getCountryLanguage())
tgt.addCountryLanguage(convertMedicinalProductNameCountryLanguageComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameComponent convertMedicinalProductNameComponent(org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameComponent tgt = new org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameComponent();
copyElement(src, tgt);
if (src.hasProductName())
tgt.setProductNameElement(convertString(src.getProductNameElement()));
for (org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameNamePartComponent t : src.getNamePart())
tgt.addNamePart(convertMedicinalProductNameNamePartComponent(t));
for (org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameCountryLanguageComponent t : src.getCountryLanguage())
tgt.addCountryLanguage(convertMedicinalProductNameCountryLanguageComponent(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameNamePartComponent convertMedicinalProductNameNamePartComponent(org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameNamePartComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameNamePartComponent tgt = new org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameNamePartComponent();
copyElement(src, tgt);
if (src.hasPart())
tgt.setPartElement(convertString(src.getPartElement()));
if (src.hasType())
tgt.setType(convertCoding(src.getType()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameNamePartComponent convertMedicinalProductNameNamePartComponent(org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameNamePartComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameNamePartComponent tgt = new org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameNamePartComponent();
copyElement(src, tgt);
if (src.hasPart())
tgt.setPartElement(convertString(src.getPartElement()));
if (src.hasType())
tgt.setType(convertCoding(src.getType()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameCountryLanguageComponent convertMedicinalProductNameCountryLanguageComponent(org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameCountryLanguageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameCountryLanguageComponent tgt = new org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameCountryLanguageComponent();
copyElement(src, tgt);
if (src.hasCountry())
tgt.setCountry(convertCodeableConcept(src.getCountry()));
if (src.hasJurisdiction())
tgt.setJurisdiction(convertCodeableConcept(src.getJurisdiction()));
if (src.hasLanguage())
tgt.setLanguage(convertCodeableConcept(src.getLanguage()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameCountryLanguageComponent convertMedicinalProductNameCountryLanguageComponent(org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductNameCountryLanguageComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameCountryLanguageComponent tgt = new org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameCountryLanguageComponent();
copyElement(src, tgt);
if (src.hasCountry())
tgt.setCountry(convertCodeableConcept(src.getCountry()));
if (src.hasJurisdiction())
tgt.setJurisdiction(convertCodeableConcept(src.getJurisdiction()));
if (src.hasLanguage())
tgt.setLanguage(convertCodeableConcept(src.getLanguage()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent convertMedicinalProductManufacturingBusinessOperationComponent(org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent tgt = new org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent();
copyElement(src, tgt);
if (src.hasOperationType())
tgt.setOperationType(convertCodeableConcept(src.getOperationType()));
if (src.hasAuthorisationReferenceNumber())
tgt.setAuthorisationReferenceNumber(convertIdentifier(src.getAuthorisationReferenceNumber()));
if (src.hasEffectiveDate())
tgt.setEffectiveDateElement(convertDateTime(src.getEffectiveDateElement()));
if (src.hasConfidentialityIndicator())
tgt.setConfidentialityIndicator(convertCodeableConcept(src.getConfidentialityIndicator()));
for (org.hl7.fhir.r4.model.Reference t : src.getManufacturer())
tgt.addManufacturer(convertReference(t));
if (src.hasRegulator())
tgt.setRegulator(convertReference(src.getRegulator()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent convertMedicinalProductManufacturingBusinessOperationComponent(org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent tgt = new org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent();
copyElement(src, tgt);
if (src.hasOperationType())
tgt.setOperationType(convertCodeableConcept(src.getOperationType()));
if (src.hasAuthorisationReferenceNumber())
tgt.setAuthorisationReferenceNumber(convertIdentifier(src.getAuthorisationReferenceNumber()));
if (src.hasEffectiveDate())
tgt.setEffectiveDateElement(convertDateTime(src.getEffectiveDateElement()));
if (src.hasConfidentialityIndicator())
tgt.setConfidentialityIndicator(convertCodeableConcept(src.getConfidentialityIndicator()));
for (org.hl7.fhir.r5.model.Reference t : src.getManufacturer())
tgt.addManufacturer(convertReference(t));
if (src.hasRegulator())
tgt.setRegulator(convertReference(src.getRegulator()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductSpecialDesignationComponent convertMedicinalProductSpecialDesignationComponent(org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductSpecialDesignationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductSpecialDesignationComponent tgt = new org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductSpecialDesignationComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasIntendedUse())
tgt.setIntendedUse(convertCodeableConcept(src.getIntendedUse()));
if (src.hasIndication())
tgt.setIndication(convertType(src.getIndication()));
if (src.hasStatus())
tgt.setStatus(convertCodeableConcept(src.getStatus()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasSpecies())
tgt.setSpecies(convertCodeableConcept(src.getSpecies()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductSpecialDesignationComponent convertMedicinalProductSpecialDesignationComponent(org.hl7.fhir.r5.model.MedicinalProduct.MedicinalProductSpecialDesignationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductSpecialDesignationComponent tgt = new org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductSpecialDesignationComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasIntendedUse())
tgt.setIntendedUse(convertCodeableConcept(src.getIntendedUse()));
if (src.hasIndication())
tgt.setIndication(convertType(src.getIndication()));
if (src.hasStatus())
tgt.setStatus(convertCodeableConcept(src.getStatus()));
if (src.hasDate())
tgt.setDateElement(convertDateTime(src.getDateElement()));
if (src.hasSpecies())
tgt.setSpecies(convertCodeableConcept(src.getSpecies()));
return tgt;
}
}

View File

@ -0,0 +1,191 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class MedicinalProductAuthorization extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.MedicinalProductAuthorization convertMedicinalProductAuthorization(org.hl7.fhir.r4.model.MedicinalProductAuthorization src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicinalProductAuthorization tgt = new org.hl7.fhir.r5.model.MedicinalProductAuthorization();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCountry())
tgt.addCountry(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasStatus())
tgt.setStatus(convertCodeableConcept(src.getStatus()));
if (src.hasStatusDate())
tgt.setStatusDateElement(convertDateTime(src.getStatusDateElement()));
if (src.hasRestoreDate())
tgt.setRestoreDateElement(convertDateTime(src.getRestoreDateElement()));
if (src.hasValidityPeriod())
tgt.setValidityPeriod(convertPeriod(src.getValidityPeriod()));
if (src.hasDataExclusivityPeriod())
tgt.setDataExclusivityPeriod(convertPeriod(src.getDataExclusivityPeriod()));
if (src.hasDateOfFirstAuthorization())
tgt.setDateOfFirstAuthorizationElement(convertDateTime(src.getDateOfFirstAuthorizationElement()));
if (src.hasInternationalBirthDate())
tgt.setInternationalBirthDateElement(convertDateTime(src.getInternationalBirthDateElement()));
if (src.hasLegalBasis())
tgt.setLegalBasis(convertCodeableConcept(src.getLegalBasis()));
for (org.hl7.fhir.r4.model.MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent t : src.getJurisdictionalAuthorization())
tgt.addJurisdictionalAuthorization(convertMedicinalProductAuthorizationJurisdictionalAuthorizationComponent(t));
if (src.hasHolder())
tgt.setHolder(convertReference(src.getHolder()));
if (src.hasRegulator())
tgt.setRegulator(convertReference(src.getRegulator()));
if (src.hasProcedure())
tgt.setProcedure(convertMedicinalProductAuthorizationProcedureComponent(src.getProcedure()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicinalProductAuthorization convertMedicinalProductAuthorization(org.hl7.fhir.r5.model.MedicinalProductAuthorization src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicinalProductAuthorization tgt = new org.hl7.fhir.r4.model.MedicinalProductAuthorization();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasSubject())
tgt.setSubject(convertReference(src.getSubject()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCountry())
tgt.addCountry(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasStatus())
tgt.setStatus(convertCodeableConcept(src.getStatus()));
if (src.hasStatusDate())
tgt.setStatusDateElement(convertDateTime(src.getStatusDateElement()));
if (src.hasRestoreDate())
tgt.setRestoreDateElement(convertDateTime(src.getRestoreDateElement()));
if (src.hasValidityPeriod())
tgt.setValidityPeriod(convertPeriod(src.getValidityPeriod()));
if (src.hasDataExclusivityPeriod())
tgt.setDataExclusivityPeriod(convertPeriod(src.getDataExclusivityPeriod()));
if (src.hasDateOfFirstAuthorization())
tgt.setDateOfFirstAuthorizationElement(convertDateTime(src.getDateOfFirstAuthorizationElement()));
if (src.hasInternationalBirthDate())
tgt.setInternationalBirthDateElement(convertDateTime(src.getInternationalBirthDateElement()));
if (src.hasLegalBasis())
tgt.setLegalBasis(convertCodeableConcept(src.getLegalBasis()));
for (org.hl7.fhir.r5.model.MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent t : src.getJurisdictionalAuthorization())
tgt.addJurisdictionalAuthorization(convertMedicinalProductAuthorizationJurisdictionalAuthorizationComponent(t));
if (src.hasHolder())
tgt.setHolder(convertReference(src.getHolder()));
if (src.hasRegulator())
tgt.setRegulator(convertReference(src.getRegulator()));
if (src.hasProcedure())
tgt.setProcedure(convertMedicinalProductAuthorizationProcedureComponent(src.getProcedure()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent convertMedicinalProductAuthorizationJurisdictionalAuthorizationComponent(org.hl7.fhir.r4.model.MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent tgt = new org.hl7.fhir.r5.model.MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasCountry())
tgt.setCountry(convertCodeableConcept(src.getCountry()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasLegalStatusOfSupply())
tgt.setLegalStatusOfSupply(convertCodeableConcept(src.getLegalStatusOfSupply()));
if (src.hasValidityPeriod())
tgt.setValidityPeriod(convertPeriod(src.getValidityPeriod()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent convertMedicinalProductAuthorizationJurisdictionalAuthorizationComponent(org.hl7.fhir.r5.model.MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent tgt = new org.hl7.fhir.r4.model.MedicinalProductAuthorization.MedicinalProductAuthorizationJurisdictionalAuthorizationComponent();
copyElement(src, tgt);
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(convertIdentifier(t));
if (src.hasCountry())
tgt.setCountry(convertCodeableConcept(src.getCountry()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getJurisdiction())
tgt.addJurisdiction(convertCodeableConcept(t));
if (src.hasLegalStatusOfSupply())
tgt.setLegalStatusOfSupply(convertCodeableConcept(src.getLegalStatusOfSupply()));
if (src.hasValidityPeriod())
tgt.setValidityPeriod(convertPeriod(src.getValidityPeriod()));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent convertMedicinalProductAuthorizationProcedureComponent(org.hl7.fhir.r4.model.MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent tgt = new org.hl7.fhir.r5.model.MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent();
copyElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasDate())
tgt.setDate(convertType(src.getDate()));
for (org.hl7.fhir.r4.model.MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent t : src.getApplication())
tgt.addApplication(convertMedicinalProductAuthorizationProcedureComponent(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent convertMedicinalProductAuthorizationProcedureComponent(org.hl7.fhir.r5.model.MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent tgt = new org.hl7.fhir.r4.model.MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent();
copyElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(convertIdentifier(src.getIdentifier()));
if (src.hasType())
tgt.setType(convertCodeableConcept(src.getType()));
if (src.hasDate())
tgt.setDate(convertType(src.getDate()));
for (org.hl7.fhir.r5.model.MedicinalProductAuthorization.MedicinalProductAuthorizationProcedureComponent t : src.getApplication())
tgt.addApplication(convertMedicinalProductAuthorizationProcedureComponent(t));
return tgt;
}
}

View File

@ -0,0 +1,111 @@
package org.hl7.fhir.convertors.conv40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.convertors.VersionConvertor_40_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.
*/
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
public class MedicinalProductContraindication extends VersionConvertor_40_50 {
public static org.hl7.fhir.r5.model.MedicinalProductContraindication convertMedicinalProductContraindication(org.hl7.fhir.r4.model.MedicinalProductContraindication src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicinalProductContraindication tgt = new org.hl7.fhir.r5.model.MedicinalProductContraindication();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r4.model.Reference t : src.getSubject())
tgt.addSubject(convertReference(t));
if (src.hasDisease())
tgt.setDisease(convertCodeableConcept(src.getDisease()));
if (src.hasDiseaseStatus())
tgt.setDiseaseStatus(convertCodeableConcept(src.getDiseaseStatus()));
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getComorbidity())
tgt.addComorbidity(convertCodeableConcept(t));
for (org.hl7.fhir.r4.model.Reference t : src.getTherapeuticIndication())
tgt.addTherapeuticIndication(convertReference(t));
for (org.hl7.fhir.r4.model.MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent t : src.getOtherTherapy())
tgt.addOtherTherapy(convertMedicinalProductContraindicationOtherTherapyComponent(t));
for (org.hl7.fhir.r4.model.Population t : src.getPopulation())
tgt.addPopulation(convertPopulation(t));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicinalProductContraindication convertMedicinalProductContraindication(org.hl7.fhir.r5.model.MedicinalProductContraindication src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicinalProductContraindication tgt = new org.hl7.fhir.r4.model.MedicinalProductContraindication();
copyDomainResource(src, tgt);
for (org.hl7.fhir.r5.model.Reference t : src.getSubject())
tgt.addSubject(convertReference(t));
if (src.hasDisease())
tgt.setDisease(convertCodeableConcept(src.getDisease()));
if (src.hasDiseaseStatus())
tgt.setDiseaseStatus(convertCodeableConcept(src.getDiseaseStatus()));
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getComorbidity())
tgt.addComorbidity(convertCodeableConcept(t));
for (org.hl7.fhir.r5.model.Reference t : src.getTherapeuticIndication())
tgt.addTherapeuticIndication(convertReference(t));
for (org.hl7.fhir.r5.model.MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent t : src.getOtherTherapy())
tgt.addOtherTherapy(convertMedicinalProductContraindicationOtherTherapyComponent(t));
for (org.hl7.fhir.r5.model.Population t : src.getPopulation())
tgt.addPopulation(convertPopulation(t));
return tgt;
}
public static org.hl7.fhir.r5.model.MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent convertMedicinalProductContraindicationOtherTherapyComponent(org.hl7.fhir.r4.model.MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent tgt = new org.hl7.fhir.r5.model.MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent();
copyElement(src, tgt);
if (src.hasTherapyRelationshipType())
tgt.setTherapyRelationshipType(convertCodeableConcept(src.getTherapyRelationshipType()));
if (src.hasMedication())
tgt.setMedication(convertType(src.getMedication()));
return tgt;
}
public static org.hl7.fhir.r4.model.MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent convertMedicinalProductContraindicationOtherTherapyComponent(org.hl7.fhir.r5.model.MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r4.model.MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent tgt = new org.hl7.fhir.r4.model.MedicinalProductContraindication.MedicinalProductContraindicationOtherTherapyComponent();
copyElement(src, tgt);
if (src.hasTherapyRelationshipType())
tgt.setTherapyRelationshipType(convertCodeableConcept(src.getTherapyRelationshipType()));
if (src.hasMedication())
tgt.setMedication(convertType(src.getMedication()));
return tgt;
}
}

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