Conversion library overhaul (#568)

* wip

* adding pathing to 40_50 conversion

* wip

* 30_50 and 40_50 updated to factory

* 30_40 factory

* 14_50

* 14_40

* 14_30, 10_50

* 10_40

* 10_30

* forcing non-null on VersionConvertors

* *trying* to clean up advisor code, switching from jetbrains NotNull to javax Nonnull annotation

* all calls within convertor classes should use INSTANCE access, not factory to maintain thread safety

* adding README for conversion library

* spacing

* threaded test removal

* release notes

* Update RELEASE_NOTES.md

Co-authored-by: Tadgh <tadgh@cs.toronto.edu>

* Update RELEASE_NOTES.md

Co-authored-by: Tadgh <tadgh@cs.toronto.edu>

* Update org.hl7.fhir.convertors/CONVERTORS.md

Co-authored-by: Tadgh <tadgh@cs.toronto.edu>

* Update org.hl7.fhir.convertors/CONVERTORS.md

Co-authored-by: Tadgh <tadgh@cs.toronto.edu>

* Update org.hl7.fhir.convertors/CONVERTORS.md

Co-authored-by: Tadgh <tadgh@cs.toronto.edu>

Co-authored-by: Tadgh <tadgh@cs.toronto.edu>
This commit is contained in:
Mark Iantorno 2021-08-06 19:28:24 -04:00 committed by GitHub
parent 99fcac64ac
commit 58c0e216e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1119 changed files with 153903 additions and 145326 deletions

View File

@ -0,0 +1,6 @@
* Conversion context added to conversions process
* Users can now define custom behavior for CodeSystems, Extensions, BundleEntries, and Types by extending BaseAdvisor.
* Resource Conversions are now thread-safe, each using their own instance of the conversion context that is unique
* ConversionFactory classes are statically accessed, to minimize changes downstream
* I need to add more tests, there were very few to begin with, and it's my next task
* All conversion libraries and no play makes Mark a dull boy

View File

@ -0,0 +1,195 @@
# Resource Conversion
##### Let's talk about converting resources between the various versions of FHIR...
### A note regarding syntax
-----
Within the code, we use a set naming convention to organize the classes used for conversion between the various versions
of FHIR.
| Version | Code |
| :--- | :---: |
| dstu2 | 10 |
| dstu2016may | 14 |
| dstu3 | 30 |
| r4 | 40 |
| r5 | 50 |
The files themselves follow the naming convention:
`(NAME)` + `(VERSION CODE)` + `_` + `(VERSION CODE)`
Where `NAME` is the proper name of the resource or datatype being converted, and the two `VERSION CODE` indicate the two
versions of FHIR that the code will convert the given resource or datatype between.
So, in the repository, you may come across a file name `Account30_40`. This would indicate that the code in this
file is related to the conversion of the Account resource between versions [dstu3](http://hl7.org/fhir/STU3/account.html)
and [r4](http://hl7.org/fhir/R4/account.html)
**N.B.** This information is only for code navigation purposes. It is important that when converting between versions
you use the provided conversion factory classes as your entry point.
### Using the conversion library
-----
The majority of use cases for conversion will involve using the provided VersionConvertorFactory_V1_V2 classes to convert
to and from the various versions of FHIR.
They provide two statically accessed base methods for converting resources:
`public static (V1 Resource) convertResource((V2 Resource) src)`
`public static (V2 Resource) convertResource((V1 Resource) src)`
as well as two statically accessed base methods for converting types:
`public static (V1 Type) convertType((V2 Type) src)`
`public static (V2 Type) convertType((V1 Type) src)`
It's important to note that these methods convert from the base `Resource` of one version to the base `Resource` of
another version, or from the base `Type` of one version to the base `Type` of another version (or `DataType` in the
case of r5), so the result will need to be cast to the correct class.
Example:
```java
// Converting a r5 StructureDefinition to dstu3.
org.hl7.fhir.r5.model.StructureDefinition r5_structure_def = new StructureDefinition();
org.hl7.fhir.dstu3.model.StructureDefinition dstu3_converted_structure_def
= (StructureDefinition) VersionConvertorFactory_30_50.convertResource(r5_structure_def);
```
### It gets complicated...
-----
As the specification has evolved over time, the versions of FHIR have built on top of one another, adding new fields
within existing resources, changing the name of existing resources, or adding entirely new resources altogether. As a
result of this conversions are inherently lossy operations.
A quick example of this would be [ValueSet Expression](https://www.hl7.org/fhir/extension-valueset-expression.html)
extension type. This exists in the r4 version of the specification, but no such type exists in dstu2.
If we were to convert a R4 resource, such as a questionnaire, that contained an extension of this type from r4 -> dstu2,
without any special intervention, the extension would be ignored, and the data would be lost in the conversion process.
This is where advisors come in.
### Using conversion advisors
-----
When you call the base conversion factory methods `convertType(...)` or `convertResource(...)`, the library does a
predefined conversion, using the standard conversion (which could be a lossy one, or one that makes assumptions).
These defaults/assumptions are defined in the convertor advisor classes. Each pair of versions has a BaseAdvisor, which
is used by default when you call the factory methods. For example, here is the advisor class which handles conversions
between dstu2 and r5:
```java
public class BaseAdvisor_10_50 extends BaseAdvisor50<org.hl7.fhir.dstu2.model.Extension> {
final List<String> conformanceIgnoredUrls = Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown");
private final List<Class<?>> ignoredExtensionTypes = new ArrayList<>(Collections.singletonList(Expression.class));
public BaseAdvisor_10_50() {
}
public BaseAdvisor_10_50(Boolean failFast) {
this.failFast = failFast;
}
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) {
List<String> paths = Arrays.asList(path.split(","));
return (paths.get(paths.size() - 1).equals("Conformance")) && (conformanceIgnoredUrls.contains(url));
}
public boolean ignoreType(@Nonnull String path,
@Nonnull DataType type) {
return ignoredExtensionTypes.contains(type.getClass());
}
}
```
You can see in the above, that when converting extensions, we check if the given conversion is for a `Conformance`
resource, and if we are converting an `Extension` within that `Conformance` with a set url, we ignore it.
As mentioned above, we provide a stock set of implied conversion rules that are used by default. However, there may be
cases where you need to add specific behavior to your conversion. Within the `BaseAdvisor` class, there exist a number
of overrideable methods that can be used to modify the outcome of any given conversion:
```java
public void handleCodeSystem(@Nonnull CodeSystem tgtcs, @Nonnull ValueSet source)
public boolean ignoreEntry(@Nonnull Bundle.BundleEntryComponent src, @Nonnull FhirPublication targetVersion)
public CodeSystem getCodeSystem(@Nonnull ValueSet src) throws FHIRException
public boolean ignoreExtension(@Nonnull String path, @Nonnull Extension ext) throws FHIRException
public boolean ignoreExtension(@Nonnull String path, @Nonnull T ext) throws FHIRException
public boolean ignoreExtension(@Nonnull String path, @Nonnull String url) throws FHIRException
public boolean ignoreType(@Nonnull String path, @Nonnull DataType type) throws FHIRException
public boolean ignoreType(@Nonnull String path, @Nonnull Object type) throws FHIRException
public boolean useAdvisorForExtension(@Nonnull String path, @Nonnull Extension ext) throws FHIRException
public boolean useAdvisorForExtension(@Nonnull String path, @Nonnull T ext) throws FHIRException
public void handleExtension(@Nonnull String path, @Nonnull Extension src, @Nonnull T tgt) throws FHIRException
public void handleExtension(@Nonnull String path, @Nonnull T src, @Nonnull Extension tgt) throws FHIRException
```
Through overriding these methods and implementing your own custom advisor, you can customize the output of any given
conversion operation to suit your specific usecase.
For example, above we briefly mentioned [ValueSet Expression](https://www.hl7.org/fhir/extension-valueset-expression.html)
extension type. This exists in the r4 version of the specification, but no such type exists in dstu2.
Our stock advisor just ignores this extension when converting from r5 to dstu2. However, if we wanted, we could create
our own conversion advisor, as follows:
```java
public class ExpressionAdvisor50 extends BaseAdvisor_10_50 {
public boolean useAdvisorForExtension(@Nonnull String path, @Nonnull org.hl7.fhir.r5.model.Extension ext) {
return ext.hasValue() && ext.getValue() instanceof org.hl7.fhir.r5.model.Expression;
}
public void handleExtension(@Nonnull String path,
@Nonnull org.hl7.fhir.r5.model.Extension src,
@Nonnull org.hl7.fhir.dstu2.model.Extension tgt) {
if (src.getValue() instanceof org.hl7.fhir.r5.model.Expression) {
StringType type = new StringType();
if (src.getValue() == null) {
throw new NullPointerException("null cannot be cast to non-null type org.hl7.fhir.r5.model.Expression");
} else {
type.setValueAsString(((Expression) src.getValue()).getExpression());
tgt.setValue(type);
if (src.hasUrlElement()) {
tgt.setUrlElement(Uri10_50.convertUri(src.getUrlElement()));
}
}
} else {
throw new FHIRException("Unknown extension type passed in to custom convertor method.");
}
}
}
```
Here, we first check to see if the extension is of type `org.hl7.fhir.r5.model.Expression` and has a value set in the
`useAdvisorForExtension` method, then in the `handleExtension` method, we manually create a `StringType` extension, and
copy the value from the r5 `Expression` into it. This results in no data being lost, and a the new custom conversion
behavior for our particular usecase.
Once you've created your new advisor, they can be provided as an argument when calling the conversion factory classes.
`public static (V1 Resource) convertResource((V2 Resource) src, <T extends BaseAdvisor> advisor)`
`public static (V2 Resource) convertResource((V1 Resource) src, <T extends BaseAdvisor> advisor)`

View File

@ -34,14 +34,13 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_40;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_40;
import org.hl7.fhir.convertors.conv10_40.VersionConvertor_10_40;
import org.hl7.fhir.convertors.conv14_40.VersionConvertor_14_40;
import org.hl7.fhir.convertors.conv30_40.VersionConvertor_30_40;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_40;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_14_40;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_40;
import org.hl7.fhir.convertors.loaders.R2016MayToR4Loader;
import org.hl7.fhir.convertors.loaders.R2ToR4Loader;
import org.hl7.fhir.convertors.loaders.R3ToR4Loader;
import org.hl7.fhir.convertors.misc.IGR2ConvertorAdvisor;
import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.conformance.ProfileUtilities;
import org.hl7.fhir.r4.context.BaseWorkerContext;
@ -72,15 +71,23 @@ import java.util.*;
public class ExtensionDefinitionGenerator {
private FHIRVersion sourceVersion;
private FHIRVersion targetVersion;
private String filename;
private StructureDefinition extbase;
private ElementDefinition extv;
private ProfileUtilities pu;
private BaseWorkerContext context;
public static void main(String[] args) throws IOException, FHIRException {
if (args.length == 0) {
System.out.println("Extension Generator");
System.out.println("===================");
System.out.println("");
System.out.println();
System.out.println("See http://hl7.org/fhir/versions.html#extensions. This generates the packages");
System.out.println("");
System.out.println();
System.out.println("parameters: -srcver [version] -tgtver [version] -package [filename]");
System.out.println("");
System.out.println();
System.out.println("srcver: the source version to load");
System.out.println("tgtver: the version to generate extension definitions for");
System.out.println("package: the package to produce");
@ -93,7 +100,6 @@ public class ExtensionDefinitionGenerator {
}
}
private static String getNamedParam(String[] args, String param) {
boolean found = false;
for (String a : args) {
@ -106,14 +112,6 @@ public class ExtensionDefinitionGenerator {
throw new Error("Unable to find parameter " + param);
}
private FHIRVersion sourceVersion;
private FHIRVersion targetVersion;
private String filename;
private StructureDefinition extbase;
private ElementDefinition extv;
private ProfileUtilities pu;
private BaseWorkerContext context;
public FHIRVersion getSourceVersion() {
return sourceVersion;
}
@ -148,7 +146,7 @@ public class ExtensionDefinitionGenerator {
}
private List<StructureDefinition> buildExtensions(List<StructureDefinition> definitions) throws DefinitionException, FHIRException {
private List<StructureDefinition> buildExtensions(List<StructureDefinition> definitions) throws FHIRException {
Set<String> types = new HashSet<>();
List<StructureDefinition> list = new ArrayList<>();
for (StructureDefinition type : definitions)
@ -160,7 +158,7 @@ public class ExtensionDefinitionGenerator {
}
private void buildExtensions(StructureDefinition type, List<StructureDefinition> list) throws DefinitionException, FHIRException {
private void buildExtensions(StructureDefinition type, List<StructureDefinition> list) throws FHIRException {
for (ElementDefinition ed : type.getDifferential().getElement()) {
if (ed.getPath().contains(".")) {
if (!ed.getPath().endsWith(".extension") && !ed.getPath().endsWith(".modifierExtension")) {
@ -174,7 +172,7 @@ public class ExtensionDefinitionGenerator {
}
}
private StructureDefinition generateExtension(StructureDefinition type, ElementDefinition ed) throws DefinitionException, FHIRException {
private StructureDefinition generateExtension(StructureDefinition type, ElementDefinition ed) throws FHIRException {
StructureDefinition ext = new StructureDefinition();
ext.setId("extension-" + ed.getPath().replace("[x]", ""));
ext.setUrl("http://hl7.org/fhir/" + sourceVersion.toCode(3) + "/StructureDefinition/" + ext.getId());
@ -405,14 +403,14 @@ public class ExtensionDefinitionGenerator {
private byte[] saveResource(Resource resource, FHIRVersion v) throws IOException, FHIRException {
if (v == FHIRVersion._3_0_1) {
org.hl7.fhir.dstu3.model.Resource res = VersionConvertor_30_40.convertResource(resource, new BaseAdvisor_30_40(false));
org.hl7.fhir.dstu3.model.Resource res = VersionConvertorFactory_30_40.convertResource(resource, new BaseAdvisor_30_40(false));
return new org.hl7.fhir.dstu3.formats.JsonParser().composeBytes(res);
} else if (v == FHIRVersion._1_4_0) {
org.hl7.fhir.dstu2016may.model.Resource res = VersionConvertor_14_40.convertResource(resource);
org.hl7.fhir.dstu2016may.model.Resource res = VersionConvertorFactory_14_40.convertResource(resource);
return new org.hl7.fhir.dstu2016may.formats.JsonParser().composeBytes(res);
} else if (v == FHIRVersion._1_0_2) {
BaseAdvisor_10_40 advisor = new IGR2ConvertorAdvisor();
org.hl7.fhir.dstu2.model.Resource res = VersionConvertor_10_40.convertResource(resource, advisor);
org.hl7.fhir.dstu2.model.Resource res = VersionConvertorFactory_10_40.convertResource(resource, advisor);
return new org.hl7.fhir.dstu2.formats.JsonParser().composeBytes(res);
} else if (v == FHIRVersion._4_0_0) {
return new JsonParser().composeBytes(resource);
@ -423,14 +421,14 @@ public class ExtensionDefinitionGenerator {
private Resource loadResource(InputStream inputStream, FHIRVersion v) throws IOException, FHIRException {
if (v == FHIRVersion._3_0_1) {
org.hl7.fhir.dstu3.model.Resource res = new org.hl7.fhir.dstu3.formats.JsonParser().parse(inputStream);
return VersionConvertor_30_40.convertResource(res, new BaseAdvisor_30_40(false));
return VersionConvertorFactory_30_40.convertResource(res, new BaseAdvisor_30_40(false));
} else if (v == FHIRVersion._1_4_0) {
org.hl7.fhir.dstu2016may.model.Resource res = new org.hl7.fhir.dstu2016may.formats.JsonParser().parse(inputStream);
return VersionConvertor_14_40.convertResource(res);
return VersionConvertorFactory_14_40.convertResource(res);
} else if (v == FHIRVersion._1_0_2) {
org.hl7.fhir.dstu2.model.Resource res = new org.hl7.fhir.dstu2.formats.JsonParser().parse(inputStream);
BaseAdvisor_10_40 advisor = new IGR2ConvertorAdvisor();
return VersionConvertor_10_40.convertResource(res, advisor);
return VersionConvertorFactory_10_40.convertResource(res, advisor);
} else if (v == FHIRVersion._4_0_0) {
return new JsonParser().parse(inputStream);
} else

View File

@ -29,23 +29,6 @@ package org.hl7.fhir.convertors;
*/
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import org.hl7.fhir.convertors.loaders.R2ToR3Loader;
import org.hl7.fhir.dstu3.context.SimpleWorkerContext;
import org.hl7.fhir.dstu3.elementmodel.Manager;
@ -53,49 +36,88 @@ import org.hl7.fhir.dstu3.elementmodel.Manager.FhirFormat;
import org.hl7.fhir.dstu3.formats.FormatUtilities;
import org.hl7.fhir.dstu3.formats.IParser.OutputStyle;
import org.hl7.fhir.dstu3.formats.JsonParser;
import org.hl7.fhir.dstu3.model.Base;
import org.hl7.fhir.dstu3.model.Coding;
import org.hl7.fhir.dstu3.model.ExpansionProfile;
import org.hl7.fhir.dstu3.model.MetadataResource;
import org.hl7.fhir.dstu3.model.PractitionerRole;
import org.hl7.fhir.dstu3.model.Resource;
import org.hl7.fhir.dstu3.model.ResourceFactory;
import org.hl7.fhir.dstu3.model.StructureDefinition;
import org.hl7.fhir.dstu3.model.*;
import org.hl7.fhir.dstu3.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.dstu3.model.StructureMap;
import org.hl7.fhir.dstu3.model.UriType;
import org.hl7.fhir.dstu3.utils.StructureMapUtilities;
import org.hl7.fhir.dstu3.utils.StructureMapUtilities.ITransformerServices;
import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.exceptions.FHIRFormatError;
import org.hl7.fhir.utilities.TextFile;
import java.io.*;
import java.util.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
/**
* This class manages conversion from R2 to R3 and vice versa
*
* <p>
* To use this class, do the following:
*
* - provide a stream or path (file or URL) that points to R2 definitions (from http://hl7.org/fhir/DSTU2/downloads.html)
* - provide a stream or a path (file or URL) that points to the R3 definitions (from http://hl7.org/fhir/STU3/downloads.html)
* - provide a stream or a path (file or URL) that points to R2/R3 map files (from http://hl7.org/fhir/r2r3maps.zip)
*
* - call convert() (can call this more than once, but not multithread safe)
*
* @author Grahame Grieve
* <p>
* - provide a stream or path (file or URL) that points to R2 definitions (from http://hl7.org/fhir/DSTU2/downloads.html)
* - provide a stream or a path (file or URL) that points to the R3 definitions (from http://hl7.org/fhir/STU3/downloads.html)
* - provide a stream or a path (file or URL) that points to R2/R3 map files (from http://hl7.org/fhir/r2r3maps.zip)
* <p>
* - call convert() (can call this more than once, but not multithread safe)
*
* @author Grahame Grieve
*/
public class R2R3ConversionManager implements ITransformerServices {
private final Map<String, StructureMap> library = new HashMap<String, StructureMap>();
private final List<Resource> extras = new ArrayList<Resource>();
private SimpleWorkerContext contextR2;
private SimpleWorkerContext contextR3;
private Map<String, StructureMap> library = new HashMap<String, StructureMap>();
private boolean needPrepare = false;
private List<Resource> extras = new ArrayList<Resource>();
private StructureMapUtilities smu3;
private StructureMapUtilities smu2;
private OutputStyle style = OutputStyle.PRETTY;
private OutputStyle style = OutputStyle.PRETTY;
public static void main(String[] args) throws IOException, FHIRException {
if (args.length == 0 || !hasParam(args, "-d2") || !hasParam(args, "-d3") || !hasParam(args, "-maps") || !hasParam(args, "-src") || !hasParam(args, "-dest") || (!hasParam(args, "-r2") && !hasParam(args, "-r3"))) {
System.out.println("R2 <--> R3 Convertor");
System.out.println("====================");
System.out.println();
System.out.println("parameters: -d2 [r2 definitions] -d3 [r3 definitions] -maps [map source] -src [source] -dest [dest] -r2/3 - fmt [format]");
System.out.println();
System.out.println("d2: definitions from http://hl7.org/fhir/DSTU2/downloads.html");
System.out.println("d3: definitions from http://hl7.org/fhir/STU3/downloads.html");
System.out.println("maps: R2/R3 maps from http://hl7.org/fhir/r2r3maps.zip");
System.out.println("src: filename for source to convert");
System.out.println("dest: filename for destination of conversion");
System.out.println("-r2: source is r2, convert to r3");
System.out.println("-r3: source is r3, convert to r2");
System.out.println("-fmt: xml | json (xml is default)");
} else {
R2R3ConversionManager self = new R2R3ConversionManager();
self.setR2Definitions(getNamedParam(args, "-d2"));
self.setR3Definitions(getNamedParam(args, "-d3"));
self.setMappingLibrary(getNamedParam(args, "-maps"));
FhirFormat fmt = hasParam(args, "-fmt") ? getNamedParam(args, "-fmt").equalsIgnoreCase("json") ? FhirFormat.JSON : FhirFormat.XML : FhirFormat.XML;
InputStream src = new FileInputStream(getNamedParam(args, "-src"));
OutputStream dst = new FileOutputStream(getNamedParam(args, "-dest"));
self.convert(src, dst, hasParam(args, "-r2"), fmt);
}
}
private static boolean hasParam(String[] args, String param) {
for (String a : args)
if (a.equals(param))
return true;
return false;
}
private static String getNamedParam(String[] args, String param) {
boolean found = false;
for (String a : args) {
if (found)
return a;
if (a.equals(param)) {
found = true;
}
}
return null;
}
public OutputStyle getStyle() {
return style;
}
@ -120,7 +142,7 @@ public class R2R3ConversionManager implements ITransformerServices {
contextR2.loadFromFile(files.get("profiles-resources.xml"), "profiles-resources.xml", ldr);
contextR2.loadFromFile(files.get("valuesets.xml"), "valuesets.xml", ldr);
}
public void setR2Definitions(String source) throws IOException, FHIRException {
File f = new File(source);
if (f.exists())
@ -128,7 +150,7 @@ public class R2R3ConversionManager implements ITransformerServices {
else
setR2Definitions(fetch(source));
}
public void setR3Definitions(InputStream stream) throws IOException, FHIRException {
needPrepare = true;
Map<String, InputStream> files = readInputStream(stream);
@ -140,15 +162,15 @@ public class R2R3ConversionManager implements ITransformerServices {
contextR3.loadFromFile(files.get("valuesets.xml"), "valuesets.xml", null);
contextR3.setCanRunWithoutTerminology(true);
}
public void setR3Definitions(String source) throws FileNotFoundException, IOException, FHIRException {
public void setR3Definitions(String source) throws IOException, FHIRException {
File f = new File(source);
if (f.exists())
setR3Definitions(new FileInputStream(f));
else
setR3Definitions(fetch(source));
}
public void setMappingLibrary(InputStream stream) throws IOException, FHIRException {
needPrepare = true;
Map<String, InputStream> files = readInputStream(stream);
@ -157,13 +179,13 @@ public class R2R3ConversionManager implements ITransformerServices {
library.put(sm.getUrl(), sm);
}
}
public void setMappingLibrary(String source) throws IOException, FHIRException {
File f = new File(source);
if (f.exists())
setMappingLibrary(new FileInputStream(f));
else
setMappingLibrary(fetch(source));
setMappingLibrary(fetch(source));
}
// support
@ -172,7 +194,7 @@ public class R2R3ConversionManager implements ITransformerServices {
}
private Map<String, InputStream> readInputStream(InputStream stream) throws IOException {
Map<String, InputStream> res = new HashMap<String, InputStream>();
Map<String, InputStream> res = new HashMap<String, InputStream>();
ZipInputStream zip = new ZipInputStream(stream);
ZipEntry ze = null;
while ((ze = zip.getNextEntry()) != null) {
@ -215,17 +237,17 @@ public class R2R3ConversionManager implements ITransformerServices {
}
}
contextR2.setExpansionProfile(new ExpansionProfile().setUrl("urn:uuid:"+UUID.randomUUID().toString().toLowerCase()));
contextR3.setExpansionProfile(new ExpansionProfile().setUrl("urn:uuid:"+UUID.randomUUID().toString().toLowerCase()));
contextR2.setExpansionProfile(new ExpansionProfile().setUrl("urn:uuid:" + UUID.randomUUID().toString().toLowerCase()));
contextR3.setExpansionProfile(new ExpansionProfile().setUrl("urn:uuid:" + UUID.randomUUID().toString().toLowerCase()));
smu3 = new StructureMapUtilities(contextR3, library, this);
smu2 = new StructureMapUtilities(contextR2, library, this);
needPrepare = false;
}
}
// execution
// execution
public byte[] convert(byte[] source, boolean r2ToR3, FhirFormat format) throws FHIRException, IOException {
prepare();
ByteArrayOutputStream bs = new ByteArrayOutputStream();
@ -245,32 +267,32 @@ public class R2R3ConversionManager implements ITransformerServices {
convertToR2(source, dest, format);
}
public org.hl7.fhir.dstu2.model.Resource convert(org.hl7.fhir.dstu3.model.Resource source) throws IOException, FHIRFormatError, FHIRException {
public org.hl7.fhir.dstu2.model.Resource convert(org.hl7.fhir.dstu3.model.Resource source) throws IOException, FHIRException {
ByteArrayOutputStream bs = new ByteArrayOutputStream();
new JsonParser().compose(bs, source);
bs.close();
return new org.hl7.fhir.dstu2.formats.JsonParser().parse(convert(bs.toByteArray(), false, FhirFormat.JSON));
}
public org.hl7.fhir.dstu3.model.Resource convert(org.hl7.fhir.dstu2.model.Resource source) throws IOException, FHIRFormatError, FHIRException {
public org.hl7.fhir.dstu3.model.Resource convert(org.hl7.fhir.dstu2.model.Resource source) throws IOException, FHIRException {
ByteArrayOutputStream bs = new ByteArrayOutputStream();
new org.hl7.fhir.dstu2.formats.JsonParser().compose(bs, source);
bs.close();
return new JsonParser().parse(convert(bs.toByteArray(), false, FhirFormat.JSON));
}
private void convertToR3(InputStream source, OutputStream dest, FhirFormat format) throws FHIRFormatError, DefinitionException, FHIRException, IOException {
private void convertToR3(InputStream source, OutputStream dest, FhirFormat format) throws FHIRException, IOException {
org.hl7.fhir.dstu3.elementmodel.Element r2 = new org.hl7.fhir.dstu3.elementmodel.XmlParser(contextR2).parse(source);
StructureMap map = library.get("http://hl7.org/fhir/StructureMap/"+r2.fhirType()+"2to3");
StructureMap map = library.get("http://hl7.org/fhir/StructureMap/" + r2.fhirType() + "2to3");
if (map == null)
throw new FHIRException("No Map Found from R2 to R3 for "+r2.fhirType());
throw new FHIRException("No Map Found from R2 to R3 for " + r2.fhirType());
String tn = smu3.getTargetType(map).getType();
Resource r3 = ResourceFactory.createResource(tn);
smu3.transform(new TransformContextR2R3(contextR3, r2.getChildValue("id")), r2, map, r3);
FormatUtilities.makeParser(format).setOutputStyle(style).compose(dest, r3);
}
private void convertToR2(InputStream source, OutputStream dest, FhirFormat format) throws FHIRFormatError, DefinitionException, FHIRException, IOException {
private void convertToR2(InputStream source, OutputStream dest, FhirFormat format) throws FHIRException, IOException {
org.hl7.fhir.dstu3.elementmodel.Element r3 = new org.hl7.fhir.dstu3.elementmodel.XmlParser(contextR3).parse(source);
StructureMap map = library.get("??");
String tn = smu3.getTargetType(map).getType();
@ -289,9 +311,9 @@ public class R2R3ConversionManager implements ITransformerServices {
public Base createType(Object appInfo, String name) throws FHIRException {
SimpleWorkerContext context = ((TransformContextR2R3) appInfo).getContext();
if (context == contextR2) {
StructureDefinition sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/DSTU2/StructureDefinition/"+name);
StructureDefinition sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/DSTU2/StructureDefinition/" + name);
if (sd == null)
throw new FHIRException("Type not found: '"+name+"'");
throw new FHIRException("Type not found: '" + name + "'");
return Manager.build(context, sd);
} else
return ResourceFactory.createResourceOrType(name);
@ -302,7 +324,7 @@ public class R2R3ConversionManager implements ITransformerServices {
if (res instanceof Resource && (res.fhirType().equals("CodeSystem") || res.fhirType().equals("CareTeam")) || res.fhirType().equals("PractitionerRole")) {
Resource r = (Resource) res;
extras.add(r);
r.setId(((TransformContextR2R3) appInfo).getId()+"-"+extras.size()); //todo: get this into appinfo
r.setId(((TransformContextR2R3) appInfo).getId() + "-" + extras.size()); //todo: get this into appinfo
}
return res;
}
@ -320,10 +342,10 @@ public class R2R3ConversionManager implements ITransformerServices {
if (url.equals(mr.getUrl()))
return mr;
}
if (url.equals(r.fhirType()+"/"+r.getId()))
if (url.equals(r.fhirType() + "/" + r.getId()))
return r;
}
return null;
}
@ -334,58 +356,12 @@ public class R2R3ConversionManager implements ITransformerServices {
if (parts.length == 2 && parts[0].substring(1).equals("PractitionerRole")) {
String[] vals = parts[1].split("\\=");
if (vals.length == 2 && vals[0].equals("practitioner"))
for (Resource r : extras) {
if (r instanceof PractitionerRole && ((PractitionerRole) r).getPractitioner().getReference().equals("Practitioner/"+vals[1])) {
results.add(r);
for (Resource r : extras) {
if (r instanceof PractitionerRole && ((PractitionerRole) r).getPractitioner().getReference().equals("Practitioner/" + vals[1])) {
results.add(r);
}
}
}
}
return results;
}
public static void main(String[] args) throws IOException, FHIRException {
if (args.length == 0 || !hasParam(args, "-d2") || !hasParam(args, "-d3") || !hasParam(args, "-maps") || !hasParam(args, "-src") || !hasParam(args, "-dest") || (!hasParam(args, "-r2") && !hasParam(args, "-r3"))) {
System.out.println("R2 <--> R3 Convertor");
System.out.println("====================");
System.out.println("");
System.out.println("parameters: -d2 [r2 definitions] -d3 [r3 definitions] -maps [map source] -src [source] -dest [dest] -r2/3 - fmt [format]");
System.out.println("");
System.out.println("d2: definitions from http://hl7.org/fhir/DSTU2/downloads.html");
System.out.println("d3: definitions from http://hl7.org/fhir/STU3/downloads.html");
System.out.println("maps: R2/R3 maps from http://hl7.org/fhir/r2r3maps.zip");
System.out.println("src: filename for source to convert");
System.out.println("dest: filename for destination of conversion");
System.out.println("-r2: source is r2, convert to r3");
System.out.println("-r3: source is r3, convert to r2");
System.out.println("-fmt: xml | json (xml is default)");
} else {
R2R3ConversionManager self = new R2R3ConversionManager();
self.setR2Definitions(getNamedParam(args, "-d2"));
self.setR3Definitions(getNamedParam(args, "-d3"));
self.setMappingLibrary(getNamedParam(args, "-maps"));
FhirFormat fmt = hasParam(args, "-fmt") ? getNamedParam(args, "-fmt").equalsIgnoreCase("json") ? FhirFormat.JSON : FhirFormat.XML : FhirFormat.XML;
InputStream src = new FileInputStream(getNamedParam(args, "-src"));
OutputStream dst = new FileOutputStream(getNamedParam(args, "-dest"));
self.convert(src, dst, hasParam(args, "-r2"), fmt);
}
}
private static boolean hasParam(String[] args, String param) {
for (String a : args)
if (a.equals(param))
return true;
return false;
}
private static String getNamedParam(String[] args, String param) {
boolean found = false;
for (String a : args) {
if (found)
return a;
if (a.equals(param)) {
found = true;
}
}
return null;
}
}

View File

@ -59,35 +59,18 @@ import org.w3c.dom.Node;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.*;
public class SpecDifferenceEvaluator {
private SpecPackage original = new SpecPackage();
private SpecPackage revision = new SpecPackage();
private Map<String, String> renames = new HashMap<String, String>();
private List<String> moves = new ArrayList<String>();
private final SpecPackage original = new SpecPackage();
private final SpecPackage revision = new SpecPackage();
private final Map<String, String> renames = new HashMap<String, String>();
private final List<String> moves = new ArrayList<String>();
private XhtmlNode tbl;
private TypeLinkProvider linker;
public void loadFromIni(IniFile ini) {
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() {
return original;
}
public SpecPackage getRevision() {
return revision;
}
public static void main(String[] args) throws Exception {
System.out.println("gen diff");
SpecDifferenceEvaluator self = new SpecDifferenceEvaluator();
@ -116,7 +99,7 @@ public class SpecDifferenceEvaluator {
System.out.println("done");
}
private static void loadSD4(Map<String, StructureDefinition> map, String fn) throws FHIRException, FileNotFoundException, IOException {
private static void loadSD4(Map<String, StructureDefinition> map, String fn) throws FHIRException, 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) {
@ -127,7 +110,7 @@ public class SpecDifferenceEvaluator {
}
private static void loadSD(Map<String, StructureDefinition> map, String fn) throws FHIRFormatError, FileNotFoundException, IOException {
private static void loadSD(Map<String, StructureDefinition> map, String fn) throws FHIRFormatError, IOException {
Bundle bundle = (Bundle) new XmlParser().parse(new FileInputStream(fn));
for (BundleEntryComponent be : bundle.getEntry()) {
if (be.getResource() instanceof StructureDefinition) {
@ -137,7 +120,7 @@ public class SpecDifferenceEvaluator {
}
}
private static void loadVS4(Map<String, ValueSet> map, String fn) throws FHIRException, FileNotFoundException, IOException {
private static void loadVS4(Map<String, ValueSet> map, String fn) throws FHIRException, 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) {
@ -147,7 +130,7 @@ public class SpecDifferenceEvaluator {
}
}
private static void loadVS(Map<String, ValueSet> map, String fn) throws FHIRFormatError, FileNotFoundException, IOException {
private static void loadVS(Map<String, ValueSet> map, String fn) throws FHIRFormatError, IOException {
Bundle bundle = (Bundle) new XmlParser().parse(new FileInputStream(fn));
for (BundleEntryComponent be : bundle.getEntry()) {
if (be.getResource() instanceof ValueSet) {
@ -157,6 +140,22 @@ public class SpecDifferenceEvaluator {
}
}
public void loadFromIni(IniFile ini) {
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() {
return original;
}
public SpecPackage getRevision() {
return revision;
}
public void getDiffAsJson(JsonObject json, StructureDefinition rev) throws IOException {
this.linker = null;
StructureDefinition orig = original.getResources().get(checkRename(rev.getName()));
@ -549,7 +548,7 @@ public class SpecDifferenceEvaluator {
}
if (rev.getMin() != orig.getMin())
b.append("Min Cardinality changed from " + Integer.toString(orig.getMin()) + " to " + Integer.toString(rev.getMin()));
b.append("Min Cardinality changed from " + orig.getMin() + " to " + rev.getMin());
if (!rev.getMax().equals(orig.getMax()))
b.append("Max Cardinality changed from " + orig.getMax() + " to " + rev.getMax());
@ -814,9 +813,9 @@ public class SpecDifferenceEvaluator {
}
}
if (added.length() > 0)
bp.append("Add " + Utilities.pluralize("Type", added.count()) + " " + added.toString());
bp.append("Add " + Utilities.pluralize("Type", added.count()) + " " + added);
if (removed.length() > 0)
bp.append("Remove " + Utilities.pluralize("Type", removed.count()) + " " + removed.toString());
bp.append("Remove " + Utilities.pluralize("Type", removed.count()) + " " + removed);
if (retargetted.length() > 0)
bp.append(retargetted.toString());
}

View File

@ -30,43 +30,38 @@ package org.hl7.fhir.convertors;
*/
import java.io.IOException;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_40.VersionConvertor_10_40;
import org.hl7.fhir.convertors.conv14_30.VersionConvertor_14_30;
import org.hl7.fhir.convertors.conv14_40.VersionConvertor_14_40;
import org.hl7.fhir.convertors.conv30_40.VersionConvertor_30_40;
import org.hl7.fhir.convertors.factory.*;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.elementmodel.Manager.FhirFormat;
import org.hl7.fhir.r4.formats.IParser.OutputStyle;
import org.hl7.fhir.r4.model.FhirPublication;
import java.io.IOException;
public class VersionConversionService {
/**
/**
* use the package manager to load relevant conversion packages, and then initialise internally as required
*
* <p>
* not thread safe
*
* @param system - true if the software is running in system context, not in a user context
*
* @param system - true if the software is running in system context, not in a user context
* @param txServer - Address of the terminology server to use (null = use http://tx.fhir.org
*/
public VersionConversionService(boolean system, String txServer) throws FHIRException {
}
/**
* convert from one version to another.
*
* convert from one version to another.
* <p>
* This routine is thread safe
*
* @param src - the resource to convert
*
* @param src - the resource to convert
* @param srcVersion - the version of the resource to convert
* @param dstVersion - the target version to convert to
* @return the converted resource
* @throws FHIRException - if the source resource cannot be parsed, no single path exists from source to dest version, or the conversion process fails
* @throws IOException
* @throws IOException
*/
public byte[] convert(byte[] src, FhirFormat srcFormat, FhirPublication srcVersion, FhirFormat dstFormat, FhirPublication dstVersion, boolean useJava, OutputStyle style) throws FHIRException, IOException {
if (src == null)
@ -76,199 +71,267 @@ public class VersionConversionService {
if (dstVersion == null)
throw new FHIRException("No destination version specified");
switch (srcVersion) {
case DSTU1: throw new FHIRException("FHIR Version #1 is not supported by the inter-version convertor");
case DSTU2: return convert10(parseResource10(src, srcFormat), dstFormat, dstVersion, useJava, style);
case DSTU2016May: return convert14(parseResource14(src, srcFormat), dstFormat, dstVersion, useJava, style);
case R4: return convert40(parseResource40(src, srcFormat), dstFormat, dstVersion, useJava, style);
case STU3: return convert30(parseResource30(src, srcFormat), dstFormat, dstVersion, useJava, style);
default: throw new FHIRException("FHIR Version 'unknown' is not supported by the inter-version convertor");
case DSTU1:
throw new FHIRException("FHIR Version #1 is not supported by the inter-version convertor");
case DSTU2:
return convert10(parseResource10(src, srcFormat), dstFormat, dstVersion, useJava, style);
case DSTU2016May:
return convert14(parseResource14(src, srcFormat), dstFormat, dstVersion, useJava, style);
case R4:
return convert40(parseResource40(src, srcFormat), dstFormat, dstVersion, useJava, style);
case STU3:
return convert30(parseResource30(src, srcFormat), dstFormat, dstVersion, useJava, style);
default:
throw new FHIRException("FHIR Version 'unknown' is not supported by the inter-version convertor");
}
}
private org.hl7.fhir.dstu2.model.Resource parseResource10(byte[] src, FhirFormat srcFormat) throws FHIRException, IOException {
switch (srcFormat) {
case JSON: return new org.hl7.fhir.dstu2.formats.JsonParser().parse(src);
case TEXT: throw new FHIRException("Text format not supported for DSTU2");
case TURTLE: throw new FHIRException("Turtle format not supported for DSTU2");
case VBAR: throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML: return new org.hl7.fhir.dstu2.formats.XmlParser().parse(src);
default: throw new FHIRException("Unknown format not supported for DSTU2");
case JSON:
return new org.hl7.fhir.dstu2.formats.JsonParser().parse(src);
case TEXT:
throw new FHIRException("Text format not supported for DSTU2");
case TURTLE:
throw new FHIRException("Turtle format not supported for DSTU2");
case VBAR:
throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML:
return new org.hl7.fhir.dstu2.formats.XmlParser().parse(src);
default:
throw new FHIRException("Unknown format not supported for DSTU2");
}
}
private org.hl7.fhir.dstu2016may.model.Resource parseResource14(byte[] src, FhirFormat srcFormat) throws FHIRException, IOException {
switch (srcFormat) {
case JSON: return new org.hl7.fhir.dstu2016may.formats.JsonParser().parse(src);
case TEXT: throw new FHIRException("Text format not supported for DSTU2");
case TURTLE: throw new FHIRException("Turtle format not supported for DSTU2");
case VBAR: throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML: return new org.hl7.fhir.dstu2016may.formats.XmlParser().parse(src);
default: throw new FHIRException("Unknown format not supported for DSTU2");
case JSON:
return new org.hl7.fhir.dstu2016may.formats.JsonParser().parse(src);
case TEXT:
throw new FHIRException("Text format not supported for DSTU2");
case TURTLE:
throw new FHIRException("Turtle format not supported for DSTU2");
case VBAR:
throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML:
return new org.hl7.fhir.dstu2016may.formats.XmlParser().parse(src);
default:
throw new FHIRException("Unknown format not supported for DSTU2");
}
}
private org.hl7.fhir.dstu3.model.Resource parseResource30(byte[] src, FhirFormat srcFormat) throws FHIRException, IOException {
switch (srcFormat) {
case JSON: return new org.hl7.fhir.dstu3.formats.JsonParser().parse(src);
case TEXT: throw new FHIRException("Text format not supported for DSTU2");
case TURTLE: return new org.hl7.fhir.dstu3.formats.RdfParser().parse(src);
case VBAR: throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML: return new org.hl7.fhir.dstu3.formats.XmlParser().parse(src);
default: throw new FHIRException("Unknown format not supported for DSTU2");
case JSON:
return new org.hl7.fhir.dstu3.formats.JsonParser().parse(src);
case TEXT:
throw new FHIRException("Text format not supported for DSTU2");
case TURTLE:
return new org.hl7.fhir.dstu3.formats.RdfParser().parse(src);
case VBAR:
throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML:
return new org.hl7.fhir.dstu3.formats.XmlParser().parse(src);
default:
throw new FHIRException("Unknown format not supported for DSTU2");
}
}
private org.hl7.fhir.r4.model.Resource parseResource40(byte[] src, FhirFormat srcFormat) throws FHIRException, IOException {
switch (srcFormat) {
case JSON: return new org.hl7.fhir.r4.formats.JsonParser().parse(src);
case TEXT: throw new FHIRException("Text format not supported for DSTU2");
case TURTLE: return new org.hl7.fhir.r4.formats.RdfParser().parse(src);
case VBAR: throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML: return new org.hl7.fhir.r4.formats.XmlParser().parse(src);
default: throw new FHIRException("Unknown format not supported for DSTU2");
case JSON:
return new org.hl7.fhir.r4.formats.JsonParser().parse(src);
case TEXT:
throw new FHIRException("Text format not supported for DSTU2");
case TURTLE:
return new org.hl7.fhir.r4.formats.RdfParser().parse(src);
case VBAR:
throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML:
return new org.hl7.fhir.r4.formats.XmlParser().parse(src);
default:
throw new FHIRException("Unknown format not supported for DSTU2");
}
}
private org.hl7.fhir.dstu2.formats.IParser.OutputStyle style10(OutputStyle style) {
return style == OutputStyle.CANONICAL ? org.hl7.fhir.dstu2.formats.IParser.OutputStyle.CANONICAL : style == OutputStyle.NORMAL ? org.hl7.fhir.dstu2.formats.IParser.OutputStyle.NORMAL : org.hl7.fhir.dstu2.formats.IParser.OutputStyle.PRETTY;
}
private org.hl7.fhir.dstu2016may.formats.IParser.OutputStyle style14(OutputStyle style) {
return style == OutputStyle.CANONICAL ? org.hl7.fhir.dstu2016may.formats.IParser.OutputStyle.CANONICAL : style == OutputStyle.NORMAL ? org.hl7.fhir.dstu2016may.formats.IParser.OutputStyle.NORMAL : org.hl7.fhir.dstu2016may.formats.IParser.OutputStyle.PRETTY;
}
private org.hl7.fhir.dstu3.formats.IParser.OutputStyle style30(OutputStyle style) {
return style == OutputStyle.CANONICAL ? org.hl7.fhir.dstu3.formats.IParser.OutputStyle.CANONICAL : style == OutputStyle.NORMAL ? org.hl7.fhir.dstu3.formats.IParser.OutputStyle.NORMAL : org.hl7.fhir.dstu3.formats.IParser.OutputStyle.PRETTY;
}
private byte[] saveResource10(org.hl7.fhir.dstu2.model.Resource src, FhirFormat dstFormat, OutputStyle style) throws FHIRException, IOException {
switch (dstFormat) {
case JSON: return new org.hl7.fhir.dstu2.formats.JsonParser().setOutputStyle(style10(style)).composeBytes(src);
case TEXT: throw new FHIRException("Text format not supported for DSTU2");
case TURTLE: throw new FHIRException("Turtle format not supported for DSTU2");
case VBAR: throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML: return new org.hl7.fhir.dstu2.formats.XmlParser().setOutputStyle(style10(style)).composeBytes(src);
default: throw new FHIRException("Unknown format not supported for DSTU2");
case JSON:
return new org.hl7.fhir.dstu2.formats.JsonParser().setOutputStyle(style10(style)).composeBytes(src);
case TEXT:
throw new FHIRException("Text format not supported for DSTU2");
case TURTLE:
throw new FHIRException("Turtle format not supported for DSTU2");
case VBAR:
throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML:
return new org.hl7.fhir.dstu2.formats.XmlParser().setOutputStyle(style10(style)).composeBytes(src);
default:
throw new FHIRException("Unknown format not supported for DSTU2");
}
}
private byte[] saveResource14(org.hl7.fhir.dstu2016may.model.Resource src, FhirFormat dstFormat, OutputStyle style) throws FHIRException, IOException {
switch (dstFormat) {
case JSON: return new org.hl7.fhir.dstu2016may.formats.JsonParser().setOutputStyle(style14(style)).composeBytes(src);
case TEXT: throw new FHIRException("Text format not supported for DSTU2");
case TURTLE: throw new FHIRException("Turtle format not supported for DSTU2");
case VBAR: throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML: return new org.hl7.fhir.dstu2016may.formats.XmlParser().setOutputStyle(style14(style)).composeBytes(src);
default: throw new FHIRException("Unknown format not supported for DSTU2");
case JSON:
return new org.hl7.fhir.dstu2016may.formats.JsonParser().setOutputStyle(style14(style)).composeBytes(src);
case TEXT:
throw new FHIRException("Text format not supported for DSTU2");
case TURTLE:
throw new FHIRException("Turtle format not supported for DSTU2");
case VBAR:
throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML:
return new org.hl7.fhir.dstu2016may.formats.XmlParser().setOutputStyle(style14(style)).composeBytes(src);
default:
throw new FHIRException("Unknown format not supported for DSTU2");
}
}
private byte[] saveResource30(org.hl7.fhir.dstu3.model.Resource src, FhirFormat dstFormat, OutputStyle style) throws FHIRException, IOException {
switch (dstFormat) {
case JSON: return new org.hl7.fhir.dstu3.formats.JsonParser().setOutputStyle(style30(style)).composeBytes(src);
case TEXT: throw new FHIRException("Text format not supported for DSTU2");
case TURTLE: return new org.hl7.fhir.dstu3.formats.RdfParser().setOutputStyle(style30(style)).composeBytes(src);
case VBAR: throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML: return new org.hl7.fhir.dstu3.formats.XmlParser().setOutputStyle(style30(style)).composeBytes(src);
default: throw new FHIRException("Unknown format not supported for DSTU2");
case JSON:
return new org.hl7.fhir.dstu3.formats.JsonParser().setOutputStyle(style30(style)).composeBytes(src);
case TEXT:
throw new FHIRException("Text format not supported for DSTU2");
case TURTLE:
return new org.hl7.fhir.dstu3.formats.RdfParser().setOutputStyle(style30(style)).composeBytes(src);
case VBAR:
throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML:
return new org.hl7.fhir.dstu3.formats.XmlParser().setOutputStyle(style30(style)).composeBytes(src);
default:
throw new FHIRException("Unknown format not supported for DSTU2");
}
}
private byte[] saveResource40(org.hl7.fhir.r4.model.Resource src, FhirFormat dstFormat, OutputStyle style) throws FHIRException, IOException {
switch (dstFormat) {
case JSON: return new org.hl7.fhir.r4.formats.JsonParser().setOutputStyle(style).composeBytes(src);
case TEXT: throw new FHIRException("Text format not supported for DSTU2");
case TURTLE: return new org.hl7.fhir.r4.formats.RdfParser().setOutputStyle(style).composeBytes(src);
case VBAR: throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML: return new org.hl7.fhir.r4.formats.XmlParser().setOutputStyle(style).composeBytes(src);
default: throw new FHIRException("Unknown format not supported for DSTU2");
case JSON:
return new org.hl7.fhir.r4.formats.JsonParser().setOutputStyle(style).composeBytes(src);
case TEXT:
throw new FHIRException("Text format not supported for DSTU2");
case TURTLE:
return new org.hl7.fhir.r4.formats.RdfParser().setOutputStyle(style).composeBytes(src);
case VBAR:
throw new FHIRException("Vertical Bar format not supported for DSTU2");
case XML:
return new org.hl7.fhir.r4.formats.XmlParser().setOutputStyle(style).composeBytes(src);
default:
throw new FHIRException("Unknown format not supported for DSTU2");
}
}
private byte[] convert10(org.hl7.fhir.dstu2.model.Resource src, FhirFormat dstFormat, FhirPublication dstVersion, boolean useJava, OutputStyle style) throws FHIRException, IOException {
switch (dstVersion) {
case DSTU1: throw new FHIRException("FHIR Version #1 is not supported by the inter-version convertor");
case DSTU2: return saveResource10(src, dstFormat, style);
case DSTU2016May: throw new FHIRException("Conversion from DSTU2 to 2016May version is not supported");
case R4:
if (useJava && VersionConvertor_10_40.convertsResource(src.fhirType()))
return saveResource40(VersionConvertor_10_40.convertResource(src), dstFormat, style); // todo: handle code system?
else
throw new FHIRException("Conversion from R4 to 2016May version is not supported for resources of type "+src.fhirType());
case STU3:
if (useJava && VersionConvertor_10_30.convertsResource(src.fhirType()))
return saveResource30(VersionConvertor_10_30.convertResource(src), dstFormat, style); // todo: handle code system?
else
throw new FHIRException("todo: use script based conversion....");
default: throw new FHIRException("FHIR Version 'unknown' is not supported by the inter-version convertor");
case DSTU1:
throw new FHIRException("FHIR Version #1 is not supported by the inter-version convertor");
case DSTU2:
return saveResource10(src, dstFormat, style);
case DSTU2016May:
throw new FHIRException("Conversion from DSTU2 to 2016May version is not supported");
case R4:
if (useJava && VersionConvertorFactory_10_40.convertsResource(src.fhirType()))
return saveResource40(VersionConvertorFactory_10_40.convertResource(src), dstFormat, style); // todo: handle code system?
else
throw new FHIRException("Conversion from R4 to 2016May version is not supported for resources of type " + src.fhirType());
case STU3:
if (useJava && VersionConvertorFactory_10_30.convertsResource(src.fhirType()))
return saveResource30(VersionConvertorFactory_10_30.convertResource(src), dstFormat, style); // todo: handle code system?
else
throw new FHIRException("todo: use script based conversion....");
default:
throw new FHIRException("FHIR Version 'unknown' is not supported by the inter-version convertor");
}
}
private byte[] convert14(org.hl7.fhir.dstu2016may.model.Resource src, FhirFormat dstFormat, FhirPublication dstVersion, boolean useJava, OutputStyle style) throws FHIRException, IOException {
switch (dstVersion) {
case DSTU1: throw new FHIRException("FHIR Version #1 is not supported by the inter-version convertor");
case DSTU2: throw new FHIRException("Conversion from 2016May version to DSTU2 is not supported");
case DSTU2016May: return saveResource14(src, dstFormat, style);
case R4:
if (useJava && VersionConvertor_14_40.convertsResource(src.fhirType()))
return saveResource40(VersionConvertor_14_40.convertResource(src), dstFormat, style);
else
throw new FHIRException("Conversion from 2016May version to R4 is not supported for resources of type "+src.fhirType());
case STU3:
if (useJava && VersionConvertor_14_30.convertsResource(src.fhirType()))
return saveResource30(VersionConvertor_14_30.convertResource(src), dstFormat, style);
else
throw new FHIRException("Conversion from 2016May version to STU3 is not supported for resources of type "+src.fhirType());
default: throw new FHIRException("FHIR Version 'unknown' is not supported by the inter-version convertor");
case DSTU1:
throw new FHIRException("FHIR Version #1 is not supported by the inter-version convertor");
case DSTU2:
throw new FHIRException("Conversion from 2016May version to DSTU2 is not supported");
case DSTU2016May:
return saveResource14(src, dstFormat, style);
case R4:
if (useJava && VersionConvertorFactory_14_40.convertsResource(src.fhirType()))
return saveResource40(VersionConvertorFactory_14_40.convertResource(src), dstFormat, style);
else
throw new FHIRException("Conversion from 2016May version to R4 is not supported for resources of type " + src.fhirType());
case STU3:
if (useJava && VersionConvertorFactory_14_30.convertsResource(src.fhirType()))
return saveResource30(VersionConvertorFactory_14_30.convertResource(src), dstFormat, style);
else
throw new FHIRException("Conversion from 2016May version to STU3 is not supported for resources of type " + src.fhirType());
default:
throw new FHIRException("FHIR Version 'unknown' is not supported by the inter-version convertor");
}
}
private byte[] convert30(org.hl7.fhir.dstu3.model.Resource src, FhirFormat dstFormat, FhirPublication dstVersion, boolean useJava, OutputStyle style) throws FHIRException, IOException {
switch (dstVersion) {
case DSTU1: throw new FHIRException("FHIR Version #1 is not supported by the inter-version convertor");
case DSTU2:
if (useJava && VersionConvertor_10_30.convertsResource(src.fhirType()))
return saveResource10(VersionConvertor_10_30.convertResource(src), dstFormat, style); // todo: handle code system?
else
throw new FHIRException("todo: use script based conversion....");
case DSTU2016May:
if (useJava && VersionConvertor_14_30.convertsResource(src.fhirType()))
return saveResource14(VersionConvertor_14_30.convertResource(src), dstFormat, style);
else
throw new FHIRException("Conversion from R3 to 2016May version is not supported for resources of type "+src.fhirType());
case R4:
if (useJava && VersionConvertor_30_40.convertsResource(src.fhirType()))
return saveResource40(VersionConvertor_30_40.convertResource(src), dstFormat, style);
else
throw new FHIRException("todo: use script based conversion....");
case STU3: return saveResource30(src, dstFormat, style);
default: throw new FHIRException("FHIR Version 'unknown' is not supported by the inter-version convertor");
case DSTU1:
throw new FHIRException("FHIR Version #1 is not supported by the inter-version convertor");
case DSTU2:
if (useJava && VersionConvertorFactory_10_30.convertsResource(src.fhirType()))
return saveResource10(VersionConvertorFactory_10_30.convertResource(src), dstFormat, style); // todo: handle code system?
else
throw new FHIRException("todo: use script based conversion....");
case DSTU2016May:
if (useJava && VersionConvertorFactory_14_30.convertsResource(src.fhirType()))
return saveResource14(VersionConvertorFactory_14_30.convertResource(src), dstFormat, style);
else
throw new FHIRException("Conversion from R3 to 2016May version is not supported for resources of type " + src.fhirType());
case R4:
if (useJava && VersionConvertorFactory_30_40.convertsResource(src.fhirType()))
return saveResource40(VersionConvertorFactory_30_40.convertResource(src), dstFormat, style);
else
throw new FHIRException("todo: use script based conversion....");
case STU3:
return saveResource30(src, dstFormat, style);
default:
throw new FHIRException("FHIR Version 'unknown' is not supported by the inter-version convertor");
}
}
private byte[] convert40(org.hl7.fhir.r4.model.Resource src, FhirFormat dstFormat, FhirPublication dstVersion, boolean useJava, OutputStyle style) throws FHIRException, IOException {
switch (dstVersion) {
case DSTU1: throw new FHIRException("FHIR Version #1 is not supported by the inter-version convertor");
case DSTU2:
if (useJava && VersionConvertor_10_40.convertsResource(src.fhirType()))
return saveResource10(VersionConvertor_10_40.convertResource(src), dstFormat, style); // todo: handle code system?
else
throw new FHIRException("Conversion from R4 to DSTU2 version is not supported for resources of type "+src.fhirType());
case DSTU2016May:
if (useJava && VersionConvertor_14_40.convertsResource(src.fhirType()))
return saveResource14(VersionConvertor_14_40.convertResource(src), dstFormat, style);
else
throw new FHIRException("Conversion from DSTU2 to 2016May version is not supported for resources of type "+src.fhirType());
case R4: return saveResource40(src, dstFormat, style);
case STU3:
if (useJava && VersionConvertor_30_40.convertsResource(src.fhirType()))
return saveResource30(VersionConvertor_30_40.convertResource(src), dstFormat, style);
else
throw new FHIRException("todo: use script based conversion....");
default: throw new FHIRException("FHIR Version 'unknown' is not supported by the inter-version convertor");
case DSTU1:
throw new FHIRException("FHIR Version #1 is not supported by the inter-version convertor");
case DSTU2:
if (useJava && VersionConvertorFactory_10_40.convertsResource(src.fhirType()))
return saveResource10(VersionConvertorFactory_10_40.convertResource(src), dstFormat, style); // todo: handle code system?
else
throw new FHIRException("Conversion from R4 to DSTU2 version is not supported for resources of type " + src.fhirType());
case DSTU2016May:
if (useJava && VersionConvertorFactory_14_40.convertsResource(src.fhirType()))
return saveResource14(VersionConvertorFactory_14_40.convertResource(src), dstFormat, style);
else
throw new FHIRException("Conversion from DSTU2 to 2016May version is not supported for resources of type " + src.fhirType());
case R4:
return saveResource40(src, dstFormat, style);
case STU3:
if (useJava && VersionConvertorFactory_30_40.convertsResource(src.fhirType()))
return saveResource30(VersionConvertorFactory_30_40.convertResource(src), dstFormat, style);
else
throw new FHIRException("todo: use script based conversion....");
default:
throw new FHIRException("FHIR Version 'unknown' is not supported by the inter-version convertor");
}
}
}

View File

@ -2,35 +2,34 @@ package org.hl7.fhir.convertors;
import org.hl7.fhir.r5.renderers.QuestionnaireRenderer;
/*
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.
*/
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
public class VersionConvertorConstants {
@ -42,7 +41,10 @@ public class VersionConvertorConstants {
public final static String MODIFIER_REASON_LEGACY = "No Modifier Reason provideed in previous versions of FHIR";
public final static String PROFILE_EXTENSION = "http://hl7.org/fhir/4.0/StructureDefinition/extension-ElementDefinition.type.profile";
public final static String IG_CONFORMANCE_MESSAGE_EVENT = "http://hl7.org/fhir/1.0/StructureDefinition/extension-Conformance.messaging.event";
public static final String EXT_OLD_CONCEPTMAP_EQUIVALENCE = "http://hl7.org/fhir/1.0/StructureDefinition/extension-ConceptMap.element.target.equivalence";
public static final String EXT_ACTUAL_RESOURCE_NAME = "http://hl7.org/fhir/tools/StructureDefinition/original-resource-name";
public static final String EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL = QuestionnaireRenderer.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL;
public static String refToVS(String url) {
if (url == null)
return null;
@ -71,7 +73,7 @@ public class VersionConvertorConstants {
else
return url;
}
public static String vsToRef(String url) {
if (url == null)
return null;
@ -100,8 +102,4 @@ public class VersionConvertorConstants {
else
return null;
}
public static final String EXT_OLD_CONCEPTMAP_EQUIVALENCE = "http://hl7.org/fhir/1.0/StructureDefinition/extension-ConceptMap.element.target.equivalence";
public static final String EXT_ACTUAL_RESOURCE_NAME = "http://hl7.org/fhir/tools/StructureDefinition/original-resource-name";
public static final String EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL = QuestionnaireRenderer.EXT_QUESTIONNAIRE_ITEM_TYPE_ORIGINAL;
}

View File

@ -1,36 +1,25 @@
package org.hl7.fhir.convertors.advisors.impl;
import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor30;
import org.hl7.fhir.dstu3.model.CodeSystem;
import org.hl7.fhir.dstu3.model.ValueSet;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class BaseAdvisor_10_30 extends BaseAdvisor30<org.hl7.fhir.dstu2.model.Extension> {
private final List<CodeSystem> cslist = new ArrayList<>();
private final List<String> ignoredUrls = new ArrayList<>(Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"));
public BaseAdvisor_10_30() {}
public BaseAdvisor_10_30() {
}
public BaseAdvisor_10_30(Boolean failFast) {
this.failFast = failFast;
}
public final List<CodeSystem> getCslist() {
return this.cslist;
}
public boolean ignoreExtension(@NotNull String path, @NotNull String url) {
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) {
return this.ignoredUrls.contains(url);
}
public void handleCodeSystem(@NotNull CodeSystem tgtcs, @NotNull ValueSet source) {
tgtcs.setId(source.getId());
tgtcs.setValueSet(source.getUrl());
this.cslist.add(tgtcs);
}
}

View File

@ -1,40 +1,37 @@
package org.hl7.fhir.convertors.advisors.impl;
import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor40;
import org.hl7.fhir.r4.model.*;
import org.jetbrains.annotations.NotNull;
import org.hl7.fhir.r4.model.Expression;
import org.hl7.fhir.r4.model.Type;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class BaseAdvisor_10_40 extends BaseAdvisor40<org.hl7.fhir.dstu2.model.Extension> {
private final List<CodeSystem> cslist = new ArrayList<>();
private final List<String> ignoredUrls = new ArrayList<>(Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"));
final List<String> conformanceIgnoredUrls = Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown");
private final List<Class<?>> ignoredExtensionTypes = new ArrayList<>(Collections.singletonList(Expression.class));
public BaseAdvisor_10_40() {}
public BaseAdvisor_10_40() {
}
public BaseAdvisor_10_40(Boolean failFast) {
this.failFast = failFast;
}
public final List<CodeSystem> getCslist() {
return this.cslist;
@Override
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) {
List<String> paths = Arrays.asList(path.split(","));
return (paths.get(paths.size() - 1).equals("Conformance")) && (conformanceIgnoredUrls.contains(url));
}
public boolean ignoreExtension(@NotNull String path, @NotNull String url) {
return this.ignoredUrls.contains(url);
}
public boolean ignoreType(@NotNull String path, @NotNull Type type) {
@Override
public boolean ignoreType(@Nonnull String path,
@Nonnull Type type) {
return ignoredExtensionTypes.contains(type.getClass());
}
public void handleCodeSystem(@NotNull CodeSystem tgtcs, @NotNull ValueSet source) {
tgtcs.setId(source.getId());
tgtcs.setValueSet(source.getUrl());
this.cslist.add(tgtcs);
}
}

View File

@ -1,44 +1,34 @@
package org.hl7.fhir.convertors.advisors.impl;
import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor50;
import org.hl7.fhir.dstu2.model.Extension;
import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.DataType;
import org.hl7.fhir.r5.model.Expression;
import org.hl7.fhir.r5.model.ValueSet;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class BaseAdvisor_10_50 extends BaseAdvisor50<org.hl7.fhir.dstu2.model.Extension> {
private final List<CodeSystem> cslist = new ArrayList<>();
private final List<String> ignoredUrls = new ArrayList<>(Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"));
final List<String> conformanceIgnoredUrls = Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown");
private final List<Class<?>> ignoredExtensionTypes = new ArrayList<>(Collections.singletonList(Expression.class));
public BaseAdvisor_10_50() {}
public BaseAdvisor_10_50() {
}
public BaseAdvisor_10_50(Boolean failFast) {
this.failFast = failFast;
}
public final List<CodeSystem> getCslist() {
return this.cslist;
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) {
List<String> paths = Arrays.asList(path.split(","));
return (paths.get(paths.size() - 1).equals("Conformance")) && (conformanceIgnoredUrls.contains(url));
}
public boolean ignoreExtension(@NotNull String path, @NotNull String url) {
return this.ignoredUrls.contains(url);
}
public boolean ignoreType(@NotNull String path, @NotNull DataType type) {
public boolean ignoreType(@Nonnull String path,
@Nonnull DataType type) {
return ignoredExtensionTypes.contains(type.getClass());
}
public void handleCodeSystem(@NotNull CodeSystem tgtcs, @NotNull ValueSet source) {
tgtcs.setId(source.getId());
tgtcs.setValueSet(source.getUrl());
this.cslist.add(tgtcs);
}
}

View File

@ -1,37 +1,26 @@
package org.hl7.fhir.convertors.advisors.impl;
import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor30;
import org.hl7.fhir.dstu2016may.model.Extension;
import org.hl7.fhir.dstu3.model.CodeSystem;
import org.hl7.fhir.dstu3.model.ValueSet;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class BaseAdvisor_14_30 extends BaseAdvisor30<org.hl7.fhir.dstu2016may.model.Extension> {
private final List<CodeSystem> cslist = new ArrayList<>();
private final List<String> ignoredUrls = new ArrayList<>(Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"));
public BaseAdvisor_14_30() {}
public BaseAdvisor_14_30() {
}
public BaseAdvisor_14_30(Boolean failFast) {
this.failFast = failFast;
}
public final List<CodeSystem> getCslist() {
return this.cslist;
}
public boolean ignoreExtension(@NotNull String path, @NotNull String url) {
@Override
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) {
return this.ignoredUrls.contains(url);
}
public void handleCodeSystem(@NotNull CodeSystem tgtcs, @NotNull ValueSet source) {
tgtcs.setId(source.getId());
tgtcs.setValueSet(source.getUrl());
this.cslist.add(tgtcs);
}
}

View File

@ -1,43 +1,40 @@
package org.hl7.fhir.convertors.advisors.impl;
import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor40;
import org.hl7.fhir.r4.model.CodeSystem;
import org.hl7.fhir.r4.model.Expression;
import org.hl7.fhir.r4.model.Type;
import org.hl7.fhir.r4.model.ValueSet;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class BaseAdvisor_14_40 extends BaseAdvisor40<org.hl7.fhir.dstu2016may.model.Extension> {
private final List<CodeSystem> cslist = new ArrayList<>();
final List<String> conformanceIgnoredUrls = Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown");
private final List<String> ignoredUrls = new ArrayList<>(Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown"));
private final List<Class<?>> ignoredExtensionTypes = new ArrayList<>(Collections.singletonList(Expression.class));
public BaseAdvisor_14_40() {}
public BaseAdvisor_14_40() {
}
public BaseAdvisor_14_40(Boolean failFast) {
this.failFast = failFast;
}
public final List<CodeSystem> getCslist() {
return this.cslist;
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) {
List<String> paths = Arrays.asList(path.split(","));
if ((paths.get(paths.size() - 1).equals("Conformance")) && (conformanceIgnoredUrls.contains(url))) {
return true;
} else {
return this.ignoredUrls.contains(url);
}
}
public boolean ignoreExtension(@NotNull String path, @NotNull String url) {
return this.ignoredUrls.contains(url);
}
public boolean ignoreType(@NotNull String path, @NotNull Type type) {
public boolean ignoreType(@Nonnull String path, @Nonnull Type type) {
return ignoredExtensionTypes.contains(type.getClass());
}
public void handleCodeSystem(@NotNull CodeSystem tgtcs, @NotNull ValueSet source) {
tgtcs.setId(source.getId());
tgtcs.setValueSet(source.getUrl());
this.cslist.add(tgtcs);
}
}

View File

@ -1,34 +1,28 @@
package org.hl7.fhir.convertors.advisors.impl;
import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor50;
import org.hl7.fhir.dstu2.model.Extension;
import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.DataType;
import org.hl7.fhir.r5.model.Expression;
import org.hl7.fhir.r5.model.ValueSet;
import org.jetbrains.annotations.NotNull;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.ArrayList;
import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class BaseAdvisor_14_50 extends BaseAdvisor50<org.hl7.fhir.dstu2016may.model.Extension> {
private final List<CodeSystem> cslist = new ArrayList<>();
final List<String> capabilityStatementIgnoredUrls = Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown");
public BaseAdvisor_14_50() {}
public BaseAdvisor_14_50() {
}
public BaseAdvisor_14_50(Boolean failFast) {
this.failFast = failFast;
}
public final List<CodeSystem> getCslist() {
return this.cslist;
}
public void handleCodeSystem(@NotNull CodeSystem tgtcs, @NotNull ValueSet source) {
tgtcs.setId(source.getId());
tgtcs.setValueSet(source.getUrl());
this.cslist.add(tgtcs);
@Override
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) throws FHIRException {
List<String> paths = Arrays.asList(path.split(","));
return (paths.get(paths.size() - 1).equals("CapabilityStatement")) && (capabilityStatementIgnoredUrls.contains(url));
}
}

View File

@ -1,33 +1,28 @@
package org.hl7.fhir.convertors.advisors.impl;
import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor40;
import org.hl7.fhir.r4.model.CodeSystem;
import org.hl7.fhir.r4.model.Expression;
import org.hl7.fhir.r4.model.Type;
import org.hl7.fhir.r4.model.ValueSet;
import org.jetbrains.annotations.NotNull;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.ArrayList;
import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class BaseAdvisor_30_40 extends BaseAdvisor40<org.hl7.fhir.dstu3.model.Extension> {
private final List<CodeSystem> cslist = new ArrayList<>();
final List<String> capabilityStatementIgnoredUrls = Collections.singletonList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown");
public BaseAdvisor_30_40() {}
public BaseAdvisor_30_40() {
}
public BaseAdvisor_30_40(Boolean failFast) {
this.failFast = failFast;
}
public final List<CodeSystem> getCslist() {
return this.cslist;
}
public void handleCodeSystem(@NotNull CodeSystem tgtcs, @NotNull ValueSet source) {
tgtcs.setId(source.getId());
tgtcs.setValueSet(source.getUrl());
this.cslist.add(tgtcs);
@Override
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) throws FHIRException {
List<String> paths = Arrays.asList(path.split(","));
return (paths.get(paths.size() - 1).equals("CapabilityStatement")) && (capabilityStatementIgnoredUrls.contains(url));
}
}

View File

@ -1,30 +1,33 @@
package org.hl7.fhir.convertors.advisors.impl;
import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor50;
import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.ValueSet;
import org.jetbrains.annotations.NotNull;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.ArrayList;
import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class BaseAdvisor_30_50 extends BaseAdvisor50<org.hl7.fhir.dstu3.model.Extension> {
private final List<CodeSystem> cslist = new ArrayList<>();
final List<String> valueSetIgnoredUrls = Collections.singletonList("http://hl7.org/fhir/StructureDefinition/valueset-extensible");
final List<String> capabilityStatementIgnoredUrls = Arrays.asList("http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.acceptUnknown",
"http://hl7.org/fhir/3.0/StructureDefinition/extension-CapabilityStatement.profile");
public final List<CodeSystem> getCslist() {
return this.cslist;
public BaseAdvisor_30_50() {
}
public BaseAdvisor_30_50() {}
public BaseAdvisor_30_50(Boolean failFast) {
this.failFast = failFast;
}
public void handleCodeSystem(@NotNull CodeSystem tgtcs, @NotNull ValueSet source) {
tgtcs.setId(source.getId());
tgtcs.setValueSet(source.getUrl());
this.cslist.add(tgtcs);
@Override
public boolean ignoreExtension(@Nonnull String path,
@Nonnull String url) throws FHIRException {
List<String> paths = Arrays.asList(path.split(","));
if ((paths.get(paths.size() - 1).equals("ValueSet")) && (valueSetIgnoredUrls.contains(url))) {
return true;
} else
return (paths.get(paths.size() - 1).equals("CapabilityStatement")) && (capabilityStatementIgnoredUrls.contains(url));
}
}

View File

@ -1,30 +1,13 @@
package org.hl7.fhir.convertors.advisors.impl;
import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor50;
import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.ValueSet;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
public class BaseAdvisor_40_50 extends BaseAdvisor50<org.hl7.fhir.r4.model.Extension> {
private final List<CodeSystem> cslist = new ArrayList<>();
public BaseAdvisor_40_50() {}
public BaseAdvisor_40_50() {
}
public BaseAdvisor_40_50(Boolean failFast) {
this.failFast = failFast;
}
public final List<CodeSystem> getCslist() {
return this.cslist;
}
public void handleCodeSystem(@NotNull CodeSystem tgtcs, @NotNull ValueSet source) {
tgtcs.setId(source.getId());
tgtcs.setValueSet(source.getUrl());
this.cslist.add(tgtcs);
}
}

View File

@ -1,7 +1,9 @@
package org.hl7.fhir.convertors.advisors.interfaces;
public abstract class BaseAdvisor {
public boolean failFast = true;
public boolean failFastOnNullOrUnknownEntry() {
return this.failFast;
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,54 @@
package org.hl7.fhir.convertors.context;
/*
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.
*/
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
public enum ConversionContext10_30 {
INSTANCE;
private final VersionConvertorContext<VersionConvertor_10_30> context = new VersionConvertorContext<>();
public void init(VersionConvertor_10_30 versionConvertor_10_30, String path) {
context.init(versionConvertor_10_30, path);
}
public void close(String path) {
context.close(path);
}
public String path() {
return context.getPath();
}
public VersionConvertor_10_30 getVersionConvertor_10_30() {
return context.getVersionConvertor();
}
}

View File

@ -0,0 +1,54 @@
package org.hl7.fhir.convertors.context;
/*
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.
*/
import org.hl7.fhir.convertors.conv10_40.VersionConvertor_10_40;
public enum ConversionContext10_40 {
INSTANCE;
private final VersionConvertorContext<VersionConvertor_10_40> context = new VersionConvertorContext<>();
public void init(VersionConvertor_10_40 versionConvertor_10_40, String path) {
context.init(versionConvertor_10_40, path);
}
public void close(String path) {
context.close(path);
}
public String path() {
return context.getPath();
}
public VersionConvertor_10_40 getVersionConvertor_10_40() {
return context.getVersionConvertor();
}
}

View File

@ -0,0 +1,54 @@
package org.hl7.fhir.convertors.context;
/*
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.
*/
import org.hl7.fhir.convertors.conv10_50.VersionConvertor_10_50;
public enum ConversionContext10_50 {
INSTANCE;
private final VersionConvertorContext<VersionConvertor_10_50> context = new VersionConvertorContext<>();
public void init(VersionConvertor_10_50 versionConvertor_10_50, String path) {
context.init(versionConvertor_10_50, path);
}
public void close(String path) {
context.close(path);
}
public String path() {
return context.getPath();
}
public VersionConvertor_10_50 getVersionConvertor_10_50() {
return context.getVersionConvertor();
}
}

View File

@ -0,0 +1,54 @@
package org.hl7.fhir.convertors.context;
/*
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.
*/
import org.hl7.fhir.convertors.conv14_30.VersionConvertor_14_30;
public enum ConversionContext14_30 {
INSTANCE;
private final VersionConvertorContext<VersionConvertor_14_30> context = new VersionConvertorContext<>();
public void init(VersionConvertor_14_30 versionConvertor_14_30, String path) {
context.init(versionConvertor_14_30, path);
}
public void close(String path) {
context.close(path);
}
public String path() {
return context.getPath();
}
public VersionConvertor_14_30 getVersionConvertor_14_30() {
return context.getVersionConvertor();
}
}

View File

@ -0,0 +1,54 @@
package org.hl7.fhir.convertors.context;
/*
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.
*/
import org.hl7.fhir.convertors.conv14_40.VersionConvertor_14_40;
public enum ConversionContext14_40 {
INSTANCE;
private final VersionConvertorContext<VersionConvertor_14_40> context = new VersionConvertorContext<>();
public void init(VersionConvertor_14_40 versionConvertor_14_40, String path) {
context.init(versionConvertor_14_40, path);
}
public void close(String path) {
context.close(path);
}
public String path() {
return context.getPath();
}
public VersionConvertor_14_40 getVersionConvertor_14_40() {
return context.getVersionConvertor();
}
}

View File

@ -0,0 +1,54 @@
package org.hl7.fhir.convertors.context;
/*
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.
*/
import org.hl7.fhir.convertors.conv14_50.VersionConvertor_14_50;
public enum ConversionContext14_50 {
INSTANCE;
private final VersionConvertorContext<VersionConvertor_14_50> context = new VersionConvertorContext<>();
public void init(VersionConvertor_14_50 versionConvertor_14_50, String path) {
context.init(versionConvertor_14_50, path);
}
public void close(String path) {
context.close(path);
}
public String path() {
return context.getPath();
}
public VersionConvertor_14_50 getVersionConvertor_14_50() {
return context.getVersionConvertor();
}
}

View File

@ -0,0 +1,54 @@
package org.hl7.fhir.convertors.context;
/*
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.
*/
import org.hl7.fhir.convertors.conv30_40.VersionConvertor_30_40;
public enum ConversionContext30_40 {
INSTANCE;
private final VersionConvertorContext<VersionConvertor_30_40> context = new VersionConvertorContext<>();
public void init(VersionConvertor_30_40 versionConvertor_30_40, String path) {
context.init(versionConvertor_30_40, path);
}
public void close(String path) {
context.close(path);
}
public String path() {
return context.getPath();
}
public VersionConvertor_30_40 getVersionConvertor_30_40() {
return context.getVersionConvertor();
}
}

View File

@ -0,0 +1,54 @@
package org.hl7.fhir.convertors.context;
/*
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.
*/
import org.hl7.fhir.convertors.conv30_50.VersionConvertor_30_50;
public enum ConversionContext30_50 {
INSTANCE;
private final VersionConvertorContext<VersionConvertor_30_50> context = new VersionConvertorContext<>();
public void init(VersionConvertor_30_50 versionConvertor_30_50, String path) {
context.init(versionConvertor_30_50, path);
}
public void close(String path) {
context.close(path);
}
public String path() {
return context.getPath();
}
public VersionConvertor_30_50 getVersionConvertor_30_50() {
return context.getVersionConvertor();
}
}

View File

@ -0,0 +1,53 @@
package org.hl7.fhir.convertors.context;
import org.hl7.fhir.convertors.conv40_50.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.
*/
public enum ConversionContext40_50 {
INSTANCE;
private final VersionConvertorContext<VersionConvertor_40_50> context = new VersionConvertorContext<>();
public void init(VersionConvertor_40_50 versionConvertor_40_50, String path) {
context.init(versionConvertor_40_50, path);
}
public void close(String path) {
context.close(path);
}
public String path() {
return context.getPath();
}
public VersionConvertor_40_50 getVersionConvertor_40_50() {
return context.getVersionConvertor();
}
}

View File

@ -0,0 +1,132 @@
package org.hl7.fhir.convertors.context;
import org.hl7.fhir.exceptions.FHIRException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Stack;
/*
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.
*/
/**
* @param <T>
*/
public class VersionConvertorContext<T> {
private final Logger logger = LoggerFactory.getLogger(VersionConvertorContext.class);
/**
* Each conversion thread instantiates it's own instance of a convertor, which is stored in a {@link ThreadLocal} for
* access.
*/
private final ThreadLocal<T> threadLocalVersionConverter = new ThreadLocal<>();
/**
* We store the current state of the path as a {@link Stack<String>}. Each Fhir type is pushed onto the stack
* as we progress, and popped off once converted. The conversions are traversed in a depth first manner, which
* makes this possible.
*/
private final ThreadLocal<Stack<String>> threadLocalPath = new ThreadLocal<>();
/**
* Initializes the conversion context. If a context already exists, this will just add the path to the current tracked
* path for the conversion context.
*
* @param versionConvertor Instance of the version convertor context to use.
* @param path Current path (i.e. String label) for the given conversion.
*/
public void init(T versionConvertor, String path) {
if (versionConvertor == null) {
throw new FHIRException("Null convertor is not allowed!");
}
if (path == null) {
throw new FHIRException("Null path type is not allowed!");
}
if (threadLocalVersionConverter.get() == null) {
threadLocalVersionConverter.set(versionConvertor);
}
Stack<String> stack = threadLocalPath.get();
if (stack == null) {
stack = new Stack<>();
}
stack.push(path);
logger.debug("Pushing path <" + path + "> onto stack. Current path -> " + String.join(",", stack));
threadLocalPath.set(stack);
}
/**
* Closes the current path. This removes the label from the current stored path.
* If there is no remaining path set after this path is removed, the context convertor and path are cleared from
* memory.
*
* @param path {@link String} label path to add.
*/
public void close(String path) {
Stack<String> stack = threadLocalPath.get();
if (stack == null) {
throw new FHIRException("Cannot close path <" + path + ">. Reached unstable state, no stack path available.");
}
String currentPath = stack.pop();
logger.debug("Popping path <" + currentPath + "> off stack. Current path -> " + String.join(",", stack));
if (!path.equals(currentPath)) {
throw new FHIRException("Reached unstable state, current path doesn't match expected path.");
}
if (stack.isEmpty()) {
threadLocalVersionConverter.remove();
threadLocalPath.remove();
} else {
threadLocalPath.set(stack);
}
}
/**
* Will return the {@link String} corresponding to the current conversion "path".
* ex: "Bundle.Appointment"
*
* @return {@link ArrayList<String>}
*/
public String getPath() throws FHIRException {
if (threadLocalPath.get() == null) {
throw new FHIRException("No current path is set.");
}
return String.join(".", new ArrayList<>(threadLocalPath.get()));
}
/**
* Returns the current instance of the version convertor.
*/
public T getVersionConvertor() {
T result = threadLocalVersionConverter.get();
logger.debug(result.toString());
return result;
}
}

View File

@ -1,11 +1,14 @@
package org.hl7.fhir.convertors.conv10_30;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.*;
import org.hl7.fhir.convertors.conv10_30.resources10_30.*;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Type10_30;
import org.hl7.fhir.convertors.conv10_30.resources10_30.Resource10_30;
import org.hl7.fhir.dstu2.model.CodeableConcept;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
import javax.annotation.Nonnull;
/*
Copyright (c) 2011+, HL7, Inc.
@ -37,349 +40,100 @@ import org.hl7.fhir.utilities.Utilities;
public class VersionConvertor_10_30 {
public static void copyDomainResource(org.hl7.fhir.dstu2.model.DomainResource src, org.hl7.fhir.dstu3.model.DomainResource tgt) throws FHIRException {
copyResource(src, tgt);
tgt.setText(Narrative10_30.convertNarrative(src.getText()));
for (org.hl7.fhir.dstu2.model.Resource t : src.getContained()) tgt.addContained(convertResource(t));
for (org.hl7.fhir.dstu2.model.Extension t : src.getExtension()) tgt.addExtension(Extension10_30.convertExtension(t));
for (org.hl7.fhir.dstu2.model.Extension t : src.getModifierExtension())
tgt.addModifierExtension(Extension10_30.convertExtension(t));
private final BaseAdvisor_10_30 advisor;
private final Element10_30 elementConvertor;
private final Resource10_30 resourceConvertor;
private final Type10_30 typeConvertor;
public VersionConvertor_10_30(@Nonnull BaseAdvisor_10_30 advisor) {
this.advisor = advisor;
this.elementConvertor = new Element10_30(advisor);
this.resourceConvertor = new Resource10_30(advisor);
this.typeConvertor = new Type10_30(advisor);
}
public static void copyDomainResource(org.hl7.fhir.dstu3.model.DomainResource src, org.hl7.fhir.dstu2.model.DomainResource tgt) throws FHIRException {
copyResource(src, tgt);
tgt.setText(Narrative10_30.convertNarrative(src.getText()));
for (org.hl7.fhir.dstu3.model.Resource t : src.getContained()) tgt.addContained(convertResource(t));
for (org.hl7.fhir.dstu3.model.Extension t : src.getExtension()) tgt.addExtension(Extension10_30.convertExtension(t));
for (org.hl7.fhir.dstu3.model.Extension t : src.getModifierExtension())
tgt.addModifierExtension(Extension10_30.convertExtension(t));
static public boolean isJurisdiction(@Nonnull CodeableConcept t) {
return t.hasCoding()
&& ("http://unstats.un.org/unsd/methods/m49/m49.htm".equals(t.getCoding().get(0).getSystem())
|| "urn:iso:std:iso:3166".equals(t.getCoding().get(0).getSystem())
|| "https://www.usps.com/".equals(t.getCoding().get(0).getSystem()));
}
public static void copyResource(org.hl7.fhir.dstu2.model.Resource src, org.hl7.fhir.dstu3.model.Resource tgt) throws FHIRException {
tgt.setId(src.getId());
tgt.setMeta(Meta10_30.convertMeta(src.getMeta()));
tgt.setImplicitRules(src.getImplicitRules());
tgt.setLanguage(src.getLanguage());
public BaseAdvisor_10_30 advisor() {
return advisor;
}
public static void copyResource(org.hl7.fhir.dstu3.model.Resource src, org.hl7.fhir.dstu2.model.Resource tgt) throws FHIRException {
tgt.setId(src.getId());
if (src.hasMeta()) tgt.setMeta(Meta10_30.convertMeta(src.getMeta()));
if (src.hasImplicitRules()) tgt.setImplicitRules(src.getImplicitRules());
if (src.hasLanguage()) tgt.setLanguage(src.getLanguage());
public void copyResource(@Nonnull org.hl7.fhir.dstu2.model.Resource src,
@Nonnull org.hl7.fhir.dstu3.model.Resource tgt) throws FHIRException {
resourceConvertor.copyResource(src, tgt);
}
static public boolean isJurisdiction(CodeableConcept t) {
return t.hasCoding() && ("http://unstats.un.org/unsd/methods/m49/m49.htm".equals(t.getCoding().get(0).getSystem()) || "urn:iso:std:iso:3166".equals(t.getCoding().get(0).getSystem()) || "https://www.usps.com/".equals(t.getCoding().get(0).getSystem()));
public void copyResource(@Nonnull org.hl7.fhir.dstu3.model.Resource src,
@Nonnull org.hl7.fhir.dstu2.model.Resource tgt) throws FHIRException {
resourceConvertor.copyResource(src, tgt);
}
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.dstu2.model.Resource src, BaseAdvisor_10_30 advisor) throws FHIRException {
if (src == null || src.isEmpty()) return null;
if (src instanceof org.hl7.fhir.dstu2.model.Parameters)
return Parameters10_30.convertParameters((org.hl7.fhir.dstu2.model.Parameters) src);
if (src instanceof org.hl7.fhir.dstu2.model.Account)
return Account10_30.convertAccount((org.hl7.fhir.dstu2.model.Account) src);
if (src instanceof org.hl7.fhir.dstu2.model.Appointment)
return Appointment10_30.convertAppointment((org.hl7.fhir.dstu2.model.Appointment) src);
if (src instanceof org.hl7.fhir.dstu2.model.AppointmentResponse)
return AppointmentResponse10_30.convertAppointmentResponse((org.hl7.fhir.dstu2.model.AppointmentResponse) src);
if (src instanceof org.hl7.fhir.dstu2.model.AllergyIntolerance)
return AllergyIntolerance10_30.convertAllergyIntolerance((org.hl7.fhir.dstu2.model.AllergyIntolerance) src);
if (src instanceof org.hl7.fhir.dstu2.model.AuditEvent)
return AuditEvent10_30.convertAuditEvent((org.hl7.fhir.dstu2.model.AuditEvent) src);
if (src instanceof org.hl7.fhir.dstu2.model.Basic)
return Basic10_30.convertBasic((org.hl7.fhir.dstu2.model.Basic) src);
if (src instanceof org.hl7.fhir.dstu2.model.Binary)
return Binary10_30.convertBinary((org.hl7.fhir.dstu2.model.Binary) src);
if (src instanceof org.hl7.fhir.dstu2.model.Bundle)
return Bundle10_30.convertBundle((org.hl7.fhir.dstu2.model.Bundle) src);
if (src instanceof org.hl7.fhir.dstu2.model.CarePlan)
return CarePlan10_30.convertCarePlan((org.hl7.fhir.dstu2.model.CarePlan) src);
if (src instanceof org.hl7.fhir.dstu2.model.ClinicalImpression)
return ClinicalImpression10_30.convertClinicalImpression((org.hl7.fhir.dstu2.model.ClinicalImpression) src);
if (src instanceof org.hl7.fhir.dstu2.model.Communication)
return Communication10_30.convertCommunication((org.hl7.fhir.dstu2.model.Communication) src);
if (src instanceof org.hl7.fhir.dstu2.model.CommunicationRequest)
return CommunicationRequest10_30.convertCommunicationRequest((org.hl7.fhir.dstu2.model.CommunicationRequest) src);
if (src instanceof org.hl7.fhir.dstu2.model.Composition)
return Composition10_30.convertComposition((org.hl7.fhir.dstu2.model.Composition) src);
if (src instanceof org.hl7.fhir.dstu2.model.ConceptMap)
return ConceptMap10_30.convertConceptMap((org.hl7.fhir.dstu2.model.ConceptMap) src);
if (src instanceof org.hl7.fhir.dstu2.model.Condition)
return Condition10_30.convertCondition((org.hl7.fhir.dstu2.model.Condition) src);
if (src instanceof org.hl7.fhir.dstu2.model.Conformance)
return Conformance10_30.convertConformance((org.hl7.fhir.dstu2.model.Conformance) src);
if (src instanceof org.hl7.fhir.dstu2.model.Contract)
return Contract10_30.convertContract((org.hl7.fhir.dstu2.model.Contract) src);
if (src instanceof org.hl7.fhir.dstu2.model.DataElement)
return DataElement10_30.convertDataElement((org.hl7.fhir.dstu2.model.DataElement) src);
if (src instanceof org.hl7.fhir.dstu2.model.DetectedIssue)
return DetectedIssue10_30.convertDetectedIssue((org.hl7.fhir.dstu2.model.DetectedIssue) src);
if (src instanceof org.hl7.fhir.dstu2.model.Device)
return Device10_30.convertDevice((org.hl7.fhir.dstu2.model.Device) src);
if (src instanceof org.hl7.fhir.dstu2.model.DeviceComponent)
return DeviceComponent10_30.convertDeviceComponent((org.hl7.fhir.dstu2.model.DeviceComponent) src);
if (src instanceof org.hl7.fhir.dstu2.model.DeviceMetric)
return DeviceMetric10_30.convertDeviceMetric((org.hl7.fhir.dstu2.model.DeviceMetric) src);
if (src instanceof org.hl7.fhir.dstu2.model.DeviceUseStatement)
return DeviceUseStatement10_30.convertDeviceUseStatement((org.hl7.fhir.dstu2.model.DeviceUseStatement) src);
if (src instanceof org.hl7.fhir.dstu2.model.DiagnosticReport)
return DiagnosticReport10_30.convertDiagnosticReport((org.hl7.fhir.dstu2.model.DiagnosticReport) src);
if (src instanceof org.hl7.fhir.dstu2.model.DocumentManifest)
return DocumentManifest10_30.convertDocumentManifest((org.hl7.fhir.dstu2.model.DocumentManifest) src);
if (src instanceof org.hl7.fhir.dstu2.model.DocumentReference)
return DocumentReference10_30.convertDocumentReference((org.hl7.fhir.dstu2.model.DocumentReference) src);
if (src instanceof org.hl7.fhir.dstu2.model.Encounter)
return Encounter10_30.convertEncounter((org.hl7.fhir.dstu2.model.Encounter) src);
if (src instanceof org.hl7.fhir.dstu2.model.EnrollmentRequest)
return EnrollmentRequest10_30.convertEnrollmentRequest((org.hl7.fhir.dstu2.model.EnrollmentRequest) src);
if (src instanceof org.hl7.fhir.dstu2.model.EnrollmentResponse)
return EnrollmentResponse10_30.convertEnrollmentResponse((org.hl7.fhir.dstu2.model.EnrollmentResponse) src);
if (src instanceof org.hl7.fhir.dstu2.model.EpisodeOfCare)
return EpisodeOfCare10_30.convertEpisodeOfCare((org.hl7.fhir.dstu2.model.EpisodeOfCare) src);
if (src instanceof org.hl7.fhir.dstu2.model.FamilyMemberHistory)
return FamilyMemberHistory10_30.convertFamilyMemberHistory((org.hl7.fhir.dstu2.model.FamilyMemberHistory) src);
if (src instanceof org.hl7.fhir.dstu2.model.Flag)
return Flag10_30.convertFlag((org.hl7.fhir.dstu2.model.Flag) src);
if (src instanceof org.hl7.fhir.dstu2.model.Group)
return Group10_30.convertGroup((org.hl7.fhir.dstu2.model.Group) src);
if (src instanceof org.hl7.fhir.dstu2.model.HealthcareService)
return HealthcareService10_30.convertHealthcareService((org.hl7.fhir.dstu2.model.HealthcareService) src);
if (src instanceof org.hl7.fhir.dstu2.model.ImagingStudy)
return ImagingStudy10_30.convertImagingStudy((org.hl7.fhir.dstu2.model.ImagingStudy) src);
if (src instanceof org.hl7.fhir.dstu2.model.Immunization)
return Immunization10_30.convertImmunization((org.hl7.fhir.dstu2.model.Immunization) src);
if (src instanceof org.hl7.fhir.dstu2.model.ImmunizationRecommendation)
return ImmunizationRecommendation10_30.convertImmunizationRecommendation((org.hl7.fhir.dstu2.model.ImmunizationRecommendation) src);
if (src instanceof org.hl7.fhir.dstu2.model.ImplementationGuide)
return ImplementationGuide10_30.convertImplementationGuide((org.hl7.fhir.dstu2.model.ImplementationGuide) src);
if (src instanceof org.hl7.fhir.dstu2.model.List_)
return List10_30.convertList((org.hl7.fhir.dstu2.model.List_) src);
if (src instanceof org.hl7.fhir.dstu2.model.Location)
return Location10_30.convertLocation((org.hl7.fhir.dstu2.model.Location) src);
if (src instanceof org.hl7.fhir.dstu2.model.Media)
return Media10_30.convertMedia((org.hl7.fhir.dstu2.model.Media) src);
if (src instanceof org.hl7.fhir.dstu2.model.Medication)
return Medication10_30.convertMedication((org.hl7.fhir.dstu2.model.Medication) src);
if (src instanceof org.hl7.fhir.dstu2.model.MedicationDispense)
return MedicationDispense10_30.convertMedicationDispense((org.hl7.fhir.dstu2.model.MedicationDispense) src);
if (src instanceof org.hl7.fhir.dstu2.model.MedicationOrder)
return MedicationRequest10_30.convertMedicationOrder((org.hl7.fhir.dstu2.model.MedicationOrder) src);
if (src instanceof org.hl7.fhir.dstu2.model.MedicationStatement)
return MedicationStatement10_30.convertMedicationStatement((org.hl7.fhir.dstu2.model.MedicationStatement) src);
if (src instanceof org.hl7.fhir.dstu2.model.MessageHeader)
return MessageHeader10_30.convertMessageHeader((org.hl7.fhir.dstu2.model.MessageHeader) src);
if (src instanceof org.hl7.fhir.dstu2.model.NamingSystem)
return NamingSystem10_30.convertNamingSystem((org.hl7.fhir.dstu2.model.NamingSystem) src);
if (src instanceof org.hl7.fhir.dstu2.model.Observation)
return Observation10_30.convertObservation((org.hl7.fhir.dstu2.model.Observation) src);
if (src instanceof org.hl7.fhir.dstu2.model.OperationDefinition)
return OperationDefinition10_30.convertOperationDefinition((org.hl7.fhir.dstu2.model.OperationDefinition) src);
if (src instanceof org.hl7.fhir.dstu2.model.OperationOutcome)
return OperationOutcome10_30.convertOperationOutcome((org.hl7.fhir.dstu2.model.OperationOutcome) src);
if (src instanceof org.hl7.fhir.dstu2.model.Organization)
return Organization10_30.convertOrganization((org.hl7.fhir.dstu2.model.Organization) src);
if (src instanceof org.hl7.fhir.dstu2.model.Patient)
return Patient10_30.convertPatient((org.hl7.fhir.dstu2.model.Patient) src);
if (src instanceof org.hl7.fhir.dstu2.model.Person)
return Person10_30.convertPerson((org.hl7.fhir.dstu2.model.Person) src);
if (src instanceof org.hl7.fhir.dstu2.model.Practitioner)
return Practitioner10_30.convertPractitioner((org.hl7.fhir.dstu2.model.Practitioner) src);
if (src instanceof org.hl7.fhir.dstu2.model.Procedure)
return Procedure10_30.convertProcedure((org.hl7.fhir.dstu2.model.Procedure) src);
if (src instanceof org.hl7.fhir.dstu2.model.ProcedureRequest)
return ProcedureRequest10_30.convertProcedureRequest((org.hl7.fhir.dstu2.model.ProcedureRequest) src);
if (src instanceof org.hl7.fhir.dstu2.model.Provenance)
return Provenance10_30.convertProvenance((org.hl7.fhir.dstu2.model.Provenance) src);
if (src instanceof org.hl7.fhir.dstu2.model.Questionnaire)
return Questionnaire10_30.convertQuestionnaire((org.hl7.fhir.dstu2.model.Questionnaire) src);
if (src instanceof org.hl7.fhir.dstu2.model.QuestionnaireResponse)
return QuestionnaireResponse10_30.convertQuestionnaireResponse((org.hl7.fhir.dstu2.model.QuestionnaireResponse) src);
if (src instanceof org.hl7.fhir.dstu2.model.ReferralRequest)
return ReferralRequest10_30.convertReferralRequest((org.hl7.fhir.dstu2.model.ReferralRequest) src);
if (src instanceof org.hl7.fhir.dstu2.model.RelatedPerson)
return RelatedPerson10_30.convertRelatedPerson((org.hl7.fhir.dstu2.model.RelatedPerson) src);
if (src instanceof org.hl7.fhir.dstu2.model.RiskAssessment)
return RiskAssessment10_30.convertRiskAssessment((org.hl7.fhir.dstu2.model.RiskAssessment) src);
if (src instanceof org.hl7.fhir.dstu2.model.Schedule)
return Schedule10_30.convertSchedule((org.hl7.fhir.dstu2.model.Schedule) src);
if (src instanceof org.hl7.fhir.dstu2.model.SearchParameter)
return SearchParameter10_30.convertSearchParameter((org.hl7.fhir.dstu2.model.SearchParameter) src);
if (src instanceof org.hl7.fhir.dstu2.model.Slot)
return Slot10_30.convertSlot((org.hl7.fhir.dstu2.model.Slot) src);
if (src instanceof org.hl7.fhir.dstu2.model.StructureDefinition)
return StructureDefinition10_30.convertStructureDefinition((org.hl7.fhir.dstu2.model.StructureDefinition) src);
if (src instanceof org.hl7.fhir.dstu2.model.Subscription)
return Subscription10_30.convertSubscription((org.hl7.fhir.dstu2.model.Subscription) src);
if (src instanceof org.hl7.fhir.dstu2.model.Substance)
return Substance10_30.convertSubstance((org.hl7.fhir.dstu2.model.Substance) src);
if (src instanceof org.hl7.fhir.dstu2.model.SupplyDelivery)
return SupplyDelivery10_30.convertSupplyDelivery((org.hl7.fhir.dstu2.model.SupplyDelivery) src);
if (src instanceof org.hl7.fhir.dstu2.model.SupplyRequest)
return SupplyRequest10_30.convertSupplyRequest((org.hl7.fhir.dstu2.model.SupplyRequest) src);
if (src instanceof org.hl7.fhir.dstu2.model.TestScript)
return TestScript10_30.convertTestScript((org.hl7.fhir.dstu2.model.TestScript) src);
if (src instanceof org.hl7.fhir.dstu2.model.ValueSet)
return ValueSet10_30.convertValueSet((org.hl7.fhir.dstu2.model.ValueSet) src, advisor);
throw new FHIRException("Unknown resource " + src.fhirType());
public org.hl7.fhir.dstu3.model.Resource convertResource(@Nonnull org.hl7.fhir.dstu2.model.Resource src) throws FHIRException {
ConversionContext10_30.INSTANCE.init(this, src.fhirType());
try {
return resourceConvertor.convertResource(src);
} finally {
ConversionContext10_30.INSTANCE.close(src.fhirType());
}
}
public static org.hl7.fhir.dstu2.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src, BaseAdvisor_10_30 advisor) throws FHIRException {
if (src == null || src.isEmpty()) return null;
if (src instanceof org.hl7.fhir.dstu3.model.Parameters)
return Parameters10_30.convertParameters((org.hl7.fhir.dstu3.model.Parameters) src);
if (src instanceof org.hl7.fhir.dstu3.model.Appointment)
return Appointment10_30.convertAppointment((org.hl7.fhir.dstu3.model.Appointment) src);
if (src instanceof org.hl7.fhir.dstu3.model.AppointmentResponse)
return AppointmentResponse10_30.convertAppointmentResponse((org.hl7.fhir.dstu3.model.AppointmentResponse) src);
if (src instanceof org.hl7.fhir.dstu3.model.AuditEvent)
return AuditEvent10_30.convertAuditEvent((org.hl7.fhir.dstu3.model.AuditEvent) src);
if (src instanceof org.hl7.fhir.dstu3.model.Basic)
return Basic10_30.convertBasic((org.hl7.fhir.dstu3.model.Basic) src);
if (src instanceof org.hl7.fhir.dstu3.model.Binary)
return Binary10_30.convertBinary((org.hl7.fhir.dstu3.model.Binary) src);
if (src instanceof org.hl7.fhir.dstu3.model.Bundle)
return Bundle10_30.convertBundle((org.hl7.fhir.dstu3.model.Bundle) src, advisor);
if (src instanceof org.hl7.fhir.dstu3.model.CarePlan)
return CarePlan10_30.convertCarePlan((org.hl7.fhir.dstu3.model.CarePlan) src);
if (src instanceof org.hl7.fhir.dstu3.model.ClinicalImpression)
return ClinicalImpression10_30.convertClinicalImpression((org.hl7.fhir.dstu3.model.ClinicalImpression) src);
if (src instanceof org.hl7.fhir.dstu3.model.Communication)
return Communication10_30.convertCommunication((org.hl7.fhir.dstu3.model.Communication) src);
if (src instanceof org.hl7.fhir.dstu3.model.CommunicationRequest)
return CommunicationRequest10_30.convertCommunicationRequest((org.hl7.fhir.dstu3.model.CommunicationRequest) src);
if (src instanceof org.hl7.fhir.dstu3.model.Composition)
return Composition10_30.convertComposition((org.hl7.fhir.dstu3.model.Composition) src);
if (src instanceof org.hl7.fhir.dstu3.model.ConceptMap)
return ConceptMap10_30.convertConceptMap((org.hl7.fhir.dstu3.model.ConceptMap) src);
if (src instanceof org.hl7.fhir.dstu3.model.Condition)
return Condition10_30.convertCondition((org.hl7.fhir.dstu3.model.Condition) src);
if (src instanceof org.hl7.fhir.dstu3.model.CapabilityStatement)
return Conformance10_30.convertConformance((org.hl7.fhir.dstu3.model.CapabilityStatement) src);
if (src instanceof org.hl7.fhir.dstu3.model.Contract)
return Contract10_30.convertContract((org.hl7.fhir.dstu3.model.Contract) src);
if (src instanceof org.hl7.fhir.dstu3.model.DataElement)
return DataElement10_30.convertDataElement((org.hl7.fhir.dstu3.model.DataElement) src);
if (src instanceof org.hl7.fhir.dstu3.model.DetectedIssue)
return DetectedIssue10_30.convertDetectedIssue((org.hl7.fhir.dstu3.model.DetectedIssue) src);
if (src instanceof org.hl7.fhir.dstu3.model.Device)
return Device10_30.convertDevice((org.hl7.fhir.dstu3.model.Device) src);
if (src instanceof org.hl7.fhir.dstu3.model.DeviceComponent)
return DeviceComponent10_30.convertDeviceComponent((org.hl7.fhir.dstu3.model.DeviceComponent) src);
if (src instanceof org.hl7.fhir.dstu3.model.DeviceMetric)
return DeviceMetric10_30.convertDeviceMetric((org.hl7.fhir.dstu3.model.DeviceMetric) src);
if (src instanceof org.hl7.fhir.dstu3.model.DeviceUseStatement)
return DeviceUseStatement10_30.convertDeviceUseStatement((org.hl7.fhir.dstu3.model.DeviceUseStatement) src);
if (src instanceof org.hl7.fhir.dstu3.model.DiagnosticReport)
return DiagnosticReport10_30.convertDiagnosticReport((org.hl7.fhir.dstu3.model.DiagnosticReport) src);
if (src instanceof org.hl7.fhir.dstu3.model.DocumentManifest)
return DocumentManifest10_30.convertDocumentManifest((org.hl7.fhir.dstu3.model.DocumentManifest) src);
if (src instanceof org.hl7.fhir.dstu3.model.DocumentReference)
return DocumentReference10_30.convertDocumentReference((org.hl7.fhir.dstu3.model.DocumentReference) src);
if (src instanceof org.hl7.fhir.dstu3.model.Encounter)
return Encounter10_30.convertEncounter((org.hl7.fhir.dstu3.model.Encounter) src);
if (src instanceof org.hl7.fhir.dstu3.model.EnrollmentRequest)
return EnrollmentRequest10_30.convertEnrollmentRequest((org.hl7.fhir.dstu3.model.EnrollmentRequest) src);
if (src instanceof org.hl7.fhir.dstu3.model.EnrollmentResponse)
return EnrollmentResponse10_30.convertEnrollmentResponse((org.hl7.fhir.dstu3.model.EnrollmentResponse) src);
if (src instanceof org.hl7.fhir.dstu3.model.EpisodeOfCare)
return EpisodeOfCare10_30.convertEpisodeOfCare((org.hl7.fhir.dstu3.model.EpisodeOfCare) src);
if (src instanceof org.hl7.fhir.dstu3.model.FamilyMemberHistory)
return FamilyMemberHistory10_30.convertFamilyMemberHistory((org.hl7.fhir.dstu3.model.FamilyMemberHistory) src);
if (src instanceof org.hl7.fhir.dstu3.model.Flag)
return Flag10_30.convertFlag((org.hl7.fhir.dstu3.model.Flag) src);
if (src instanceof org.hl7.fhir.dstu3.model.Group)
return Group10_30.convertGroup((org.hl7.fhir.dstu3.model.Group) src);
if (src instanceof org.hl7.fhir.dstu3.model.HealthcareService)
return HealthcareService10_30.convertHealthcareService((org.hl7.fhir.dstu3.model.HealthcareService) src);
if (src instanceof org.hl7.fhir.dstu3.model.ImagingStudy)
return ImagingStudy10_30.convertImagingStudy((org.hl7.fhir.dstu3.model.ImagingStudy) src);
if (src instanceof org.hl7.fhir.dstu3.model.Immunization)
return Immunization10_30.convertImmunization((org.hl7.fhir.dstu3.model.Immunization) src);
if (src instanceof org.hl7.fhir.dstu3.model.ImmunizationRecommendation)
return ImmunizationRecommendation10_30.convertImmunizationRecommendation((org.hl7.fhir.dstu3.model.ImmunizationRecommendation) src);
if (src instanceof org.hl7.fhir.dstu3.model.ImplementationGuide)
return ImplementationGuide10_30.convertImplementationGuide((org.hl7.fhir.dstu3.model.ImplementationGuide) src);
if (src instanceof org.hl7.fhir.dstu3.model.ListResource)
return List10_30.convertList((org.hl7.fhir.dstu3.model.ListResource) src);
if (src instanceof org.hl7.fhir.dstu3.model.Location)
return Location10_30.convertLocation((org.hl7.fhir.dstu3.model.Location) src);
if (src instanceof org.hl7.fhir.dstu3.model.Media)
return Media10_30.convertMedia((org.hl7.fhir.dstu3.model.Media) src);
if (src instanceof org.hl7.fhir.dstu3.model.Medication)
return Medication10_30.convertMedication((org.hl7.fhir.dstu3.model.Medication) src);
if (src instanceof org.hl7.fhir.dstu3.model.MedicationDispense)
return MedicationDispense10_30.convertMedicationDispense((org.hl7.fhir.dstu3.model.MedicationDispense) src);
if (src instanceof org.hl7.fhir.dstu3.model.MedicationStatement)
return MedicationStatement10_30.convertMedicationStatement((org.hl7.fhir.dstu3.model.MedicationStatement) src);
if (src instanceof org.hl7.fhir.dstu3.model.MessageHeader)
return MessageHeader10_30.convertMessageHeader((org.hl7.fhir.dstu3.model.MessageHeader) src);
if (src instanceof org.hl7.fhir.dstu3.model.NamingSystem)
return NamingSystem10_30.convertNamingSystem((org.hl7.fhir.dstu3.model.NamingSystem) src);
if (src instanceof org.hl7.fhir.dstu3.model.Observation)
return Observation10_30.convertObservation((org.hl7.fhir.dstu3.model.Observation) src);
if (src instanceof org.hl7.fhir.dstu3.model.OperationDefinition)
return OperationDefinition10_30.convertOperationDefinition((org.hl7.fhir.dstu3.model.OperationDefinition) src);
if (src instanceof org.hl7.fhir.dstu3.model.OperationOutcome)
return OperationOutcome10_30.convertOperationOutcome((org.hl7.fhir.dstu3.model.OperationOutcome) src);
if (src instanceof org.hl7.fhir.dstu3.model.Organization)
return Organization10_30.convertOrganization((org.hl7.fhir.dstu3.model.Organization) src);
if (src instanceof org.hl7.fhir.dstu3.model.Patient)
return Patient10_30.convertPatient((org.hl7.fhir.dstu3.model.Patient) src);
if (src instanceof org.hl7.fhir.dstu3.model.Person)
return Person10_30.convertPerson((org.hl7.fhir.dstu3.model.Person) src);
if (src instanceof org.hl7.fhir.dstu3.model.Practitioner)
return Practitioner10_30.convertPractitioner((org.hl7.fhir.dstu3.model.Practitioner) src);
if (src instanceof org.hl7.fhir.dstu3.model.Procedure)
return Procedure10_30.convertProcedure((org.hl7.fhir.dstu3.model.Procedure) src);
if (src instanceof org.hl7.fhir.dstu3.model.ProcedureRequest)
return ProcedureRequest10_30.convertProcedureRequest((org.hl7.fhir.dstu3.model.ProcedureRequest) src);
if (src instanceof org.hl7.fhir.dstu3.model.Provenance)
return Provenance10_30.convertProvenance((org.hl7.fhir.dstu3.model.Provenance) src);
if (src instanceof org.hl7.fhir.dstu3.model.Questionnaire)
return Questionnaire10_30.convertQuestionnaire((org.hl7.fhir.dstu3.model.Questionnaire) src);
if (src instanceof org.hl7.fhir.dstu3.model.QuestionnaireResponse)
return QuestionnaireResponse10_30.convertQuestionnaireResponse((org.hl7.fhir.dstu3.model.QuestionnaireResponse) src);
if (src instanceof org.hl7.fhir.dstu3.model.ReferralRequest)
return ReferralRequest10_30.convertReferralRequest((org.hl7.fhir.dstu3.model.ReferralRequest) src);
if (src instanceof org.hl7.fhir.dstu3.model.RelatedPerson)
return RelatedPerson10_30.convertRelatedPerson((org.hl7.fhir.dstu3.model.RelatedPerson) src);
if (src instanceof org.hl7.fhir.dstu3.model.RiskAssessment)
return RiskAssessment10_30.convertRiskAssessment((org.hl7.fhir.dstu3.model.RiskAssessment) src);
if (src instanceof org.hl7.fhir.dstu3.model.Schedule)
return Schedule10_30.convertSchedule((org.hl7.fhir.dstu3.model.Schedule) src);
if (src instanceof org.hl7.fhir.dstu3.model.SearchParameter)
return SearchParameter10_30.convertSearchParameter((org.hl7.fhir.dstu3.model.SearchParameter) src);
if (src instanceof org.hl7.fhir.dstu3.model.Slot)
return Slot10_30.convertSlot((org.hl7.fhir.dstu3.model.Slot) src);
if (src instanceof org.hl7.fhir.dstu3.model.Specimen)
return Specimen10_30.convertSpecimen((org.hl7.fhir.dstu3.model.Specimen) src);
if (src instanceof org.hl7.fhir.dstu3.model.StructureDefinition)
return StructureDefinition10_30.convertStructureDefinition((org.hl7.fhir.dstu3.model.StructureDefinition) src);
if (src instanceof org.hl7.fhir.dstu3.model.Subscription)
return Subscription10_30.convertSubscription((org.hl7.fhir.dstu3.model.Subscription) src);
if (src instanceof org.hl7.fhir.dstu3.model.Substance)
return Substance10_30.convertSubstance((org.hl7.fhir.dstu3.model.Substance) src);
if (src instanceof org.hl7.fhir.dstu3.model.SupplyDelivery)
return SupplyDelivery10_30.convertSupplyDelivery((org.hl7.fhir.dstu3.model.SupplyDelivery) src);
if (src instanceof org.hl7.fhir.dstu3.model.SupplyRequest)
return SupplyRequest10_30.convertSupplyRequest((org.hl7.fhir.dstu3.model.SupplyRequest) src);
if (src instanceof org.hl7.fhir.dstu3.model.TestScript)
return TestScript10_30.convertTestScript((org.hl7.fhir.dstu3.model.TestScript) src);
if (src instanceof org.hl7.fhir.dstu3.model.ValueSet)
return ValueSet10_30.convertValueSet((org.hl7.fhir.dstu3.model.ValueSet) src, advisor);
throw new FHIRException("Unknown resource " + src.fhirType());
public org.hl7.fhir.dstu2.model.Resource convertResource(@Nonnull org.hl7.fhir.dstu3.model.Resource src) throws FHIRException {
ConversionContext10_30.INSTANCE.init(this, src.fhirType());
try {
return resourceConvertor.convertResource(src);
} finally {
ConversionContext10_30.INSTANCE.close(src.fhirType());
}
}
public static boolean convertsResource(String rt) {
return Utilities.existsInList(rt, "Parameters", "Appointment", "AppointmentResponse", "AuditEvent", "Basic", "Binary", "Bundle", "CarePlan", "ClinicalImpression", "Communication", "CommunicationRequest", "Composition", "ConceptMap", "Condition", "CapabilityStatement", "Contract", "DataElement", "DetectedIssue", "Device", "DeviceComponent", "DeviceMetric", "DeviceUseStatement", "DiagnosticReport", "DocumentManifest", "DocumentReference", "Encounter", "EnrollmentRequest", "EnrollmentResponse", "EpisodeOfCare", "FamilyMemberHistory", "Flag", "Group", "HealthcareService", "ImagingStudy", "Immunization", "ImmunizationRecommendation", "ImplementationGuide", "ListResource", "Location", "Media", "Medication", "MedicationDispense", "MedicationStatement", "MessageHeader", "NamingSystem", "Observation", "OperationDefinition", "OperationOutcome", "Organization", "Patient", "Person", "Practitioner", "Procedure", "ProcedureRequest", "Provenance", "Questionnaire", "QuestionnaireResponse", "ReferralRequest", "RelatedPerson", "RiskAssessment", "Schedule", "SearchParameter", "Slot", "StructureDefinition", "Subscription", "Substance", "SupplyDelivery", "SupplyRequest", "TestScript", "ValueSet");
public org.hl7.fhir.dstu3.model.Type convertType(@Nonnull org.hl7.fhir.dstu2.model.Type src) throws FHIRException {
ConversionContext10_30.INSTANCE.init(this, src.fhirType());
try {
return typeConvertor.convertType(src);
} finally {
ConversionContext10_30.INSTANCE.close(src.fhirType());
}
}
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.dstu2.model.Resource src) throws FHIRException {
return convertResource(src, null);
public org.hl7.fhir.dstu2.model.Type convertType(@Nonnull org.hl7.fhir.dstu3.model.Type src) throws FHIRException {
ConversionContext10_30.INSTANCE.init(this, src.fhirType());
try {
return typeConvertor.convertType(src);
} finally {
ConversionContext10_30.INSTANCE.close(src.fhirType());
}
}
public static org.hl7.fhir.dstu2.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src) throws FHIRException {
return convertResource(src, null);
public void copyDomainResource(@Nonnull org.hl7.fhir.dstu2.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu3.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
}
public void copyDomainResource(@Nonnull org.hl7.fhir.dstu3.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2.model.DomainResource tgt) throws FHIRException {
resourceConvertor.copyDomainResource(src, tgt);
}
public void copyElement(@Nonnull org.hl7.fhir.dstu2.model.Element src,
@Nonnull org.hl7.fhir.dstu3.model.Element tgt, String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_30.INSTANCE.path(), var);
}
public void copyElement(@Nonnull org.hl7.fhir.dstu3.model.Element src,
@Nonnull org.hl7.fhir.dstu2.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_30.INSTANCE.path(), var);
}
public void copyElement(@Nonnull org.hl7.fhir.dstu3.model.DomainResource src,
@Nonnull org.hl7.fhir.dstu2.model.Element tgt,
String... var) throws FHIRException {
elementConvertor.copyElement(src, tgt, ConversionContext10_30.INSTANCE.path(), var);
}
}

View File

@ -1,26 +1,74 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_30;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.Arrays;
public class Element10_30 {
public static void copyElement(org.hl7.fhir.dstu2.model.Element src, org.hl7.fhir.dstu3.model.Element tgt) throws FHIRException {
tgt.setId(src.getId());
for (org.hl7.fhir.dstu2.model.Extension e : src.getExtension()) {
tgt.addExtension(Extension10_30.convertExtension(e));
}
}
public static void copyElement(org.hl7.fhir.dstu3.model.Element src, org.hl7.fhir.dstu2.model.Element tgt) throws FHIRException {
tgt.setId(src.getId());
for (org.hl7.fhir.dstu3.model.Extension e : src.getExtension()) {
tgt.addExtension(Extension10_30.convertExtension(e));
}
}
public final BaseAdvisor_10_30 advisor;
public static void copyElement(org.hl7.fhir.dstu3.model.DomainResource src, org.hl7.fhir.dstu2.model.Element tgt) throws FHIRException {
tgt.setId(src.getId());
for (org.hl7.fhir.dstu3.model.Extension e : src.getExtension()) {
tgt.addExtension(Extension10_30.convertExtension(e));
}
}
public Element10_30(BaseAdvisor_10_30 advisor) {
this.advisor = advisor;
}
public boolean isExemptExtension(String url, String[] extensionsToIgnore) {
return Arrays.asList(extensionsToIgnore).contains(url);
}
public void copyElement(org.hl7.fhir.dstu2.model.Element src,
org.hl7.fhir.dstu3.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.dstu3.model.Extension convertedExtension = new org.hl7.fhir.dstu3.model.Extension();
advisor.handleExtension(path, e, convertedExtension);
tgt.addExtension(convertedExtension);
} else {
tgt.addExtension(Extension10_30.convertExtension(e));
}
});
}
public void copyElement(org.hl7.fhir.dstu3.model.Element src,
org.hl7.fhir.dstu2.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.dstu2.model.Extension convertedExtension = new org.hl7.fhir.dstu2.model.Extension();
advisor.handleExtension(path, e, convertedExtension);
tgt.addExtension(convertedExtension);
} else {
tgt.addExtension(Extension10_30.convertExtension(e));
}
});
}
public void copyElement(org.hl7.fhir.dstu3.model.DomainResource src,
org.hl7.fhir.dstu2.model.Element tgt,
String path,
String... extensionsToIgnore) throws FHIRException {
if (src.hasId()) tgt.setId(src.getId());
src.getExtension().stream()
.filter(e -> !isExemptExtension(e.getUrl(), extensionsToIgnore))
.forEach(e -> {
if (advisor.useAdvisorForExtension(path, e)) {
org.hl7.fhir.dstu2.model.Extension convertedExtension = new org.hl7.fhir.dstu2.model.Extension();
advisor.handleExtension(path, e, convertedExtension);
tgt.addExtension(convertedExtension);
} else {
tgt.addExtension(Extension10_30.convertExtension(e));
}
});
}
}

View File

@ -1,5 +1,6 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Coding10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.*;
import org.hl7.fhir.dstu2.utils.ToolingExtensions;
@ -11,464 +12,482 @@ import java.util.List;
import java.util.stream.Collectors;
public class ElementDefinition10_30 {
public static org.hl7.fhir.dstu3.model.ElementDefinition convertElementDefinition(org.hl7.fhir.dstu2.model.ElementDefinition src, List<String> slicePaths) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.ElementDefinition tgt = new org.hl7.fhir.dstu3.model.ElementDefinition();
Element10_30.copyElement(src, tgt);
if (src.hasPathElement()) tgt.setPathElement(String10_30.convertString(src.getPathElement()));
tgt.setRepresentation(src.getRepresentation().stream().map(ElementDefinition10_30::convertPropertyRepresentation).collect(Collectors.toList()));
if (src.hasName()) {
if (slicePaths.contains(src.getPath())) tgt.setSliceNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasNameElement()) tgt.setIdElement(String10_30.convertString(src.getNameElement()));
public static org.hl7.fhir.dstu3.model.ElementDefinition convertElementDefinition(org.hl7.fhir.dstu2.model.ElementDefinition src, List<String> slicePaths) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.ElementDefinition tgt = new org.hl7.fhir.dstu3.model.ElementDefinition();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasPathElement()) tgt.setPathElement(String10_30.convertString(src.getPathElement()));
tgt.setRepresentation(src.getRepresentation().stream().map(ElementDefinition10_30::convertPropertyRepresentation).collect(Collectors.toList()));
if (src.hasName()) {
if (slicePaths.contains(src.getPath())) tgt.setSliceNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasNameElement()) tgt.setIdElement(String10_30.convertString(src.getNameElement()));
}
if (src.hasLabel()) tgt.setLabelElement(String10_30.convertString(src.getLabelElement()));
for (org.hl7.fhir.dstu2.model.Coding t : src.getCode()) tgt.addCode(Coding10_30.convertCoding(t));
if (src.hasSlicing()) tgt.setSlicing(convertElementDefinitionSlicingComponent(src.getSlicing()));
if (src.hasShort()) tgt.setShortElement(String10_30.convertString(src.getShortElement()));
if (src.hasDefinition()) tgt.setDefinitionElement(MarkDown10_30.convertMarkdown(src.getDefinitionElement()));
if (src.hasComments()) tgt.setCommentElement(MarkDown10_30.convertMarkdown(src.getCommentsElement()));
if (src.hasRequirements()) tgt.setRequirementsElement(MarkDown10_30.convertMarkdown(src.getRequirementsElement()));
for (org.hl7.fhir.dstu2.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue());
if (src.hasMin()) tgt.setMin(src.getMin());
if (src.hasMax()) tgt.setMaxElement(String10_30.convertString(src.getMaxElement()));
if (src.hasBase()) tgt.setBase(convertElementDefinitionBaseComponent(src.getBase()));
if (src.hasNameReference()) tgt.setContentReference("#" + src.getNameReference());
for (org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent t : src.getType())
tgt.addType(convertElementDefinitionTypeComponent(t));
if (src.hasDefaultValue())
tgt.setDefaultValue(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getDefaultValue()));
if (src.hasMeaningWhenMissing())
tgt.setMeaningWhenMissingElement(MarkDown10_30.convertMarkdown(src.getMeaningWhenMissingElement()));
if (src.hasFixed())
tgt.setFixed(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getFixed()));
if (src.hasPattern())
tgt.setPattern(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getPattern()));
if (src.hasExample())
tgt.addExample().setLabel("General").setValue(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getExample()));
if (src.hasMinValue())
tgt.setMinValue(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getMinValue()));
if (src.hasMaxValue())
tgt.setMaxValue(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getMaxValue()));
if (src.hasMaxLength()) tgt.setMaxLengthElement(Integer10_30.convertInteger(src.getMaxLengthElement()));
for (org.hl7.fhir.dstu2.model.IdType t : src.getCondition()) tgt.addCondition(t.getValue());
for (org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent t : src.getConstraint())
tgt.addConstraint(convertElementDefinitionConstraintComponent(t));
if (src.hasMustSupport()) tgt.setMustSupportElement(Boolean10_30.convertBoolean(src.getMustSupportElement()));
if (src.hasIsModifier()) tgt.setIsModifierElement(Boolean10_30.convertBoolean(src.getIsModifierElement()));
if (src.hasIsSummary()) tgt.setIsSummaryElement(Boolean10_30.convertBoolean(src.getIsSummaryElement()));
if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
for (org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
tgt.addMapping(convertElementDefinitionMappingComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ElementDefinition convertElementDefinition(org.hl7.fhir.dstu3.model.ElementDefinition src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ElementDefinition tgt = new org.hl7.fhir.dstu2.model.ElementDefinition();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasPathElement()) tgt.setPathElement(String10_30.convertString(src.getPathElement()));
tgt.setRepresentation(src.getRepresentation().stream().map(ElementDefinition10_30::convertPropertyRepresentation).collect(Collectors.toList()));
if (src.hasSliceName()) tgt.setNameElement(String10_30.convertString(src.getSliceNameElement()));
else tgt.setNameElement(String10_30.convertString(src.getIdElement()));
if (src.hasLabelElement()) tgt.setLabelElement(String10_30.convertString(src.getLabelElement()));
for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addCode(Coding10_30.convertCoding(t));
if (src.hasSlicing()) tgt.setSlicing(convertElementDefinitionSlicingComponent(src.getSlicing()));
if (src.hasShortElement()) tgt.setShortElement(String10_30.convertString(src.getShortElement()));
if (src.hasDefinitionElement()) tgt.setDefinitionElement(MarkDown10_30.convertMarkdown(src.getDefinitionElement()));
if (src.hasCommentElement()) tgt.setCommentsElement(MarkDown10_30.convertMarkdown(src.getCommentElement()));
if (src.hasRequirementsElement())
tgt.setRequirementsElement(MarkDown10_30.convertMarkdown(src.getRequirementsElement()));
for (org.hl7.fhir.dstu3.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue());
tgt.setMin(src.getMin());
if (src.hasMaxElement()) tgt.setMaxElement(String10_30.convertString(src.getMaxElement()));
if (src.hasBase()) tgt.setBase(convertElementDefinitionBaseComponent(src.getBase()));
if (src.hasContentReference()) tgt.setNameReference(src.getContentReference().substring(1));
for (org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent t : src.getType())
tgt.addType(convertElementDefinitionTypeComponent(t));
if (src.hasDefaultValue())
tgt.setDefaultValue(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getDefaultValue()));
if (src.hasMeaningWhenMissingElement())
tgt.setMeaningWhenMissingElement(MarkDown10_30.convertMarkdown(src.getMeaningWhenMissingElement()));
if (src.hasFixed())
tgt.setFixed(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getFixed()));
if (src.hasPattern())
tgt.setPattern(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getPattern()));
if (src.hasExample())
tgt.setExample(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getExampleFirstRep().getValue()));
if (src.hasMinValue())
tgt.setMinValue(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getMinValue()));
if (src.hasMaxValue())
tgt.setMaxValue(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getMaxValue()));
if (src.hasMaxLengthElement()) tgt.setMaxLengthElement(Integer10_30.convertInteger(src.getMaxLengthElement()));
for (org.hl7.fhir.dstu3.model.IdType t : src.getCondition()) tgt.addCondition(t.getValue());
for (org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionConstraintComponent t : src.getConstraint())
tgt.addConstraint(convertElementDefinitionConstraintComponent(t));
if (src.hasMustSupportElement())
tgt.setMustSupportElement(Boolean10_30.convertBoolean(src.getMustSupportElement()));
if (src.hasIsModifierElement()) tgt.setIsModifierElement(Boolean10_30.convertBoolean(src.getIsModifierElement()));
if (src.hasIsSummaryElement()) tgt.setIsSummaryElement(Boolean10_30.convertBoolean(src.getIsSummaryElement()));
if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
for (org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
tgt.addMapping(convertElementDefinitionMappingComponent(t));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation> convertPropertyRepresentation(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentationEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.NULL);
} else {
switch (src.getValue()) {
case XMLATTR:
tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XMLATTR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.NULL);
break;
}
if (src.hasLabel()) tgt.setLabelElement(String10_30.convertString(src.getLabelElement()));
for (org.hl7.fhir.dstu2.model.Coding t : src.getCode()) tgt.addCode(Coding10_30.convertCoding(t));
if (src.hasSlicing()) tgt.setSlicing(convertElementDefinitionSlicingComponent(src.getSlicing()));
if (src.hasShort()) tgt.setShortElement(String10_30.convertString(src.getShortElement()));
if (src.hasDefinition()) tgt.setDefinitionElement(MarkDown10_30.convertMarkdown(src.getDefinitionElement()));
if (src.hasComments()) tgt.setCommentElement(MarkDown10_30.convertMarkdown(src.getCommentsElement()));
if (src.hasRequirements()) tgt.setRequirementsElement(MarkDown10_30.convertMarkdown(src.getRequirementsElement()));
for (org.hl7.fhir.dstu2.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue());
if (src.hasMin()) tgt.setMin(src.getMin());
if (src.hasMax()) tgt.setMaxElement(String10_30.convertString(src.getMaxElement()));
if (src.hasBase()) tgt.setBase(convertElementDefinitionBaseComponent(src.getBase()));
if (src.hasNameReference()) tgt.setContentReference("#" + src.getNameReference());
for (org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent t : src.getType())
tgt.addType(convertElementDefinitionTypeComponent(t));
if (src.hasDefaultValue()) tgt.setDefaultValue(Type10_30.convertType(src.getDefaultValue()));
if (src.hasMeaningWhenMissing())
tgt.setMeaningWhenMissingElement(MarkDown10_30.convertMarkdown(src.getMeaningWhenMissingElement()));
if (src.hasFixed()) tgt.setFixed(Type10_30.convertType(src.getFixed()));
if (src.hasPattern()) tgt.setPattern(Type10_30.convertType(src.getPattern()));
if (src.hasExample()) tgt.addExample().setLabel("General").setValue(Type10_30.convertType(src.getExample()));
if (src.hasMinValue()) tgt.setMinValue(Type10_30.convertType(src.getMinValue()));
if (src.hasMaxValue()) tgt.setMaxValue(Type10_30.convertType(src.getMaxValue()));
if (src.hasMaxLength()) tgt.setMaxLengthElement(Integer10_30.convertInteger(src.getMaxLengthElement()));
for (org.hl7.fhir.dstu2.model.IdType t : src.getCondition()) tgt.addCondition(t.getValue());
for (org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent t : src.getConstraint())
tgt.addConstraint(convertElementDefinitionConstraintComponent(t));
if (src.hasMustSupport()) tgt.setMustSupportElement(Boolean10_30.convertBoolean(src.getMustSupportElement()));
if (src.hasIsModifier()) tgt.setIsModifierElement(Boolean10_30.convertBoolean(src.getIsModifierElement()));
if (src.hasIsSummary()) tgt.setIsSummaryElement(Boolean10_30.convertBoolean(src.getIsSummaryElement()));
if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
for (org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
tgt.addMapping(convertElementDefinitionMappingComponent(t));
return tgt;
}
return tgt;
}
public static org.hl7.fhir.dstu2.model.ElementDefinition convertElementDefinition(org.hl7.fhir.dstu3.model.ElementDefinition src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ElementDefinition tgt = new org.hl7.fhir.dstu2.model.ElementDefinition();
Element10_30.copyElement(src, tgt);
if (src.hasPathElement()) tgt.setPathElement(String10_30.convertString(src.getPathElement()));
tgt.setRepresentation(src.getRepresentation().stream().map(ElementDefinition10_30::convertPropertyRepresentation).collect(Collectors.toList()));
if (src.hasSliceName()) tgt.setNameElement(String10_30.convertString(src.getSliceNameElement()));
else tgt.setNameElement(String10_30.convertString(src.getIdElement()));
if (src.hasLabelElement()) tgt.setLabelElement(String10_30.convertString(src.getLabelElement()));
for (org.hl7.fhir.dstu3.model.Coding t : src.getCode()) tgt.addCode(Coding10_30.convertCoding(t));
if (src.hasSlicing()) tgt.setSlicing(convertElementDefinitionSlicingComponent(src.getSlicing()));
if (src.hasShortElement()) tgt.setShortElement(String10_30.convertString(src.getShortElement()));
if (src.hasDefinitionElement()) tgt.setDefinitionElement(MarkDown10_30.convertMarkdown(src.getDefinitionElement()));
if (src.hasCommentElement()) tgt.setCommentsElement(MarkDown10_30.convertMarkdown(src.getCommentElement()));
if (src.hasRequirementsElement()) tgt.setRequirementsElement(MarkDown10_30.convertMarkdown(src.getRequirementsElement()));
for (org.hl7.fhir.dstu3.model.StringType t : src.getAlias()) tgt.addAlias(t.getValue());
tgt.setMin(src.getMin());
if (src.hasMaxElement()) tgt.setMaxElement(String10_30.convertString(src.getMaxElement()));
if (src.hasBase()) tgt.setBase(convertElementDefinitionBaseComponent(src.getBase()));
if (src.hasContentReference()) tgt.setNameReference(src.getContentReference().substring(1));
for (org.hl7.fhir.dstu3.model.ElementDefinition.TypeRefComponent t : src.getType())
tgt.addType(convertElementDefinitionTypeComponent(t));
if (src.hasDefaultValue()) tgt.setDefaultValue(Type10_30.convertType(src.getDefaultValue()));
if (src.hasMeaningWhenMissingElement())
tgt.setMeaningWhenMissingElement(MarkDown10_30.convertMarkdown(src.getMeaningWhenMissingElement()));
if (src.hasFixed()) tgt.setFixed(Type10_30.convertType(src.getFixed()));
if (src.hasPattern()) tgt.setPattern(Type10_30.convertType(src.getPattern()));
if (src.hasExample()) tgt.setExample(Type10_30.convertType(src.getExampleFirstRep().getValue()));
if (src.hasMinValue()) tgt.setMinValue(Type10_30.convertType(src.getMinValue()));
if (src.hasMaxValue()) tgt.setMaxValue(Type10_30.convertType(src.getMaxValue()));
if (src.hasMaxLengthElement()) tgt.setMaxLengthElement(Integer10_30.convertInteger(src.getMaxLengthElement()));
for (org.hl7.fhir.dstu3.model.IdType t : src.getCondition()) tgt.addCondition(t.getValue());
for (org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionConstraintComponent t : src.getConstraint())
tgt.addConstraint(convertElementDefinitionConstraintComponent(t));
if (src.hasMustSupportElement()) tgt.setMustSupportElement(Boolean10_30.convertBoolean(src.getMustSupportElement()));
if (src.hasIsModifierElement()) tgt.setIsModifierElement(Boolean10_30.convertBoolean(src.getIsModifierElement()));
if (src.hasIsSummaryElement()) tgt.setIsSummaryElement(Boolean10_30.convertBoolean(src.getIsSummaryElement()));
if (src.hasBinding()) tgt.setBinding(convertElementDefinitionBindingComponent(src.getBinding()));
for (org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionMappingComponent t : src.getMapping())
tgt.addMapping(convertElementDefinitionMappingComponent(t));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation> convertPropertyRepresentation(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentationEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.NULL);
} else {
switch (src.getValue()) {
case XMLATTR:
tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.XMLATTR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation> convertPropertyRepresentation(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentationEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.NULL);
} else {
switch (src.getValue()) {
case XMLATTR:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.XMLATTR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation> convertPropertyRepresentation(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ElementDefinition.PropertyRepresentation> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentationEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.NULL);
} else {
switch (src.getValue()) {
case XMLATTR:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.XMLATTR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.PropertyRepresentation.NULL);
break;
}
public static org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionSlicingComponent convertElementDefinitionSlicingComponent(org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionSlicingComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionSlicingComponent tgt = new org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionSlicingComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.StringType t : src.getDiscriminator())
tgt.addDiscriminator(ProfileUtilities.interpretR2Discriminator(t.getValue()));
if (src.hasDescriptionElement()) tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasOrderedElement()) tgt.setOrderedElement(Boolean10_30.convertBoolean(src.getOrderedElement()));
if (src.hasRules()) tgt.setRulesElement(convertSlicingRules(src.getRulesElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionSlicingComponent convertElementDefinitionSlicingComponent(org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionSlicingComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionSlicingComponent tgt = new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionSlicingComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent t : src.getDiscriminator())
tgt.addDiscriminator(ProfileUtilities.buildR2Discriminator(t));
if (src.hasDescriptionElement()) tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasOrderedElement()) tgt.setOrderedElement(Boolean10_30.convertBoolean(src.getOrderedElement()));
if (src.hasRules()) tgt.setRulesElement(convertSlicingRules(src.getRulesElement()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.SlicingRules> convertSlicingRules(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.SlicingRules> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ElementDefinition.SlicingRulesEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(ElementDefinition.SlicingRules.NULL);
} else {
switch (src.getValue()) {
case CLOSED:
tgt.setValue(ElementDefinition.SlicingRules.CLOSED);
break;
case OPEN:
tgt.setValue(ElementDefinition.SlicingRules.OPEN);
break;
case OPENATEND:
tgt.setValue(ElementDefinition.SlicingRules.OPENATEND);
break;
default:
tgt.setValue(ElementDefinition.SlicingRules.NULL);
break;
}
return tgt;
}
return tgt;
}
public static org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionSlicingComponent convertElementDefinitionSlicingComponent(org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionSlicingComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionSlicingComponent tgt = new org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionSlicingComponent();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.StringType t : src.getDiscriminator())
tgt.addDiscriminator(ProfileUtilities.interpretR2Discriminator(t.getValue()));
if (src.hasDescriptionElement()) tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasOrderedElement()) tgt.setOrderedElement(Boolean10_30.convertBoolean(src.getOrderedElement()));
if (src.hasRules()) tgt.setRulesElement(convertSlicingRules(src.getRulesElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionSlicingComponent convertElementDefinitionSlicingComponent(org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionSlicingComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionSlicingComponent tgt = new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionSlicingComponent();
Element10_30.copyElement(src, tgt);
for (ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent t : src.getDiscriminator())
tgt.addDiscriminator(ProfileUtilities.buildR2Discriminator(t));
if (src.hasDescriptionElement()) tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasOrderedElement()) tgt.setOrderedElement(Boolean10_30.convertBoolean(src.getOrderedElement()));
if (src.hasRules()) tgt.setRulesElement(convertSlicingRules(src.getRulesElement()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.SlicingRules> convertSlicingRules(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.SlicingRules> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ElementDefinition.SlicingRulesEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(ElementDefinition.SlicingRules.NULL);
} else {
switch (src.getValue()) {
case CLOSED:
tgt.setValue(ElementDefinition.SlicingRules.CLOSED);
break;
case OPEN:
tgt.setValue(ElementDefinition.SlicingRules.OPEN);
break;
case OPENATEND:
tgt.setValue(ElementDefinition.SlicingRules.OPENATEND);
break;
default:
tgt.setValue(ElementDefinition.SlicingRules.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules> convertSlicingRules(org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.SlicingRules> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRulesEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.NULL);
} else {
switch (src.getValue()) {
case CLOSED:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.CLOSED);
break;
case OPEN:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPEN);
break;
case OPENATEND:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPENATEND);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules> convertSlicingRules(org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.SlicingRules> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRulesEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.NULL);
} else {
switch (src.getValue()) {
case CLOSED:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.CLOSED);
break;
case OPEN:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPEN);
break;
case OPENATEND:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.OPENATEND);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.SlicingRules.NULL);
break;
}
public static ElementDefinition.ElementDefinitionBaseComponent convertElementDefinitionBaseComponent(org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBaseComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
ElementDefinition.ElementDefinitionBaseComponent tgt = new ElementDefinition.ElementDefinitionBaseComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasPathElement()) tgt.setPathElement(String10_30.convertString(src.getPathElement()));
if (src.hasMin()) tgt.setMin(src.getMin());
if (src.hasMaxElement()) tgt.setMaxElement(String10_30.convertString(src.getMaxElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBaseComponent convertElementDefinitionBaseComponent(ElementDefinition.ElementDefinitionBaseComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBaseComponent tgt = new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBaseComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasPathElement()) tgt.setPathElement(String10_30.convertString(src.getPathElement()));
if (src.hasMin()) tgt.setMin(src.getMin());
if (src.hasMaxElement()) tgt.setMaxElement(String10_30.convertString(src.getMaxElement()));
return tgt;
}
public static ElementDefinition.TypeRefComponent convertElementDefinitionTypeComponent(org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
ElementDefinition.TypeRefComponent tgt = new ElementDefinition.TypeRefComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCodeToUri(src.getCodeElement()));
for (org.hl7.fhir.dstu2.model.UriType t : src.getProfile())
if (src.hasTarget()) tgt.setTargetProfile(t.getValueAsString());
else tgt.setProfile(t.getValue());
tgt.setAggregation(src.getAggregation().stream().map(ElementDefinition10_30::convertAggregationMode).collect(Collectors.toList()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent convertElementDefinitionTypeComponent(ElementDefinition.TypeRefComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent tgt = new org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertUriToCode(src.getCodeElement()));
if (src.hasTarget()) {
if (src.hasTargetProfile()) tgt.addProfile(src.getTargetProfile());
} else if (src.hasProfile()) tgt.addProfile(src.getProfile());
tgt.setAggregation(src.getAggregation().stream().map(ElementDefinition10_30::convertAggregationMode).collect(Collectors.toList()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.AggregationMode> convertAggregationMode(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.AggregationMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ElementDefinition.AggregationModeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(ElementDefinition.AggregationMode.NULL);
} else {
switch (src.getValue()) {
case CONTAINED:
tgt.setValue(ElementDefinition.AggregationMode.CONTAINED);
break;
case REFERENCED:
tgt.setValue(ElementDefinition.AggregationMode.REFERENCED);
break;
case BUNDLED:
tgt.setValue(ElementDefinition.AggregationMode.BUNDLED);
break;
default:
tgt.setValue(ElementDefinition.AggregationMode.NULL);
break;
}
return tgt;
}
return tgt;
}
public static ElementDefinition.ElementDefinitionBaseComponent convertElementDefinitionBaseComponent(org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBaseComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
ElementDefinition.ElementDefinitionBaseComponent tgt = new ElementDefinition.ElementDefinitionBaseComponent();
Element10_30.copyElement(src, tgt);
if (src.hasPathElement()) tgt.setPathElement(String10_30.convertString(src.getPathElement()));
if (src.hasMin()) tgt.setMin(src.getMin());
if (src.hasMaxElement()) tgt.setMaxElement(String10_30.convertString(src.getMaxElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBaseComponent convertElementDefinitionBaseComponent(ElementDefinition.ElementDefinitionBaseComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBaseComponent tgt = new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBaseComponent();
Element10_30.copyElement(src, tgt);
if (src.hasPathElement()) tgt.setPathElement(String10_30.convertString(src.getPathElement()));
if (src.hasMin()) tgt.setMin(src.getMin());
if (src.hasMaxElement()) tgt.setMaxElement(String10_30.convertString(src.getMaxElement()));
return tgt;
}
public static ElementDefinition.TypeRefComponent convertElementDefinitionTypeComponent(org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
ElementDefinition.TypeRefComponent tgt = new ElementDefinition.TypeRefComponent();
Element10_30.copyElement(src, tgt);
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCodeToUri(src.getCodeElement()));
for (org.hl7.fhir.dstu2.model.UriType t : src.getProfile())
if (src.hasTarget()) tgt.setTargetProfile(t.getValueAsString());
else tgt.setProfile(t.getValue());
tgt.setAggregation(src.getAggregation().stream().map(ElementDefinition10_30::convertAggregationMode).collect(Collectors.toList()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent convertElementDefinitionTypeComponent(ElementDefinition.TypeRefComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent tgt = new org.hl7.fhir.dstu2.model.ElementDefinition.TypeRefComponent();
Element10_30.copyElement(src, tgt);
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertUriToCode(src.getCodeElement()));
if (src.hasTarget()) {
if (src.hasTargetProfile()) tgt.addProfile(src.getTargetProfile());
} else if (src.hasProfile()) tgt.addProfile(src.getProfile());
tgt.setAggregation(src.getAggregation().stream().map(ElementDefinition10_30::convertAggregationMode).collect(Collectors.toList()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.AggregationMode> convertAggregationMode(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.AggregationMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ElementDefinition.AggregationModeEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(ElementDefinition.AggregationMode.NULL);
} else {
switch (src.getValue()) {
case CONTAINED:
tgt.setValue(ElementDefinition.AggregationMode.CONTAINED);
break;
case REFERENCED:
tgt.setValue(ElementDefinition.AggregationMode.REFERENCED);
break;
case BUNDLED:
tgt.setValue(ElementDefinition.AggregationMode.BUNDLED);
break;
default:
tgt.setValue(ElementDefinition.AggregationMode.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode> convertAggregationMode(org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.AggregationMode> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.AggregationModeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.NULL);
} else {
switch (src.getValue()) {
case CONTAINED:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.CONTAINED);
break;
case REFERENCED:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.REFERENCED);
break;
case BUNDLED:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.BUNDLED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode> convertAggregationMode(org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.AggregationMode> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.AggregationModeEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.NULL);
} else {
switch (src.getValue()) {
case CONTAINED:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.CONTAINED);
break;
case REFERENCED:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.REFERENCED);
break;
case BUNDLED:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.BUNDLED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.AggregationMode.NULL);
break;
}
public static ElementDefinition.ElementDefinitionConstraintComponent convertElementDefinitionConstraintComponent(org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
ElementDefinition.ElementDefinitionConstraintComponent tgt = new ElementDefinition.ElementDefinitionConstraintComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasKeyElement()) tgt.setKeyElement(Id10_30.convertId(src.getKeyElement()));
if (src.hasRequirementsElement())
tgt.setRequirementsElement(String10_30.convertString(src.getRequirementsElement()));
if (src.hasSeverity()) tgt.setSeverityElement(convertConstraintSeverity(src.getSeverityElement()));
if (src.hasHumanElement()) tgt.setHumanElement(String10_30.convertString(src.getHumanElement()));
tgt.setExpression(ToolingExtensions.readStringExtension(src, ToolingExtensions.EXT_EXPRESSION));
if (src.hasXpathElement()) tgt.setXpathElement(String10_30.convertString(src.getXpathElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent convertElementDefinitionConstraintComponent(ElementDefinition.ElementDefinitionConstraintComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent tgt = new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasKeyElement()) tgt.setKeyElement(Id10_30.convertId(src.getKeyElement()));
if (src.hasRequirementsElement())
tgt.setRequirementsElement(String10_30.convertString(src.getRequirementsElement()));
if (src.hasSeverity()) tgt.setSeverityElement(convertConstraintSeverity(src.getSeverityElement()));
if (src.hasHumanElement()) tgt.setHumanElement(String10_30.convertString(src.getHumanElement()));
if (src.hasExpression())
ToolingExtensions.addStringExtension(tgt, ToolingExtensions.EXT_EXPRESSION, src.getExpression());
if (src.hasXpathElement()) tgt.setXpathElement(String10_30.convertString(src.getXpathElement()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.ConstraintSeverity> convertConstraintSeverity(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.ConstraintSeverity> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ElementDefinition.ConstraintSeverityEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(ElementDefinition.ConstraintSeverity.NULL);
} else {
switch (src.getValue()) {
case ERROR:
tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR);
break;
case WARNING:
tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING);
break;
default:
tgt.setValue(ElementDefinition.ConstraintSeverity.NULL);
break;
}
return tgt;
}
return tgt;
}
public static ElementDefinition.ElementDefinitionConstraintComponent convertElementDefinitionConstraintComponent(org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
ElementDefinition.ElementDefinitionConstraintComponent tgt = new ElementDefinition.ElementDefinitionConstraintComponent();
Element10_30.copyElement(src, tgt);
if (src.hasKeyElement()) tgt.setKeyElement(Id10_30.convertId(src.getKeyElement()));
if (src.hasRequirementsElement()) tgt.setRequirementsElement(String10_30.convertString(src.getRequirementsElement()));
if (src.hasSeverity()) tgt.setSeverityElement(convertConstraintSeverity(src.getSeverityElement()));
if (src.hasHumanElement()) tgt.setHumanElement(String10_30.convertString(src.getHumanElement()));
tgt.setExpression(ToolingExtensions.readStringExtension(src, ToolingExtensions.EXT_EXPRESSION));
if (src.hasXpathElement()) tgt.setXpathElement(String10_30.convertString(src.getXpathElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent convertElementDefinitionConstraintComponent(ElementDefinition.ElementDefinitionConstraintComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent tgt = new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionConstraintComponent();
Element10_30.copyElement(src, tgt);
if (src.hasKeyElement()) tgt.setKeyElement(Id10_30.convertId(src.getKeyElement()));
if (src.hasRequirementsElement()) tgt.setRequirementsElement(String10_30.convertString(src.getRequirementsElement()));
if (src.hasSeverity()) tgt.setSeverityElement(convertConstraintSeverity(src.getSeverityElement()));
if (src.hasHumanElement()) tgt.setHumanElement(String10_30.convertString(src.getHumanElement()));
if (src.hasExpression())
ToolingExtensions.addStringExtension(tgt, ToolingExtensions.EXT_EXPRESSION, src.getExpression());
if (src.hasXpathElement()) tgt.setXpathElement(String10_30.convertString(src.getXpathElement()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.ConstraintSeverity> convertConstraintSeverity(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.ConstraintSeverity> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new ElementDefinition.ConstraintSeverityEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(ElementDefinition.ConstraintSeverity.NULL);
} else {
switch (src.getValue()) {
case ERROR:
tgt.setValue(ElementDefinition.ConstraintSeverity.ERROR);
break;
case WARNING:
tgt.setValue(ElementDefinition.ConstraintSeverity.WARNING);
break;
default:
tgt.setValue(ElementDefinition.ConstraintSeverity.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity> convertConstraintSeverity(org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.ConstraintSeverity> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverityEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.NULL);
} else {
switch (src.getValue()) {
case ERROR:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.ERROR);
break;
case WARNING:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.WARNING);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity> convertConstraintSeverity(org.hl7.fhir.dstu3.model.Enumeration<ElementDefinition.ConstraintSeverity> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverityEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.NULL);
} else {
switch (src.getValue()) {
case ERROR:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.ERROR);
break;
case WARNING:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.WARNING);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.ElementDefinition.ConstraintSeverity.NULL);
break;
}
public static ElementDefinition.ElementDefinitionBindingComponent convertElementDefinitionBindingComponent(org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBindingComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
ElementDefinition.ElementDefinitionBindingComponent tgt = new ElementDefinition.ElementDefinitionBindingComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasStrength()) tgt.setStrengthElement(convertBindingStrength(src.getStrengthElement()));
if (src.hasDescriptionElement()) tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasValueSet())
tgt.setValueSet(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getValueSet()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBindingComponent convertElementDefinitionBindingComponent(ElementDefinition.ElementDefinitionBindingComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBindingComponent tgt = new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBindingComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasStrength()) tgt.setStrengthElement(convertBindingStrength(src.getStrengthElement()));
if (src.hasDescriptionElement()) tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasValueSet())
tgt.setValueSet(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getValueSet()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.BindingStrength> convertBindingStrength(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.BindingStrength> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.BindingStrength> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.BindingStrengthEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL);
} else {
switch (src.getValue()) {
case REQUIRED:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.REQUIRED);
break;
case EXTENSIBLE:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXTENSIBLE);
break;
case PREFERRED:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.PREFERRED);
break;
case EXAMPLE:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXAMPLE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL);
break;
}
return tgt;
}
return tgt;
}
public static ElementDefinition.ElementDefinitionBindingComponent convertElementDefinitionBindingComponent(org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBindingComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
ElementDefinition.ElementDefinitionBindingComponent tgt = new ElementDefinition.ElementDefinitionBindingComponent();
Element10_30.copyElement(src, tgt);
if (src.hasStrength()) tgt.setStrengthElement(convertBindingStrength(src.getStrengthElement()));
if (src.hasDescriptionElement()) tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasValueSet()) tgt.setValueSet(Type10_30.convertType(src.getValueSet()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBindingComponent convertElementDefinitionBindingComponent(ElementDefinition.ElementDefinitionBindingComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBindingComponent tgt = new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionBindingComponent();
Element10_30.copyElement(src, tgt);
if (src.hasStrength()) tgt.setStrengthElement(convertBindingStrength(src.getStrengthElement()));
if (src.hasDescriptionElement()) tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasValueSet()) tgt.setValueSet(Type10_30.convertType(src.getValueSet()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.BindingStrength> convertBindingStrength(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.BindingStrength> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.BindingStrength> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.BindingStrengthEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL);
} else {
switch (src.getValue()) {
case REQUIRED:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.REQUIRED);
break;
case EXTENSIBLE:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXTENSIBLE);
break;
case PREFERRED:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.PREFERRED);
break;
case EXAMPLE:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXAMPLE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.BindingStrength> convertBindingStrength(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.BindingStrength> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.BindingStrength> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.BindingStrengthEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL);
} else {
switch (src.getValue()) {
case REQUIRED:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.REQUIRED);
break;
case EXTENSIBLE:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXTENSIBLE);
break;
case PREFERRED:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.PREFERRED);
break;
case EXAMPLE:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXAMPLE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.BindingStrength> convertBindingStrength(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.BindingStrength> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.BindingStrength> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.BindingStrengthEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL);
} else {
switch (src.getValue()) {
case REQUIRED:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.REQUIRED);
break;
case EXTENSIBLE:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXTENSIBLE);
break;
case PREFERRED:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.PREFERRED);
break;
case EXAMPLE:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.EXAMPLE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.BindingStrength.NULL);
break;
}
}
return tgt;
}
public static ElementDefinition.ElementDefinitionMappingComponent convertElementDefinitionMappingComponent(org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionMappingComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
ElementDefinition.ElementDefinitionMappingComponent tgt = new ElementDefinition.ElementDefinitionMappingComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasIdentityElement()) tgt.setIdentityElement(Id10_30.convertId(src.getIdentityElement()));
if (src.hasLanguageElement()) tgt.setLanguageElement(Code10_30.convertCode(src.getLanguageElement()));
if (src.hasMapElement()) tgt.setMapElement(String10_30.convertString(src.getMapElement()));
return tgt;
}
public static ElementDefinition.ElementDefinitionMappingComponent convertElementDefinitionMappingComponent(org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionMappingComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
ElementDefinition.ElementDefinitionMappingComponent tgt = new ElementDefinition.ElementDefinitionMappingComponent();
Element10_30.copyElement(src, tgt);
if (src.hasIdentityElement()) tgt.setIdentityElement(Id10_30.convertId(src.getIdentityElement()));
if (src.hasLanguageElement()) tgt.setLanguageElement(Code10_30.convertCode(src.getLanguageElement()));
if (src.hasMapElement()) tgt.setMapElement(String10_30.convertString(src.getMapElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionMappingComponent convertElementDefinitionMappingComponent(ElementDefinition.ElementDefinitionMappingComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionMappingComponent tgt = new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionMappingComponent();
Element10_30.copyElement(src, tgt);
if (src.hasIdentityElement()) tgt.setIdentityElement(Id10_30.convertId(src.getIdentityElement()));
if (src.hasLanguageElement()) tgt.setLanguageElement(Code10_30.convertCode(src.getLanguageElement()));
if (src.hasMapElement()) tgt.setMapElement(String10_30.convertString(src.getMapElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionMappingComponent convertElementDefinitionMappingComponent(ElementDefinition.ElementDefinitionMappingComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionMappingComponent tgt = new org.hl7.fhir.dstu2.model.ElementDefinition.ElementDefinitionMappingComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasIdentityElement()) tgt.setIdentityElement(Id10_30.convertId(src.getIdentityElement()));
if (src.hasLanguageElement()) tgt.setLanguageElement(Code10_30.convertCode(src.getLanguageElement()));
if (src.hasMapElement()) tgt.setMapElement(String10_30.convertString(src.getMapElement()));
return tgt;
}
}

View File

@ -1,24 +1,27 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Extension10_30 {
public static org.hl7.fhir.dstu3.model.Extension convertExtension(org.hl7.fhir.dstu2.model.Extension src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Extension tgt = new org.hl7.fhir.dstu3.model.Extension();
Element10_30.copyElement(src, tgt);
if (src.hasUrlElement()) tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
if (src.hasValue()) tgt.setValue(Type10_30.convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Extension convertExtension(org.hl7.fhir.dstu2.model.Extension src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Extension tgt = new org.hl7.fhir.dstu3.model.Extension();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasUrlElement()) tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
if (src.hasValue())
tgt.setValue(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Extension convertExtension(org.hl7.fhir.dstu3.model.Extension src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Extension tgt = new org.hl7.fhir.dstu2.model.Extension();
Element10_30.copyElement(src, tgt);
if (src.hasUrlElement()) tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
if (src.hasValue()) tgt.setValue(Type10_30.convertType(src.getValue()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Extension convertExtension(org.hl7.fhir.dstu3.model.Extension src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Extension tgt = new org.hl7.fhir.dstu2.model.Extension();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasUrlElement()) tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
if (src.hasValue())
tgt.setValue(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getValue()));
return tgt;
}
}

View File

@ -1,32 +1,35 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Coding10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Id10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Meta10_30 {
public static org.hl7.fhir.dstu3.model.Meta convertMeta(org.hl7.fhir.dstu2.model.Meta src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Meta tgt = new org.hl7.fhir.dstu3.model.Meta();
Element10_30.copyElement(src, tgt);
if (src.hasVersionIdElement()) tgt.setVersionIdElement(Id10_30.convertId(src.getVersionIdElement()));
if (src.hasLastUpdatedElement()) tgt.setLastUpdatedElement(Instant10_30.convertInstant(src.getLastUpdatedElement()));
for (org.hl7.fhir.dstu2.model.UriType t : src.getProfile()) tgt.addProfile(t.getValue());
for (org.hl7.fhir.dstu2.model.Coding t : src.getSecurity()) tgt.addSecurity(Coding10_30.convertCoding(t));
for (org.hl7.fhir.dstu2.model.Coding t : src.getTag()) tgt.addTag(Coding10_30.convertCoding(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Meta convertMeta(org.hl7.fhir.dstu2.model.Meta src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Meta tgt = new org.hl7.fhir.dstu3.model.Meta();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasVersionIdElement()) tgt.setVersionIdElement(Id10_30.convertId(src.getVersionIdElement()));
if (src.hasLastUpdatedElement())
tgt.setLastUpdatedElement(Instant10_30.convertInstant(src.getLastUpdatedElement()));
for (org.hl7.fhir.dstu2.model.UriType t : src.getProfile()) tgt.addProfile(t.getValue());
for (org.hl7.fhir.dstu2.model.Coding t : src.getSecurity()) tgt.addSecurity(Coding10_30.convertCoding(t));
for (org.hl7.fhir.dstu2.model.Coding t : src.getTag()) tgt.addTag(Coding10_30.convertCoding(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Meta convertMeta(org.hl7.fhir.dstu3.model.Meta src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Meta tgt = new org.hl7.fhir.dstu2.model.Meta();
Element10_30.copyElement(src, tgt);
if (src.hasVersionIdElement()) tgt.setVersionIdElement(Id10_30.convertId(src.getVersionIdElement()));
if (src.hasLastUpdatedElement()) tgt.setLastUpdatedElement(Instant10_30.convertInstant(src.getLastUpdatedElement()));
for (org.hl7.fhir.dstu3.model.UriType t : src.getProfile()) tgt.addProfile(t.getValue());
for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurity()) tgt.addSecurity(Coding10_30.convertCoding(t));
for (org.hl7.fhir.dstu3.model.Coding t : src.getTag()) tgt.addTag(Coding10_30.convertCoding(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Meta convertMeta(org.hl7.fhir.dstu3.model.Meta src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Meta tgt = new org.hl7.fhir.dstu2.model.Meta();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasVersionIdElement()) tgt.setVersionIdElement(Id10_30.convertId(src.getVersionIdElement()));
if (src.hasLastUpdatedElement())
tgt.setLastUpdatedElement(Instant10_30.convertInstant(src.getLastUpdatedElement()));
for (org.hl7.fhir.dstu3.model.UriType t : src.getProfile()) tgt.addProfile(t.getValue());
for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurity()) tgt.addSecurity(Coding10_30.convertCoding(t));
for (org.hl7.fhir.dstu3.model.Coding t : src.getTag()) tgt.addTag(Coding10_30.convertCoding(t));
return tgt;
}
}

View File

@ -1,80 +1,80 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Narrative10_30 {
public static org.hl7.fhir.dstu3.model.Narrative convertNarrative(org.hl7.fhir.dstu2.model.Narrative src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Narrative tgt = new org.hl7.fhir.dstu3.model.Narrative();
Element10_30.copyElement(src, tgt);
if (src.hasStatus()) tgt.setStatusElement(convertNarrativeStatus(src.getStatusElement()));
if (src.hasDiv()) tgt.setDiv(src.getDiv());
return tgt;
}
public static org.hl7.fhir.dstu3.model.Narrative convertNarrative(org.hl7.fhir.dstu2.model.Narrative src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Narrative tgt = new org.hl7.fhir.dstu3.model.Narrative();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasStatus()) tgt.setStatusElement(convertNarrativeStatus(src.getStatusElement()));
if (src.hasDiv()) tgt.setDiv(src.getDiv());
return tgt;
}
public static org.hl7.fhir.dstu2.model.Narrative convertNarrative(org.hl7.fhir.dstu3.model.Narrative src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Narrative tgt = new org.hl7.fhir.dstu2.model.Narrative();
Element10_30.copyElement(src, tgt);
if (src.hasStatus()) tgt.setStatusElement(convertNarrativeStatus(src.getStatusElement()));
tgt.setDiv(src.getDiv());
return tgt;
}
public static org.hl7.fhir.dstu2.model.Narrative convertNarrative(org.hl7.fhir.dstu3.model.Narrative src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Narrative tgt = new org.hl7.fhir.dstu2.model.Narrative();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasStatus()) tgt.setStatusElement(convertNarrativeStatus(src.getStatusElement()));
tgt.setDiv(src.getDiv());
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus> convertNarrativeStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Narrative.NarrativeStatusEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.NULL);
} else {
switch (src.getValue()) {
case GENERATED:
tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.GENERATED);
break;
case EXTENSIONS:
tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EXTENSIONS);
break;
case ADDITIONAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.ADDITIONAL);
break;
case EMPTY:
tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EMPTY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.NULL);
break;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus> convertNarrativeStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Narrative.NarrativeStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.NULL);
} else {
switch (src.getValue()) {
case GENERATED:
tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.GENERATED);
break;
case EXTENSIONS:
tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EXTENSIONS);
break;
case ADDITIONAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.ADDITIONAL);
break;
case EMPTY:
tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.EMPTY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus> convertNarrativeStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Narrative.NarrativeStatusEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.NULL);
} else {
switch (src.getValue()) {
case GENERATED:
tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.GENERATED);
break;
case EXTENSIONS:
tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EXTENSIONS);
break;
case ADDITIONAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.ADDITIONAL);
break;
case EMPTY:
tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EMPTY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus> convertNarrativeStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Narrative.NarrativeStatus> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Narrative.NarrativeStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.NULL);
} else {
switch (src.getValue()) {
case GENERATED:
tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.GENERATED);
break;
case EXTENSIONS:
tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EXTENSIONS);
break;
case ADDITIONAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.ADDITIONAL);
break;
case EMPTY:
tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.EMPTY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Narrative.NarrativeStatus.NULL);
break;
}
return tgt;
}
return tgt;
}
}

View File

@ -1,24 +1,25 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Reference10_30 {
public static org.hl7.fhir.dstu3.model.Reference convertReference(org.hl7.fhir.dstu2.model.Reference src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Reference tgt = new org.hl7.fhir.dstu3.model.Reference();
Element10_30.copyElement(src, tgt);
if (src.hasReference()) tgt.setReference(src.getReference());
if (src.hasDisplayElement()) tgt.setDisplayElement(String10_30.convertString(src.getDisplayElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Reference convertReference(org.hl7.fhir.dstu2.model.Reference src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Reference tgt = new org.hl7.fhir.dstu3.model.Reference();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasReference()) tgt.setReference(src.getReference());
if (src.hasDisplayElement()) tgt.setDisplayElement(String10_30.convertString(src.getDisplayElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Reference convertReference(org.hl7.fhir.dstu3.model.Reference src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Reference tgt = new org.hl7.fhir.dstu2.model.Reference();
Element10_30.copyElement(src, tgt);
if (src.hasReference()) tgt.setReference(src.getReference());
if (src.hasDisplayElement()) tgt.setDisplayElement(String10_30.convertString(src.getDisplayElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Reference convertReference(org.hl7.fhir.dstu3.model.Reference src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Reference tgt = new org.hl7.fhir.dstu2.model.Reference();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasReference()) tgt.setReference(src.getReference());
if (src.hasDisplayElement()) tgt.setDisplayElement(String10_30.convertString(src.getDisplayElement()));
return tgt;
}
}

View File

@ -1,5 +1,6 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.*;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.*;
import org.hl7.fhir.exceptions.FHIRException;
@ -7,161 +8,194 @@ import org.hl7.fhir.exceptions.FHIRException;
import java.util.ArrayList;
public class Type10_30 {
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.dstu2.model.Type src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
if (src instanceof org.hl7.fhir.dstu2.model.Base64BinaryType)
return Base64Binary10_30.convertBase64Binary((org.hl7.fhir.dstu2.model.Base64BinaryType) src);
if (src instanceof org.hl7.fhir.dstu2.model.BooleanType)
return Boolean10_30.convertBoolean((org.hl7.fhir.dstu2.model.BooleanType) src);
if (src instanceof org.hl7.fhir.dstu2.model.CodeType)
return Code10_30.convertCode((org.hl7.fhir.dstu2.model.CodeType) src);
if (src instanceof org.hl7.fhir.dstu2.model.DateType)
return Date10_30.convertDate((org.hl7.fhir.dstu2.model.DateType) src);
if (src instanceof org.hl7.fhir.dstu2.model.DateTimeType)
return DateTime10_30.convertDateTime((org.hl7.fhir.dstu2.model.DateTimeType) src);
if (src instanceof org.hl7.fhir.dstu2.model.DecimalType)
return Decimal10_30.convertDecimal((org.hl7.fhir.dstu2.model.DecimalType) src);
if (src instanceof org.hl7.fhir.dstu2.model.IdType) return Id10_30.convertId((org.hl7.fhir.dstu2.model.IdType) src);
if (src instanceof org.hl7.fhir.dstu2.model.InstantType)
return Instant10_30.convertInstant((org.hl7.fhir.dstu2.model.InstantType) src);
if (src instanceof org.hl7.fhir.dstu2.model.PositiveIntType)
return PositiveInt10_30.convertPositiveInt((org.hl7.fhir.dstu2.model.PositiveIntType) src);
if (src instanceof org.hl7.fhir.dstu2.model.UnsignedIntType)
return UnsignedInt10_30.convertUnsignedInt((org.hl7.fhir.dstu2.model.UnsignedIntType) src);
if (src instanceof org.hl7.fhir.dstu2.model.IntegerType)
return Integer10_30.convertInteger((org.hl7.fhir.dstu2.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu2.model.MarkdownType)
return MarkDown10_30.convertMarkdown((org.hl7.fhir.dstu2.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.dstu2.model.OidType) return Oid10_30.convertOid((org.hl7.fhir.dstu2.model.OidType) src);
if (src instanceof org.hl7.fhir.dstu2.model.StringType)
return String10_30.convertString((org.hl7.fhir.dstu2.model.StringType) src);
if (src instanceof org.hl7.fhir.dstu2.model.TimeType)
return Time10_30.convertTime((org.hl7.fhir.dstu2.model.TimeType) src);
if (src instanceof org.hl7.fhir.dstu2.model.UuidType)
return Uuid10_30.convertUuid((org.hl7.fhir.dstu2.model.UuidType) src);
if (src instanceof org.hl7.fhir.dstu2.model.UriType) return Uri10_30.convertUri((org.hl7.fhir.dstu2.model.UriType) src);
if (src instanceof org.hl7.fhir.dstu2.model.Extension)
return Extension10_30.convertExtension((org.hl7.fhir.dstu2.model.Extension) src);
if (src instanceof org.hl7.fhir.dstu2.model.Narrative)
return Narrative10_30.convertNarrative((org.hl7.fhir.dstu2.model.Narrative) src);
if (src instanceof org.hl7.fhir.dstu2.model.Annotation)
return Annotation10_30.convertAnnotation((org.hl7.fhir.dstu2.model.Annotation) src);
if (src instanceof org.hl7.fhir.dstu2.model.Attachment)
return Attachment10_30.convertAttachment((org.hl7.fhir.dstu2.model.Attachment) src);
if (src instanceof org.hl7.fhir.dstu2.model.CodeableConcept)
return CodeableConcept10_30.convertCodeableConcept((org.hl7.fhir.dstu2.model.CodeableConcept) src);
if (src instanceof org.hl7.fhir.dstu2.model.Coding) return Coding10_30.convertCoding((org.hl7.fhir.dstu2.model.Coding) src);
if (src instanceof org.hl7.fhir.dstu2.model.Identifier)
return Identifier10_30.convertIdentifier((org.hl7.fhir.dstu2.model.Identifier) src);
if (src instanceof org.hl7.fhir.dstu2.model.Period) return Period10_30.convertPeriod((org.hl7.fhir.dstu2.model.Period) src);
if (src instanceof org.hl7.fhir.dstu2.model.Age) return Age10_30.convertAge((org.hl7.fhir.dstu2.model.Age) src);
if (src instanceof org.hl7.fhir.dstu2.model.Count) return Count10_30.convertCount((org.hl7.fhir.dstu2.model.Count) src);
if (src instanceof org.hl7.fhir.dstu2.model.Distance)
return Distance10_30.convertDistance((org.hl7.fhir.dstu2.model.Distance) src);
if (src instanceof org.hl7.fhir.dstu2.model.Duration)
return Duration10_30.convertDuration((org.hl7.fhir.dstu2.model.Duration) src);
if (src instanceof org.hl7.fhir.dstu2.model.Money) return Money10_30.convertMoney((org.hl7.fhir.dstu2.model.Money) src);
if (src instanceof org.hl7.fhir.dstu2.model.SimpleQuantity)
return SimpleQuantity10_30.convertSimpleQuantity((org.hl7.fhir.dstu2.model.SimpleQuantity) src);
if (src instanceof org.hl7.fhir.dstu2.model.Quantity)
return Quantity10_30.convertQuantity((org.hl7.fhir.dstu2.model.Quantity) src);
if (src instanceof org.hl7.fhir.dstu2.model.Range) return Range10_30.convertRange((org.hl7.fhir.dstu2.model.Range) src);
if (src instanceof org.hl7.fhir.dstu2.model.Ratio) return Ratio10_30.convertRatio((org.hl7.fhir.dstu2.model.Ratio) src);
if (src instanceof org.hl7.fhir.dstu2.model.Reference)
return Reference10_30.convertReference((org.hl7.fhir.dstu2.model.Reference) src);
if (src instanceof org.hl7.fhir.dstu2.model.SampledData)
return SampledData10_30.convertSampledData((org.hl7.fhir.dstu2.model.SampledData) src);
if (src instanceof org.hl7.fhir.dstu2.model.Signature)
return Signature10_30.convertSignature((org.hl7.fhir.dstu2.model.Signature) src);
if (src instanceof org.hl7.fhir.dstu2.model.Address)
return Address10_30.convertAddress((org.hl7.fhir.dstu2.model.Address) src);
if (src instanceof org.hl7.fhir.dstu2.model.ContactPoint)
return ContactPoint10_30.convertContactPoint((org.hl7.fhir.dstu2.model.ContactPoint) src);
if (src instanceof org.hl7.fhir.dstu2.model.ElementDefinition)
return ElementDefinition10_30.convertElementDefinition((org.hl7.fhir.dstu2.model.ElementDefinition) src, new ArrayList<String>());
if (src instanceof org.hl7.fhir.dstu2.model.HumanName)
return HumanName10_30.convertHumanName((org.hl7.fhir.dstu2.model.HumanName) src);
if (src instanceof org.hl7.fhir.dstu2.model.Meta) return Meta10_30.convertMeta((org.hl7.fhir.dstu2.model.Meta) src);
if (src instanceof org.hl7.fhir.dstu2.model.Timing) return Timing10_30.convertTiming((org.hl7.fhir.dstu2.model.Timing) src);
throw new FHIRException("Unknown type " + src.fhirType());
}
public static org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.dstu3.model.Type src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
if (src instanceof org.hl7.fhir.dstu3.model.Base64BinaryType)
return Base64Binary10_30.convertBase64Binary((org.hl7.fhir.dstu3.model.Base64BinaryType) src);
if (src instanceof org.hl7.fhir.dstu3.model.BooleanType)
return Boolean10_30.convertBoolean((org.hl7.fhir.dstu3.model.BooleanType) src);
if (src instanceof org.hl7.fhir.dstu3.model.CodeType)
return Code10_30.convertCode((org.hl7.fhir.dstu3.model.CodeType) src);
if (src instanceof org.hl7.fhir.dstu3.model.DateType)
return Date10_30.convertDate((org.hl7.fhir.dstu3.model.DateType) src);
if (src instanceof org.hl7.fhir.dstu3.model.DateTimeType)
return DateTime10_30.convertDateTime((org.hl7.fhir.dstu3.model.DateTimeType) src);
if (src instanceof org.hl7.fhir.dstu3.model.DecimalType)
return Decimal10_30.convertDecimal((org.hl7.fhir.dstu3.model.DecimalType) src);
if (src instanceof org.hl7.fhir.dstu3.model.IdType) return Id10_30.convertId((org.hl7.fhir.dstu3.model.IdType) src);
if (src instanceof org.hl7.fhir.dstu3.model.InstantType)
return Instant10_30.convertInstant((org.hl7.fhir.dstu3.model.InstantType) src);
if (src instanceof org.hl7.fhir.dstu3.model.PositiveIntType)
return PositiveInt10_30.convertPositiveInt((org.hl7.fhir.dstu3.model.PositiveIntType) src);
if (src instanceof org.hl7.fhir.dstu3.model.UnsignedIntType)
return UnsignedInt10_30.convertUnsignedInt((org.hl7.fhir.dstu3.model.UnsignedIntType) src);
if (src instanceof org.hl7.fhir.dstu3.model.IntegerType)
return Integer10_30.convertInteger((org.hl7.fhir.dstu3.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu3.model.MarkdownType)
return MarkDown10_30.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.dstu3.model.OidType) return Oid10_30.convertOid((org.hl7.fhir.dstu3.model.OidType) src);
if (src instanceof org.hl7.fhir.dstu3.model.StringType)
return String10_30.convertString((org.hl7.fhir.dstu3.model.StringType) src);
if (src instanceof org.hl7.fhir.dstu3.model.TimeType)
return Time10_30.convertTime((org.hl7.fhir.dstu3.model.TimeType) src);
if (src instanceof org.hl7.fhir.dstu3.model.UuidType)
return Uuid10_30.convertUuid((org.hl7.fhir.dstu3.model.UuidType) src);
if (src instanceof org.hl7.fhir.dstu3.model.UriType) return Uri10_30.convertUri((org.hl7.fhir.dstu3.model.UriType) src);
if (src instanceof org.hl7.fhir.dstu3.model.Extension)
return Extension10_30.convertExtension((org.hl7.fhir.dstu3.model.Extension) src);
if (src instanceof org.hl7.fhir.dstu3.model.Narrative)
return Narrative10_30.convertNarrative((org.hl7.fhir.dstu3.model.Narrative) src);
if (src instanceof org.hl7.fhir.dstu3.model.Annotation)
return Annotation10_30.convertAnnotation((org.hl7.fhir.dstu3.model.Annotation) src);
if (src instanceof org.hl7.fhir.dstu3.model.Attachment)
return Attachment10_30.convertAttachment((org.hl7.fhir.dstu3.model.Attachment) src);
if (src instanceof org.hl7.fhir.dstu3.model.CodeableConcept)
return CodeableConcept10_30.convertCodeableConcept((org.hl7.fhir.dstu3.model.CodeableConcept) src);
if (src instanceof org.hl7.fhir.dstu3.model.Coding) return Coding10_30.convertCoding((org.hl7.fhir.dstu3.model.Coding) src);
if (src instanceof org.hl7.fhir.dstu3.model.Identifier)
return Identifier10_30.convertIdentifier((org.hl7.fhir.dstu3.model.Identifier) src);
if (src instanceof org.hl7.fhir.dstu3.model.Period) return Period10_30.convertPeriod((org.hl7.fhir.dstu3.model.Period) src);
if (src instanceof org.hl7.fhir.dstu3.model.Age) return Age10_30.convertAge((org.hl7.fhir.dstu3.model.Age) src);
if (src instanceof org.hl7.fhir.dstu3.model.Count) return Count10_30.convertCount((org.hl7.fhir.dstu3.model.Count) src);
if (src instanceof org.hl7.fhir.dstu3.model.Distance)
return Distance10_30.convertDistance((org.hl7.fhir.dstu3.model.Distance) src);
if (src instanceof org.hl7.fhir.dstu3.model.Duration)
return Duration10_30.convertDuration((org.hl7.fhir.dstu3.model.Duration) src);
if (src instanceof org.hl7.fhir.dstu3.model.Money) return Money10_30.convertMoney((org.hl7.fhir.dstu3.model.Money) src);
if (src instanceof org.hl7.fhir.dstu3.model.SimpleQuantity)
return SimpleQuantity10_30.convertSimpleQuantity((org.hl7.fhir.dstu3.model.SimpleQuantity) src);
if (src instanceof org.hl7.fhir.dstu3.model.Quantity)
return Quantity10_30.convertQuantity((org.hl7.fhir.dstu3.model.Quantity) src);
if (src instanceof org.hl7.fhir.dstu3.model.Range) return Range10_30.convertRange((org.hl7.fhir.dstu3.model.Range) src);
if (src instanceof org.hl7.fhir.dstu3.model.Ratio) return Ratio10_30.convertRatio((org.hl7.fhir.dstu3.model.Ratio) src);
if (src instanceof org.hl7.fhir.dstu3.model.Reference)
return Reference10_30.convertReference((org.hl7.fhir.dstu3.model.Reference) src);
if (src instanceof org.hl7.fhir.dstu3.model.SampledData)
return SampledData10_30.convertSampledData((org.hl7.fhir.dstu3.model.SampledData) src);
if (src instanceof org.hl7.fhir.dstu3.model.Signature)
return Signature10_30.convertSignature((org.hl7.fhir.dstu3.model.Signature) src);
if (src instanceof org.hl7.fhir.dstu3.model.Address)
return Address10_30.convertAddress((org.hl7.fhir.dstu3.model.Address) src);
if (src instanceof org.hl7.fhir.dstu3.model.ContactPoint)
return ContactPoint10_30.convertContactPoint((org.hl7.fhir.dstu3.model.ContactPoint) src);
if (src instanceof org.hl7.fhir.dstu3.model.ElementDefinition)
return ElementDefinition10_30.convertElementDefinition((org.hl7.fhir.dstu3.model.ElementDefinition) src);
if (src instanceof org.hl7.fhir.dstu3.model.HumanName)
return HumanName10_30.convertHumanName((org.hl7.fhir.dstu3.model.HumanName) src);
if (src instanceof org.hl7.fhir.dstu3.model.Meta) return Meta10_30.convertMeta((org.hl7.fhir.dstu3.model.Meta) src);
if (src instanceof org.hl7.fhir.dstu3.model.Timing) return Timing10_30.convertTiming((org.hl7.fhir.dstu3.model.Timing) src);
private final BaseAdvisor_10_30 advisor;
public Type10_30(BaseAdvisor_10_30 advisor) {
this.advisor = advisor;
}
public org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.dstu2.model.Type src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
if (src instanceof org.hl7.fhir.dstu2.model.Base64BinaryType)
return Base64Binary10_30.convertBase64Binary((org.hl7.fhir.dstu2.model.Base64BinaryType) src);
if (src instanceof org.hl7.fhir.dstu2.model.BooleanType)
return Boolean10_30.convertBoolean((org.hl7.fhir.dstu2.model.BooleanType) src);
if (src instanceof org.hl7.fhir.dstu2.model.CodeType)
return Code10_30.convertCode((org.hl7.fhir.dstu2.model.CodeType) src);
if (src instanceof org.hl7.fhir.dstu2.model.DateType)
return Date10_30.convertDate((org.hl7.fhir.dstu2.model.DateType) src);
if (src instanceof org.hl7.fhir.dstu2.model.DateTimeType)
return DateTime10_30.convertDateTime((org.hl7.fhir.dstu2.model.DateTimeType) src);
if (src instanceof org.hl7.fhir.dstu2.model.DecimalType)
return Decimal10_30.convertDecimal((org.hl7.fhir.dstu2.model.DecimalType) src);
if (src instanceof org.hl7.fhir.dstu2.model.IdType) return Id10_30.convertId((org.hl7.fhir.dstu2.model.IdType) src);
if (src instanceof org.hl7.fhir.dstu2.model.InstantType)
return Instant10_30.convertInstant((org.hl7.fhir.dstu2.model.InstantType) src);
if (src instanceof org.hl7.fhir.dstu2.model.PositiveIntType)
return PositiveInt10_30.convertPositiveInt((org.hl7.fhir.dstu2.model.PositiveIntType) src);
if (src instanceof org.hl7.fhir.dstu2.model.UnsignedIntType)
return UnsignedInt10_30.convertUnsignedInt((org.hl7.fhir.dstu2.model.UnsignedIntType) src);
if (src instanceof org.hl7.fhir.dstu2.model.IntegerType)
return Integer10_30.convertInteger((org.hl7.fhir.dstu2.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu2.model.MarkdownType)
return MarkDown10_30.convertMarkdown((org.hl7.fhir.dstu2.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.dstu2.model.OidType)
return Oid10_30.convertOid((org.hl7.fhir.dstu2.model.OidType) src);
if (src instanceof org.hl7.fhir.dstu2.model.StringType)
return String10_30.convertString((org.hl7.fhir.dstu2.model.StringType) src);
if (src instanceof org.hl7.fhir.dstu2.model.TimeType)
return Time10_30.convertTime((org.hl7.fhir.dstu2.model.TimeType) src);
if (src instanceof org.hl7.fhir.dstu2.model.UuidType)
return Uuid10_30.convertUuid((org.hl7.fhir.dstu2.model.UuidType) src);
if (src instanceof org.hl7.fhir.dstu2.model.UriType)
return Uri10_30.convertUri((org.hl7.fhir.dstu2.model.UriType) src);
if (src instanceof org.hl7.fhir.dstu2.model.Extension)
return Extension10_30.convertExtension((org.hl7.fhir.dstu2.model.Extension) src);
if (src instanceof org.hl7.fhir.dstu2.model.Narrative)
return Narrative10_30.convertNarrative((org.hl7.fhir.dstu2.model.Narrative) src);
if (src instanceof org.hl7.fhir.dstu2.model.Annotation)
return Annotation10_30.convertAnnotation((org.hl7.fhir.dstu2.model.Annotation) src);
if (src instanceof org.hl7.fhir.dstu2.model.Attachment)
return Attachment10_30.convertAttachment((org.hl7.fhir.dstu2.model.Attachment) src);
if (src instanceof org.hl7.fhir.dstu2.model.CodeableConcept)
return CodeableConcept10_30.convertCodeableConcept((org.hl7.fhir.dstu2.model.CodeableConcept) src);
if (src instanceof org.hl7.fhir.dstu2.model.Coding)
return Coding10_30.convertCoding((org.hl7.fhir.dstu2.model.Coding) src);
if (src instanceof org.hl7.fhir.dstu2.model.Identifier)
return Identifier10_30.convertIdentifier((org.hl7.fhir.dstu2.model.Identifier) src);
if (src instanceof org.hl7.fhir.dstu2.model.Period)
return Period10_30.convertPeriod((org.hl7.fhir.dstu2.model.Period) src);
if (src instanceof org.hl7.fhir.dstu2.model.Age) return Age10_30.convertAge((org.hl7.fhir.dstu2.model.Age) src);
if (src instanceof org.hl7.fhir.dstu2.model.Count)
return Count10_30.convertCount((org.hl7.fhir.dstu2.model.Count) src);
if (src instanceof org.hl7.fhir.dstu2.model.Distance)
return Distance10_30.convertDistance((org.hl7.fhir.dstu2.model.Distance) src);
if (src instanceof org.hl7.fhir.dstu2.model.Duration)
return Duration10_30.convertDuration((org.hl7.fhir.dstu2.model.Duration) src);
if (src instanceof org.hl7.fhir.dstu2.model.Money)
return Money10_30.convertMoney((org.hl7.fhir.dstu2.model.Money) src);
if (src instanceof org.hl7.fhir.dstu2.model.SimpleQuantity)
return SimpleQuantity10_30.convertSimpleQuantity((org.hl7.fhir.dstu2.model.SimpleQuantity) src);
if (src instanceof org.hl7.fhir.dstu2.model.Quantity)
return Quantity10_30.convertQuantity((org.hl7.fhir.dstu2.model.Quantity) src);
if (src instanceof org.hl7.fhir.dstu2.model.Range)
return Range10_30.convertRange((org.hl7.fhir.dstu2.model.Range) src);
if (src instanceof org.hl7.fhir.dstu2.model.Ratio)
return Ratio10_30.convertRatio((org.hl7.fhir.dstu2.model.Ratio) src);
if (src instanceof org.hl7.fhir.dstu2.model.Reference)
return Reference10_30.convertReference((org.hl7.fhir.dstu2.model.Reference) src);
if (src instanceof org.hl7.fhir.dstu2.model.SampledData)
return SampledData10_30.convertSampledData((org.hl7.fhir.dstu2.model.SampledData) src);
if (src instanceof org.hl7.fhir.dstu2.model.Signature)
return Signature10_30.convertSignature((org.hl7.fhir.dstu2.model.Signature) src);
if (src instanceof org.hl7.fhir.dstu2.model.Address)
return Address10_30.convertAddress((org.hl7.fhir.dstu2.model.Address) src);
if (src instanceof org.hl7.fhir.dstu2.model.ContactPoint)
return ContactPoint10_30.convertContactPoint((org.hl7.fhir.dstu2.model.ContactPoint) src);
if (src instanceof org.hl7.fhir.dstu2.model.ElementDefinition)
return ElementDefinition10_30.convertElementDefinition((org.hl7.fhir.dstu2.model.ElementDefinition) src, new ArrayList<String>());
if (src instanceof org.hl7.fhir.dstu2.model.HumanName)
return HumanName10_30.convertHumanName((org.hl7.fhir.dstu2.model.HumanName) src);
if (src instanceof org.hl7.fhir.dstu2.model.Meta) return Meta10_30.convertMeta((org.hl7.fhir.dstu2.model.Meta) src);
if (src instanceof org.hl7.fhir.dstu2.model.Timing)
return Timing10_30.convertTiming((org.hl7.fhir.dstu2.model.Timing) src);
if (advisor.failFastOnNullOrUnknownEntry()) {
throw new FHIRException("Unknown type " + src.fhirType());
} else {
return null;
}
}
public org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.dstu3.model.Type src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
if (src instanceof org.hl7.fhir.dstu3.model.Base64BinaryType)
return Base64Binary10_30.convertBase64Binary((org.hl7.fhir.dstu3.model.Base64BinaryType) src);
if (src instanceof org.hl7.fhir.dstu3.model.BooleanType)
return Boolean10_30.convertBoolean((org.hl7.fhir.dstu3.model.BooleanType) src);
if (src instanceof org.hl7.fhir.dstu3.model.CodeType)
return Code10_30.convertCode((org.hl7.fhir.dstu3.model.CodeType) src);
if (src instanceof org.hl7.fhir.dstu3.model.DateType)
return Date10_30.convertDate((org.hl7.fhir.dstu3.model.DateType) src);
if (src instanceof org.hl7.fhir.dstu3.model.DateTimeType)
return DateTime10_30.convertDateTime((org.hl7.fhir.dstu3.model.DateTimeType) src);
if (src instanceof org.hl7.fhir.dstu3.model.DecimalType)
return Decimal10_30.convertDecimal((org.hl7.fhir.dstu3.model.DecimalType) src);
if (src instanceof org.hl7.fhir.dstu3.model.IdType) return Id10_30.convertId((org.hl7.fhir.dstu3.model.IdType) src);
if (src instanceof org.hl7.fhir.dstu3.model.InstantType)
return Instant10_30.convertInstant((org.hl7.fhir.dstu3.model.InstantType) src);
if (src instanceof org.hl7.fhir.dstu3.model.PositiveIntType)
return PositiveInt10_30.convertPositiveInt((org.hl7.fhir.dstu3.model.PositiveIntType) src);
if (src instanceof org.hl7.fhir.dstu3.model.UnsignedIntType)
return UnsignedInt10_30.convertUnsignedInt((org.hl7.fhir.dstu3.model.UnsignedIntType) src);
if (src instanceof org.hl7.fhir.dstu3.model.IntegerType)
return Integer10_30.convertInteger((org.hl7.fhir.dstu3.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu3.model.MarkdownType)
return MarkDown10_30.convertMarkdown((org.hl7.fhir.dstu3.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.dstu3.model.OidType)
return Oid10_30.convertOid((org.hl7.fhir.dstu3.model.OidType) src);
if (src instanceof org.hl7.fhir.dstu3.model.StringType)
return String10_30.convertString((org.hl7.fhir.dstu3.model.StringType) src);
if (src instanceof org.hl7.fhir.dstu3.model.TimeType)
return Time10_30.convertTime((org.hl7.fhir.dstu3.model.TimeType) src);
if (src instanceof org.hl7.fhir.dstu3.model.UuidType)
return Uuid10_30.convertUuid((org.hl7.fhir.dstu3.model.UuidType) src);
if (src instanceof org.hl7.fhir.dstu3.model.UriType)
return Uri10_30.convertUri((org.hl7.fhir.dstu3.model.UriType) src);
if (src instanceof org.hl7.fhir.dstu3.model.Extension)
return Extension10_30.convertExtension((org.hl7.fhir.dstu3.model.Extension) src);
if (src instanceof org.hl7.fhir.dstu3.model.Narrative)
return Narrative10_30.convertNarrative((org.hl7.fhir.dstu3.model.Narrative) src);
if (src instanceof org.hl7.fhir.dstu3.model.Annotation)
return Annotation10_30.convertAnnotation((org.hl7.fhir.dstu3.model.Annotation) src);
if (src instanceof org.hl7.fhir.dstu3.model.Attachment)
return Attachment10_30.convertAttachment((org.hl7.fhir.dstu3.model.Attachment) src);
if (src instanceof org.hl7.fhir.dstu3.model.CodeableConcept)
return CodeableConcept10_30.convertCodeableConcept((org.hl7.fhir.dstu3.model.CodeableConcept) src);
if (src instanceof org.hl7.fhir.dstu3.model.Coding)
return Coding10_30.convertCoding((org.hl7.fhir.dstu3.model.Coding) src);
if (src instanceof org.hl7.fhir.dstu3.model.Identifier)
return Identifier10_30.convertIdentifier((org.hl7.fhir.dstu3.model.Identifier) src);
if (src instanceof org.hl7.fhir.dstu3.model.Period)
return Period10_30.convertPeriod((org.hl7.fhir.dstu3.model.Period) src);
if (src instanceof org.hl7.fhir.dstu3.model.Age) return Age10_30.convertAge((org.hl7.fhir.dstu3.model.Age) src);
if (src instanceof org.hl7.fhir.dstu3.model.Count)
return Count10_30.convertCount((org.hl7.fhir.dstu3.model.Count) src);
if (src instanceof org.hl7.fhir.dstu3.model.Distance)
return Distance10_30.convertDistance((org.hl7.fhir.dstu3.model.Distance) src);
if (src instanceof org.hl7.fhir.dstu3.model.Duration)
return Duration10_30.convertDuration((org.hl7.fhir.dstu3.model.Duration) src);
if (src instanceof org.hl7.fhir.dstu3.model.Money)
return Money10_30.convertMoney((org.hl7.fhir.dstu3.model.Money) src);
if (src instanceof org.hl7.fhir.dstu3.model.SimpleQuantity)
return SimpleQuantity10_30.convertSimpleQuantity((org.hl7.fhir.dstu3.model.SimpleQuantity) src);
if (src instanceof org.hl7.fhir.dstu3.model.Quantity)
return Quantity10_30.convertQuantity((org.hl7.fhir.dstu3.model.Quantity) src);
if (src instanceof org.hl7.fhir.dstu3.model.Range)
return Range10_30.convertRange((org.hl7.fhir.dstu3.model.Range) src);
if (src instanceof org.hl7.fhir.dstu3.model.Ratio)
return Ratio10_30.convertRatio((org.hl7.fhir.dstu3.model.Ratio) src);
if (src instanceof org.hl7.fhir.dstu3.model.Reference)
return Reference10_30.convertReference((org.hl7.fhir.dstu3.model.Reference) src);
if (src instanceof org.hl7.fhir.dstu3.model.SampledData)
return SampledData10_30.convertSampledData((org.hl7.fhir.dstu3.model.SampledData) src);
if (src instanceof org.hl7.fhir.dstu3.model.Signature)
return Signature10_30.convertSignature((org.hl7.fhir.dstu3.model.Signature) src);
if (src instanceof org.hl7.fhir.dstu3.model.Address)
return Address10_30.convertAddress((org.hl7.fhir.dstu3.model.Address) src);
if (src instanceof org.hl7.fhir.dstu3.model.ContactPoint)
return ContactPoint10_30.convertContactPoint((org.hl7.fhir.dstu3.model.ContactPoint) src);
if (src instanceof org.hl7.fhir.dstu3.model.ElementDefinition)
return ElementDefinition10_30.convertElementDefinition((org.hl7.fhir.dstu3.model.ElementDefinition) src);
if (src instanceof org.hl7.fhir.dstu3.model.HumanName)
return HumanName10_30.convertHumanName((org.hl7.fhir.dstu3.model.HumanName) src);
if (src instanceof org.hl7.fhir.dstu3.model.Meta) return Meta10_30.convertMeta((org.hl7.fhir.dstu3.model.Meta) src);
if (src instanceof org.hl7.fhir.dstu3.model.Timing)
return Timing10_30.convertTiming((org.hl7.fhir.dstu3.model.Timing) src);
if (advisor.failFastOnNullOrUnknownEntry()) {
throw new FHIRException("Unknown type " + src.fhirType());
} else {
return null;
}
}
}

View File

@ -1,147 +1,147 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Address10_30 {
public static org.hl7.fhir.dstu3.model.Address convertAddress(org.hl7.fhir.dstu2.model.Address src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Address tgt = new org.hl7.fhir.dstu3.model.Address();
Element10_30.copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertAddressUse(src.getUseElement()));
if (src.hasType()) tgt.setTypeElement(convertAddressType(src.getTypeElement()));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
for (org.hl7.fhir.dstu2.model.StringType t : src.getLine()) tgt.addLine(t.getValue());
if (src.hasCityElement()) tgt.setCityElement(String10_30.convertString(src.getCityElement()));
if (src.hasDistrictElement()) tgt.setDistrictElement(String10_30.convertString(src.getDistrictElement()));
if (src.hasStateElement()) tgt.setStateElement(String10_30.convertString(src.getStateElement()));
if (src.hasPostalCodeElement()) tgt.setPostalCodeElement(String10_30.convertString(src.getPostalCodeElement()));
if (src.hasCountryElement()) tgt.setCountryElement(String10_30.convertString(src.getCountryElement()));
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Address convertAddress(org.hl7.fhir.dstu2.model.Address src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Address tgt = new org.hl7.fhir.dstu3.model.Address();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertAddressUse(src.getUseElement()));
if (src.hasType()) tgt.setTypeElement(convertAddressType(src.getTypeElement()));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
for (org.hl7.fhir.dstu2.model.StringType t : src.getLine()) tgt.addLine(t.getValue());
if (src.hasCityElement()) tgt.setCityElement(String10_30.convertString(src.getCityElement()));
if (src.hasDistrictElement()) tgt.setDistrictElement(String10_30.convertString(src.getDistrictElement()));
if (src.hasStateElement()) tgt.setStateElement(String10_30.convertString(src.getStateElement()));
if (src.hasPostalCodeElement()) tgt.setPostalCodeElement(String10_30.convertString(src.getPostalCodeElement()));
if (src.hasCountryElement()) tgt.setCountryElement(String10_30.convertString(src.getCountryElement()));
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Address convertAddress(org.hl7.fhir.dstu3.model.Address src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Address tgt = new org.hl7.fhir.dstu2.model.Address();
Element10_30.copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertAddressUse(src.getUseElement()));
if (src.hasType()) tgt.setTypeElement(convertAddressType(src.getTypeElement()));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
for (org.hl7.fhir.dstu3.model.StringType t : src.getLine()) tgt.addLine(t.getValue());
if (src.hasCityElement()) tgt.setCityElement(String10_30.convertString(src.getCityElement()));
if (src.hasDistrictElement()) tgt.setDistrictElement(String10_30.convertString(src.getDistrictElement()));
if (src.hasStateElement()) tgt.setStateElement(String10_30.convertString(src.getStateElement()));
if (src.hasPostalCodeElement()) tgt.setPostalCodeElement(String10_30.convertString(src.getPostalCodeElement()));
if (src.hasCountryElement()) tgt.setCountryElement(String10_30.convertString(src.getCountryElement()));
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Address convertAddress(org.hl7.fhir.dstu3.model.Address src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Address tgt = new org.hl7.fhir.dstu2.model.Address();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertAddressUse(src.getUseElement()));
if (src.hasType()) tgt.setTypeElement(convertAddressType(src.getTypeElement()));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
for (org.hl7.fhir.dstu3.model.StringType t : src.getLine()) tgt.addLine(t.getValue());
if (src.hasCityElement()) tgt.setCityElement(String10_30.convertString(src.getCityElement()));
if (src.hasDistrictElement()) tgt.setDistrictElement(String10_30.convertString(src.getDistrictElement()));
if (src.hasStateElement()) tgt.setStateElement(String10_30.convertString(src.getStateElement()));
if (src.hasPostalCodeElement()) tgt.setPostalCodeElement(String10_30.convertString(src.getPostalCodeElement()));
if (src.hasCountryElement()) tgt.setCountryElement(String10_30.convertString(src.getCountryElement()));
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Address.AddressUse> convertAddressUse(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Address.AddressUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Address.AddressUse> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Address.AddressUseEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.NULL);
} else {
switch (src.getValue()) {
case HOME:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.HOME);
break;
case WORK:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.WORK);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.TEMP);
break;
case OLD:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.OLD);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.NULL);
break;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Address.AddressUse> convertAddressUse(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Address.AddressUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Address.AddressUse> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Address.AddressUseEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.NULL);
} else {
switch (src.getValue()) {
case HOME:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.HOME);
break;
case WORK:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.WORK);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.TEMP);
break;
case OLD:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.OLD);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressUse.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Address.AddressUse> convertAddressUse(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Address.AddressUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Address.AddressUse> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Address.AddressUseEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.NULL);
} else {
switch (src.getValue()) {
case HOME:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.HOME);
break;
case WORK:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.WORK);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.TEMP);
break;
case OLD:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.OLD);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Address.AddressUse> convertAddressUse(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Address.AddressUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Address.AddressUse> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Address.AddressUseEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.NULL);
} else {
switch (src.getValue()) {
case HOME:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.HOME);
break;
case WORK:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.WORK);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.TEMP);
break;
case OLD:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.OLD);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressUse.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Address.AddressType> convertAddressType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Address.AddressType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Address.AddressType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Address.AddressTypeEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.NULL);
} else {
switch (src.getValue()) {
case POSTAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.POSTAL);
break;
case PHYSICAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.PHYSICAL);
break;
case BOTH:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.BOTH);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.NULL);
break;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Address.AddressType> convertAddressType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Address.AddressType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Address.AddressType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Address.AddressTypeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.NULL);
} else {
switch (src.getValue()) {
case POSTAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.POSTAL);
break;
case PHYSICAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.PHYSICAL);
break;
case BOTH:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.BOTH);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Address.AddressType.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Address.AddressType> convertAddressType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Address.AddressType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Address.AddressType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Address.AddressTypeEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.NULL);
} else {
switch (src.getValue()) {
case POSTAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.POSTAL);
break;
case PHYSICAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.PHYSICAL);
break;
case BOTH:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.BOTH);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Address.AddressType> convertAddressType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Address.AddressType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Address.AddressType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Address.AddressTypeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.NULL);
} else {
switch (src.getValue()) {
case POSTAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.POSTAL);
break;
case PHYSICAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.PHYSICAL);
break;
case BOTH:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.BOTH);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Address.AddressType.NULL);
break;
}
return tgt;
}
return tgt;
}
}

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Code10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Decimal10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
@ -8,27 +8,29 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri1
import org.hl7.fhir.exceptions.FHIRException;
public class Age10_30 {
public static org.hl7.fhir.dstu3.model.Age convertAge(org.hl7.fhir.dstu2.model.Age src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Age tgt = new org.hl7.fhir.dstu3.model.Age();
Element10_30.copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Age convertAge(org.hl7.fhir.dstu2.model.Age src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Age tgt = new org.hl7.fhir.dstu3.model.Age();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator())
tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Age convertAge(org.hl7.fhir.dstu3.model.Age src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Age tgt = new org.hl7.fhir.dstu2.model.Age();
Element10_30.copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Age convertAge(org.hl7.fhir.dstu3.model.Age src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Age tgt = new org.hl7.fhir.dstu2.model.Age();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator())
tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
}

View File

@ -1,29 +1,30 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Type10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Annotation10_30 {
public static org.hl7.fhir.dstu3.model.Annotation convertAnnotation(org.hl7.fhir.dstu2.model.Annotation src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Annotation tgt = new org.hl7.fhir.dstu3.model.Annotation();
Element10_30.copyElement(src, tgt);
if (src.hasAuthor()) tgt.setAuthor(Type10_30.convertType(src.getAuthor()));
if (src.hasTimeElement()) tgt.setTimeElement(DateTime10_30.convertDateTime(src.getTimeElement()));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Annotation convertAnnotation(org.hl7.fhir.dstu2.model.Annotation src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Annotation tgt = new org.hl7.fhir.dstu3.model.Annotation();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasAuthor())
tgt.setAuthor(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getAuthor()));
if (src.hasTimeElement()) tgt.setTimeElement(DateTime10_30.convertDateTime(src.getTimeElement()));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Annotation convertAnnotation(org.hl7.fhir.dstu3.model.Annotation src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Annotation tgt = new org.hl7.fhir.dstu2.model.Annotation();
Element10_30.copyElement(src, tgt);
if (src.hasAuthor()) tgt.setAuthor(Type10_30.convertType(src.getAuthor()));
if (src.hasTimeElement()) tgt.setTimeElement(DateTime10_30.convertDateTime(src.getTimeElement()));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Annotation convertAnnotation(org.hl7.fhir.dstu3.model.Annotation src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Annotation tgt = new org.hl7.fhir.dstu2.model.Annotation();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasAuthor())
tgt.setAuthor(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getAuthor()));
if (src.hasTimeElement()) tgt.setTimeElement(DateTime10_30.convertDateTime(src.getTimeElement()));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
return tgt;
}
}

View File

@ -1,29 +1,29 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.*;
import org.hl7.fhir.exceptions.FHIRException;
public class Attachment10_30 {
public static org.hl7.fhir.dstu3.model.Attachment convertAttachment(org.hl7.fhir.dstu2.model.Attachment src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Attachment tgt = new org.hl7.fhir.dstu3.model.Attachment();
Element10_30.copyElement(src, tgt);
if (src.hasContentTypeElement()) tgt.setContentTypeElement(Code10_30.convertCode(src.getContentTypeElement()));
if (src.hasLanguageElement()) tgt.setLanguageElement(Code10_30.convertCode(src.getLanguageElement()));
if (src.hasDataElement()) tgt.setDataElement(Base64Binary10_30.convertBase64Binary(src.getDataElement()));
if (src.hasUrlElement()) tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
if (src.hasSizeElement()) tgt.setSizeElement(UnsignedInt10_30.convertUnsignedInt(src.getSizeElement()));
if (src.hasHashElement()) tgt.setHashElement(Base64Binary10_30.convertBase64Binary(src.getHashElement()));
if (src.hasTitleElement()) tgt.setTitleElement(String10_30.convertString(src.getTitleElement()));
if (src.hasCreationElement()) tgt.setCreationElement(DateTime10_30.convertDateTime(src.getCreationElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Attachment convertAttachment(org.hl7.fhir.dstu2.model.Attachment src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Attachment tgt = new org.hl7.fhir.dstu3.model.Attachment();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasContentTypeElement()) tgt.setContentTypeElement(Code10_30.convertCode(src.getContentTypeElement()));
if (src.hasLanguageElement()) tgt.setLanguageElement(Code10_30.convertCode(src.getLanguageElement()));
if (src.hasDataElement()) tgt.setDataElement(Base64Binary10_30.convertBase64Binary(src.getDataElement()));
if (src.hasUrlElement()) tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
if (src.hasSizeElement()) tgt.setSizeElement(UnsignedInt10_30.convertUnsignedInt(src.getSizeElement()));
if (src.hasHashElement()) tgt.setHashElement(Base64Binary10_30.convertBase64Binary(src.getHashElement()));
if (src.hasTitleElement()) tgt.setTitleElement(String10_30.convertString(src.getTitleElement()));
if (src.hasCreationElement()) tgt.setCreationElement(DateTime10_30.convertDateTime(src.getCreationElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Attachment convertAttachment(org.hl7.fhir.dstu3.model.Attachment src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Attachment tgt = new org.hl7.fhir.dstu2.model.Attachment();
Element10_30.copyElement(src, tgt);
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasContentTypeElement()) tgt.setContentTypeElement(Code10_30.convertCode(src.getContentTypeElement()));
if (src.hasLanguageElement()) tgt.setLanguageElement(Code10_30.convertCode(src.getLanguageElement()));
if (src.hasDataElement()) tgt.setDataElement(Base64Binary10_30.convertBase64Binary(src.getDataElement()));

View File

@ -1,27 +1,27 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class CodeableConcept10_30 {
public static org.hl7.fhir.dstu3.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.dstu2.model.CodeableConcept src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.CodeableConcept tgt = new org.hl7.fhir.dstu3.model.CodeableConcept();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.Coding t : src.getCoding()) tgt.addCoding(Coding10_30.convertCoding(t));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.dstu2.model.CodeableConcept src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.CodeableConcept tgt = new org.hl7.fhir.dstu3.model.CodeableConcept();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.Coding t : src.getCoding()) tgt.addCoding(Coding10_30.convertCoding(t));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.CodeableConcept tgt = new org.hl7.fhir.dstu2.model.CodeableConcept();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.Coding t : src.getCoding()) tgt.addCoding(Coding10_30.convertCoding(t));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.CodeableConcept convertCodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.CodeableConcept tgt = new org.hl7.fhir.dstu2.model.CodeableConcept();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.Coding t : src.getCoding()) tgt.addCoding(Coding10_30.convertCoding(t));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.UsageContext convertCodeableConceptToUsageContext(org.hl7.fhir.dstu2.model.CodeableConcept t) throws FHIRException {
org.hl7.fhir.dstu3.model.UsageContext result = new org.hl7.fhir.dstu3.model.UsageContext();

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Code10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
@ -11,24 +11,26 @@ public class Coding10_30 {
public static org.hl7.fhir.dstu3.model.Coding convertCoding(org.hl7.fhir.dstu2.model.Coding src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Coding tgt = new org.hl7.fhir.dstu3.model.Coding();
Element10_30.copyElement(src, tgt);
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasVersionElement()) tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
if (src.hasDisplayElement()) tgt.setDisplayElement(String10_30.convertString(src.getDisplayElement()));
if (src.hasUserSelectedElement()) tgt.setUserSelectedElement(Boolean10_30.convertBoolean(src.getUserSelectedElement()));
if (src.hasUserSelectedElement())
tgt.setUserSelectedElement(Boolean10_30.convertBoolean(src.getUserSelectedElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Coding convertCoding(org.hl7.fhir.dstu3.model.Coding src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Coding tgt = new org.hl7.fhir.dstu2.model.Coding();
Element10_30.copyElement(src, tgt);
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasVersionElement()) tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
if (src.hasDisplayElement()) tgt.setDisplayElement(String10_30.convertString(src.getDisplayElement()));
if (src.hasUserSelectedElement()) tgt.setUserSelectedElement(Boolean10_30.convertBoolean(src.getUserSelectedElement()));
if (src.hasUserSelectedElement())
tgt.setUserSelectedElement(Boolean10_30.convertBoolean(src.getUserSelectedElement()));
return tgt;
}
}

View File

@ -1,159 +1,159 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.PositiveInt10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class ContactPoint10_30 {
public static org.hl7.fhir.dstu3.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu2.model.ContactPoint src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.ContactPoint tgt = new org.hl7.fhir.dstu3.model.ContactPoint();
Element10_30.copyElement(src, tgt);
if (src.hasSystem()) tgt.setSystemElement(convertContactPointSystem(src.getSystemElement()));
if (src.hasValueElement()) tgt.setValueElement(String10_30.convertString(src.getValueElement()));
if (src.hasUse()) tgt.setUseElement(convertContactPointUse(src.getUseElement()));
if (src.hasRank()) tgt.setRankElement(PositiveInt10_30.convertPositiveInt(src.getRankElement()));
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu2.model.ContactPoint src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.ContactPoint tgt = new org.hl7.fhir.dstu3.model.ContactPoint();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasSystem()) tgt.setSystemElement(convertContactPointSystem(src.getSystemElement()));
if (src.hasValueElement()) tgt.setValueElement(String10_30.convertString(src.getValueElement()));
if (src.hasUse()) tgt.setUseElement(convertContactPointUse(src.getUseElement()));
if (src.hasRank()) tgt.setRankElement(PositiveInt10_30.convertPositiveInt(src.getRankElement()));
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu3.model.ContactPoint src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ContactPoint tgt = new org.hl7.fhir.dstu2.model.ContactPoint();
Element10_30.copyElement(src, tgt);
if (src.hasSystem()) tgt.setSystemElement(convertContactPointSystem(src.getSystemElement()));
if (src.hasValueElement()) tgt.setValueElement(String10_30.convertString(src.getValueElement()));
if (src.hasUse()) tgt.setUseElement(convertContactPointUse(src.getUseElement()));
if (src.hasRankElement()) tgt.setRankElement(PositiveInt10_30.convertPositiveInt(src.getRankElement()));
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ContactPoint convertContactPoint(org.hl7.fhir.dstu3.model.ContactPoint src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.ContactPoint tgt = new org.hl7.fhir.dstu2.model.ContactPoint();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasSystem()) tgt.setSystemElement(convertContactPointSystem(src.getSystemElement()));
if (src.hasValueElement()) tgt.setValueElement(String10_30.convertString(src.getValueElement()));
if (src.hasUse()) tgt.setUseElement(convertContactPointUse(src.getUseElement()));
if (src.hasRankElement()) tgt.setRankElement(PositiveInt10_30.convertPositiveInt(src.getRankElement()));
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem> convertContactPointSystem(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystemEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.NULL);
} else {
switch (src.getValue()) {
case PHONE:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PHONE);
break;
case FAX:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.FAX);
break;
case EMAIL:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.EMAIL);
break;
case PAGER:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PAGER);
break;
case OTHER:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.OTHER);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.NULL);
break;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem> convertContactPointSystem(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystemEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.NULL);
} else {
switch (src.getValue()) {
case PHONE:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PHONE);
break;
case FAX:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.FAX);
break;
case EMAIL:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.EMAIL);
break;
case PAGER:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.PAGER);
break;
case OTHER:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.OTHER);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem> convertContactPointSystem(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystemEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.NULL);
} else {
switch (src.getValue()) {
case PHONE:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PHONE);
break;
case FAX:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.FAX);
break;
case EMAIL:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.EMAIL);
break;
case PAGER:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PAGER);
break;
case OTHER:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER);
break;
case URL:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem> convertContactPointSystem(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ContactPoint.ContactPointSystem> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystemEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.NULL);
} else {
switch (src.getValue()) {
case PHONE:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PHONE);
break;
case FAX:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.FAX);
break;
case EMAIL:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.EMAIL);
break;
case PAGER:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.PAGER);
break;
case OTHER:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER);
break;
case URL:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.OTHER);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointSystem.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse> convertContactPointUse(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUseEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.NULL);
} else {
switch (src.getValue()) {
case HOME:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.HOME);
break;
case WORK:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.WORK);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.TEMP);
break;
case OLD:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.OLD);
break;
case MOBILE:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.MOBILE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.NULL);
break;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse> convertContactPointUse(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUseEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.NULL);
} else {
switch (src.getValue()) {
case HOME:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.HOME);
break;
case WORK:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.WORK);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.TEMP);
break;
case OLD:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.OLD);
break;
case MOBILE:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.MOBILE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse> convertContactPointUse(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUseEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.NULL);
} else {
switch (src.getValue()) {
case HOME:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.HOME);
break;
case WORK:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.WORK);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.TEMP);
break;
case OLD:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.OLD);
break;
case MOBILE:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.MOBILE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse> convertContactPointUse(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ContactPoint.ContactPointUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUseEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.NULL);
} else {
switch (src.getValue()) {
case HOME:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.HOME);
break;
case WORK:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.WORK);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.TEMP);
break;
case OLD:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.OLD);
break;
case MOBILE:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.MOBILE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.ContactPoint.ContactPointUse.NULL);
break;
}
return tgt;
}
return tgt;
}
}

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Code10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Decimal10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
@ -8,27 +8,29 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri1
import org.hl7.fhir.exceptions.FHIRException;
public class Count10_30 {
public static org.hl7.fhir.dstu3.model.Count convertCount(org.hl7.fhir.dstu2.model.Count src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Count tgt = new org.hl7.fhir.dstu3.model.Count();
Element10_30.copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Count convertCount(org.hl7.fhir.dstu2.model.Count src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Count tgt = new org.hl7.fhir.dstu3.model.Count();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator())
tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Count convertCount(org.hl7.fhir.dstu3.model.Count src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Count tgt = new org.hl7.fhir.dstu2.model.Count();
Element10_30.copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Count convertCount(org.hl7.fhir.dstu3.model.Count src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Count tgt = new org.hl7.fhir.dstu2.model.Count();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator())
tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
}

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Code10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Decimal10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
@ -8,27 +8,29 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri1
import org.hl7.fhir.exceptions.FHIRException;
public class Distance10_30 {
public static org.hl7.fhir.dstu3.model.Distance convertDistance(org.hl7.fhir.dstu2.model.Distance src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Distance tgt = new org.hl7.fhir.dstu3.model.Distance();
Element10_30.copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Distance convertDistance(org.hl7.fhir.dstu2.model.Distance src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Distance tgt = new org.hl7.fhir.dstu3.model.Distance();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator())
tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Distance convertDistance(org.hl7.fhir.dstu3.model.Distance src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Distance tgt = new org.hl7.fhir.dstu2.model.Distance();
Element10_30.copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Distance convertDistance(org.hl7.fhir.dstu3.model.Distance src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Distance tgt = new org.hl7.fhir.dstu2.model.Distance();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator())
tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
}

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Code10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Decimal10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
@ -8,27 +8,29 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri1
import org.hl7.fhir.exceptions.FHIRException;
public class Duration10_30 {
public static org.hl7.fhir.dstu3.model.Duration convertDuration(org.hl7.fhir.dstu2.model.Duration src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Duration tgt = new org.hl7.fhir.dstu3.model.Duration();
Element10_30.copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Duration convertDuration(org.hl7.fhir.dstu2.model.Duration src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Duration tgt = new org.hl7.fhir.dstu3.model.Duration();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator())
tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Duration convertDuration(org.hl7.fhir.dstu3.model.Duration src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Duration tgt = new org.hl7.fhir.dstu2.model.Duration();
Element10_30.copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Duration convertDuration(org.hl7.fhir.dstu3.model.Duration src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Duration tgt = new org.hl7.fhir.dstu2.model.Duration();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator())
tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
}

View File

@ -1,109 +1,109 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class HumanName10_30 {
public static org.hl7.fhir.dstu3.model.HumanName convertHumanName(org.hl7.fhir.dstu2.model.HumanName src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.HumanName tgt = new org.hl7.fhir.dstu3.model.HumanName();
Element10_30.copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertNameUse(src.getUseElement()));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
for (org.hl7.fhir.dstu2.model.StringType t : src.getFamily()) tgt.setFamily(t.getValue());
for (org.hl7.fhir.dstu2.model.StringType t : src.getGiven()) tgt.addGiven(t.getValue());
for (org.hl7.fhir.dstu2.model.StringType t : src.getPrefix()) tgt.addPrefix(t.getValue());
for (org.hl7.fhir.dstu2.model.StringType t : src.getSuffix()) tgt.addSuffix(t.getValue());
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.HumanName convertHumanName(org.hl7.fhir.dstu2.model.HumanName src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.HumanName tgt = new org.hl7.fhir.dstu3.model.HumanName();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertNameUse(src.getUseElement()));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
for (org.hl7.fhir.dstu2.model.StringType t : src.getFamily()) tgt.setFamily(t.getValue());
for (org.hl7.fhir.dstu2.model.StringType t : src.getGiven()) tgt.addGiven(t.getValue());
for (org.hl7.fhir.dstu2.model.StringType t : src.getPrefix()) tgt.addPrefix(t.getValue());
for (org.hl7.fhir.dstu2.model.StringType t : src.getSuffix()) tgt.addSuffix(t.getValue());
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.HumanName convertHumanName(org.hl7.fhir.dstu3.model.HumanName src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.HumanName tgt = new org.hl7.fhir.dstu2.model.HumanName();
Element10_30.copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertNameUse(src.getUseElement()));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
if (src.hasFamily()) tgt.addFamily(src.getFamily());
for (org.hl7.fhir.dstu3.model.StringType t : src.getGiven()) tgt.addGiven(t.getValue());
for (org.hl7.fhir.dstu3.model.StringType t : src.getPrefix()) tgt.addPrefix(t.getValue());
for (org.hl7.fhir.dstu3.model.StringType t : src.getSuffix()) tgt.addSuffix(t.getValue());
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.HumanName convertHumanName(org.hl7.fhir.dstu3.model.HumanName src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.HumanName tgt = new org.hl7.fhir.dstu2.model.HumanName();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertNameUse(src.getUseElement()));
if (src.hasTextElement()) tgt.setTextElement(String10_30.convertString(src.getTextElement()));
if (src.hasFamily()) tgt.addFamily(src.getFamily());
for (org.hl7.fhir.dstu3.model.StringType t : src.getGiven()) tgt.addGiven(t.getValue());
for (org.hl7.fhir.dstu3.model.StringType t : src.getPrefix()) tgt.addPrefix(t.getValue());
for (org.hl7.fhir.dstu3.model.StringType t : src.getSuffix()) tgt.addSuffix(t.getValue());
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.HumanName.NameUse> convertNameUse(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.HumanName.NameUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.HumanName.NameUse> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.HumanName.NameUseEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NULL);
} else {
switch (src.getValue()) {
case USUAL:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.USUAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OFFICIAL);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.TEMP);
break;
case NICKNAME:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NICKNAME);
break;
case ANONYMOUS:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.ANONYMOUS);
break;
case OLD:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OLD);
break;
case MAIDEN:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.MAIDEN);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NULL);
break;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.HumanName.NameUse> convertNameUse(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.HumanName.NameUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.HumanName.NameUse> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.HumanName.NameUseEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NULL);
} else {
switch (src.getValue()) {
case USUAL:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.USUAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OFFICIAL);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.TEMP);
break;
case NICKNAME:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NICKNAME);
break;
case ANONYMOUS:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.ANONYMOUS);
break;
case OLD:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.OLD);
break;
case MAIDEN:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.MAIDEN);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.HumanName.NameUse.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.HumanName.NameUse> convertNameUse(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.HumanName.NameUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.HumanName.NameUse> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.HumanName.NameUseEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NULL);
} else {
switch (src.getValue()) {
case USUAL:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.USUAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OFFICIAL);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.TEMP);
break;
case NICKNAME:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NICKNAME);
break;
case ANONYMOUS:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.ANONYMOUS);
break;
case OLD:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OLD);
break;
case MAIDEN:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.MAIDEN);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.HumanName.NameUse> convertNameUse(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.HumanName.NameUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.HumanName.NameUse> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.HumanName.NameUseEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NULL);
} else {
switch (src.getValue()) {
case USUAL:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.USUAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OFFICIAL);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.TEMP);
break;
case NICKNAME:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NICKNAME);
break;
case ANONYMOUS:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.ANONYMOUS);
break;
case OLD:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.OLD);
break;
case MAIDEN:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.MAIDEN);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.HumanName.NameUse.NULL);
break;
}
return tgt;
}
return tgt;
}
}

View File

@ -1,92 +1,92 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Identifier10_30 {
public static org.hl7.fhir.dstu3.model.Identifier convertIdentifier(org.hl7.fhir.dstu2.model.Identifier src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Identifier tgt = new org.hl7.fhir.dstu3.model.Identifier();
Element10_30.copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertIdentifierUse(src.getUseElement()));
if (src.hasType()) tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasValueElement()) tgt.setValueElement(String10_30.convertString(src.getValueElement()));
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
if (src.hasAssigner()) tgt.setAssigner(Reference10_30.convertReference(src.getAssigner()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Identifier convertIdentifier(org.hl7.fhir.dstu2.model.Identifier src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Identifier tgt = new org.hl7.fhir.dstu3.model.Identifier();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertIdentifierUse(src.getUseElement()));
if (src.hasType()) tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasValueElement()) tgt.setValueElement(String10_30.convertString(src.getValueElement()));
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
if (src.hasAssigner()) tgt.setAssigner(Reference10_30.convertReference(src.getAssigner()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Identifier convertIdentifier(org.hl7.fhir.dstu3.model.Identifier src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Identifier tgt = new org.hl7.fhir.dstu2.model.Identifier();
Element10_30.copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertIdentifierUse(src.getUseElement()));
if (src.hasType()) tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasSystem()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasValue()) tgt.setValueElement(String10_30.convertString(src.getValueElement()));
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
if (src.hasAssigner()) tgt.setAssigner(Reference10_30.convertReference(src.getAssigner()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Identifier convertIdentifier(org.hl7.fhir.dstu3.model.Identifier src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Identifier tgt = new org.hl7.fhir.dstu2.model.Identifier();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasUse()) tgt.setUseElement(convertIdentifierUse(src.getUseElement()));
if (src.hasType()) tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasSystem()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasValue()) tgt.setValueElement(String10_30.convertString(src.getValueElement()));
if (src.hasPeriod()) tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
if (src.hasAssigner()) tgt.setAssigner(Reference10_30.convertReference(src.getAssigner()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Identifier.IdentifierUse> convertIdentifierUse(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Identifier.IdentifierUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Identifier.IdentifierUse> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Identifier.IdentifierUseEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.NULL);
} else {
switch (src.getValue()) {
case USUAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.USUAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.OFFICIAL);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.TEMP);
break;
case SECONDARY:
tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.SECONDARY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.NULL);
break;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Identifier.IdentifierUse> convertIdentifierUse(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Identifier.IdentifierUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Identifier.IdentifierUse> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Identifier.IdentifierUseEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.NULL);
} else {
switch (src.getValue()) {
case USUAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.USUAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.OFFICIAL);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.TEMP);
break;
case SECONDARY:
tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.SECONDARY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Identifier.IdentifierUse.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Identifier.IdentifierUse> convertIdentifierUse(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Identifier.IdentifierUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Identifier.IdentifierUse> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Identifier.IdentifierUseEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.NULL);
} else {
switch (src.getValue()) {
case USUAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.USUAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.OFFICIAL);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.TEMP);
break;
case SECONDARY:
tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.SECONDARY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Identifier.IdentifierUse> convertIdentifierUse(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Identifier.IdentifierUse> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Identifier.IdentifierUse> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Identifier.IdentifierUseEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.NULL);
} else {
switch (src.getValue()) {
case USUAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.USUAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.OFFICIAL);
break;
case TEMP:
tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.TEMP);
break;
case SECONDARY:
tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.SECONDARY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Identifier.IdentifierUse.NULL);
break;
}
return tgt;
}
return tgt;
}
}

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Code10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Decimal10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
@ -8,27 +8,29 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri1
import org.hl7.fhir.exceptions.FHIRException;
public class Money10_30 {
public static org.hl7.fhir.dstu3.model.Money convertMoney(org.hl7.fhir.dstu2.model.Money src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Money tgt = new org.hl7.fhir.dstu3.model.Money();
Element10_30.copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Money convertMoney(org.hl7.fhir.dstu2.model.Money src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Money tgt = new org.hl7.fhir.dstu3.model.Money();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator())
tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Money convertMoney(org.hl7.fhir.dstu3.model.Money src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Money tgt = new org.hl7.fhir.dstu2.model.Money();
Element10_30.copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Money convertMoney(org.hl7.fhir.dstu3.model.Money src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Money tgt = new org.hl7.fhir.dstu2.model.Money();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator())
tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
}

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30;
import org.hl7.fhir.exceptions.FHIRException;
@ -8,7 +8,7 @@ public class Period10_30 {
public static org.hl7.fhir.dstu3.model.Period convertPeriod(org.hl7.fhir.dstu2.model.Period src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Period tgt = new org.hl7.fhir.dstu3.model.Period();
Element10_30.copyElement(src, tgt);
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasStartElement()) tgt.setStartElement(DateTime10_30.convertDateTime(src.getStartElement()));
if (src.hasEndElement()) tgt.setEndElement(DateTime10_30.convertDateTime(src.getEndElement()));
return tgt;
@ -17,7 +17,7 @@ public class Period10_30 {
public static org.hl7.fhir.dstu2.model.Period convertPeriod(org.hl7.fhir.dstu3.model.Period src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Period tgt = new org.hl7.fhir.dstu2.model.Period();
Element10_30.copyElement(src, tgt);
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasStartElement()) tgt.setStartElement(DateTime10_30.convertDateTime(src.getStartElement()));
if (src.hasEndElement()) tgt.setEndElement(DateTime10_30.convertDateTime(src.getEndElement()));
return tgt;

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Code10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Decimal10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
@ -8,83 +8,83 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri1
import org.hl7.fhir.exceptions.FHIRException;
public class Quantity10_30 {
public static org.hl7.fhir.dstu3.model.Quantity convertQuantity(org.hl7.fhir.dstu2.model.Quantity src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Quantity tgt = new org.hl7.fhir.dstu3.model.Quantity();
Element10_30.copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Quantity convertQuantity(org.hl7.fhir.dstu2.model.Quantity src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Quantity tgt = new org.hl7.fhir.dstu3.model.Quantity();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Quantity convertQuantity(org.hl7.fhir.dstu3.model.Quantity src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Quantity tgt = new org.hl7.fhir.dstu2.model.Quantity();
Element10_30.copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Quantity convertQuantity(org.hl7.fhir.dstu3.model.Quantity src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Quantity tgt = new org.hl7.fhir.dstu2.model.Quantity();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Quantity.QuantityComparator> convertQuantityComparator(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Quantity.QuantityComparator> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Quantity.QuantityComparator> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Quantity.QuantityComparatorEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.NULL);
} else {
switch (src.getValue()) {
case LESS_THAN:
tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.LESS_THAN);
break;
case LESS_OR_EQUAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.LESS_OR_EQUAL);
break;
case GREATER_OR_EQUAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.GREATER_OR_EQUAL);
break;
case GREATER_THAN:
tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.GREATER_THAN);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.NULL);
break;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Quantity.QuantityComparator> convertQuantityComparator(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Quantity.QuantityComparator> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Quantity.QuantityComparator> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Quantity.QuantityComparatorEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.NULL);
} else {
switch (src.getValue()) {
case LESS_THAN:
tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.LESS_THAN);
break;
case LESS_OR_EQUAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.LESS_OR_EQUAL);
break;
case GREATER_OR_EQUAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.GREATER_OR_EQUAL);
break;
case GREATER_THAN:
tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.GREATER_THAN);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Quantity.QuantityComparator.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Quantity.QuantityComparator> convertQuantityComparator(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Quantity.QuantityComparator> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Quantity.QuantityComparator> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Quantity.QuantityComparatorEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.NULL);
} else {
switch (src.getValue()) {
case LESS_THAN:
tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.LESS_THAN);
break;
case LESS_OR_EQUAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.LESS_OR_EQUAL);
break;
case GREATER_OR_EQUAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.GREATER_OR_EQUAL);
break;
case GREATER_THAN:
tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.GREATER_THAN);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Quantity.QuantityComparator> convertQuantityComparator(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Quantity.QuantityComparator> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Quantity.QuantityComparator> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Quantity.QuantityComparatorEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.NULL);
} else {
switch (src.getValue()) {
case LESS_THAN:
tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.LESS_THAN);
break;
case LESS_OR_EQUAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.LESS_OR_EQUAL);
break;
case GREATER_OR_EQUAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.GREATER_OR_EQUAL);
break;
case GREATER_THAN:
tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.GREATER_THAN);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Quantity.QuantityComparator.NULL);
break;
}
return tgt;
}
return tgt;
}
}

View File

@ -1,24 +1,24 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Range10_30 {
public static org.hl7.fhir.dstu3.model.Range convertRange(org.hl7.fhir.dstu2.model.Range src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Range tgt = new org.hl7.fhir.dstu3.model.Range();
Element10_30.copyElement(src, tgt);
if (src.hasLow()) tgt.setLow(SimpleQuantity10_30.convertSimpleQuantity(src.getLow()));
if (src.hasHigh()) tgt.setHigh(SimpleQuantity10_30.convertSimpleQuantity(src.getHigh()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Range convertRange(org.hl7.fhir.dstu2.model.Range src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Range tgt = new org.hl7.fhir.dstu3.model.Range();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasLow()) tgt.setLow(SimpleQuantity10_30.convertSimpleQuantity(src.getLow()));
if (src.hasHigh()) tgt.setHigh(SimpleQuantity10_30.convertSimpleQuantity(src.getHigh()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Range convertRange(org.hl7.fhir.dstu3.model.Range src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Range tgt = new org.hl7.fhir.dstu2.model.Range();
Element10_30.copyElement(src, tgt);
if (src.hasLow()) tgt.setLow(SimpleQuantity10_30.convertSimpleQuantity(src.getLow()));
if (src.hasHigh()) tgt.setHigh(SimpleQuantity10_30.convertSimpleQuantity(src.getHigh()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Range convertRange(org.hl7.fhir.dstu3.model.Range src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Range tgt = new org.hl7.fhir.dstu2.model.Range();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasLow()) tgt.setLow(SimpleQuantity10_30.convertSimpleQuantity(src.getLow()));
if (src.hasHigh()) tgt.setHigh(SimpleQuantity10_30.convertSimpleQuantity(src.getHigh()));
return tgt;
}
}

View File

@ -1,24 +1,24 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Ratio10_30 {
public static org.hl7.fhir.dstu3.model.Ratio convertRatio(org.hl7.fhir.dstu2.model.Ratio src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Ratio tgt = new org.hl7.fhir.dstu3.model.Ratio();
Element10_30.copyElement(src, tgt);
if (src.hasNumerator()) tgt.setNumerator(Quantity10_30.convertQuantity(src.getNumerator()));
if (src.hasDenominator()) tgt.setDenominator(Quantity10_30.convertQuantity(src.getDenominator()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Ratio convertRatio(org.hl7.fhir.dstu2.model.Ratio src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Ratio tgt = new org.hl7.fhir.dstu3.model.Ratio();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasNumerator()) tgt.setNumerator(Quantity10_30.convertQuantity(src.getNumerator()));
if (src.hasDenominator()) tgt.setDenominator(Quantity10_30.convertQuantity(src.getDenominator()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Ratio convertRatio(org.hl7.fhir.dstu3.model.Ratio src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Ratio tgt = new org.hl7.fhir.dstu2.model.Ratio();
Element10_30.copyElement(src, tgt);
if (src.hasNumerator()) tgt.setNumerator(Quantity10_30.convertQuantity(src.getNumerator()));
if (src.hasDenominator()) tgt.setDenominator(Quantity10_30.convertQuantity(src.getDenominator()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Ratio convertRatio(org.hl7.fhir.dstu3.model.Ratio src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Ratio tgt = new org.hl7.fhir.dstu2.model.Ratio();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasNumerator()) tgt.setNumerator(Quantity10_30.convertQuantity(src.getNumerator()));
if (src.hasDenominator()) tgt.setDenominator(Quantity10_30.convertQuantity(src.getDenominator()));
return tgt;
}
}

View File

@ -1,37 +1,39 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Decimal10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.PositiveInt10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class SampledData10_30 {
public static org.hl7.fhir.dstu3.model.SampledData convertSampledData(org.hl7.fhir.dstu2.model.SampledData src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.SampledData tgt = new org.hl7.fhir.dstu3.model.SampledData();
Element10_30.copyElement(src, tgt);
if (src.hasOrigin()) tgt.setOrigin(SimpleQuantity10_30.convertSimpleQuantity(src.getOrigin()));
if (src.hasPeriodElement()) tgt.setPeriodElement(Decimal10_30.convertDecimal(src.getPeriodElement()));
if (src.hasFactorElement()) tgt.setFactorElement(Decimal10_30.convertDecimal(src.getFactorElement()));
if (src.hasLowerLimitElement()) tgt.setLowerLimitElement(Decimal10_30.convertDecimal(src.getLowerLimitElement()));
if (src.hasUpperLimitElement()) tgt.setUpperLimitElement(Decimal10_30.convertDecimal(src.getUpperLimitElement()));
if (src.hasDimensionsElement()) tgt.setDimensionsElement(PositiveInt10_30.convertPositiveInt(src.getDimensionsElement()));
if (src.hasDataElement()) tgt.setDataElement(String10_30.convertString(src.getDataElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.SampledData convertSampledData(org.hl7.fhir.dstu2.model.SampledData src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.SampledData tgt = new org.hl7.fhir.dstu3.model.SampledData();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasOrigin()) tgt.setOrigin(SimpleQuantity10_30.convertSimpleQuantity(src.getOrigin()));
if (src.hasPeriodElement()) tgt.setPeriodElement(Decimal10_30.convertDecimal(src.getPeriodElement()));
if (src.hasFactorElement()) tgt.setFactorElement(Decimal10_30.convertDecimal(src.getFactorElement()));
if (src.hasLowerLimitElement()) tgt.setLowerLimitElement(Decimal10_30.convertDecimal(src.getLowerLimitElement()));
if (src.hasUpperLimitElement()) tgt.setUpperLimitElement(Decimal10_30.convertDecimal(src.getUpperLimitElement()));
if (src.hasDimensionsElement())
tgt.setDimensionsElement(PositiveInt10_30.convertPositiveInt(src.getDimensionsElement()));
if (src.hasDataElement()) tgt.setDataElement(String10_30.convertString(src.getDataElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.SampledData convertSampledData(org.hl7.fhir.dstu3.model.SampledData src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.SampledData tgt = new org.hl7.fhir.dstu2.model.SampledData();
Element10_30.copyElement(src, tgt);
if (src.hasOrigin()) tgt.setOrigin(SimpleQuantity10_30.convertSimpleQuantity(src.getOrigin()));
if (src.hasPeriodElement()) tgt.setPeriodElement(Decimal10_30.convertDecimal(src.getPeriodElement()));
if (src.hasFactorElement()) tgt.setFactorElement(Decimal10_30.convertDecimal(src.getFactorElement()));
if (src.hasLowerLimitElement()) tgt.setLowerLimitElement(Decimal10_30.convertDecimal(src.getLowerLimitElement()));
if (src.hasUpperLimitElement()) tgt.setUpperLimitElement(Decimal10_30.convertDecimal(src.getUpperLimitElement()));
if (src.hasDimensionsElement()) tgt.setDimensionsElement(PositiveInt10_30.convertPositiveInt(src.getDimensionsElement()));
if (src.hasDataElement()) tgt.setDataElement(String10_30.convertString(src.getDataElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.SampledData convertSampledData(org.hl7.fhir.dstu3.model.SampledData src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.SampledData tgt = new org.hl7.fhir.dstu2.model.SampledData();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasOrigin()) tgt.setOrigin(SimpleQuantity10_30.convertSimpleQuantity(src.getOrigin()));
if (src.hasPeriodElement()) tgt.setPeriodElement(Decimal10_30.convertDecimal(src.getPeriodElement()));
if (src.hasFactorElement()) tgt.setFactorElement(Decimal10_30.convertDecimal(src.getFactorElement()));
if (src.hasLowerLimitElement()) tgt.setLowerLimitElement(Decimal10_30.convertDecimal(src.getLowerLimitElement()));
if (src.hasUpperLimitElement()) tgt.setUpperLimitElement(Decimal10_30.convertDecimal(src.getUpperLimitElement()));
if (src.hasDimensionsElement())
tgt.setDimensionsElement(PositiveInt10_30.convertPositiveInt(src.getDimensionsElement()));
if (src.hasDataElement()) tgt.setDataElement(String10_30.convertString(src.getDataElement()));
return tgt;
}
}

View File

@ -1,34 +1,33 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Type10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Base64Binary10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Code10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Signature10_30 {
public static org.hl7.fhir.dstu3.model.Signature convertSignature(org.hl7.fhir.dstu2.model.Signature src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Signature tgt = new org.hl7.fhir.dstu3.model.Signature();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.Coding t : src.getType()) tgt.addType(Coding10_30.convertCoding(t));
if (src.hasWhenElement()) tgt.setWhenElement(Instant10_30.convertInstant(src.getWhenElement()));
if (src.hasWho()) tgt.setWho(Type10_30.convertType(src.getWho()));
if (src.hasContentTypeElement()) tgt.setContentTypeElement(Code10_30.convertCode(src.getContentTypeElement()));
if (src.hasBlobElement()) tgt.setBlobElement(Base64Binary10_30.convertBase64Binary(src.getBlobElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Signature convertSignature(org.hl7.fhir.dstu2.model.Signature src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Signature tgt = new org.hl7.fhir.dstu3.model.Signature();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.Coding t : src.getType()) tgt.addType(Coding10_30.convertCoding(t));
if (src.hasWhenElement()) tgt.setWhenElement(Instant10_30.convertInstant(src.getWhenElement()));
if (src.hasWho()) tgt.setWho(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getWho()));
if (src.hasContentTypeElement()) tgt.setContentTypeElement(Code10_30.convertCode(src.getContentTypeElement()));
if (src.hasBlobElement()) tgt.setBlobElement(Base64Binary10_30.convertBase64Binary(src.getBlobElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Signature convertSignature(org.hl7.fhir.dstu3.model.Signature src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Signature tgt = new org.hl7.fhir.dstu2.model.Signature();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.Coding t : src.getType()) tgt.addType(Coding10_30.convertCoding(t));
if (src.hasWhenElement()) tgt.setWhenElement(Instant10_30.convertInstant(src.getWhenElement()));
if (src.hasWho()) tgt.setWho(Type10_30.convertType(src.getWho()));
if (src.hasContentTypeElement()) tgt.setContentTypeElement(Code10_30.convertCode(src.getContentTypeElement()));
if (src.hasBlobElement()) tgt.setBlobElement(Base64Binary10_30.convertBase64Binary(src.getBlobElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Signature convertSignature(org.hl7.fhir.dstu3.model.Signature src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Signature tgt = new org.hl7.fhir.dstu2.model.Signature();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.Coding t : src.getType()) tgt.addType(Coding10_30.convertCoding(t));
if (src.hasWhenElement()) tgt.setWhenElement(Instant10_30.convertInstant(src.getWhenElement()));
if (src.hasWho()) tgt.setWho(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getWho()));
if (src.hasContentTypeElement()) tgt.setContentTypeElement(Code10_30.convertCode(src.getContentTypeElement()));
if (src.hasBlobElement()) tgt.setBlobElement(Base64Binary10_30.convertBase64Binary(src.getBlobElement()));
return tgt;
}
}

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Code10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Decimal10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
@ -8,27 +8,29 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri1
import org.hl7.fhir.exceptions.FHIRException;
public class SimpleQuantity10_30 {
public static org.hl7.fhir.dstu3.model.SimpleQuantity convertSimpleQuantity(org.hl7.fhir.dstu2.model.SimpleQuantity src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.SimpleQuantity tgt = new org.hl7.fhir.dstu3.model.SimpleQuantity();
Element10_30.copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.SimpleQuantity convertSimpleQuantity(org.hl7.fhir.dstu2.model.SimpleQuantity src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.SimpleQuantity tgt = new org.hl7.fhir.dstu3.model.SimpleQuantity();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator())
tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.SimpleQuantity convertSimpleQuantity(org.hl7.fhir.dstu3.model.SimpleQuantity src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.SimpleQuantity tgt = new org.hl7.fhir.dstu2.model.SimpleQuantity();
Element10_30.copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator()) tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.SimpleQuantity convertSimpleQuantity(org.hl7.fhir.dstu3.model.SimpleQuantity src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.SimpleQuantity tgt = new org.hl7.fhir.dstu2.model.SimpleQuantity();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasValueElement()) tgt.setValueElement(Decimal10_30.convertDecimal(src.getValueElement()));
if (src.hasComparator())
tgt.setComparatorElement(Quantity10_30.convertQuantityComparator(src.getComparatorElement()));
if (src.hasUnitElement()) tgt.setUnitElement(String10_30.convertString(src.getUnitElement()));
if (src.hasSystemElement()) tgt.setSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement()) tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
return tgt;
}
}

View File

@ -1,7 +1,6 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Type10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Decimal10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Integer10_30;
import org.hl7.fhir.exceptions.FHIRException;
@ -9,249 +8,255 @@ import org.hl7.fhir.exceptions.FHIRException;
import java.util.Collections;
public class Timing10_30 {
public static org.hl7.fhir.dstu3.model.Timing convertTiming(org.hl7.fhir.dstu2.model.Timing src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Timing tgt = new org.hl7.fhir.dstu3.model.Timing();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.DateTimeType t : src.getEvent()) tgt.addEvent(t.getValue());
if (src.hasRepeat()) tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat()));
if (src.hasCode()) tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Timing convertTiming(org.hl7.fhir.dstu2.model.Timing src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Timing tgt = new org.hl7.fhir.dstu3.model.Timing();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.DateTimeType t : src.getEvent()) tgt.addEvent(t.getValue());
if (src.hasRepeat()) tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat()));
if (src.hasCode()) tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Timing convertTiming(org.hl7.fhir.dstu3.model.Timing src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Timing tgt = new org.hl7.fhir.dstu2.model.Timing();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.DateTimeType t : src.getEvent()) tgt.addEvent(t.getValue());
if (src.hasRepeat()) tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat()));
if (src.hasCode()) tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Timing convertTiming(org.hl7.fhir.dstu3.model.Timing src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Timing tgt = new org.hl7.fhir.dstu2.model.Timing();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.DateTimeType t : src.getEvent()) tgt.addEvent(t.getValue());
if (src.hasRepeat()) tgt.setRepeat(convertTimingRepeatComponent(src.getRepeat()));
if (src.hasCode()) tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent convertTimingRepeatComponent(org.hl7.fhir.dstu2.model.Timing.TimingRepeatComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent tgt = new org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent();
Element10_30.copyElement(src, tgt);
if (src.hasBounds()) tgt.setBounds(Type10_30.convertType(src.getBounds()));
if (src.hasCountElement()) tgt.setCountElement(Integer10_30.convertInteger(src.getCountElement()));
if (src.hasDurationElement()) tgt.setDurationElement(Decimal10_30.convertDecimal(src.getDurationElement()));
if (src.hasDurationMaxElement()) tgt.setDurationMaxElement(Decimal10_30.convertDecimal(src.getDurationMaxElement()));
if (src.hasDurationUnits()) tgt.setDurationUnitElement(convertUnitsOfTime(src.getDurationUnitsElement()));
if (src.hasFrequencyElement()) tgt.setFrequencyElement(Integer10_30.convertInteger(src.getFrequencyElement()));
if (src.hasFrequencyMaxElement()) tgt.setFrequencyMaxElement(Integer10_30.convertInteger(src.getFrequencyMaxElement()));
if (src.hasPeriodElement()) tgt.setPeriodElement(Decimal10_30.convertDecimal(src.getPeriodElement()));
if (src.hasPeriodMaxElement()) tgt.setPeriodMaxElement(Decimal10_30.convertDecimal(src.getPeriodMaxElement()));
if (src.hasPeriodUnits()) tgt.setPeriodUnitElement(convertUnitsOfTime(src.getPeriodUnitsElement()));
if (src.hasWhen()) tgt.setWhen(Collections.singletonList(convertEventTiming(src.getWhenElement())));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent convertTimingRepeatComponent(org.hl7.fhir.dstu2.model.Timing.TimingRepeatComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent tgt = new org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasBounds())
tgt.setBounds(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getBounds()));
if (src.hasCountElement()) tgt.setCountElement(Integer10_30.convertInteger(src.getCountElement()));
if (src.hasDurationElement()) tgt.setDurationElement(Decimal10_30.convertDecimal(src.getDurationElement()));
if (src.hasDurationMaxElement())
tgt.setDurationMaxElement(Decimal10_30.convertDecimal(src.getDurationMaxElement()));
if (src.hasDurationUnits()) tgt.setDurationUnitElement(convertUnitsOfTime(src.getDurationUnitsElement()));
if (src.hasFrequencyElement()) tgt.setFrequencyElement(Integer10_30.convertInteger(src.getFrequencyElement()));
if (src.hasFrequencyMaxElement())
tgt.setFrequencyMaxElement(Integer10_30.convertInteger(src.getFrequencyMaxElement()));
if (src.hasPeriodElement()) tgt.setPeriodElement(Decimal10_30.convertDecimal(src.getPeriodElement()));
if (src.hasPeriodMaxElement()) tgt.setPeriodMaxElement(Decimal10_30.convertDecimal(src.getPeriodMaxElement()));
if (src.hasPeriodUnits()) tgt.setPeriodUnitElement(convertUnitsOfTime(src.getPeriodUnitsElement()));
if (src.hasWhen()) tgt.setWhen(Collections.singletonList(convertEventTiming(src.getWhenElement())));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Timing.TimingRepeatComponent convertTimingRepeatComponent(org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Timing.TimingRepeatComponent tgt = new org.hl7.fhir.dstu2.model.Timing.TimingRepeatComponent();
Element10_30.copyElement(src, tgt);
if (src.hasBounds()) tgt.setBounds(Type10_30.convertType(src.getBounds()));
if (src.hasCountElement()) tgt.setCountElement(Integer10_30.convertInteger(src.getCountElement()));
if (src.hasDurationElement()) tgt.setDurationElement(Decimal10_30.convertDecimal(src.getDurationElement()));
if (src.hasDurationMaxElement()) tgt.setDurationMaxElement(Decimal10_30.convertDecimal(src.getDurationMaxElement()));
if (src.hasDurationUnit()) tgt.setDurationUnitsElement(convertUnitsOfTime(src.getDurationUnitElement()));
if (src.hasFrequencyElement()) tgt.setFrequencyElement(Integer10_30.convertInteger(src.getFrequencyElement()));
if (src.hasFrequencyMaxElement()) tgt.setFrequencyMaxElement(Integer10_30.convertInteger(src.getFrequencyMaxElement()));
if (src.hasPeriodElement()) tgt.setPeriodElement(Decimal10_30.convertDecimal(src.getPeriodElement()));
if (src.hasPeriodMaxElement()) tgt.setPeriodMaxElement(Decimal10_30.convertDecimal(src.getPeriodMaxElement()));
if (src.hasPeriodUnit()) tgt.setPeriodUnitsElement(convertUnitsOfTime(src.getPeriodUnitElement()));
if (src.hasWhen()) tgt.setWhenElement(convertEventTiming(src.getWhen().get(0)));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Timing.TimingRepeatComponent convertTimingRepeatComponent(org.hl7.fhir.dstu3.model.Timing.TimingRepeatComponent src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Timing.TimingRepeatComponent tgt = new org.hl7.fhir.dstu2.model.Timing.TimingRepeatComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasBounds())
tgt.setBounds(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getBounds()));
if (src.hasCountElement()) tgt.setCountElement(Integer10_30.convertInteger(src.getCountElement()));
if (src.hasDurationElement()) tgt.setDurationElement(Decimal10_30.convertDecimal(src.getDurationElement()));
if (src.hasDurationMaxElement())
tgt.setDurationMaxElement(Decimal10_30.convertDecimal(src.getDurationMaxElement()));
if (src.hasDurationUnit()) tgt.setDurationUnitsElement(convertUnitsOfTime(src.getDurationUnitElement()));
if (src.hasFrequencyElement()) tgt.setFrequencyElement(Integer10_30.convertInteger(src.getFrequencyElement()));
if (src.hasFrequencyMaxElement())
tgt.setFrequencyMaxElement(Integer10_30.convertInteger(src.getFrequencyMaxElement()));
if (src.hasPeriodElement()) tgt.setPeriodElement(Decimal10_30.convertDecimal(src.getPeriodElement()));
if (src.hasPeriodMaxElement()) tgt.setPeriodMaxElement(Decimal10_30.convertDecimal(src.getPeriodMaxElement()));
if (src.hasPeriodUnit()) tgt.setPeriodUnitsElement(convertUnitsOfTime(src.getPeriodUnitElement()));
if (src.hasWhen()) tgt.setWhenElement(convertEventTiming(src.getWhen().get(0)));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Timing.UnitsOfTime> convertUnitsOfTime(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Timing.UnitsOfTime> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Timing.UnitsOfTime> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Timing.UnitsOfTimeEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.NULL);
} else {
switch (src.getValue()) {
case S:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.S);
break;
case MIN:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MIN);
break;
case H:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.H);
break;
case D:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.D);
break;
case WK:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.WK);
break;
case MO:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MO);
break;
case A:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.A);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.NULL);
break;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Timing.UnitsOfTime> convertUnitsOfTime(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Timing.UnitsOfTime> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Timing.UnitsOfTime> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Timing.UnitsOfTimeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.NULL);
} else {
switch (src.getValue()) {
case S:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.S);
break;
case MIN:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MIN);
break;
case H:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.H);
break;
case D:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.D);
break;
case WK:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.WK);
break;
case MO:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.MO);
break;
case A:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.A);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.UnitsOfTime.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Timing.UnitsOfTime> convertUnitsOfTime(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Timing.UnitsOfTime> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Timing.UnitsOfTime> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Timing.UnitsOfTimeEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.NULL);
} else {
switch (src.getValue()) {
case S:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.S);
break;
case MIN:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MIN);
break;
case H:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.H);
break;
case D:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.D);
break;
case WK:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.WK);
break;
case MO:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MO);
break;
case A:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.A);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Timing.UnitsOfTime> convertUnitsOfTime(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Timing.UnitsOfTime> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Timing.UnitsOfTime> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Timing.UnitsOfTimeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.NULL);
} else {
switch (src.getValue()) {
case S:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.S);
break;
case MIN:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MIN);
break;
case H:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.H);
break;
case D:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.D);
break;
case WK:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.WK);
break;
case MO:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.MO);
break;
case A:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.A);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.UnitsOfTime.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Timing.EventTiming> convertEventTiming(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Timing.EventTiming> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Timing.EventTiming> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Timing.EventTimingEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NULL);
} else {
switch (src.getValue()) {
case HS:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.HS);
break;
case WAKE:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.WAKE);
break;
case C:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.C);
break;
case CM:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CM);
break;
case CD:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CD);
break;
case CV:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CV);
break;
case AC:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.AC);
break;
case ACM:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACM);
break;
case ACD:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACD);
break;
case ACV:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACV);
break;
case PC:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PC);
break;
case PCM:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCM);
break;
case PCD:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCD);
break;
case PCV:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCV);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NULL);
break;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Timing.EventTiming> convertEventTiming(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Timing.EventTiming> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Timing.EventTiming> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Timing.EventTimingEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NULL);
} else {
switch (src.getValue()) {
case HS:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.HS);
break;
case WAKE:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.WAKE);
break;
case C:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.C);
break;
case CM:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CM);
break;
case CD:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CD);
break;
case CV:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.CV);
break;
case AC:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.AC);
break;
case ACM:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACM);
break;
case ACD:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACD);
break;
case ACV:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.ACV);
break;
case PC:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PC);
break;
case PCM:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCM);
break;
case PCD:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCD);
break;
case PCV:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.PCV);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Timing.EventTiming.NULL);
break;
}
return tgt;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Timing.EventTiming> convertEventTiming(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Timing.EventTiming> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Timing.EventTiming> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Timing.EventTimingEnumFactory());
Element10_30.copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.NULL);
} else {
switch (src.getValue()) {
case HS:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.HS);
break;
case WAKE:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.WAKE);
break;
case C:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.C);
break;
case CM:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CM);
break;
case CD:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CD);
break;
case CV:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CV);
break;
case AC:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.AC);
break;
case ACM:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACM);
break;
case ACD:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACD);
break;
case ACV:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACV);
break;
case PC:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PC);
break;
case PCM:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCM);
break;
case PCD:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCD);
break;
case PCV:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCV);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.NULL);
break;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Timing.EventTiming> convertEventTiming(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Timing.EventTiming> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Timing.EventTiming> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Timing.EventTimingEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.getValue() == null) {
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.NULL);
} else {
switch (src.getValue()) {
case HS:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.HS);
break;
case WAKE:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.WAKE);
break;
case C:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.C);
break;
case CM:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CM);
break;
case CD:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CD);
break;
case CV:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.CV);
break;
case AC:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.AC);
break;
case ACM:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACM);
break;
case ACD:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACD);
break;
case ACV:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.ACV);
break;
case PC:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PC);
break;
case PCM:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCM);
break;
case PCD:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCD);
break;
case PCV:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.PCV);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Timing.EventTiming.NULL);
break;
}
return tgt;
}
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Base64Binary10_30 {
public static org.hl7.fhir.dstu3.model.Base64BinaryType convertBase64Binary(org.hl7.fhir.dstu2.model.Base64BinaryType src) throws FHIRException {
org.hl7.fhir.dstu3.model.Base64BinaryType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.Base64BinaryType(src.getValue()) : new org.hl7.fhir.dstu3.model.Base64BinaryType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.Base64BinaryType convertBase64Binary(org.hl7.fhir.dstu2.model.Base64BinaryType src) throws FHIRException {
org.hl7.fhir.dstu3.model.Base64BinaryType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.Base64BinaryType(src.getValue()) : new org.hl7.fhir.dstu3.model.Base64BinaryType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.Base64BinaryType convertBase64Binary(org.hl7.fhir.dstu3.model.Base64BinaryType src) throws FHIRException {
org.hl7.fhir.dstu2.model.Base64BinaryType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.Base64BinaryType(src.getValue()) : new org.hl7.fhir.dstu2.model.Base64BinaryType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.Base64BinaryType convertBase64Binary(org.hl7.fhir.dstu3.model.Base64BinaryType src) throws FHIRException {
org.hl7.fhir.dstu2.model.Base64BinaryType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.Base64BinaryType(src.getValue()) : new org.hl7.fhir.dstu2.model.Base64BinaryType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Boolean10_30 {
public static org.hl7.fhir.dstu3.model.BooleanType convertBoolean(org.hl7.fhir.dstu2.model.BooleanType src) throws FHIRException {
org.hl7.fhir.dstu3.model.BooleanType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.BooleanType(src.getValue()) : new org.hl7.fhir.dstu3.model.BooleanType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.BooleanType convertBoolean(org.hl7.fhir.dstu2.model.BooleanType src) throws FHIRException {
org.hl7.fhir.dstu3.model.BooleanType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.BooleanType(src.getValue()) : new org.hl7.fhir.dstu3.model.BooleanType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.BooleanType convertBoolean(org.hl7.fhir.dstu3.model.BooleanType src) throws FHIRException {
org.hl7.fhir.dstu2.model.BooleanType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.BooleanType(src.getValue()) : new org.hl7.fhir.dstu2.model.BooleanType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.BooleanType convertBoolean(org.hl7.fhir.dstu3.model.BooleanType src) throws FHIRException {
org.hl7.fhir.dstu2.model.BooleanType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.BooleanType(src.getValue()) : new org.hl7.fhir.dstu2.model.BooleanType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,30 +1,30 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Code10_30 {
public static org.hl7.fhir.dstu3.model.CodeType convertCode(org.hl7.fhir.dstu2.model.CodeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.CodeType(src.getValue()) : new org.hl7.fhir.dstu3.model.CodeType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.CodeType convertCode(org.hl7.fhir.dstu2.model.CodeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.CodeType(src.getValue()) : new org.hl7.fhir.dstu3.model.CodeType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.CodeType convertCode(org.hl7.fhir.dstu3.model.CodeType src) throws FHIRException {
org.hl7.fhir.dstu2.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.CodeType(src.getValue()) : new org.hl7.fhir.dstu2.model.CodeType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.CodeType convertCode(org.hl7.fhir.dstu3.model.CodeType src) throws FHIRException {
org.hl7.fhir.dstu2.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.CodeType(src.getValue()) : new org.hl7.fhir.dstu2.model.CodeType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.UriType convertCodeToUri(org.hl7.fhir.dstu2.model.CodeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.UriType(src.getValue()) : new org.hl7.fhir.dstu3.model.UriType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.UriType convertCodeToUri(org.hl7.fhir.dstu2.model.CodeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.UriType(src.getValue()) : new org.hl7.fhir.dstu3.model.UriType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.CodeType convertUriToCode(org.hl7.fhir.dstu3.model.UriType src) throws FHIRException {
org.hl7.fhir.dstu2.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.CodeType(src.getValue()) : new org.hl7.fhir.dstu2.model.CodeType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.CodeType convertUriToCode(org.hl7.fhir.dstu3.model.UriType src) throws FHIRException {
org.hl7.fhir.dstu2.model.CodeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.CodeType(src.getValue()) : new org.hl7.fhir.dstu2.model.CodeType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,30 +1,30 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Date10_30 {
public static org.hl7.fhir.dstu3.model.DateType convertDate(org.hl7.fhir.dstu2.model.DateType src) throws FHIRException {
org.hl7.fhir.dstu3.model.DateType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DateType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.DateType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.DateType convertDate(org.hl7.fhir.dstu2.model.DateType src) throws FHIRException {
org.hl7.fhir.dstu3.model.DateType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DateType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.DateType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.DateType convertDate(org.hl7.fhir.dstu2.model.DateTimeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.DateType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DateType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.DateType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.DateType convertDate(org.hl7.fhir.dstu2.model.DateTimeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.DateType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DateType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.DateType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.DateType convertDate(org.hl7.fhir.dstu3.model.DateType src) throws FHIRException {
org.hl7.fhir.dstu2.model.DateType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.DateType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.DateType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.DateType convertDate(org.hl7.fhir.dstu3.model.DateType src) throws FHIRException {
org.hl7.fhir.dstu2.model.DateType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.DateType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.DateType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.DateType convertDate(org.hl7.fhir.dstu3.model.DateTimeType src) throws FHIRException {
org.hl7.fhir.dstu2.model.DateType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.DateType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.DateType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.DateType convertDate(org.hl7.fhir.dstu3.model.DateTimeType src) throws FHIRException {
org.hl7.fhir.dstu2.model.DateType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.DateType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.DateType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class DateTime10_30 {
public static org.hl7.fhir.dstu3.model.DateTimeType convertDateTime(org.hl7.fhir.dstu2.model.DateTimeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.DateTimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DateTimeType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.DateTimeType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.DateTimeType convertDateTime(org.hl7.fhir.dstu2.model.DateTimeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.DateTimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DateTimeType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.DateTimeType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.DateTimeType convertDateTime(org.hl7.fhir.dstu3.model.DateTimeType src) throws FHIRException {
org.hl7.fhir.dstu2.model.DateTimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.DateTimeType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.DateTimeType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.DateTimeType convertDateTime(org.hl7.fhir.dstu3.model.DateTimeType src) throws FHIRException {
org.hl7.fhir.dstu2.model.DateTimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.DateTimeType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.DateTimeType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Decimal10_30 {
public static org.hl7.fhir.dstu3.model.DecimalType convertDecimal(org.hl7.fhir.dstu2.model.DecimalType src) throws FHIRException {
org.hl7.fhir.dstu3.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DecimalType(src.getValue()) : new org.hl7.fhir.dstu3.model.DecimalType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.DecimalType convertDecimal(org.hl7.fhir.dstu2.model.DecimalType src) throws FHIRException {
org.hl7.fhir.dstu3.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DecimalType(src.getValue()) : new org.hl7.fhir.dstu3.model.DecimalType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.DecimalType convertDecimal(org.hl7.fhir.dstu3.model.DecimalType src) throws FHIRException {
org.hl7.fhir.dstu2.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.DecimalType(src.getValue()) : new org.hl7.fhir.dstu2.model.DecimalType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.DecimalType convertDecimal(org.hl7.fhir.dstu3.model.DecimalType src) throws FHIRException {
org.hl7.fhir.dstu2.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.DecimalType(src.getValue()) : new org.hl7.fhir.dstu2.model.DecimalType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Id10_30 {
public static org.hl7.fhir.dstu3.model.IdType convertId(org.hl7.fhir.dstu2.model.IdType src) throws FHIRException {
org.hl7.fhir.dstu3.model.IdType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.IdType(src.getValue()) : new org.hl7.fhir.dstu3.model.IdType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.IdType convertId(org.hl7.fhir.dstu2.model.IdType src) throws FHIRException {
org.hl7.fhir.dstu3.model.IdType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.IdType(src.getValue()) : new org.hl7.fhir.dstu3.model.IdType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.IdType convertId(org.hl7.fhir.dstu3.model.IdType src) throws FHIRException {
org.hl7.fhir.dstu2.model.IdType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.IdType(src.getValue()) : new org.hl7.fhir.dstu2.model.IdType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.IdType convertId(org.hl7.fhir.dstu3.model.IdType src) throws FHIRException {
org.hl7.fhir.dstu2.model.IdType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.IdType(src.getValue()) : new org.hl7.fhir.dstu2.model.IdType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Instant10_30 {
public static org.hl7.fhir.dstu3.model.InstantType convertInstant(org.hl7.fhir.dstu2.model.InstantType src) throws FHIRException {
org.hl7.fhir.dstu3.model.InstantType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.InstantType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.InstantType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.InstantType convertInstant(org.hl7.fhir.dstu2.model.InstantType src) throws FHIRException {
org.hl7.fhir.dstu3.model.InstantType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.InstantType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.InstantType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.InstantType convertInstant(org.hl7.fhir.dstu3.model.InstantType src) throws FHIRException {
org.hl7.fhir.dstu2.model.InstantType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.InstantType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.InstantType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.InstantType convertInstant(org.hl7.fhir.dstu3.model.InstantType src) throws FHIRException {
org.hl7.fhir.dstu2.model.InstantType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.InstantType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.InstantType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Integer10_30 {
public static org.hl7.fhir.dstu3.model.IntegerType convertInteger(org.hl7.fhir.dstu2.model.IntegerType src) throws FHIRException {
org.hl7.fhir.dstu3.model.IntegerType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.IntegerType(src.getValue()) : new org.hl7.fhir.dstu3.model.IntegerType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.IntegerType convertInteger(org.hl7.fhir.dstu2.model.IntegerType src) throws FHIRException {
org.hl7.fhir.dstu3.model.IntegerType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.IntegerType(src.getValue()) : new org.hl7.fhir.dstu3.model.IntegerType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.IntegerType convertInteger(org.hl7.fhir.dstu3.model.IntegerType src) throws FHIRException {
org.hl7.fhir.dstu2.model.IntegerType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.IntegerType(src.getValue()) : new org.hl7.fhir.dstu2.model.IntegerType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.IntegerType convertInteger(org.hl7.fhir.dstu3.model.IntegerType src) throws FHIRException {
org.hl7.fhir.dstu2.model.IntegerType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.IntegerType(src.getValue()) : new org.hl7.fhir.dstu2.model.IntegerType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class MarkDown10_30 {
public static org.hl7.fhir.dstu3.model.MarkdownType convertMarkdown(org.hl7.fhir.dstu2.model.MarkdownType src) throws FHIRException {
org.hl7.fhir.dstu3.model.MarkdownType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.MarkdownType(src.getValue()) : new org.hl7.fhir.dstu3.model.MarkdownType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.MarkdownType convertMarkdown(org.hl7.fhir.dstu2.model.MarkdownType src) throws FHIRException {
org.hl7.fhir.dstu3.model.MarkdownType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.MarkdownType(src.getValue()) : new org.hl7.fhir.dstu3.model.MarkdownType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.MarkdownType convertMarkdown(org.hl7.fhir.dstu3.model.MarkdownType src) throws FHIRException {
org.hl7.fhir.dstu2.model.MarkdownType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.MarkdownType(src.getValue()) : new org.hl7.fhir.dstu2.model.MarkdownType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.MarkdownType convertMarkdown(org.hl7.fhir.dstu3.model.MarkdownType src) throws FHIRException {
org.hl7.fhir.dstu2.model.MarkdownType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.MarkdownType(src.getValue()) : new org.hl7.fhir.dstu2.model.MarkdownType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Oid10_30 {
public static org.hl7.fhir.dstu3.model.OidType convertOid(org.hl7.fhir.dstu2.model.OidType src) throws FHIRException {
org.hl7.fhir.dstu3.model.OidType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.OidType(src.getValue()) : new org.hl7.fhir.dstu3.model.OidType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.OidType convertOid(org.hl7.fhir.dstu2.model.OidType src) throws FHIRException {
org.hl7.fhir.dstu3.model.OidType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.OidType(src.getValue()) : new org.hl7.fhir.dstu3.model.OidType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.OidType convertOid(org.hl7.fhir.dstu3.model.OidType src) throws FHIRException {
org.hl7.fhir.dstu2.model.OidType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.OidType(src.getValue()) : new org.hl7.fhir.dstu2.model.OidType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.OidType convertOid(org.hl7.fhir.dstu3.model.OidType src) throws FHIRException {
org.hl7.fhir.dstu2.model.OidType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.OidType(src.getValue()) : new org.hl7.fhir.dstu2.model.OidType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class PositiveInt10_30 {
public static org.hl7.fhir.dstu3.model.PositiveIntType convertPositiveInt(org.hl7.fhir.dstu2.model.PositiveIntType src) throws FHIRException {
org.hl7.fhir.dstu3.model.PositiveIntType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.PositiveIntType(src.getValue()) : new org.hl7.fhir.dstu3.model.PositiveIntType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.PositiveIntType convertPositiveInt(org.hl7.fhir.dstu2.model.PositiveIntType src) throws FHIRException {
org.hl7.fhir.dstu3.model.PositiveIntType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.PositiveIntType(src.getValue()) : new org.hl7.fhir.dstu3.model.PositiveIntType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.PositiveIntType convertPositiveInt(org.hl7.fhir.dstu3.model.PositiveIntType src) throws FHIRException {
org.hl7.fhir.dstu2.model.PositiveIntType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.PositiveIntType(src.getValue()) : new org.hl7.fhir.dstu2.model.PositiveIntType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.PositiveIntType convertPositiveInt(org.hl7.fhir.dstu3.model.PositiveIntType src) throws FHIRException {
org.hl7.fhir.dstu2.model.PositiveIntType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.PositiveIntType(src.getValue()) : new org.hl7.fhir.dstu2.model.PositiveIntType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class String10_30 {
public static org.hl7.fhir.dstu3.model.StringType convertString(org.hl7.fhir.dstu2.model.StringType src) throws FHIRException {
org.hl7.fhir.dstu3.model.StringType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.StringType(src.getValue()) : new org.hl7.fhir.dstu3.model.StringType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.StringType convertString(org.hl7.fhir.dstu2.model.StringType src) throws FHIRException {
org.hl7.fhir.dstu3.model.StringType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.StringType(src.getValue()) : new org.hl7.fhir.dstu3.model.StringType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.StringType convertString(org.hl7.fhir.dstu3.model.StringType src) throws FHIRException {
org.hl7.fhir.dstu2.model.StringType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.StringType(src.getValue()) : new org.hl7.fhir.dstu2.model.StringType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.StringType convertString(org.hl7.fhir.dstu3.model.StringType src) throws FHIRException {
org.hl7.fhir.dstu2.model.StringType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.StringType(src.getValue()) : new org.hl7.fhir.dstu2.model.StringType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Time10_30 {
public static org.hl7.fhir.dstu3.model.TimeType convertTime(org.hl7.fhir.dstu2.model.TimeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.TimeType(src.getValue()) : new org.hl7.fhir.dstu3.model.TimeType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.TimeType convertTime(org.hl7.fhir.dstu2.model.TimeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.TimeType(src.getValue()) : new org.hl7.fhir.dstu3.model.TimeType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.TimeType convertTime(org.hl7.fhir.dstu3.model.TimeType src) throws FHIRException {
org.hl7.fhir.dstu2.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.TimeType(src.getValue()) : new org.hl7.fhir.dstu2.model.TimeType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.TimeType convertTime(org.hl7.fhir.dstu3.model.TimeType src) throws FHIRException {
org.hl7.fhir.dstu2.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.TimeType(src.getValue()) : new org.hl7.fhir.dstu2.model.TimeType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class UnsignedInt10_30 {
public static org.hl7.fhir.dstu3.model.UnsignedIntType convertUnsignedInt(org.hl7.fhir.dstu2.model.UnsignedIntType src) throws FHIRException {
org.hl7.fhir.dstu3.model.UnsignedIntType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.UnsignedIntType(src.getValue()) : new org.hl7.fhir.dstu3.model.UnsignedIntType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.UnsignedIntType convertUnsignedInt(org.hl7.fhir.dstu2.model.UnsignedIntType src) throws FHIRException {
org.hl7.fhir.dstu3.model.UnsignedIntType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.UnsignedIntType(src.getValue()) : new org.hl7.fhir.dstu3.model.UnsignedIntType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.UnsignedIntType convertUnsignedInt(org.hl7.fhir.dstu3.model.UnsignedIntType src) throws FHIRException {
org.hl7.fhir.dstu2.model.UnsignedIntType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.UnsignedIntType(src.getValue()) : new org.hl7.fhir.dstu2.model.UnsignedIntType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.UnsignedIntType convertUnsignedInt(org.hl7.fhir.dstu3.model.UnsignedIntType src) throws FHIRException {
org.hl7.fhir.dstu2.model.UnsignedIntType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.UnsignedIntType(src.getValue()) : new org.hl7.fhir.dstu2.model.UnsignedIntType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Uri10_30 {
public static org.hl7.fhir.dstu3.model.UriType convertUri(org.hl7.fhir.dstu2.model.UriType src) throws FHIRException {
org.hl7.fhir.dstu3.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.UriType(src.getValue()) : new org.hl7.fhir.dstu3.model.UriType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.UriType convertUri(org.hl7.fhir.dstu2.model.UriType src) throws FHIRException {
org.hl7.fhir.dstu3.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.UriType(src.getValue()) : new org.hl7.fhir.dstu3.model.UriType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.UriType convertUri(org.hl7.fhir.dstu3.model.UriType src) throws FHIRException {
org.hl7.fhir.dstu2.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.UriType(src.getValue()) : new org.hl7.fhir.dstu2.model.UriType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.UriType convertUri(org.hl7.fhir.dstu3.model.UriType src) throws FHIRException {
org.hl7.fhir.dstu2.model.UriType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.UriType(src.getValue()) : new org.hl7.fhir.dstu2.model.UriType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,18 +1,18 @@
package org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Uuid10_30 {
public static org.hl7.fhir.dstu3.model.UuidType convertUuid(org.hl7.fhir.dstu2.model.UuidType src) throws FHIRException {
org.hl7.fhir.dstu3.model.UuidType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.UuidType(src.getValue()) : new org.hl7.fhir.dstu3.model.UuidType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.UuidType convertUuid(org.hl7.fhir.dstu2.model.UuidType src) throws FHIRException {
org.hl7.fhir.dstu3.model.UuidType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.UuidType(src.getValue()) : new org.hl7.fhir.dstu3.model.UuidType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.UuidType convertUuid(org.hl7.fhir.dstu3.model.UuidType src) throws FHIRException {
org.hl7.fhir.dstu2.model.UuidType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.UuidType(src.getValue()) : new org.hl7.fhir.dstu2.model.UuidType();
Element10_30.copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.UuidType convertUuid(org.hl7.fhir.dstu3.model.UuidType src) throws FHIRException {
org.hl7.fhir.dstu2.model.UuidType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.UuidType(src.getValue()) : new org.hl7.fhir.dstu2.model.UuidType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
}

View File

@ -1,102 +1,103 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Money10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Period10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Account10_30 {
public static org.hl7.fhir.dstu2.model.Account convertAccount(org.hl7.fhir.dstu3.model.Account src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Account tgt = new org.hl7.fhir.dstu2.model.Account();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasStatus())
tgt.setStatusElement(convertAccountStatus(src.getStatusElement()));
if (src.hasActive())
tgt.setActivePeriod(Period10_30.convertPeriod(src.getActive()));
if (src.hasBalance())
tgt.setBalance(Money10_30.convertMoney(src.getBalance()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasOwner())
tgt.setOwner(Reference10_30.convertReference(src.getOwner()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Account convertAccount(org.hl7.fhir.dstu3.model.Account src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Account tgt = new org.hl7.fhir.dstu2.model.Account();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasStatus())
tgt.setStatusElement(convertAccountStatus(src.getStatusElement()));
if (src.hasActive())
tgt.setActivePeriod(Period10_30.convertPeriod(src.getActive()));
if (src.hasBalance())
tgt.setBalance(Money10_30.convertMoney(src.getBalance()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasOwner())
tgt.setOwner(Reference10_30.convertReference(src.getOwner()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Account convertAccount(org.hl7.fhir.dstu2.model.Account src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Account tgt = new org.hl7.fhir.dstu3.model.Account();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasName())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasStatus())
tgt.setStatusElement(convertAccountStatus(src.getStatusElement()));
if (src.hasActivePeriod())
tgt.setActive(Period10_30.convertPeriod(src.getActivePeriod()));
if (src.hasBalance())
tgt.setBalance(Money10_30.convertMoney(src.getBalance()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasOwner())
tgt.setOwner(Reference10_30.convertReference(src.getOwner()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Account convertAccount(org.hl7.fhir.dstu2.model.Account src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Account tgt = new org.hl7.fhir.dstu3.model.Account();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasName())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasStatus())
tgt.setStatusElement(convertAccountStatus(src.getStatusElement()));
if (src.hasActivePeriod())
tgt.setActive(Period10_30.convertPeriod(src.getActivePeriod()));
if (src.hasBalance())
tgt.setBalance(Money10_30.convertMoney(src.getBalance()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasOwner())
tgt.setOwner(Reference10_30.convertReference(src.getOwner()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Account.AccountStatus> convertAccountStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Account.AccountStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Account.AccountStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Account.AccountStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.ACTIVE);
break;
case INACTIVE:
tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.INACTIVE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Account.AccountStatus> convertAccountStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Account.AccountStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Account.AccountStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Account.AccountStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.ACTIVE);
break;
case INACTIVE:
tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.INACTIVE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Account.AccountStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Account.AccountStatus> convertAccountStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Account.AccountStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Account.AccountStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Account.AccountStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.Account.AccountStatus.ACTIVE);
break;
case INACTIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.Account.AccountStatus.INACTIVE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Account.AccountStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Account.AccountStatus> convertAccountStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Account.AccountStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Account.AccountStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Account.AccountStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.Account.AccountStatus.ACTIVE);
break;
case INACTIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.Account.AccountStatus.INACTIVE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Account.AccountStatus.NULL);
break;
}
return tgt;
}
}

View File

@ -1,129 +1,132 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Extension10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Annotation10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Extension10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.dstu2.model.AllergyIntolerance;
import org.hl7.fhir.exceptions.FHIRException;
public class AllergyIntolerance10_30 {
public static org.hl7.fhir.dstu3.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.dstu2.model.AllergyIntolerance src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.dstu3.model.AllergyIntolerance tgt = new org.hl7.fhir.dstu3.model.AllergyIntolerance();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier identifier : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(identifier));
if (src.hasOnset())
tgt.setOnset(DateTime10_30.convertDateTime(src.getOnsetElement()));
if (src.hasRecordedDate())
tgt.setAssertedDateElement(DateTime10_30.convertDateTime(src.getRecordedDateElement()));
if (src.hasRecorder())
tgt.setRecorder(Reference10_30.convertReference(src.getRecorder()));
if (src.hasPatient())
tgt.setPatient(Reference10_30.convertReference(src.getPatient()));
if (src.hasReporter())
tgt.setAsserter(Reference10_30.convertReference(src.getReporter()));
if (src.hasSubstance())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getSubstance()));
if (src.hasStatus()) {
if (src.getStatus() != org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceStatus.REFUTED
&& src.getStatus() != org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceStatus.ENTEREDINERROR) {
tgt.setClinicalStatus(translateAllergyIntoleranceClinicalStatus(src.getStatus()));
}
if (src.getStatus() != org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceStatus.ACTIVE
&& src.getStatus() != org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceStatus.RESOLVED) {
tgt.setVerificationStatus(translateAllergyIntoleranceVerificationStatus(src.getStatus()));
}
}
if (src.hasCriticality())
tgt.setCriticality(translateAllergyIntoleranceCriticality(src.getCriticality()));
if (src.hasType())
tgt.setType(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceType.fromCode(src.getType().toCode()));
if (src.hasCategory())
tgt.addCategory(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.fromCode(src.getCategory().toCode()));
if (src.hasLastOccurence())
tgt.setLastOccurrenceElement(DateTime10_30.convertDateTime(src.getLastOccurenceElement()));
if (src.hasNote())
tgt.addNote(Annotation10_30.convertAnnotation(src.getNote()));
for (org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceReactionComponent reaction : src.getReaction())
tgt.addReaction(algReaction(reaction));
return tgt;
public static org.hl7.fhir.dstu3.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.dstu2.model.AllergyIntolerance src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.dstu3.model.AllergyIntolerance tgt = new org.hl7.fhir.dstu3.model.AllergyIntolerance();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier identifier : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(identifier));
if (src.hasOnset())
tgt.setOnset(DateTime10_30.convertDateTime(src.getOnsetElement()));
if (src.hasRecordedDate())
tgt.setAssertedDateElement(DateTime10_30.convertDateTime(src.getRecordedDateElement()));
if (src.hasRecorder())
tgt.setRecorder(Reference10_30.convertReference(src.getRecorder()));
if (src.hasPatient())
tgt.setPatient(Reference10_30.convertReference(src.getPatient()));
if (src.hasReporter())
tgt.setAsserter(Reference10_30.convertReference(src.getReporter()));
if (src.hasSubstance())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getSubstance()));
if (src.hasStatus()) {
if (src.getStatus() != org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceStatus.REFUTED
&& src.getStatus() != org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceStatus.ENTEREDINERROR) {
tgt.setClinicalStatus(translateAllergyIntoleranceClinicalStatus(src.getStatus()));
}
if (src.getStatus() != org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceStatus.ACTIVE
&& src.getStatus() != org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceStatus.RESOLVED) {
tgt.setVerificationStatus(translateAllergyIntoleranceVerificationStatus(src.getStatus()));
}
}
if (src.hasCriticality())
tgt.setCriticality(translateAllergyIntoleranceCriticality(src.getCriticality()));
if (src.hasType())
tgt.setType(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceType.fromCode(src.getType().toCode()));
if (src.hasCategory())
tgt.addCategory(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCategory.fromCode(src.getCategory().toCode()));
if (src.hasLastOccurence())
tgt.setLastOccurrenceElement(DateTime10_30.convertDateTime(src.getLastOccurenceElement()));
if (src.hasNote())
tgt.addNote(Annotation10_30.convertAnnotation(src.getNote()));
for (org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceReactionComponent reaction : src.getReaction())
tgt.addReaction(algReaction(reaction));
return tgt;
}
private static org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent algReaction(AllergyIntolerance.AllergyIntoleranceReactionComponent src) {
if (src == null)
return null;
org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt = new org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.Extension extension : src.getModifierExtension()) tgt.addExtension(Extension10_30.convertExtension(extension));
if (src.hasSubstance())
tgt.setSubstance(CodeableConcept10_30.convertCodeableConcept(src.getSubstance()));
if (src.hasCertainty())
tgt.addExtension(new org.hl7.fhir.dstu3.model.Extension(
"http://hl7.org/fhir/AllergyIntolerance-r2-certainty",
new org.hl7.fhir.dstu3.model.StringType(src.getCertainty().toCode())
));
for (org.hl7.fhir.dstu2.model.CodeableConcept concept : src.getManifestation()) tgt.addManifestation(CodeableConcept10_30.convertCodeableConcept(concept));
if (src.hasDescription())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasOnset())
tgt.setOnsetElement(DateTime10_30.convertDateTime(src.getOnsetElement()));
if (src.hasSeverity())
tgt.setSeverity(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.fromCode(src.getSeverity().toCode()));
if (src.hasExposureRoute())
tgt.setExposureRoute(CodeableConcept10_30.convertCodeableConcept(src.getExposureRoute()));
if (src.hasNote())
tgt.addNote(Annotation10_30.convertAnnotation(src.getNote()));
return tgt;
}
private static org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent algReaction(AllergyIntolerance.AllergyIntoleranceReactionComponent src) {
if (src == null)
return null;
org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt = new org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceReactionComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.Extension extension : src.getModifierExtension())
tgt.addExtension(Extension10_30.convertExtension(extension));
if (src.hasSubstance())
tgt.setSubstance(CodeableConcept10_30.convertCodeableConcept(src.getSubstance()));
if (src.hasCertainty())
tgt.addExtension(new org.hl7.fhir.dstu3.model.Extension(
"http://hl7.org/fhir/AllergyIntolerance-r2-certainty",
new org.hl7.fhir.dstu3.model.StringType(src.getCertainty().toCode())
));
for (org.hl7.fhir.dstu2.model.CodeableConcept concept : src.getManifestation())
tgt.addManifestation(CodeableConcept10_30.convertCodeableConcept(concept));
if (src.hasDescription())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasOnset())
tgt.setOnsetElement(DateTime10_30.convertDateTime(src.getOnsetElement()));
if (src.hasSeverity())
tgt.setSeverity(org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceSeverity.fromCode(src.getSeverity().toCode()));
if (src.hasExposureRoute())
tgt.setExposureRoute(CodeableConcept10_30.convertCodeableConcept(src.getExposureRoute()));
if (src.hasNote())
tgt.addNote(Annotation10_30.convertAnnotation(src.getNote()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceVerificationStatus translateAllergyIntoleranceVerificationStatus(org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceStatus src) {
switch(src) {
case UNCONFIRMED:
case INACTIVE:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceVerificationStatus.UNCONFIRMED;
case CONFIRMED:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceVerificationStatus.CONFIRMED;
case REFUTED:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceVerificationStatus.REFUTED;
case ENTEREDINERROR:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceVerificationStatus.ENTEREDINERROR;
default:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceVerificationStatus.NULL;
}
public static org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceVerificationStatus translateAllergyIntoleranceVerificationStatus(org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceStatus src) {
switch (src) {
case UNCONFIRMED:
case INACTIVE:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceVerificationStatus.UNCONFIRMED;
case CONFIRMED:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceVerificationStatus.CONFIRMED;
case REFUTED:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceVerificationStatus.REFUTED;
case ENTEREDINERROR:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceVerificationStatus.ENTEREDINERROR;
default:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceVerificationStatus.NULL;
}
}
public static org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceClinicalStatus translateAllergyIntoleranceClinicalStatus(org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceStatus src) {
switch(src) {
case ACTIVE:
case UNCONFIRMED:
case CONFIRMED:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceClinicalStatus.ACTIVE;
case INACTIVE:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceClinicalStatus.INACTIVE;
case RESOLVED:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceClinicalStatus.RESOLVED;
default:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceClinicalStatus.NULL;
}
public static org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceClinicalStatus translateAllergyIntoleranceClinicalStatus(org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceStatus src) {
switch (src) {
case ACTIVE:
case UNCONFIRMED:
case CONFIRMED:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceClinicalStatus.ACTIVE;
case INACTIVE:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceClinicalStatus.INACTIVE;
case RESOLVED:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceClinicalStatus.RESOLVED;
default:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceClinicalStatus.NULL;
}
public static org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality translateAllergyIntoleranceCriticality(org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceCriticality src) {
switch(src) {
case CRITL:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW;
case CRITH:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH;
case CRITU:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS;
default:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL;
}
}
public static org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality translateAllergyIntoleranceCriticality(org.hl7.fhir.dstu2.model.AllergyIntolerance.AllergyIntoleranceCriticality src) {
switch (src) {
case CRITL:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW;
case CRITH:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH;
case CRITU:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS;
default:
return org.hl7.fhir.dstu3.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL;
}
}
}

View File

@ -1,260 +1,266 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.PositiveInt10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.UnsignedInt10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Appointment10_30 {
public static org.hl7.fhir.dstu2.model.Appointment convertAppointment(org.hl7.fhir.dstu3.model.Appointment src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Appointment tgt = new org.hl7.fhir.dstu2.model.Appointment();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertAppointmentStatus(src.getStatusElement()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType()) tgt.setType(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasPriorityElement())
tgt.setPriorityElement(UnsignedInt10_30.convertUnsignedInt(src.getPriorityElement()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasStartElement())
tgt.setStartElement(Instant10_30.convertInstant(src.getStartElement()));
if (src.hasEndElement())
tgt.setEndElement(Instant10_30.convertInstant(src.getEndElement()));
if (src.hasMinutesDurationElement())
tgt.setMinutesDurationElement(PositiveInt10_30.convertPositiveInt(src.getMinutesDurationElement()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getSlot()) tgt.addSlot(Reference10_30.convertReference(t));
if (src.hasCommentElement())
tgt.setCommentElement(String10_30.convertString(src.getCommentElement()));
for (org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Appointment convertAppointment(org.hl7.fhir.dstu3.model.Appointment src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Appointment tgt = new org.hl7.fhir.dstu2.model.Appointment();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertAppointmentStatus(src.getStatusElement()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getServiceType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasPriorityElement())
tgt.setPriorityElement(UnsignedInt10_30.convertUnsignedInt(src.getPriorityElement()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasStartElement())
tgt.setStartElement(Instant10_30.convertInstant(src.getStartElement()));
if (src.hasEndElement())
tgt.setEndElement(Instant10_30.convertInstant(src.getEndElement()));
if (src.hasMinutesDurationElement())
tgt.setMinutesDurationElement(PositiveInt10_30.convertPositiveInt(src.getMinutesDurationElement()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getSlot()) tgt.addSlot(Reference10_30.convertReference(t));
if (src.hasCommentElement())
tgt.setCommentElement(String10_30.convertString(src.getCommentElement()));
for (org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertAppointmentParticipantComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Appointment convertAppointment(org.hl7.fhir.dstu2.model.Appointment src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Appointment tgt = new org.hl7.fhir.dstu3.model.Appointment();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertAppointmentStatus(src.getStatusElement()));
if (src.hasType())
tgt.addServiceType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasPriorityElement())
tgt.setPriorityElement(UnsignedInt10_30.convertUnsignedInt(src.getPriorityElement()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasStartElement())
tgt.setStartElement(Instant10_30.convertInstant(src.getStartElement()));
if (src.hasEndElement())
tgt.setEndElement(Instant10_30.convertInstant(src.getEndElement()));
if (src.hasMinutesDurationElement())
tgt.setMinutesDurationElement(PositiveInt10_30.convertPositiveInt(src.getMinutesDurationElement()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getSlot()) tgt.addSlot(Reference10_30.convertReference(t));
if (src.hasCommentElement())
tgt.setCommentElement(String10_30.convertString(src.getCommentElement()));
for (org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent t : src.getParticipant()) tgt.addParticipant(convertAppointmentParticipantComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Appointment convertAppointment(org.hl7.fhir.dstu2.model.Appointment src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Appointment tgt = new org.hl7.fhir.dstu3.model.Appointment();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasStatus())
tgt.setStatusElement(convertAppointmentStatus(src.getStatusElement()));
if (src.hasType())
tgt.addServiceType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasPriorityElement())
tgt.setPriorityElement(UnsignedInt10_30.convertUnsignedInt(src.getPriorityElement()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasStartElement())
tgt.setStartElement(Instant10_30.convertInstant(src.getStartElement()));
if (src.hasEndElement())
tgt.setEndElement(Instant10_30.convertInstant(src.getEndElement()));
if (src.hasMinutesDurationElement())
tgt.setMinutesDurationElement(PositiveInt10_30.convertPositiveInt(src.getMinutesDurationElement()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getSlot()) tgt.addSlot(Reference10_30.convertReference(t));
if (src.hasCommentElement())
tgt.setCommentElement(String10_30.convertString(src.getCommentElement()));
for (org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent t : src.getParticipant())
tgt.addParticipant(convertAppointmentParticipantComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType()) tgt.addType(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(Reference10_30.convertReference(src.getActor()));
if (src.hasRequired())
tgt.setRequiredElement(convertParticipantRequired(src.getRequiredElement()));
if (src.hasStatus())
tgt.setStatusElement(convertParticipationStatus(src.getStatusElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getType())
tgt.addType(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(Reference10_30.convertReference(src.getActor()));
if (src.hasRequired())
tgt.setRequiredElement(convertParticipantRequired(src.getRequiredElement()));
if (src.hasStatus())
tgt.setStatusElement(convertParticipationStatus(src.getStatusElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType()) tgt.addType(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(Reference10_30.convertReference(src.getActor()));
if (src.hasRequired())
tgt.setRequiredElement(convertParticipantRequired(src.getRequiredElement()));
if (src.hasStatus())
tgt.setStatusElement(convertParticipationStatus(src.getStatusElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent convertAppointmentParticipantComponent(org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent tgt = new org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getType())
tgt.addType(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(Reference10_30.convertReference(src.getActor()));
if (src.hasRequired())
tgt.setRequiredElement(convertParticipantRequired(src.getRequiredElement()));
if (src.hasStatus())
tgt.setStatusElement(convertParticipationStatus(src.getStatusElement()));
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus> convertAppointmentStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.AppointmentStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case PROPOSED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.PROPOSED);
break;
case PENDING:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.PENDING);
break;
case BOOKED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.BOOKED);
break;
case ARRIVED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.ARRIVED);
break;
case FULFILLED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.FULFILLED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.CANCELLED);
break;
case NOSHOW:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.NOSHOW);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus> convertAppointmentStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.AppointmentStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case PROPOSED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.PROPOSED);
break;
case PENDING:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.PENDING);
break;
case BOOKED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.BOOKED);
break;
case ARRIVED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.ARRIVED);
break;
case FULFILLED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.FULFILLED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.CANCELLED);
break;
case NOSHOW:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.NOSHOW);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus> convertAppointmentStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Appointment.AppointmentStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case PROPOSED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.PROPOSED);
break;
case PENDING:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.PENDING);
break;
case BOOKED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.BOOKED);
break;
case ARRIVED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.ARRIVED);
break;
case FULFILLED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.FULFILLED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.CANCELLED);
break;
case NOSHOW:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.NOSHOW);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus> convertAppointmentStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.AppointmentStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Appointment.AppointmentStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case PROPOSED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.PROPOSED);
break;
case PENDING:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.PENDING);
break;
case BOOKED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.BOOKED);
break;
case ARRIVED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.ARRIVED);
break;
case FULFILLED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.FULFILLED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.CANCELLED);
break;
case NOSHOW:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.NOSHOW);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.AppointmentStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired> convertParticipantRequired(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.ParticipantRequiredEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case REQUIRED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.REQUIRED);
break;
case OPTIONAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.OPTIONAL);
break;
case INFORMATIONONLY:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.INFORMATIONONLY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired> convertParticipantRequired(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.ParticipantRequiredEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case REQUIRED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.REQUIRED);
break;
case OPTIONAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.OPTIONAL);
break;
case INFORMATIONONLY:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.INFORMATIONONLY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired> convertParticipantRequired(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Appointment.ParticipantRequiredEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case REQUIRED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.REQUIRED);
break;
case OPTIONAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.OPTIONAL);
break;
case INFORMATIONONLY:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.INFORMATIONONLY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired> convertParticipantRequired(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Appointment.ParticipantRequiredEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case REQUIRED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.REQUIRED);
break;
case OPTIONAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.OPTIONAL);
break;
case INFORMATIONONLY:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.INFORMATIONONLY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus> convertParticipationStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.ParticipationStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case ACCEPTED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.ACCEPTED);
break;
case DECLINED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.DECLINED);
break;
case TENTATIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.TENTATIVE);
break;
case NEEDSACTION:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.NEEDSACTION);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus> convertParticipationStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Appointment.ParticipationStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case ACCEPTED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.ACCEPTED);
break;
case DECLINED:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.DECLINED);
break;
case TENTATIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.TENTATIVE);
break;
case NEEDSACTION:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.NEEDSACTION);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus> convertParticipationStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Appointment.ParticipationStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case ACCEPTED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.ACCEPTED);
break;
case DECLINED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.DECLINED);
break;
case TENTATIVE:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.TENTATIVE);
break;
case NEEDSACTION:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.NEEDSACTION);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus> convertParticipationStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Appointment.ParticipationStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case ACCEPTED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.ACCEPTED);
break;
case DECLINED:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.DECLINED);
break;
case TENTATIVE:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.TENTATIVE);
break;
case NEEDSACTION:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.NEEDSACTION);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipationStatus.NULL);
break;
}
return tgt;
}
}

View File

@ -1,113 +1,116 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class AppointmentResponse10_30 {
public static org.hl7.fhir.dstu2.model.AppointmentResponse convertAppointmentResponse(org.hl7.fhir.dstu3.model.AppointmentResponse src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.AppointmentResponse tgt = new org.hl7.fhir.dstu2.model.AppointmentResponse();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasAppointment())
tgt.setAppointment(Reference10_30.convertReference(src.getAppointment()));
if (src.hasStartElement())
tgt.setStartElement(Instant10_30.convertInstant(src.getStartElement()));
if (src.hasEndElement())
tgt.setEndElement(Instant10_30.convertInstant(src.getEndElement()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(Reference10_30.convertReference(src.getActor()));
if (src.hasParticipantStatus())
tgt.setParticipantStatusElement(convertParticipantStatus(src.getParticipantStatusElement()));
if (src.hasCommentElement())
tgt.setCommentElement(String10_30.convertString(src.getCommentElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.AppointmentResponse convertAppointmentResponse(org.hl7.fhir.dstu3.model.AppointmentResponse src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.AppointmentResponse tgt = new org.hl7.fhir.dstu2.model.AppointmentResponse();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasAppointment())
tgt.setAppointment(Reference10_30.convertReference(src.getAppointment()));
if (src.hasStartElement())
tgt.setStartElement(Instant10_30.convertInstant(src.getStartElement()));
if (src.hasEndElement())
tgt.setEndElement(Instant10_30.convertInstant(src.getEndElement()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getParticipantType())
tgt.addParticipantType(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(Reference10_30.convertReference(src.getActor()));
if (src.hasParticipantStatus())
tgt.setParticipantStatusElement(convertParticipantStatus(src.getParticipantStatusElement()));
if (src.hasCommentElement())
tgt.setCommentElement(String10_30.convertString(src.getCommentElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.AppointmentResponse convertAppointmentResponse(org.hl7.fhir.dstu2.model.AppointmentResponse src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.AppointmentResponse tgt = new org.hl7.fhir.dstu3.model.AppointmentResponse();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasAppointment())
tgt.setAppointment(Reference10_30.convertReference(src.getAppointment()));
if (src.hasStartElement())
tgt.setStartElement(Instant10_30.convertInstant(src.getStartElement()));
if (src.hasEndElement())
tgt.setEndElement(Instant10_30.convertInstant(src.getEndElement()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getParticipantType()) tgt.addParticipantType(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(Reference10_30.convertReference(src.getActor()));
if (src.hasParticipantStatus())
tgt.setParticipantStatusElement(convertParticipantStatus(src.getParticipantStatusElement()));
if (src.hasCommentElement())
tgt.setCommentElement(String10_30.convertString(src.getCommentElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.AppointmentResponse convertAppointmentResponse(org.hl7.fhir.dstu2.model.AppointmentResponse src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.AppointmentResponse tgt = new org.hl7.fhir.dstu3.model.AppointmentResponse();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasAppointment())
tgt.setAppointment(Reference10_30.convertReference(src.getAppointment()));
if (src.hasStartElement())
tgt.setStartElement(Instant10_30.convertInstant(src.getStartElement()));
if (src.hasEndElement())
tgt.setEndElement(Instant10_30.convertInstant(src.getEndElement()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getParticipantType())
tgt.addParticipantType(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasActor())
tgt.setActor(Reference10_30.convertReference(src.getActor()));
if (src.hasParticipantStatus())
tgt.setParticipantStatusElement(convertParticipantStatus(src.getParticipantStatusElement()));
if (src.hasCommentElement())
tgt.setCommentElement(String10_30.convertString(src.getCommentElement()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus> convertParticipantStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case ACCEPTED:
tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.ACCEPTED);
break;
case DECLINED:
tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.DECLINED);
break;
case TENTATIVE:
tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.TENTATIVE);
break;
case INPROCESS:
tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.ACCEPTED);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.ACCEPTED);
break;
case NEEDSACTION:
tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.NEEDSACTION);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus> convertParticipantStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case ACCEPTED:
tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.ACCEPTED);
break;
case DECLINED:
tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.DECLINED);
break;
case TENTATIVE:
tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.TENTATIVE);
break;
case INPROCESS:
tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.ACCEPTED);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.ACCEPTED);
break;
case NEEDSACTION:
tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.NEEDSACTION);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus> convertParticipantStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case ACCEPTED:
tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.ACCEPTED);
break;
case DECLINED:
tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.DECLINED);
break;
case TENTATIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.TENTATIVE);
break;
case NEEDSACTION:
tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NEEDSACTION);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus> convertParticipantStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AppointmentResponse.ParticipantStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case ACCEPTED:
tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.ACCEPTED);
break;
case DECLINED:
tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.DECLINED);
break;
case TENTATIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.TENTATIVE);
break;
case NEEDSACTION:
tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NEEDSACTION);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.AppointmentResponse.ParticipantStatus.NULL);
break;
}
return tgt;
}
}

View File

@ -1,398 +1,411 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Coding10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Base64Binary10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class AuditEvent10_30 {
public static org.hl7.fhir.dstu2.model.AuditEvent convertAuditEvent(org.hl7.fhir.dstu3.model.AuditEvent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.AuditEvent tgt = new org.hl7.fhir.dstu2.model.AuditEvent();
VersionConvertor_10_30.copyDomainResource(src, tgt);
tgt.getEvent().setType(Coding10_30.convertCoding(src.getType()));
for (org.hl7.fhir.dstu3.model.Coding t : src.getSubtype()) tgt.getEvent().addSubtype(Coding10_30.convertCoding(t));
tgt.getEvent().setActionElement(convertAuditEventAction(src.getActionElement()));
tgt.getEvent().setDateTime(src.getRecorded());
tgt.getEvent().setOutcomeElement(convertAuditEventOutcome(src.getOutcomeElement()));
tgt.getEvent().setOutcomeDesc(src.getOutcomeDesc());
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfEvent()) for (org.hl7.fhir.dstu3.model.Coding cc : t.getCoding()) tgt.getEvent().addPurposeOfEvent(Coding10_30.convertCoding(cc));
for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent t : src.getAgent()) tgt.addParticipant(convertAuditEventAgentComponent(t));
if (src.hasSource())
tgt.setSource(convertAuditEventSourceComponent(src.getSource()));
for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent t : src.getEntity()) tgt.addObject(convertAuditEventEntityComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.AuditEvent convertAuditEvent(org.hl7.fhir.dstu3.model.AuditEvent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.AuditEvent tgt = new org.hl7.fhir.dstu2.model.AuditEvent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
tgt.getEvent().setType(Coding10_30.convertCoding(src.getType()));
for (org.hl7.fhir.dstu3.model.Coding t : src.getSubtype()) tgt.getEvent().addSubtype(Coding10_30.convertCoding(t));
tgt.getEvent().setActionElement(convertAuditEventAction(src.getActionElement()));
tgt.getEvent().setDateTime(src.getRecorded());
tgt.getEvent().setOutcomeElement(convertAuditEventOutcome(src.getOutcomeElement()));
tgt.getEvent().setOutcomeDesc(src.getOutcomeDesc());
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfEvent())
for (org.hl7.fhir.dstu3.model.Coding cc : t.getCoding())
tgt.getEvent().addPurposeOfEvent(Coding10_30.convertCoding(cc));
for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent t : src.getAgent())
tgt.addParticipant(convertAuditEventAgentComponent(t));
if (src.hasSource())
tgt.setSource(convertAuditEventSourceComponent(src.getSource()));
for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent t : src.getEntity())
tgt.addObject(convertAuditEventEntityComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.AuditEvent convertAuditEvent(org.hl7.fhir.dstu2.model.AuditEvent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.AuditEvent tgt = new org.hl7.fhir.dstu3.model.AuditEvent();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasEvent()) {
if (src.hasType())
tgt.setType(Coding10_30.convertCoding(src.getEvent().getType()));
for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getSubtype()) tgt.addSubtype(Coding10_30.convertCoding(t));
tgt.setActionElement(convertAuditEventAction(src.getEvent().getActionElement()));
tgt.setRecorded(src.getEvent().getDateTime());
tgt.setOutcomeElement(convertAuditEventOutcome(src.getEvent().getOutcomeElement()));
tgt.setOutcomeDesc(src.getEvent().getOutcomeDesc());
for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getPurposeOfEvent()) tgt.addPurposeOfEvent().addCoding(Coding10_30.convertCoding(t));
}
for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent t : src.getParticipant()) tgt.addAgent(convertAuditEventAgentComponent(t));
if (src.hasSource())
tgt.setSource(convertAuditEventSourceComponent(src.getSource()));
for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent t : src.getObject()) tgt.addEntity(convertAuditEventEntityComponent(t));
return tgt;
public static org.hl7.fhir.dstu3.model.AuditEvent convertAuditEvent(org.hl7.fhir.dstu2.model.AuditEvent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.AuditEvent tgt = new org.hl7.fhir.dstu3.model.AuditEvent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasEvent()) {
if (src.hasType())
tgt.setType(Coding10_30.convertCoding(src.getEvent().getType()));
for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getSubtype())
tgt.addSubtype(Coding10_30.convertCoding(t));
tgt.setActionElement(convertAuditEventAction(src.getEvent().getActionElement()));
tgt.setRecorded(src.getEvent().getDateTime());
tgt.setOutcomeElement(convertAuditEventOutcome(src.getEvent().getOutcomeElement()));
tgt.setOutcomeDesc(src.getEvent().getOutcomeDesc());
for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getPurposeOfEvent())
tgt.addPurposeOfEvent().addCoding(Coding10_30.convertCoding(t));
}
for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent t : src.getParticipant())
tgt.addAgent(convertAuditEventAgentComponent(t));
if (src.hasSource())
tgt.setSource(convertAuditEventSourceComponent(src.getSource()));
for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent t : src.getObject())
tgt.addEntity(convertAuditEventEntityComponent(t));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction> convertAuditEventAction(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventActionEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case C:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.C);
break;
case R:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.R);
break;
case U:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.U);
break;
case D:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.D);
break;
case E:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.E);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction> convertAuditEventAction(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventActionEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case C:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.C);
break;
case R:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.R);
break;
case U:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.U);
break;
case D:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.D);
break;
case E:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.E);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction> convertAuditEventAction(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventActionEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case C:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.C);
break;
case R:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.R);
break;
case U:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.U);
break;
case D:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.D);
break;
case E:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.E);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction> convertAuditEventAction(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAction> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventActionEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case C:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.C);
break;
case R:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.R);
break;
case U:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.U);
break;
case D:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.D);
break;
case E:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.E);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventAction.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasReference())
tgt.setReference(Reference10_30.convertReference(src.getReference()));
if (src.hasUserId())
tgt.setUserId(Identifier10_30.convertIdentifier(src.getUserId()));
if (src.hasAltIdElement())
tgt.setAltIdElement(String10_30.convertString(src.getAltIdElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasRequestorElement())
tgt.setRequestorElement(Boolean10_30.convertBoolean(src.getRequestorElement()));
if (src.hasLocation())
tgt.setLocation(Reference10_30.convertReference(src.getLocation()));
for (org.hl7.fhir.dstu2.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue());
if (src.hasMedia())
tgt.setMedia(Coding10_30.convertCoding(src.getMedia()));
if (src.hasNetwork())
tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
for (org.hl7.fhir.dstu2.model.Coding t : src.getPurposeOfUse()) tgt.addPurposeOfUse().addCoding(Coding10_30.convertCoding(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent convertAuditEventAgentComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole())
tgt.addRole(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasReference())
tgt.setReference(Reference10_30.convertReference(src.getReference()));
if (src.hasUserId())
tgt.setUserId(Identifier10_30.convertIdentifier(src.getUserId()));
if (src.hasAltIdElement())
tgt.setAltIdElement(String10_30.convertString(src.getAltIdElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasRequestorElement())
tgt.setRequestorElement(Boolean10_30.convertBoolean(src.getRequestorElement()));
if (src.hasLocation())
tgt.setLocation(Reference10_30.convertReference(src.getLocation()));
for (org.hl7.fhir.dstu2.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue());
if (src.hasMedia())
tgt.setMedia(Coding10_30.convertCoding(src.getMedia()));
if (src.hasNetwork())
tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
for (org.hl7.fhir.dstu2.model.Coding t : src.getPurposeOfUse())
tgt.addPurposeOfUse().addCoding(Coding10_30.convertCoding(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent convertAuditEventAgentComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasReference())
tgt.setReference(Reference10_30.convertReference(src.getReference()));
if (src.hasUserId())
tgt.setUserId(Identifier10_30.convertIdentifier(src.getUserId()));
if (src.hasAltIdElement())
tgt.setAltIdElement(String10_30.convertString(src.getAltIdElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasRequestorElement())
tgt.setRequestorElement(Boolean10_30.convertBoolean(src.getRequestorElement()));
if (src.hasLocation())
tgt.setLocation(Reference10_30.convertReference(src.getLocation()));
for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue());
if (src.hasMedia())
tgt.setMedia(Coding10_30.convertCoding(src.getMedia()));
if (src.hasNetwork())
tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfUse()) for (org.hl7.fhir.dstu3.model.Coding cc : t.getCoding()) tgt.addPurposeOfUse(Coding10_30.convertCoding(cc));
return tgt;
}
public static org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent convertAuditEventAgentComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole())
tgt.addRole(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasReference())
tgt.setReference(Reference10_30.convertReference(src.getReference()));
if (src.hasUserId())
tgt.setUserId(Identifier10_30.convertIdentifier(src.getUserId()));
if (src.hasAltIdElement())
tgt.setAltIdElement(String10_30.convertString(src.getAltIdElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasRequestorElement())
tgt.setRequestorElement(Boolean10_30.convertBoolean(src.getRequestorElement()));
if (src.hasLocation())
tgt.setLocation(Reference10_30.convertReference(src.getLocation()));
for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue());
if (src.hasMedia())
tgt.setMedia(Coding10_30.convertCoding(src.getMedia()));
if (src.hasNetwork())
tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfUse())
for (org.hl7.fhir.dstu3.model.Coding cc : t.getCoding()) tgt.addPurposeOfUse(Coding10_30.convertCoding(cc));
return tgt;
}
public static org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent();
Element10_30.copyElement(src, tgt);
if (src.hasAddressElement())
tgt.setAddressElement(String10_30.convertString(src.getAddressElement()));
if (src.hasType())
tgt.setTypeElement(convertAuditEventParticipantNetworkType(src.getTypeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasAddressElement())
tgt.setAddressElement(String10_30.convertString(src.getAddressElement()));
if (src.hasType())
tgt.setTypeElement(convertAuditEventParticipantNetworkType(src.getTypeElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent();
Element10_30.copyElement(src, tgt);
if (src.hasAddressElement())
tgt.setAddressElement(String10_30.convertString(src.getAddressElement()));
if (src.hasType())
tgt.setTypeElement(convertAuditEventParticipantNetworkType(src.getTypeElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasAddressElement())
tgt.setAddressElement(String10_30.convertString(src.getAddressElement()));
if (src.hasType())
tgt.setTypeElement(convertAuditEventParticipantNetworkType(src.getTypeElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent();
Element10_30.copyElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasReference())
tgt.setReference(Reference10_30.convertReference(src.getReference()));
if (src.hasType())
tgt.setType(Coding10_30.convertCoding(src.getType()));
if (src.hasRole())
tgt.setRole(Coding10_30.convertCoding(src.getRole()));
if (src.hasLifecycle())
tgt.setLifecycle(Coding10_30.convertCoding(src.getLifecycle()));
for (org.hl7.fhir.dstu2.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding10_30.convertCoding(t));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasQueryElement())
tgt.setQueryElement(Base64Binary10_30.convertBase64Binary(src.getQueryElement()));
for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasReference())
tgt.setReference(Reference10_30.convertReference(src.getReference()));
if (src.hasType())
tgt.setType(Coding10_30.convertCoding(src.getType()));
if (src.hasRole())
tgt.setRole(Coding10_30.convertCoding(src.getRole()));
if (src.hasLifecycle())
tgt.setLifecycle(Coding10_30.convertCoding(src.getLifecycle()));
for (org.hl7.fhir.dstu2.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding10_30.convertCoding(t));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasQueryElement())
tgt.setQueryElement(Base64Binary10_30.convertBase64Binary(src.getQueryElement()));
for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent t : src.getDetail())
tgt.addDetail(convertAuditEventEntityDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent convertAuditEventEntityComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent();
Element10_30.copyElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasReference())
tgt.setReference(Reference10_30.convertReference(src.getReference()));
if (src.hasType())
tgt.setType(Coding10_30.convertCoding(src.getType()));
if (src.hasRole())
tgt.setRole(Coding10_30.convertCoding(src.getRole()));
if (src.hasLifecycle())
tgt.setLifecycle(Coding10_30.convertCoding(src.getLifecycle()));
for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding10_30.convertCoding(t));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasQueryElement())
tgt.setQueryElement(Base64Binary10_30.convertBase64Binary(src.getQueryElement()));
for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail()) tgt.addDetail(convertAuditEventEntityDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent convertAuditEventEntityComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasReference())
tgt.setReference(Reference10_30.convertReference(src.getReference()));
if (src.hasType())
tgt.setType(Coding10_30.convertCoding(src.getType()));
if (src.hasRole())
tgt.setRole(Coding10_30.convertCoding(src.getRole()));
if (src.hasLifecycle())
tgt.setLifecycle(Coding10_30.convertCoding(src.getLifecycle()));
for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding10_30.convertCoding(t));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasQueryElement())
tgt.setQueryElement(Base64Binary10_30.convertBase64Binary(src.getQueryElement()));
for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail())
tgt.addDetail(convertAuditEventEntityDetailComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent();
Element10_30.copyElement(src, tgt);
if (src.hasTypeElement())
tgt.setTypeElement(String10_30.convertString(src.getTypeElement()));
if (src.hasValueElement())
tgt.setValueElement(Base64Binary10_30.convertBase64Binary(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasTypeElement())
tgt.setTypeElement(String10_30.convertString(src.getTypeElement()));
if (src.hasValueElement())
tgt.setValueElement(Base64Binary10_30.convertBase64Binary(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent();
Element10_30.copyElement(src, tgt);
if (src.hasTypeElement())
tgt.setTypeElement(String10_30.convertString(src.getTypeElement()));
if (src.hasValueElement())
tgt.setValueElement(Base64Binary10_30.convertBase64Binary(src.getValueElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent convertAuditEventEntityDetailComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasTypeElement())
tgt.setTypeElement(String10_30.convertString(src.getTypeElement()));
if (src.hasValueElement())
tgt.setValueElement(Base64Binary10_30.convertBase64Binary(src.getValueElement()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome> convertAuditEventOutcome(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcomeEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case _0:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._0);
break;
case _4:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._4);
break;
case _8:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._8);
break;
case _12:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._12);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome> convertAuditEventOutcome(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcomeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case _0:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._0);
break;
case _4:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._4);
break;
case _8:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._8);
break;
case _12:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome._12);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome> convertAuditEventOutcome(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcomeEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case _0:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._0);
break;
case _4:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._4);
break;
case _8:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._8);
break;
case _12:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._12);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome> convertAuditEventOutcome(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventOutcome> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcomeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case _0:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._0);
break;
case _4:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._4);
break;
case _8:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._8);
break;
case _12:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome._12);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventOutcome.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType> convertAuditEventParticipantNetworkType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkTypeEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case _1:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._1);
break;
case _2:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._2);
break;
case _3:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._3);
break;
case _4:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._4);
break;
case _5:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._5);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType> convertAuditEventParticipantNetworkType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkTypeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case _1:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._1);
break;
case _2:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._2);
break;
case _3:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._3);
break;
case _4:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._4);
break;
case _5:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType._5);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType> convertAuditEventParticipantNetworkType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case _1:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._1);
break;
case _2:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._2);
break;
case _3:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._3);
break;
case _4:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._4);
break;
case _5:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._5);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType> convertAuditEventParticipantNetworkType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case _1:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._1);
break;
case _2:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._2);
break;
case _3:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._3);
break;
case _4:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._4);
break;
case _5:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType._5);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent();
Element10_30.copyElement(src, tgt);
if (src.hasSiteElement())
tgt.setSiteElement(String10_30.convertString(src.getSiteElement()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
for (org.hl7.fhir.dstu3.model.Coding t : src.getType()) tgt.addType(Coding10_30.convertCoding(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasSiteElement())
tgt.setSiteElement(String10_30.convertString(src.getSiteElement()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
for (org.hl7.fhir.dstu3.model.Coding t : src.getType()) tgt.addType(Coding10_30.convertCoding(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent();
Element10_30.copyElement(src, tgt);
if (src.hasSiteElement())
tgt.setSiteElement(String10_30.convertString(src.getSiteElement()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
for (org.hl7.fhir.dstu2.model.Coding t : src.getType()) tgt.addType(Coding10_30.convertCoding(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasSiteElement())
tgt.setSiteElement(String10_30.convertString(src.getSiteElement()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
for (org.hl7.fhir.dstu2.model.Coding t : src.getType()) tgt.addType(Coding10_30.convertCoding(t));
return tgt;
}
}

View File

@ -1,45 +1,47 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Date10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Basic10_30 {
public static org.hl7.fhir.dstu2.model.Basic convertBasic(org.hl7.fhir.dstu3.model.Basic src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Basic tgt = new org.hl7.fhir.dstu2.model.Basic();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasCreatedElement())
tgt.setCreatedElement(Date10_30.convertDate(src.getCreatedElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference10_30.convertReference(src.getAuthor()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Basic convertBasic(org.hl7.fhir.dstu3.model.Basic src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Basic tgt = new org.hl7.fhir.dstu2.model.Basic();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasCreatedElement())
tgt.setCreatedElement(Date10_30.convertDate(src.getCreatedElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference10_30.convertReference(src.getAuthor()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Basic convertBasic(org.hl7.fhir.dstu2.model.Basic src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Basic tgt = new org.hl7.fhir.dstu3.model.Basic();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasCreatedElement())
tgt.setCreatedElement(Date10_30.convertDate(src.getCreatedElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference10_30.convertReference(src.getAuthor()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Basic convertBasic(org.hl7.fhir.dstu2.model.Basic src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Basic tgt = new org.hl7.fhir.dstu3.model.Basic();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasCreatedElement())
tgt.setCreatedElement(Date10_30.convertDate(src.getCreatedElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference10_30.convertReference(src.getAuthor()));
return tgt;
}
}

View File

@ -1,33 +1,33 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Base64Binary10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Code10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Binary10_30 {
public static org.hl7.fhir.dstu2.model.Binary convertBinary(org.hl7.fhir.dstu3.model.Binary src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Binary tgt = new org.hl7.fhir.dstu2.model.Binary();
VersionConvertor_10_30.copyResource(src, tgt);
if (src.hasContentTypeElement())
tgt.setContentTypeElement(Code10_30.convertCode(src.getContentTypeElement()));
if (src.hasContentElement())
tgt.setContentElement(Base64Binary10_30.convertBase64Binary(src.getContentElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Binary convertBinary(org.hl7.fhir.dstu3.model.Binary src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Binary tgt = new org.hl7.fhir.dstu2.model.Binary();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyResource(src, tgt);
if (src.hasContentTypeElement())
tgt.setContentTypeElement(Code10_30.convertCode(src.getContentTypeElement()));
if (src.hasContentElement())
tgt.setContentElement(Base64Binary10_30.convertBase64Binary(src.getContentElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Binary convertBinary(org.hl7.fhir.dstu2.model.Binary src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Binary tgt = new org.hl7.fhir.dstu3.model.Binary();
VersionConvertor_10_30.copyResource(src, tgt);
if (src.hasContentTypeElement())
tgt.setContentTypeElement(Code10_30.convertCode(src.getContentTypeElement()));
if (src.hasContentElement())
tgt.setContentElement(Base64Binary10_30.convertBase64Binary(src.getContentElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Binary convertBinary(org.hl7.fhir.dstu2.model.Binary src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Binary tgt = new org.hl7.fhir.dstu3.model.Binary();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyResource(src, tgt);
if (src.hasContentTypeElement())
tgt.setContentTypeElement(Code10_30.convertCode(src.getContentTypeElement()));
if (src.hasContentElement())
tgt.setContentElement(Base64Binary10_30.convertBase64Binary(src.getContentElement()));
return tgt;
}
}

View File

@ -1,8 +1,7 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Signature10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.*;
import org.hl7.fhir.exceptions.FHIRException;
@ -10,377 +9,383 @@ import org.hl7.fhir.r5.model.FhirPublication;
public class Bundle10_30 {
public static org.hl7.fhir.dstu3.model.Bundle convertBundle(org.hl7.fhir.dstu2.model.Bundle src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Bundle tgt = new org.hl7.fhir.dstu3.model.Bundle();
VersionConvertor_10_30.copyResource(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertBundleType(src.getTypeElement()));
if (src.hasTotal())
tgt.setTotalElement(UnsignedInt10_30.convertUnsignedInt(src.getTotalElement()));
for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));
for (org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t));
if (src.hasSignature())
tgt.setSignature(Signature10_30.convertSignature(src.getSignature()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Bundle convertBundle(org.hl7.fhir.dstu2.model.Bundle src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Bundle tgt = new org.hl7.fhir.dstu3.model.Bundle();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyResource(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertBundleType(src.getTypeElement()));
if (src.hasTotal())
tgt.setTotalElement(UnsignedInt10_30.convertUnsignedInt(src.getTotalElement()));
for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink())
tgt.addLink(convertBundleLinkComponent(t));
for (org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent t : src.getEntry())
tgt.addEntry(convertBundleEntryComponent(t));
if (src.hasSignature())
tgt.setSignature(Signature10_30.convertSignature(src.getSignature()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Bundle convertBundle(org.hl7.fhir.dstu3.model.Bundle src, BaseAdvisor_10_30 advisor) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Bundle tgt = new org.hl7.fhir.dstu2.model.Bundle();
VersionConvertor_10_30.copyResource(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertBundleType(src.getTypeElement()));
if (src.hasTotal())
tgt.setTotalElement(UnsignedInt10_30.convertUnsignedInt(src.getTotalElement()));
for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));
for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t, advisor));
if (src.hasSignature())
tgt.setSignature(Signature10_30.convertSignature(src.getSignature()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Bundle convertBundle(org.hl7.fhir.dstu3.model.Bundle src, BaseAdvisor_10_30 advisor) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Bundle tgt = new org.hl7.fhir.dstu2.model.Bundle();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyResource(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertBundleType(src.getTypeElement()));
if (src.hasTotal())
tgt.setTotalElement(UnsignedInt10_30.convertUnsignedInt(src.getTotalElement()));
for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink())
tgt.addLink(convertBundleLinkComponent(t));
for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent t : src.getEntry())
tgt.addEntry(convertBundleEntryComponent(t, advisor));
if (src.hasSignature())
tgt.setSignature(Signature10_30.convertSignature(src.getSignature()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Bundle convertBundle(org.hl7.fhir.dstu3.model.Bundle src) throws FHIRException {
return convertBundle(src, null);
}
public static org.hl7.fhir.dstu2.model.Bundle convertBundle(org.hl7.fhir.dstu3.model.Bundle src) throws FHIRException {
return convertBundle(src, null);
}
public static org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent src, BaseAdvisor_10_30 advisor) throws FHIRException {
if (src == null || src.isEmpty())
return null;
if (advisor.ignoreEntry(src, FhirPublication.DSTU2))
return null;
org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));
if (src.hasFullUrlElement())
tgt.setFullUrlElement(Uri10_30.convertUri(src.getFullUrlElement()));
org.hl7.fhir.dstu2.model.Resource res = VersionConvertor_10_30.convertResource(src.getResource());
tgt.setResource(res);
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.dstu2.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent src, BaseAdvisor_10_30 advisor) throws FHIRException {
if (src == null || src.isEmpty())
return null;
if (advisor.ignoreEntry(src, FhirPublication.DSTU2))
return null;
org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink())
tgt.addLink(convertBundleLinkComponent(t));
if (src.hasFullUrlElement())
tgt.setFullUrlElement(Uri10_30.convertUri(src.getFullUrlElement()));
org.hl7.fhir.dstu2.model.Resource res = ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertResource(src.getResource());
tgt.setResource(res);
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.dstu2.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent src) throws FHIRException {
return convertBundleEntryComponent(src, null);
}
public static org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent src) throws FHIRException {
return convertBundleEntryComponent(src, null);
}
public static org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));
if (src.hasFullUrlElement())
tgt.setFullUrlElement(Uri10_30.convertUri(src.getFullUrlElement()));
if (src.hasResource())
tgt.setResource(VersionConvertor_10_30.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.dstu3.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent t : src.getLink())
tgt.addLink(convertBundleLinkComponent(t));
if (src.hasFullUrlElement())
tgt.setFullUrlElement(Uri10_30.convertUri(src.getFullUrlElement()));
if (src.hasResource())
tgt.setResource(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().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.dstu2.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent();
Element10_30.copyElement(src, tgt);
if (src.hasMethod())
tgt.setMethodElement(convertHTTPVerb(src.getMethodElement()));
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
if (src.hasIfNoneMatchElement())
tgt.setIfNoneMatchElement(String10_30.convertString(src.getIfNoneMatchElement()));
if (src.hasIfModifiedSinceElement())
tgt.setIfModifiedSinceElement(Instant10_30.convertInstant(src.getIfModifiedSinceElement()));
if (src.hasIfMatchElement())
tgt.setIfMatchElement(String10_30.convertString(src.getIfMatchElement()));
if (src.hasIfNoneExistElement())
tgt.setIfNoneExistElement(String10_30.convertString(src.getIfNoneExistElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasMethod())
tgt.setMethodElement(convertHTTPVerb(src.getMethodElement()));
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
if (src.hasIfNoneMatchElement())
tgt.setIfNoneMatchElement(String10_30.convertString(src.getIfNoneMatchElement()));
if (src.hasIfModifiedSinceElement())
tgt.setIfModifiedSinceElement(Instant10_30.convertInstant(src.getIfModifiedSinceElement()));
if (src.hasIfMatchElement())
tgt.setIfMatchElement(String10_30.convertString(src.getIfMatchElement()));
if (src.hasIfNoneExistElement())
tgt.setIfNoneExistElement(String10_30.convertString(src.getIfNoneExistElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent();
Element10_30.copyElement(src, tgt);
if (src.hasMethod())
tgt.setMethodElement(convertHTTPVerb(src.getMethodElement()));
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
if (src.hasIfNoneMatchElement())
tgt.setIfNoneMatchElement(String10_30.convertString(src.getIfNoneMatchElement()));
if (src.hasIfModifiedSinceElement())
tgt.setIfModifiedSinceElement(Instant10_30.convertInstant(src.getIfModifiedSinceElement()));
if (src.hasIfMatchElement())
tgt.setIfMatchElement(String10_30.convertString(src.getIfMatchElement()));
if (src.hasIfNoneExistElement())
tgt.setIfNoneExistElement(String10_30.convertString(src.getIfNoneExistElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent convertBundleEntryRequestComponent(org.hl7.fhir.dstu2.model.Bundle.BundleEntryRequestComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasMethod())
tgt.setMethodElement(convertHTTPVerb(src.getMethodElement()));
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
if (src.hasIfNoneMatchElement())
tgt.setIfNoneMatchElement(String10_30.convertString(src.getIfNoneMatchElement()));
if (src.hasIfModifiedSinceElement())
tgt.setIfModifiedSinceElement(Instant10_30.convertInstant(src.getIfModifiedSinceElement()));
if (src.hasIfMatchElement())
tgt.setIfMatchElement(String10_30.convertString(src.getIfMatchElement()));
if (src.hasIfNoneExistElement())
tgt.setIfNoneExistElement(String10_30.convertString(src.getIfNoneExistElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent();
Element10_30.copyElement(src, tgt);
if (src.hasStatusElement())
tgt.setStatusElement(String10_30.convertString(src.getStatusElement()));
if (src.hasLocationElement())
tgt.setLocationElement(Uri10_30.convertUri(src.getLocationElement()));
if (src.hasEtagElement())
tgt.setEtagElement(String10_30.convertString(src.getEtagElement()));
if (src.hasLastModifiedElement())
tgt.setLastModifiedElement(Instant10_30.convertInstant(src.getLastModifiedElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasStatusElement())
tgt.setStatusElement(String10_30.convertString(src.getStatusElement()));
if (src.hasLocationElement())
tgt.setLocationElement(Uri10_30.convertUri(src.getLocationElement()));
if (src.hasEtagElement())
tgt.setEtagElement(String10_30.convertString(src.getEtagElement()));
if (src.hasLastModifiedElement())
tgt.setLastModifiedElement(Instant10_30.convertInstant(src.getLastModifiedElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent();
Element10_30.copyElement(src, tgt);
if (src.hasStatusElement())
tgt.setStatusElement(String10_30.convertString(src.getStatusElement()));
if (src.hasLocationElement())
tgt.setLocationElement(Uri10_30.convertUri(src.getLocationElement()));
if (src.hasEtagElement())
tgt.setEtagElement(String10_30.convertString(src.getEtagElement()));
if (src.hasLastModifiedElement())
tgt.setLastModifiedElement(Instant10_30.convertInstant(src.getLastModifiedElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent convertBundleEntryResponseComponent(org.hl7.fhir.dstu2.model.Bundle.BundleEntryResponseComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasStatusElement())
tgt.setStatusElement(String10_30.convertString(src.getStatusElement()));
if (src.hasLocationElement())
tgt.setLocationElement(Uri10_30.convertUri(src.getLocationElement()));
if (src.hasEtagElement())
tgt.setEtagElement(String10_30.convertString(src.getEtagElement()));
if (src.hasLastModifiedElement())
tgt.setLastModifiedElement(Instant10_30.convertInstant(src.getLastModifiedElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntrySearchComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent();
Element10_30.copyElement(src, tgt);
if (src.hasMode())
tgt.setModeElement(convertSearchEntryMode(src.getModeElement()));
if (src.hasScoreElement())
tgt.setScoreElement(Decimal10_30.convertDecimal(src.getScoreElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntrySearchComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasMode())
tgt.setModeElement(convertSearchEntryMode(src.getModeElement()));
if (src.hasScoreElement())
tgt.setScoreElement(Decimal10_30.convertDecimal(src.getScoreElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntrySearchComponent();
Element10_30.copyElement(src, tgt);
if (src.hasMode())
tgt.setModeElement(convertSearchEntryMode(src.getModeElement()));
if (src.hasScoreElement())
tgt.setScoreElement(Decimal10_30.convertDecimal(src.getScoreElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Bundle.BundleEntrySearchComponent convertBundleEntrySearchComponent(org.hl7.fhir.dstu2.model.Bundle.BundleEntrySearchComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Bundle.BundleEntrySearchComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleEntrySearchComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasMode())
tgt.setModeElement(convertSearchEntryMode(src.getModeElement()));
if (src.hasScoreElement())
tgt.setScoreElement(Decimal10_30.convertDecimal(src.getScoreElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent();
Element10_30.copyElement(src, tgt);
if (src.hasRelationElement())
tgt.setRelationElement(String10_30.convertString(src.getRelationElement()));
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasRelationElement())
tgt.setRelationElement(String10_30.convertString(src.getRelationElement()));
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent();
Element10_30.copyElement(src, tgt);
if (src.hasRelationElement())
tgt.setRelationElement(String10_30.convertString(src.getRelationElement()));
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent convertBundleLinkComponent(org.hl7.fhir.dstu2.model.Bundle.BundleLinkComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent tgt = new org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasRelationElement())
tgt.setRelationElement(String10_30.convertString(src.getRelationElement()));
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.BundleType> convertBundleType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.BundleType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.BundleType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.BundleTypeEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case DOCUMENT:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.DOCUMENT);
break;
case MESSAGE:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.MESSAGE);
break;
case TRANSACTION:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.TRANSACTION);
break;
case TRANSACTIONRESPONSE:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.TRANSACTIONRESPONSE);
break;
case BATCH:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.BATCH);
break;
case BATCHRESPONSE:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.BATCHRESPONSE);
break;
case HISTORY:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.HISTORY);
break;
case SEARCHSET:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.SEARCHSET);
break;
case COLLECTION:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.COLLECTION);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.BundleType> convertBundleType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.BundleType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.BundleType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.BundleTypeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case DOCUMENT:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.DOCUMENT);
break;
case MESSAGE:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.MESSAGE);
break;
case TRANSACTION:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.TRANSACTION);
break;
case TRANSACTIONRESPONSE:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.TRANSACTIONRESPONSE);
break;
case BATCH:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.BATCH);
break;
case BATCHRESPONSE:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.BATCHRESPONSE);
break;
case HISTORY:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.HISTORY);
break;
case SEARCHSET:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.SEARCHSET);
break;
case COLLECTION:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.COLLECTION);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.BundleType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.BundleType> convertBundleType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.BundleType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.BundleType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.BundleTypeEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case DOCUMENT:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.DOCUMENT);
break;
case MESSAGE:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.MESSAGE);
break;
case TRANSACTION:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTION);
break;
case TRANSACTIONRESPONSE:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTIONRESPONSE);
break;
case BATCH:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCH);
break;
case BATCHRESPONSE:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCHRESPONSE);
break;
case HISTORY:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.HISTORY);
break;
case SEARCHSET:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.SEARCHSET);
break;
case COLLECTION:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.COLLECTION);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.BundleType> convertBundleType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.BundleType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.BundleType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.BundleTypeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case DOCUMENT:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.DOCUMENT);
break;
case MESSAGE:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.MESSAGE);
break;
case TRANSACTION:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTION);
break;
case TRANSACTIONRESPONSE:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.TRANSACTIONRESPONSE);
break;
case BATCH:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCH);
break;
case BATCHRESPONSE:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.BATCHRESPONSE);
break;
case HISTORY:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.HISTORY);
break;
case SEARCHSET:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.SEARCHSET);
break;
case COLLECTION:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.COLLECTION);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.BundleType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.HTTPVerb> convertHTTPVerb(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.HTTPVerb> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.HTTPVerb> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.HTTPVerbEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case GET:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.GET);
break;
case POST:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.POST);
break;
case PUT:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.PUT);
break;
case DELETE:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.DELETE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.HTTPVerb> convertHTTPVerb(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.HTTPVerb> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.HTTPVerb> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.HTTPVerbEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case GET:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.GET);
break;
case POST:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.POST);
break;
case PUT:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.PUT);
break;
case DELETE:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.DELETE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.HTTPVerb> convertHTTPVerb(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.HTTPVerb> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.HTTPVerb> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.HTTPVerbEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case GET:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.GET);
break;
case POST:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.POST);
break;
case PUT:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.PUT);
break;
case DELETE:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.DELETE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.HTTPVerb> convertHTTPVerb(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.HTTPVerb> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.HTTPVerb> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.HTTPVerbEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case GET:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.GET);
break;
case POST:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.POST);
break;
case PUT:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.PUT);
break;
case DELETE:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.DELETE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.HTTPVerb.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode> convertSearchEntryMode(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.SearchEntryModeEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case MATCH:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.MATCH);
break;
case INCLUDE:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.INCLUDE);
break;
case OUTCOME:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.OUTCOME);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode> convertSearchEntryMode(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Bundle.SearchEntryModeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case MATCH:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.MATCH);
break;
case INCLUDE:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.INCLUDE);
break;
case OUTCOME:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.OUTCOME);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode> convertSearchEntryMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.SearchEntryModeEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case MATCH:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.MATCH);
break;
case INCLUDE:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.INCLUDE);
break;
case OUTCOME:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.OUTCOME);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode> convertSearchEntryMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Bundle.SearchEntryMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Bundle.SearchEntryModeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case MATCH:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.MATCH);
break;
case INCLUDE:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.INCLUDE);
break;
case OUTCOME:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.OUTCOME);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Bundle.SearchEntryMode.NULL);
break;
}
return tgt;
}
}

View File

@ -1,266 +1,280 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Type10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.*;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Boolean10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class CarePlan10_30 {
public static org.hl7.fhir.dstu3.model.CarePlan convertCarePlan(org.hl7.fhir.dstu2.model.CarePlan src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.CarePlan tgt = new org.hl7.fhir.dstu3.model.CarePlan();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasStatus())
tgt.setStatusElement(convertCarePlanStatus(src.getStatusElement()));
if (src.hasContext())
tgt.setContext(Reference10_30.convertReference(src.getContext()));
if (src.hasPeriod())
tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCategory()) tgt.addCategory(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getAddresses()) tgt.addAddresses(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.CarePlan convertCarePlan(org.hl7.fhir.dstu2.model.CarePlan src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.CarePlan tgt = new org.hl7.fhir.dstu3.model.CarePlan();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasStatus())
tgt.setStatusElement(convertCarePlanStatus(src.getStatusElement()));
if (src.hasContext())
tgt.setContext(Reference10_30.convertReference(src.getContext()));
if (src.hasPeriod())
tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getAddresses())
tgt.addAddresses(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent t : src.getActivity())
tgt.addActivity(convertCarePlanActivityComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.CarePlan convertCarePlan(org.hl7.fhir.dstu3.model.CarePlan src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.CarePlan tgt = new org.hl7.fhir.dstu2.model.CarePlan();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasStatus())
tgt.setStatusElement(convertCarePlanStatus(src.getStatusElement()));
if (src.hasContext())
tgt.setContext(Reference10_30.convertReference(src.getContext()));
if (src.hasPeriod())
tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.addCategory(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getAddresses()) tgt.addAddresses(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.Reference t : src.getGoal()) tgt.addGoal(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityComponent t : src.getActivity()) tgt.addActivity(convertCarePlanActivityComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.CarePlan convertCarePlan(org.hl7.fhir.dstu3.model.CarePlan src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.CarePlan tgt = new org.hl7.fhir.dstu2.model.CarePlan();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasStatus())
tgt.setStatusElement(convertCarePlanStatus(src.getStatusElement()));
if (src.hasContext())
tgt.setContext(Reference10_30.convertReference(src.getContext()));
if (src.hasPeriod())
tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory())
tgt.addCategory(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getAddresses())
tgt.addAddresses(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.Reference t : src.getGoal()) tgt.addGoal(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityComponent t : src.getActivity())
tgt.addActivity(convertCarePlanActivityComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.Annotation t : src.getProgress()) tgt.addProgress(Annotation10_30.convertAnnotation(t));
if (src.hasReference())
tgt.setReference(Reference10_30.convertReference(src.getReference()));
if (src.hasDetail())
tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.Annotation t : src.getProgress())
tgt.addProgress(Annotation10_30.convertAnnotation(t));
if (src.hasReference())
tgt.setReference(Reference10_30.convertReference(src.getReference()));
if (src.hasDetail())
tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityComponent();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.Annotation t : src.getProgress()) tgt.addProgress(Annotation10_30.convertAnnotation(t));
if (src.hasReference())
tgt.setReference(Reference10_30.convertReference(src.getReference()));
if (src.hasDetail())
tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityComponent convertCarePlanActivityComponent(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityComponent tgt = new org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.Annotation t : src.getProgress())
tgt.addProgress(Annotation10_30.convertAnnotation(t));
if (src.hasReference())
tgt.setReference(Reference10_30.convertReference(src.getReference()));
if (src.hasDetail())
tgt.setDetail(convertCarePlanActivityDetailComponent(src.getDetail()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityDetailComponent();
Element10_30.copyElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategory()));
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu2.model.Reference t : src.getReasonReference()) tgt.addReasonReference(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(Reference10_30.convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertCarePlanActivityStatus(src.getStatusElement()));
if (src.hasProhibitedElement())
tgt.setProhibitedElement(Boolean10_30.convertBoolean(src.getProhibitedElement()));
if (src.hasScheduled())
tgt.setScheduled(Type10_30.convertType(src.getScheduled()));
if (src.hasLocation())
tgt.setLocation(Reference10_30.convertReference(src.getLocation()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference10_30.convertReference(t));
if (src.hasProduct())
tgt.setProduct(Type10_30.convertType(src.getProduct()));
if (src.hasDailyAmount())
tgt.setDailyAmount(SimpleQuantity10_30.convertSimpleQuantity(src.getDailyAmount()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity10_30.convertSimpleQuantity(src.getQuantity()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityDetailComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategory()));
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu2.model.Reference t : src.getReasonReference())
tgt.addReasonReference(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.Reference t : src.getGoal()) tgt.addGoal(Reference10_30.convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertCarePlanActivityStatus(src.getStatusElement()));
if (src.hasProhibitedElement())
tgt.setProhibitedElement(Boolean10_30.convertBoolean(src.getProhibitedElement()));
if (src.hasScheduled())
tgt.setScheduled(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getScheduled()));
if (src.hasLocation())
tgt.setLocation(Reference10_30.convertReference(src.getLocation()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getPerformer())
tgt.addPerformer(Reference10_30.convertReference(t));
if (src.hasProduct())
tgt.setProduct(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getProduct()));
if (src.hasDailyAmount())
tgt.setDailyAmount(SimpleQuantity10_30.convertSimpleQuantity(src.getDailyAmount()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity10_30.convertSimpleQuantity(src.getQuantity()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent();
Element10_30.copyElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategory()));
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReasonCode(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference()) tgt.addReasonReference(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.Reference t : src.getGoal()) tgt.addGoal(Reference10_30.convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertCarePlanActivityStatus(src.getStatusElement()));
if (src.hasProhibitedElement())
tgt.setProhibitedElement(Boolean10_30.convertBoolean(src.getProhibitedElement()));
if (src.hasScheduled())
tgt.setScheduled(Type10_30.convertType(src.getScheduled()));
if (src.hasLocation())
tgt.setLocation(Reference10_30.convertReference(src.getLocation()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference10_30.convertReference(t));
if (src.hasProduct())
tgt.setProduct(Type10_30.convertType(src.getProduct()));
if (src.hasDailyAmount())
tgt.setDailyAmount(SimpleQuantity10_30.convertSimpleQuantity(src.getDailyAmount()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity10_30.convertSimpleQuantity(src.getQuantity()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent convertCarePlanActivityDetailComponent(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityDetailComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent tgt = new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityDetailComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasCategory())
tgt.setCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategory()));
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode())
tgt.addReasonCode(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu3.model.Reference t : src.getReasonReference())
tgt.addReasonReference(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.Reference t : src.getGoal()) tgt.addGoal(Reference10_30.convertReference(t));
if (src.hasStatus())
tgt.setStatusElement(convertCarePlanActivityStatus(src.getStatusElement()));
if (src.hasProhibitedElement())
tgt.setProhibitedElement(Boolean10_30.convertBoolean(src.getProhibitedElement()));
if (src.hasScheduled())
tgt.setScheduled(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getScheduled()));
if (src.hasLocation())
tgt.setLocation(Reference10_30.convertReference(src.getLocation()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getPerformer())
tgt.addPerformer(Reference10_30.convertReference(t));
if (src.hasProduct())
tgt.setProduct(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getProduct()));
if (src.hasDailyAmount())
tgt.setDailyAmount(SimpleQuantity10_30.convertSimpleQuantity(src.getDailyAmount()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity10_30.convertSimpleQuantity(src.getQuantity()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus> convertCarePlanActivityStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case NOTSTARTED:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.NOTSTARTED);
break;
case SCHEDULED:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.SCHEDULED);
break;
case INPROGRESS:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.INPROGRESS);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.ONHOLD);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.COMPLETED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.CANCELLED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus> convertCarePlanActivityStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case NOTSTARTED:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.NOTSTARTED);
break;
case SCHEDULED:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.SCHEDULED);
break;
case INPROGRESS:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.INPROGRESS);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.ONHOLD);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.COMPLETED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.CANCELLED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus> convertCarePlanActivityStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case NOTSTARTED:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.NOTSTARTED);
break;
case SCHEDULED:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.SCHEDULED);
break;
case INPROGRESS:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.INPROGRESS);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.ONHOLD);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.COMPLETED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.CANCELLED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus> convertCarePlanActivityStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CarePlan.CarePlanActivityStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case NOTSTARTED:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.NOTSTARTED);
break;
case SCHEDULED:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.SCHEDULED);
break;
case INPROGRESS:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.INPROGRESS);
break;
case ONHOLD:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.ONHOLD);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.COMPLETED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.CANCELLED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanActivityStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus> convertCarePlanStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case DRAFT:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.DRAFT);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.ACTIVE);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.COMPLETED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.CANCELLED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus> convertCarePlanStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case DRAFT:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.DRAFT);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.ACTIVE);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.COMPLETED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.CANCELLED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus> convertCarePlanStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case PROPOSED:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.DRAFT);
break;
case DRAFT:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.DRAFT);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.ACTIVE);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.COMPLETED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.CANCELLED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus> convertCarePlanStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CarePlan.CarePlanStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case PROPOSED:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.DRAFT);
break;
case DRAFT:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.DRAFT);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.ACTIVE);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.COMPLETED);
break;
case CANCELLED:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.CANCELLED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.CarePlan.CarePlanStatus.NULL);
break;
}
return tgt;
}
}

View File

@ -1,137 +1,138 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.dstu3.model.UriType;
import org.hl7.fhir.exceptions.FHIRException;
public class ClinicalImpression10_30 {
public static org.hl7.fhir.dstu3.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.dstu2.model.ClinicalImpression src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.ClinicalImpression tgt = new org.hl7.fhir.dstu3.model.ClinicalImpression();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasPatient())
tgt.setSubject(Reference10_30.convertReference(src.getPatient()));
if (src.hasAssessor())
tgt.setAssessor(Reference10_30.convertReference(src.getAssessor()));
if (src.hasStatus())
tgt.setStatusElement(convertClinicalImpressionStatus(src.getStatusElement()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasPrevious())
tgt.setPrevious(Reference10_30.convertReference(src.getPrevious()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getProblem()) tgt.addProblem(Reference10_30.convertReference(t));
tgt.addProtocol(src.getProtocol());
if (src.hasSummaryElement())
tgt.setSummaryElement(String10_30.convertString(src.getSummaryElement()));
for (org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t));
if (src.hasPrognosis())
tgt.addPrognosisCodeableConcept().setText(src.getPrognosis());
for (org.hl7.fhir.dstu2.model.Reference t : src.getAction()) tgt.addAction(Reference10_30.convertReference(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.dstu2.model.ClinicalImpression src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.ClinicalImpression tgt = new org.hl7.fhir.dstu3.model.ClinicalImpression();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasPatient())
tgt.setSubject(Reference10_30.convertReference(src.getPatient()));
if (src.hasAssessor())
tgt.setAssessor(Reference10_30.convertReference(src.getAssessor()));
if (src.hasStatus())
tgt.setStatusElement(convertClinicalImpressionStatus(src.getStatusElement()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasPrevious())
tgt.setPrevious(Reference10_30.convertReference(src.getPrevious()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getProblem()) tgt.addProblem(Reference10_30.convertReference(t));
tgt.addProtocol(src.getProtocol());
if (src.hasSummaryElement())
tgt.setSummaryElement(String10_30.convertString(src.getSummaryElement()));
for (org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding())
tgt.addFinding(convertClinicalImpressionFindingComponent(t));
if (src.hasPrognosis())
tgt.addPrognosisCodeableConcept().setText(src.getPrognosis());
for (org.hl7.fhir.dstu2.model.Reference t : src.getAction()) tgt.addAction(Reference10_30.convertReference(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.dstu3.model.ClinicalImpression src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.ClinicalImpression tgt = new org.hl7.fhir.dstu2.model.ClinicalImpression();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasSubject())
tgt.setPatient(Reference10_30.convertReference(src.getSubject()));
if (src.hasAssessor())
tgt.setAssessor(Reference10_30.convertReference(src.getAssessor()));
if (src.hasStatus())
tgt.setStatusElement(convertClinicalImpressionStatus(src.getStatusElement()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasPrevious())
tgt.setPrevious(Reference10_30.convertReference(src.getPrevious()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getProblem()) tgt.addProblem(Reference10_30.convertReference(t));
for (UriType t : src.getProtocol()) tgt.setProtocol(t.asStringValue());
if (src.hasSummaryElement())
tgt.setSummaryElement(String10_30.convertString(src.getSummaryElement()));
for (org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding()) tgt.addFinding(convertClinicalImpressionFindingComponent(t));
if (src.hasText())
tgt.setPrognosis(src.getPrognosisCodeableConceptFirstRep().getText());
for (org.hl7.fhir.dstu3.model.Reference t : src.getAction()) tgt.addAction(Reference10_30.convertReference(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ClinicalImpression convertClinicalImpression(org.hl7.fhir.dstu3.model.ClinicalImpression src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.ClinicalImpression tgt = new org.hl7.fhir.dstu2.model.ClinicalImpression();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasSubject())
tgt.setPatient(Reference10_30.convertReference(src.getSubject()));
if (src.hasAssessor())
tgt.setAssessor(Reference10_30.convertReference(src.getAssessor()));
if (src.hasStatus())
tgt.setStatusElement(convertClinicalImpressionStatus(src.getStatusElement()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasDescriptionElement())
tgt.setDescriptionElement(String10_30.convertString(src.getDescriptionElement()));
if (src.hasPrevious())
tgt.setPrevious(Reference10_30.convertReference(src.getPrevious()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getProblem()) tgt.addProblem(Reference10_30.convertReference(t));
for (UriType t : src.getProtocol()) tgt.setProtocol(t.asStringValue());
if (src.hasSummaryElement())
tgt.setSummaryElement(String10_30.convertString(src.getSummaryElement()));
for (org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent t : src.getFinding())
tgt.addFinding(convertClinicalImpressionFindingComponent(t));
if (src.hasText())
tgt.setPrognosis(src.getPrognosisCodeableConceptFirstRep().getText());
for (org.hl7.fhir.dstu3.model.Reference t : src.getAction()) tgt.addAction(Reference10_30.convertReference(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent tgt = new org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent();
Element10_30.copyElement(src, tgt);
if (src.hasItem())
tgt.setItem(CodeableConcept10_30.convertCodeableConcept(src.getItem()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent tgt = new org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasItem())
tgt.setItem(CodeableConcept10_30.convertCodeableConcept(src.getItem()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionFindingComponent tgt = new org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionFindingComponent();
Element10_30.copyElement(src, tgt);
public static org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionFindingComponent convertClinicalImpressionFindingComponent(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionFindingComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionFindingComponent tgt = new org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionFindingComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasItemCodeableConcept())
try {
if (src.hasItemCodeableConcept())
try {
if (src.hasItemCodeableConcept())
tgt.setItem(CodeableConcept10_30.convertCodeableConcept(src.getItemCodeableConcept()));
} catch (org.hl7.fhir.exceptions.FHIRException e) {
}
return tgt;
}
tgt.setItem(CodeableConcept10_30.convertCodeableConcept(src.getItemCodeableConcept()));
} catch (org.hl7.fhir.exceptions.FHIRException e) {
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus> convertClinicalImpressionStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case INPROGRESS:
tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.DRAFT);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus> convertClinicalImpressionStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case INPROGRESS:
tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.DRAFT);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus> convertClinicalImpressionStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case DRAFT:
tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.INPROGRESS);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus> convertClinicalImpressionStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ClinicalImpression.ClinicalImpressionStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case DRAFT:
tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.INPROGRESS);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.COMPLETED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.ClinicalImpression.ClinicalImpressionStatus.NULL);
break;
}
return tgt;
}
}

View File

@ -1,143 +1,151 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Type10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Communication10_30 {
public static org.hl7.fhir.dstu3.model.Communication convertCommunication(org.hl7.fhir.dstu2.model.Communication src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Communication tgt = new org.hl7.fhir.dstu3.model.Communication();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasCategory())
tgt.addCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategory()));
if (src.hasSender())
tgt.setSender(Reference10_30.convertReference(src.getSender()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium()) tgt.addMedium(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasStatus())
tgt.setStatusElement(convertCommunicationStatus(src.getStatusElement()));
if (src.hasEncounter())
tgt.setContext(Reference10_30.convertReference(src.getEncounter()));
if (src.hasSentElement())
tgt.setSentElement(DateTime10_30.convertDateTime(src.getSentElement()));
if (src.hasReceivedElement())
tgt.setReceivedElement(DateTime10_30.convertDateTime(src.getReceivedElement()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Communication convertCommunication(org.hl7.fhir.dstu2.model.Communication src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Communication tgt = new org.hl7.fhir.dstu3.model.Communication();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasCategory())
tgt.addCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategory()));
if (src.hasSender())
tgt.setSender(Reference10_30.convertReference(src.getSender()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient())
tgt.addRecipient(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent t : src.getPayload())
tgt.addPayload(convertCommunicationPayloadComponent(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium())
tgt.addMedium(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasStatus())
tgt.setStatusElement(convertCommunicationStatus(src.getStatusElement()));
if (src.hasEncounter())
tgt.setContext(Reference10_30.convertReference(src.getEncounter()));
if (src.hasSentElement())
tgt.setSentElement(DateTime10_30.convertDateTime(src.getSentElement()));
if (src.hasReceivedElement())
tgt.setReceivedElement(DateTime10_30.convertDateTime(src.getReceivedElement()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason())
tgt.addReasonCode(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Communication convertCommunication(org.hl7.fhir.dstu3.model.Communication src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Communication tgt = new org.hl7.fhir.dstu2.model.Communication();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasCategory())
tgt.setCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategoryFirstRep()));
if (src.hasSender())
tgt.setSender(Reference10_30.convertReference(src.getSender()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationPayloadComponent(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getMedium()) tgt.addMedium(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasStatus())
tgt.setStatusElement(convertCommunicationStatus(src.getStatusElement()));
if (src.hasContext())
tgt.setEncounter(Reference10_30.convertReference(src.getContext()));
if (src.hasSentElement())
tgt.setSentElement(DateTime10_30.convertDateTime(src.getSentElement()));
if (src.hasReceivedElement())
tgt.setReceivedElement(DateTime10_30.convertDateTime(src.getReceivedElement()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Communication convertCommunication(org.hl7.fhir.dstu3.model.Communication src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Communication tgt = new org.hl7.fhir.dstu2.model.Communication();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasCategory())
tgt.setCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategoryFirstRep()));
if (src.hasSender())
tgt.setSender(Reference10_30.convertReference(src.getSender()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient())
tgt.addRecipient(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent t : src.getPayload())
tgt.addPayload(convertCommunicationPayloadComponent(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getMedium())
tgt.addMedium(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasStatus())
tgt.setStatusElement(convertCommunicationStatus(src.getStatusElement()));
if (src.hasContext())
tgt.setEncounter(Reference10_30.convertReference(src.getContext()));
if (src.hasSentElement())
tgt.setSentElement(DateTime10_30.convertDateTime(src.getSentElement()));
if (src.hasReceivedElement())
tgt.setReceivedElement(DateTime10_30.convertDateTime(src.getReceivedElement()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode())
tgt.addReason(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent();
Element10_30.copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(Type10_30.convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent();
Element10_30.copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(Type10_30.convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent convertCommunicationPayloadComponent(org.hl7.fhir.dstu2.model.Communication.CommunicationPayloadComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent tgt = new org.hl7.fhir.dstu3.model.Communication.CommunicationPayloadComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getContent()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Communication.CommunicationStatus> convertCommunicationStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Communication.CommunicationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Communication.CommunicationStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Communication.CommunicationStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case INPROGRESS:
tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.INPROGRESS);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.COMPLETED);
break;
case SUSPENDED:
tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.SUSPENDED);
break;
case REJECTED:
tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.ENTEREDINERROR);
break;
case FAILED:
tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.ABORTED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Communication.CommunicationStatus> convertCommunicationStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Communication.CommunicationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Communication.CommunicationStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Communication.CommunicationStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case INPROGRESS:
tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.INPROGRESS);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.COMPLETED);
break;
case SUSPENDED:
tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.SUSPENDED);
break;
case REJECTED:
tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.ENTEREDINERROR);
break;
case FAILED:
tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.ABORTED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Communication.CommunicationStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Communication.CommunicationStatus> convertCommunicationStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Communication.CommunicationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Communication.CommunicationStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Communication.CommunicationStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case INPROGRESS:
tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.INPROGRESS);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.COMPLETED);
break;
case SUSPENDED:
tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.SUSPENDED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.REJECTED);
break;
case ABORTED:
tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.FAILED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Communication.CommunicationStatus> convertCommunicationStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Communication.CommunicationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Communication.CommunicationStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Communication.CommunicationStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case INPROGRESS:
tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.INPROGRESS);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.COMPLETED);
break;
case SUSPENDED:
tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.SUSPENDED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.REJECTED);
break;
case ABORTED:
tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.FAILED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Communication.CommunicationStatus.NULL);
break;
}
return tgt;
}
}

View File

@ -1,196 +1,204 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Type10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class CommunicationRequest10_30 {
public static org.hl7.fhir.dstu2.model.CommunicationRequest convertCommunicationRequest(org.hl7.fhir.dstu3.model.CommunicationRequest src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.CommunicationRequest tgt = new org.hl7.fhir.dstu2.model.CommunicationRequest();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasCategory())
tgt.setCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategoryFirstRep()));
if (src.hasSender())
tgt.setSender(Reference10_30.convertReference(src.getSender()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getMedium()) tgt.addMedium(CodeableConcept10_30.convertCodeableConcept(t));
tgt.setRequester(Reference10_30.convertReference(src.getRequester().getAgent()));
if (src.hasStatus())
tgt.setStatusElement(convertCommunicationRequestStatus(src.getStatusElement()));
if (src.hasContext())
tgt.setEncounter(Reference10_30.convertReference(src.getContext()));
if (src.hasOccurrence())
tgt.setScheduled(Type10_30.convertType(src.getOccurrence()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode()) tgt.addReason(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasAuthoredOnElement())
tgt.setRequestedOnElement(DateTime10_30.convertDateTime(src.getAuthoredOnElement()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasPriority())
tgt.setPriority(convertPriorityCode(src.getPriority()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.CommunicationRequest convertCommunicationRequest(org.hl7.fhir.dstu3.model.CommunicationRequest src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.CommunicationRequest tgt = new org.hl7.fhir.dstu2.model.CommunicationRequest();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasCategory())
tgt.setCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategoryFirstRep()));
if (src.hasSender())
tgt.setSender(Reference10_30.convertReference(src.getSender()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getRecipient())
tgt.addRecipient(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload())
tgt.addPayload(convertCommunicationRequestPayloadComponent(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getMedium())
tgt.addMedium(CodeableConcept10_30.convertCodeableConcept(t));
tgt.setRequester(Reference10_30.convertReference(src.getRequester().getAgent()));
if (src.hasStatus())
tgt.setStatusElement(convertCommunicationRequestStatus(src.getStatusElement()));
if (src.hasContext())
tgt.setEncounter(Reference10_30.convertReference(src.getContext()));
if (src.hasOccurrence())
tgt.setScheduled(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getOccurrence()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReasonCode())
tgt.addReason(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasAuthoredOnElement())
tgt.setRequestedOnElement(DateTime10_30.convertDateTime(src.getAuthoredOnElement()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasPriority())
tgt.setPriority(convertPriorityCode(src.getPriority()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.CommunicationRequest convertCommunicationRequest(org.hl7.fhir.dstu2.model.CommunicationRequest src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.CommunicationRequest tgt = new org.hl7.fhir.dstu3.model.CommunicationRequest();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasCategory())
tgt.addCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategory()));
if (src.hasSender())
tgt.setSender(Reference10_30.convertReference(src.getSender()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient()) tgt.addRecipient(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload()) tgt.addPayload(convertCommunicationRequestPayloadComponent(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium()) tgt.addMedium(CodeableConcept10_30.convertCodeableConcept(t));
tgt.getRequester().setAgent(Reference10_30.convertReference(src.getRequester()));
if (src.hasStatus())
tgt.setStatusElement(convertCommunicationRequestStatus(src.getStatusElement()));
if (src.hasEncounter())
tgt.setContext(Reference10_30.convertReference(src.getEncounter()));
if (src.hasScheduled())
tgt.setOccurrence(Type10_30.convertType(src.getScheduled()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason()) tgt.addReasonCode(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasRequestedOnElement())
tgt.setAuthoredOnElement(DateTime10_30.convertDateTime(src.getRequestedOnElement()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasPriority())
tgt.setPriority(convertPriorityCode(src.getPriority()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.CommunicationRequest convertCommunicationRequest(org.hl7.fhir.dstu2.model.CommunicationRequest src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.CommunicationRequest tgt = new org.hl7.fhir.dstu3.model.CommunicationRequest();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasCategory())
tgt.addCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategory()));
if (src.hasSender())
tgt.setSender(Reference10_30.convertReference(src.getSender()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getRecipient())
tgt.addRecipient(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent t : src.getPayload())
tgt.addPayload(convertCommunicationRequestPayloadComponent(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getMedium())
tgt.addMedium(CodeableConcept10_30.convertCodeableConcept(t));
tgt.getRequester().setAgent(Reference10_30.convertReference(src.getRequester()));
if (src.hasStatus())
tgt.setStatusElement(convertCommunicationRequestStatus(src.getStatusElement()));
if (src.hasEncounter())
tgt.setContext(Reference10_30.convertReference(src.getEncounter()));
if (src.hasScheduled())
tgt.setOccurrence(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getScheduled()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason())
tgt.addReasonCode(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasRequestedOnElement())
tgt.setAuthoredOnElement(DateTime10_30.convertDateTime(src.getRequestedOnElement()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasPriority())
tgt.setPriority(convertPriorityCode(src.getPriority()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent();
Element10_30.copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(Type10_30.convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestPayloadComponent();
Element10_30.copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(Type10_30.convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestPayloadComponent convertCommunicationRequestPayloadComponent(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestPayloadComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestPayloadComponent tgt = new org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestPayloadComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getContent()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus> convertCommunicationRequestStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case PROPOSED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.DRAFT);
break;
case PLANNED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE);
break;
case REQUESTED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE);
break;
case RECEIVED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE);
break;
case ACCEPTED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE);
break;
case INPROGRESS:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED);
break;
case SUSPENDED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.SUSPENDED);
break;
case REJECTED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus> convertCommunicationRequestStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case PROPOSED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.DRAFT);
break;
case PLANNED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE);
break;
case REQUESTED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE);
break;
case RECEIVED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE);
break;
case ACCEPTED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE);
break;
case INPROGRESS:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ACTIVE);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED);
break;
case SUSPENDED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.SUSPENDED);
break;
case REJECTED:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus> convertCommunicationRequestStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case DRAFT:
tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.PROPOSED);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.INPROGRESS);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED);
break;
case SUSPENDED:
tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.SUSPENDED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.REJECTED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus> convertCommunicationRequestStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationRequestStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case DRAFT:
tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.PROPOSED);
break;
case ACTIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.INPROGRESS);
break;
case COMPLETED:
tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.COMPLETED);
break;
case SUSPENDED:
tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.SUSPENDED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.REJECTED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.CommunicationRequest.CommunicationRequestStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.CodeableConcept convertPriorityCode(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationPriority priority) {
org.hl7.fhir.dstu2.model.CodeableConcept cc = new org.hl7.fhir.dstu2.model.CodeableConcept();
switch(priority) {
case ROUTINE:
cc.addCoding().setSystem("http://hl7.org/fhir/diagnostic-order-priority").setCode("routine");
break;
case URGENT:
cc.addCoding().setSystem("http://hl7.org/fhir/diagnostic-order-priority").setCode("urgent");
break;
case STAT:
cc.addCoding().setSystem("http://hl7.org/fhir/diagnostic-order-priority").setCode("stat");
break;
case ASAP:
cc.addCoding().setSystem("http://hl7.org/fhir/diagnostic-order-priority").setCode("asap");
break;
default:
return null;
}
return cc;
}
static public org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationPriority convertPriorityCode(org.hl7.fhir.dstu2.model.CodeableConcept priority) {
for (org.hl7.fhir.dstu2.model.Coding c : priority.getCoding()) {
if ("http://hl7.org/fhir/diagnostic-order-priority".equals(c.getSystem()) && "routine".equals(c.getCode()))
return org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationPriority.ROUTINE;
if ("http://hl7.org/fhir/diagnostic-order-priority".equals(c.getSystem()) && "urgent".equals(c.getCode()))
return org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationPriority.URGENT;
if ("http://hl7.org/fhir/diagnostic-order-priority".equals(c.getSystem()) && "stat".equals(c.getCode()))
return org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationPriority.STAT;
if ("http://hl7.org/fhir/diagnostic-order-priority".equals(c.getSystem()) && "asap".equals(c.getCode()))
return org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationPriority.ASAP;
}
static public org.hl7.fhir.dstu2.model.CodeableConcept convertPriorityCode(org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationPriority priority) {
org.hl7.fhir.dstu2.model.CodeableConcept cc = new org.hl7.fhir.dstu2.model.CodeableConcept();
switch (priority) {
case ROUTINE:
cc.addCoding().setSystem("http://hl7.org/fhir/diagnostic-order-priority").setCode("routine");
break;
case URGENT:
cc.addCoding().setSystem("http://hl7.org/fhir/diagnostic-order-priority").setCode("urgent");
break;
case STAT:
cc.addCoding().setSystem("http://hl7.org/fhir/diagnostic-order-priority").setCode("stat");
break;
case ASAP:
cc.addCoding().setSystem("http://hl7.org/fhir/diagnostic-order-priority").setCode("asap");
break;
default:
return null;
}
return cc;
}
static public org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationPriority convertPriorityCode(org.hl7.fhir.dstu2.model.CodeableConcept priority) {
for (org.hl7.fhir.dstu2.model.Coding c : priority.getCoding()) {
if ("http://hl7.org/fhir/diagnostic-order-priority".equals(c.getSystem()) && "routine".equals(c.getCode()))
return org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationPriority.ROUTINE;
if ("http://hl7.org/fhir/diagnostic-order-priority".equals(c.getSystem()) && "urgent".equals(c.getCode()))
return org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationPriority.URGENT;
if ("http://hl7.org/fhir/diagnostic-order-priority".equals(c.getSystem()) && "stat".equals(c.getCode()))
return org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationPriority.STAT;
if ("http://hl7.org/fhir/diagnostic-order-priority".equals(c.getSystem()) && "asap".equals(c.getCode()))
return org.hl7.fhir.dstu3.model.CommunicationRequest.CommunicationPriority.ASAP;
}
return null;
}
}

View File

@ -1,285 +1,294 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Narrative10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Period10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Narrative10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.stream.Collectors;
public class Composition10_30 {
public static org.hl7.fhir.dstu3.model.Composition convertComposition(org.hl7.fhir.dstu2.model.Composition src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Composition tgt = new org.hl7.fhir.dstu3.model.Composition();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasClass_())
tgt.setClass_(CodeableConcept10_30.convertCodeableConcept(src.getClass_()));
if (src.hasTitleElement())
tgt.setTitleElement(String10_30.convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatusElement(convertCompositionStatus(src.getStatusElement()));
try {
if (src.hasConfidentiality())
tgt.setConfidentiality(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.fromCode(src.getConfidentiality()));
} catch (org.hl7.fhir.exceptions.FHIRException e) {
throw new FHIRException(e);
}
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t));
if (src.hasCustodian())
tgt.setCustodian(Reference10_30.convertReference(src.getCustodian()));
for (org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t));
if (src.hasEncounter())
tgt.setEncounter(Reference10_30.convertReference(src.getEncounter()));
for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t));
return tgt;
public static org.hl7.fhir.dstu3.model.Composition convertComposition(org.hl7.fhir.dstu2.model.Composition src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Composition tgt = new org.hl7.fhir.dstu3.model.Composition();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasClass_())
tgt.setClass_(CodeableConcept10_30.convertCodeableConcept(src.getClass_()));
if (src.hasTitleElement())
tgt.setTitleElement(String10_30.convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatusElement(convertCompositionStatus(src.getStatusElement()));
try {
if (src.hasConfidentiality())
tgt.setConfidentiality(org.hl7.fhir.dstu3.model.Composition.DocumentConfidentiality.fromCode(src.getConfidentiality()));
} catch (org.hl7.fhir.exceptions.FHIRException e) {
throw new FHIRException(e);
}
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent t : src.getAttester())
tgt.addAttester(convertCompositionAttesterComponent(t));
if (src.hasCustodian())
tgt.setCustodian(Reference10_30.convertReference(src.getCustodian()));
for (org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent t : src.getEvent())
tgt.addEvent(convertCompositionEventComponent(t));
if (src.hasEncounter())
tgt.setEncounter(Reference10_30.convertReference(src.getEncounter()));
for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection())
tgt.addSection(convertSectionComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Composition convertComposition(org.hl7.fhir.dstu3.model.Composition src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Composition tgt = new org.hl7.fhir.dstu2.model.Composition();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasClass_())
tgt.setClass_(CodeableConcept10_30.convertCodeableConcept(src.getClass_()));
if (src.hasTitleElement())
tgt.setTitleElement(String10_30.convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatusElement(convertCompositionStatus(src.getStatusElement()));
tgt.setConfidentiality(src.getConfidentiality().toCode());
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent t : src.getAttester()) tgt.addAttester(convertCompositionAttesterComponent(t));
if (src.hasCustodian())
tgt.setCustodian(Reference10_30.convertReference(src.getCustodian()));
for (org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent t : src.getEvent()) tgt.addEvent(convertCompositionEventComponent(t));
if (src.hasEncounter())
tgt.setEncounter(Reference10_30.convertReference(src.getEncounter()));
for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Composition convertComposition(org.hl7.fhir.dstu3.model.Composition src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Composition tgt = new org.hl7.fhir.dstu2.model.Composition();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasClass_())
tgt.setClass_(CodeableConcept10_30.convertCodeableConcept(src.getClass_()));
if (src.hasTitleElement())
tgt.setTitleElement(String10_30.convertString(src.getTitleElement()));
if (src.hasStatus())
tgt.setStatusElement(convertCompositionStatus(src.getStatusElement()));
tgt.setConfidentiality(src.getConfidentiality().toCode());
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthor()) tgt.addAuthor(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent t : src.getAttester())
tgt.addAttester(convertCompositionAttesterComponent(t));
if (src.hasCustodian())
tgt.setCustodian(Reference10_30.convertReference(src.getCustodian()));
for (org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent t : src.getEvent())
tgt.addEvent(convertCompositionEventComponent(t));
if (src.hasEncounter())
tgt.setEncounter(Reference10_30.convertReference(src.getEncounter()));
for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection())
tgt.addSection(convertSectionComponent(t));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.CompositionAttestationModeEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case PERSONAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.PERSONAL);
break;
case PROFESSIONAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.PROFESSIONAL);
break;
case LEGAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.LEGAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.OFFICIAL);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.CompositionAttestationModeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case PERSONAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.PERSONAL);
break;
case PROFESSIONAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.PROFESSIONAL);
break;
case LEGAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.LEGAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.OFFICIAL);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Composition.CompositionAttestationModeEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case PERSONAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.PERSONAL);
break;
case PROFESSIONAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.PROFESSIONAL);
break;
case LEGAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.LEGAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.OFFICIAL);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Composition.CompositionAttestationModeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case PERSONAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.PERSONAL);
break;
case PROFESSIONAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.PROFESSIONAL);
break;
case LEGAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.LEGAL);
break;
case OFFICIAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.OFFICIAL);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent();
Element10_30.copyElement(src, tgt);
tgt.setMode(src.getMode().stream()
.map(Composition10_30::convertCompositionAttestationMode)
.collect(Collectors.toList()));
if (src.hasTimeElement())
tgt.setTimeElement(DateTime10_30.convertDateTime(src.getTimeElement()));
if (src.hasParty())
tgt.setParty(Reference10_30.convertReference(src.getParty()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
tgt.setMode(src.getMode().stream()
.map(Composition10_30::convertCompositionAttestationMode)
.collect(Collectors.toList()));
if (src.hasTimeElement())
tgt.setTimeElement(DateTime10_30.convertDateTime(src.getTimeElement()));
if (src.hasParty())
tgt.setParty(Reference10_30.convertReference(src.getParty()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent();
Element10_30.copyElement(src, tgt);
tgt.setMode(src.getMode().stream()
.map(Composition10_30::convertCompositionAttestationMode)
.collect(Collectors.toList()));
if (src.hasTimeElement())
tgt.setTimeElement(DateTime10_30.convertDateTime(src.getTimeElement()));
if (src.hasParty())
tgt.setParty(Reference10_30.convertReference(src.getParty()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
tgt.setMode(src.getMode().stream()
.map(Composition10_30::convertCompositionAttestationMode)
.collect(Collectors.toList()));
if (src.hasTimeElement())
tgt.setTimeElement(DateTime10_30.convertDateTime(src.getTimeElement()));
if (src.hasParty())
tgt.setParty(Reference10_30.convertReference(src.getParty()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode()) tgt.addCode(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasPeriod())
tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(Reference10_30.convertReference(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCode())
tgt.addCode(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasPeriod())
tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(Reference10_30.convertReference(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCode()) tgt.addCode(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasPeriod())
tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(Reference10_30.convertReference(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent convertCompositionEventComponent(org.hl7.fhir.dstu2.model.Composition.CompositionEventComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent tgt = new org.hl7.fhir.dstu3.model.Composition.CompositionEventComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getCode())
tgt.addCode(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasPeriod())
tgt.setPeriod(Period10_30.convertPeriod(src.getPeriod()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(Reference10_30.convertReference(t));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionStatus> convertCompositionStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.CompositionStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case PRELIMINARY:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.PRELIMINARY);
break;
case FINAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.FINAL);
break;
case AMENDED:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.AMENDED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionStatus> convertCompositionStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.CompositionStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case PRELIMINARY:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.PRELIMINARY);
break;
case FINAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.FINAL);
break;
case AMENDED:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.AMENDED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionStatus> convertCompositionStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Composition.CompositionStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case PRELIMINARY:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.PRELIMINARY);
break;
case FINAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.FINAL);
break;
case AMENDED:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.AMENDED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionStatus> convertCompositionStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Composition.CompositionStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case PRELIMINARY:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.PRELIMINARY);
break;
case FINAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.FINAL);
break;
case AMENDED:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.AMENDED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionStatus.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.dstu3.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.dstu2.model.Composition.SectionComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Composition.SectionComponent tgt = new org.hl7.fhir.dstu3.model.Composition.SectionComponent();
Element10_30.copyElement(src, tgt);
if (src.hasTitleElement())
tgt.setTitleElement(String10_30.convertString(src.getTitleElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
if (src.hasText())
tgt.setText(Narrative10_30.convertNarrative(src.getText()));
try {
if (src.hasMode())
tgt.setMode(org.hl7.fhir.dstu3.model.Composition.SectionMode.fromCode(src.getMode()));
} catch (org.hl7.fhir.exceptions.FHIRException e) {
throw new FHIRException(e);
}
if (src.hasOrderedBy())
tgt.setOrderedBy(CodeableConcept10_30.convertCodeableConcept(src.getOrderedBy()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getEntry()) tgt.addEntry(Reference10_30.convertReference(t));
if (src.hasEmptyReason())
tgt.setEmptyReason(CodeableConcept10_30.convertCodeableConcept(src.getEmptyReason()));
for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t));
return tgt;
public static org.hl7.fhir.dstu3.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.dstu2.model.Composition.SectionComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Composition.SectionComponent tgt = new org.hl7.fhir.dstu3.model.Composition.SectionComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasTitleElement())
tgt.setTitleElement(String10_30.convertString(src.getTitleElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
if (src.hasText())
tgt.setText(Narrative10_30.convertNarrative(src.getText()));
try {
if (src.hasMode())
tgt.setMode(org.hl7.fhir.dstu3.model.Composition.SectionMode.fromCode(src.getMode()));
} catch (org.hl7.fhir.exceptions.FHIRException e) {
throw new FHIRException(e);
}
if (src.hasOrderedBy())
tgt.setOrderedBy(CodeableConcept10_30.convertCodeableConcept(src.getOrderedBy()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getEntry()) tgt.addEntry(Reference10_30.convertReference(t));
if (src.hasEmptyReason())
tgt.setEmptyReason(CodeableConcept10_30.convertCodeableConcept(src.getEmptyReason()));
for (org.hl7.fhir.dstu2.model.Composition.SectionComponent t : src.getSection())
tgt.addSection(convertSectionComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.dstu3.model.Composition.SectionComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Composition.SectionComponent tgt = new org.hl7.fhir.dstu2.model.Composition.SectionComponent();
Element10_30.copyElement(src, tgt);
if (src.hasTitleElement())
tgt.setTitleElement(String10_30.convertString(src.getTitleElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
if (src.hasText())
tgt.setText(Narrative10_30.convertNarrative(src.getText()));
tgt.setMode(src.getMode().toCode());
if (src.hasOrderedBy())
tgt.setOrderedBy(CodeableConcept10_30.convertCodeableConcept(src.getOrderedBy()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getEntry()) tgt.addEntry(Reference10_30.convertReference(t));
if (src.hasEmptyReason())
tgt.setEmptyReason(CodeableConcept10_30.convertCodeableConcept(src.getEmptyReason()));
for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection()) tgt.addSection(convertSectionComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Composition.SectionComponent convertSectionComponent(org.hl7.fhir.dstu3.model.Composition.SectionComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Composition.SectionComponent tgt = new org.hl7.fhir.dstu2.model.Composition.SectionComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasTitleElement())
tgt.setTitleElement(String10_30.convertString(src.getTitleElement()));
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
if (src.hasText())
tgt.setText(Narrative10_30.convertNarrative(src.getText()));
tgt.setMode(src.getMode().toCode());
if (src.hasOrderedBy())
tgt.setOrderedBy(CodeableConcept10_30.convertCodeableConcept(src.getOrderedBy()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getEntry()) tgt.addEntry(Reference10_30.convertReference(t));
if (src.hasEmptyReason())
tgt.setEmptyReason(CodeableConcept10_30.convertCodeableConcept(src.getEmptyReason()));
for (org.hl7.fhir.dstu3.model.Composition.SectionComponent t : src.getSection())
tgt.addSection(convertSectionComponent(t));
return tgt;
}
}

View File

@ -1,12 +1,8 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import java.util.ArrayList;
import java.util.List;
import org.hl7.fhir.convertors.SourceElementComponentWrapper;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Type10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.ContactPoint10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
@ -15,287 +11,305 @@ import org.hl7.fhir.dstu3.model.ConceptMap;
import org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.ArrayList;
import java.util.List;
public class ConceptMap10_30 {
public static org.hl7.fhir.dstu2.model.ConceptMap convertConceptMap(org.hl7.fhir.dstu3.model.ConceptMap src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.ConceptMap tgt = new org.hl7.fhir.dstu2.model.ConceptMap();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasVersionElement())
tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement()));
if (src.hasPublisherElement())
tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement()));
for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasDescription())
tgt.setDescription(src.getDescription());
for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept())
tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t.getValueCodeableConcept()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setRequirements(src.getPurpose());
if (src.hasCopyright())
tgt.setCopyright(src.getCopyright());
if (src.hasSource())
tgt.setSource(Type10_30.convertType(src.getSource()));
if (src.hasTarget())
tgt.setTarget(Type10_30.convertType(src.getTarget()));
for (org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup()) for (org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent t : g.getElement()) tgt.addElement(convertSourceElementComponent(t, g));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ConceptMap convertConceptMap(org.hl7.fhir.dstu3.model.ConceptMap src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.ConceptMap tgt = new org.hl7.fhir.dstu2.model.ConceptMap();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasVersionElement())
tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement()));
if (src.hasPublisherElement())
tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement()));
for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact())
tgt.addContact(convertConceptMapContactComponent(t));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasDescription())
tgt.setDescription(src.getDescription());
for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext())
if (t.hasValueCodeableConcept())
tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t.getValueCodeableConcept()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction())
tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasPurpose())
tgt.setRequirements(src.getPurpose());
if (src.hasCopyright())
tgt.setCopyright(src.getCopyright());
if (src.hasSource())
tgt.setSource(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getSource()));
if (src.hasTarget())
tgt.setTarget(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getTarget()));
for (org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent g : src.getGroup())
for (org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent t : g.getElement())
tgt.addElement(convertSourceElementComponent(t, g));
return tgt;
}
public static org.hl7.fhir.dstu3.model.ConceptMap convertConceptMap(org.hl7.fhir.dstu2.model.ConceptMap src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.ConceptMap tgt = new org.hl7.fhir.dstu3.model.ConceptMap();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasVersionElement())
tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement()));
if (src.hasPublisherElement())
tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement()));
for (org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent t : src.getContact()) tgt.addContact(convertConceptMapContactComponent(t));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasDescription())
tgt.setDescription(src.getDescription());
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_30.isJurisdiction(t))
tgt.addJurisdiction(CodeableConcept10_30.convertCodeableConcept(t));
else
tgt.addUseContext(CodeableConcept10_30.convertCodeableConceptToUsageContext(t));
if (src.hasRequirements())
tgt.setPurpose(src.getRequirements());
if (src.hasCopyright())
tgt.setCopyright(src.getCopyright());
if (src.hasSource())
tgt.setSource(Type10_30.convertType(src.getSource()));
if (src.hasTarget())
tgt.setTarget(Type10_30.convertType(src.getTarget()));
for (org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent t : src.getElement()) {
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> ws = convertSourceElementComponent(t);
for (SourceElementComponentWrapper<ConceptMap.SourceElementComponent> w : ws) getGroup(tgt, w.getSource(), w.getTarget()).addElement(w.getComp());
}
return tgt;
public static org.hl7.fhir.dstu3.model.ConceptMap convertConceptMap(org.hl7.fhir.dstu2.model.ConceptMap src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.ConceptMap tgt = new org.hl7.fhir.dstu3.model.ConceptMap();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasVersionElement())
tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement()));
if (src.hasPublisherElement())
tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement()));
for (org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent t : src.getContact())
tgt.addContact(convertConceptMapContactComponent(t));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasDescription())
tgt.setDescription(src.getDescription());
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext())
if (VersionConvertor_10_30.isJurisdiction(t))
tgt.addJurisdiction(CodeableConcept10_30.convertCodeableConcept(t));
else
tgt.addUseContext(CodeableConcept10_30.convertCodeableConceptToUsageContext(t));
if (src.hasRequirements())
tgt.setPurpose(src.getRequirements());
if (src.hasCopyright())
tgt.setCopyright(src.getCopyright());
if (src.hasSource())
tgt.setSource(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getSource()));
if (src.hasTarget())
tgt.setTarget(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getTarget()));
for (org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent t : src.getElement()) {
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> ws = convertSourceElementComponent(t);
for (SourceElementComponentWrapper<ConceptMap.SourceElementComponent> w : ws)
getGroup(tgt, w.getSource(), w.getTarget()).addElement(w.getComp());
}
return tgt;
}
public static org.hl7.fhir.dstu3.model.ContactDetail convertConceptMapContactComponent(org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail();
Element10_30.copyElement(src, tgt);
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(ContactPoint10_30.convertContactPoint(t));
return tgt;
public static org.hl7.fhir.dstu3.model.ContactDetail convertConceptMapContactComponent(org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(ContactPoint10_30.convertContactPoint(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent convertConceptMapContactComponent(org.hl7.fhir.dstu3.model.ContactDetail src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(ContactPoint10_30.convertContactPoint(t));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence> convertConceptMapEquivalence(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalenceEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case EQUIVALENT:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUIVALENT);
break;
case EQUAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUAL);
break;
case WIDER:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.WIDER);
break;
case SUBSUMES:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.SUBSUMES);
break;
case NARROWER:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NARROWER);
break;
case SPECIALIZES:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.SPECIALIZES);
break;
case INEXACT:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.INEXACT);
break;
case UNMATCHED:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.UNMATCHED);
break;
case DISJOINT:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.DISJOINT);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent convertConceptMapContactComponent(org.hl7.fhir.dstu3.model.ContactDetail src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.ConceptMapContactComponent();
Element10_30.copyElement(src, tgt);
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(ContactPoint10_30.convertContactPoint(t));
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence> convertConceptMapEquivalence(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalenceEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case EQUIVALENT:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.EQUIVALENT);
break;
case EQUAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.EQUAL);
break;
case WIDER:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.WIDER);
break;
case SUBSUMES:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.SUBSUMES);
break;
case NARROWER:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.NARROWER);
break;
case SPECIALIZES:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.SPECIALIZES);
break;
case INEXACT:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.INEXACT);
break;
case UNMATCHED:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.UNMATCHED);
break;
case DISJOINT:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.DISJOINT);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence> convertConceptMapEquivalence(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalenceEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case EQUIVALENT:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUIVALENT);
break;
case EQUAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.EQUAL);
break;
case WIDER:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.WIDER);
break;
case SUBSUMES:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.SUBSUMES);
break;
case NARROWER:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NARROWER);
break;
case SPECIALIZES:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.SPECIALIZES);
break;
case INEXACT:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.INEXACT);
break;
case UNMATCHED:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.UNMATCHED);
break;
case DISJOINT:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.DISJOINT);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence.NULL);
break;
}
return tgt;
public static org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasElementElement())
tgt.setPropertyElement(Uri10_30.convertUri(src.getElementElement()));
if (src.hasCodeSystemElement())
tgt.setSystemElement(Uri10_30.convertUri(src.getCodeSystemElement()));
if (src.hasCodeElement())
tgt.setCodeElement(String10_30.convertString(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasPropertyElement())
tgt.setElementElement(Uri10_30.convertUri(src.getPropertyElement()));
if (src.hasSystemElement())
tgt.setCodeSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement())
tgt.setCodeElement(String10_30.convertString(src.getCodeElement()));
return tgt;
}
public static List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> convertSourceElementComponent(org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent src) throws FHIRException {
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> res = new ArrayList<>();
if (src == null || src.isEmpty())
return res;
for (org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent t : src.getTarget()) {
org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
tgt.setCode(src.getCode());
tgt.addTarget(convertTargetElementComponent(t));
res.add(new SourceElementComponentWrapper<>(tgt, src.getCodeSystem(), t.getCodeSystem()));
}
return res;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence> convertConceptMapEquivalence(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.ConceptMapEquivalence> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalenceEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case EQUIVALENT:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.EQUIVALENT);
break;
case EQUAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.EQUAL);
break;
case WIDER:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.WIDER);
break;
case SUBSUMES:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.SUBSUMES);
break;
case NARROWER:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.NARROWER);
break;
case SPECIALIZES:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.SPECIALIZES);
break;
case INEXACT:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.INEXACT);
break;
case UNMATCHED:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.UNMATCHED);
break;
case DISJOINT:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.DISJOINT);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence.NULL);
break;
}
return tgt;
}
public static org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent src, org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent g) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
tgt.setCodeSystem(g.getSource());
if (src.hasCodeElement())
tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
for (org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent t : src.getTarget())
tgt.addTarget(convertTargetElementComponent(t, g));
return tgt;
}
public static org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent();
Element10_30.copyElement(src, tgt);
if (src.hasElementElement())
tgt.setPropertyElement(Uri10_30.convertUri(src.getElementElement()));
if (src.hasCodeSystemElement())
tgt.setSystemElement(Uri10_30.convertUri(src.getCodeSystemElement()));
if (src.hasCodeElement())
tgt.setCodeElement(String10_30.convertString(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent src, org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent g) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
tgt.setCodeSystem(g.getTarget());
if (src.hasCodeElement())
tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
if (src.hasEquivalence())
tgt.setEquivalenceElement(convertConceptMapEquivalence(src.getEquivalenceElement()));
if (src.hasCommentElement())
tgt.setCommentsElement(String10_30.convertString(src.getCommentElement()));
for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getDependsOn())
tgt.addDependsOn(convertOtherElementComponent(t));
for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getProduct())
tgt.addProduct(convertOtherElementComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent convertOtherElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent();
Element10_30.copyElement(src, tgt);
if (src.hasPropertyElement())
tgt.setElementElement(Uri10_30.convertUri(src.getPropertyElement()));
if (src.hasSystemElement())
tgt.setCodeSystemElement(Uri10_30.convertUri(src.getSystemElement()));
if (src.hasCodeElement())
tgt.setCodeElement(String10_30.convertString(src.getCodeElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasCodeElement())
tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
if (src.hasEquivalence())
tgt.setEquivalenceElement(convertConceptMapEquivalence(src.getEquivalenceElement()));
if (src.hasCommentsElement())
tgt.setCommentElement(String10_30.convertString(src.getCommentsElement()));
for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getDependsOn())
tgt.addDependsOn(convertOtherElementComponent(t));
for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getProduct())
tgt.addProduct(convertOtherElementComponent(t));
return tgt;
}
public static List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> convertSourceElementComponent(org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent src) throws FHIRException {
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> res = new ArrayList<>();
if (src == null || src.isEmpty())
return res;
for (org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent t : src.getTarget()) {
org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent();
Element10_30.copyElement(src, tgt);
tgt.setCode(src.getCode());
tgt.addTarget(convertTargetElementComponent(t));
res.add(new SourceElementComponentWrapper<>(tgt, src.getCodeSystem(), t.getCodeSystem()));
}
return res;
}
public static org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent convertSourceElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent src, org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent g) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent();
Element10_30.copyElement(src, tgt);
tgt.setCodeSystem(g.getSource());
if (src.hasCodeElement())
tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
for (org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent t : src.getTarget()) tgt.addTarget(convertTargetElementComponent(t, g));
return tgt;
}
public static org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent src, org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent g) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent();
Element10_30.copyElement(src, tgt);
tgt.setCodeSystem(g.getTarget());
if (src.hasCodeElement())
tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
if (src.hasEquivalence())
tgt.setEquivalenceElement(convertConceptMapEquivalence(src.getEquivalenceElement()));
if (src.hasCommentElement())
tgt.setCommentsElement(String10_30.convertString(src.getCommentElement()));
for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t));
for (org.hl7.fhir.dstu3.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent convertTargetElementComponent(org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent tgt = new org.hl7.fhir.dstu3.model.ConceptMap.TargetElementComponent();
Element10_30.copyElement(src, tgt);
if (src.hasCodeElement())
tgt.setCodeElement(Code10_30.convertCode(src.getCodeElement()));
if (src.hasEquivalence())
tgt.setEquivalenceElement(convertConceptMapEquivalence(src.getEquivalenceElement()));
if (src.hasCommentsElement())
tgt.setCommentElement(String10_30.convertString(src.getCommentsElement()));
for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getDependsOn()) tgt.addDependsOn(convertOtherElementComponent(t));
for (org.hl7.fhir.dstu2.model.ConceptMap.OtherElementComponent t : src.getProduct()) tgt.addProduct(convertOtherElementComponent(t));
return tgt;
}
static public ConceptMapGroupComponent getGroup(ConceptMap map, String srcs, String tgts) {
for (ConceptMapGroupComponent grp : map.getGroup()) {
if (grp.getSource().equals(srcs) && grp.getTarget().equals(tgts))
return grp;
}
ConceptMapGroupComponent grp = map.addGroup();
grp.setSource(srcs);
grp.setTarget(tgts);
static public ConceptMapGroupComponent getGroup(ConceptMap map, String srcs, String tgts) {
for (ConceptMapGroupComponent grp : map.getGroup()) {
if (grp.getSource().equals(srcs) && grp.getTarget().equals(tgts))
return grp;
}
ConceptMapGroupComponent grp = map.addGroup();
grp.setSource(srcs);
grp.setTarget(tgts);
return grp;
}
}

View File

@ -1,189 +1,197 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Type10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Condition10_30 {
public static org.hl7.fhir.dstu3.model.Condition convertCondition(org.hl7.fhir.dstu2.model.Condition src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Condition tgt = new org.hl7.fhir.dstu3.model.Condition();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasPatient())
tgt.setSubject(Reference10_30.convertReference(src.getPatient()));
if (src.hasEncounter())
tgt.setContext(Reference10_30.convertReference(src.getEncounter()));
if (src.hasAsserter())
tgt.setAsserter(Reference10_30.convertReference(src.getAsserter()));
if (src.hasDateRecorded())
tgt.setAssertedDate(src.getDateRecorded());
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
if (src.hasCategory())
tgt.addCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategory()));
try {
if (src.hasClinicalStatus())
tgt.setClinicalStatus(org.hl7.fhir.dstu3.model.Condition.ConditionClinicalStatus.fromCode(src.getClinicalStatus()));
} catch (org.hl7.fhir.exceptions.FHIRException e) {
throw new FHIRException(e);
}
if (src.hasVerificationStatus())
tgt.setVerificationStatusElement(convertConditionVerificationStatus(src.getVerificationStatusElement()));
if (src.hasSeverity())
tgt.setSeverity(CodeableConcept10_30.convertCodeableConcept(src.getSeverity()));
if (src.hasOnset())
tgt.setOnset(Type10_30.convertType(src.getOnset()));
if (src.hasAbatement())
tgt.setAbatement(Type10_30.convertType(src.getAbatement()));
if (src.hasStage())
tgt.setStage(convertConditionStageComponent(src.getStage()));
for (org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(CodeableConcept10_30.convertCodeableConcept(t));
return tgt;
public static org.hl7.fhir.dstu3.model.Condition convertCondition(org.hl7.fhir.dstu2.model.Condition src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Condition tgt = new org.hl7.fhir.dstu3.model.Condition();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasPatient())
tgt.setSubject(Reference10_30.convertReference(src.getPatient()));
if (src.hasEncounter())
tgt.setContext(Reference10_30.convertReference(src.getEncounter()));
if (src.hasAsserter())
tgt.setAsserter(Reference10_30.convertReference(src.getAsserter()));
if (src.hasDateRecorded())
tgt.setAssertedDate(src.getDateRecorded());
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
if (src.hasCategory())
tgt.addCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategory()));
try {
if (src.hasClinicalStatus())
tgt.setClinicalStatus(org.hl7.fhir.dstu3.model.Condition.ConditionClinicalStatus.fromCode(src.getClinicalStatus()));
} catch (org.hl7.fhir.exceptions.FHIRException e) {
throw new FHIRException(e);
}
if (src.hasVerificationStatus())
tgt.setVerificationStatusElement(convertConditionVerificationStatus(src.getVerificationStatusElement()));
if (src.hasSeverity())
tgt.setSeverity(CodeableConcept10_30.convertCodeableConcept(src.getSeverity()));
if (src.hasOnset())
tgt.setOnset(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getOnset()));
if (src.hasAbatement())
tgt.setAbatement(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getAbatement()));
if (src.hasStage())
tgt.setStage(convertConditionStageComponent(src.getStage()));
for (org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent t : src.getEvidence())
tgt.addEvidence(convertConditionEvidenceComponent(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getBodySite())
tgt.addBodySite(CodeableConcept10_30.convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Condition convertCondition(org.hl7.fhir.dstu3.model.Condition src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Condition tgt = new org.hl7.fhir.dstu2.model.Condition();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasSubject())
tgt.setPatient(Reference10_30.convertReference(src.getSubject()));
if (src.hasContext())
tgt.setEncounter(Reference10_30.convertReference(src.getContext()));
if (src.hasAsserter())
tgt.setAsserter(Reference10_30.convertReference(src.getAsserter()));
if (src.hasAssertedDate())
tgt.setDateRecorded(src.getAssertedDate());
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory()) tgt.setCategory(CodeableConcept10_30.convertCodeableConcept(t));
tgt.setClinicalStatus(src.getClinicalStatus().toCode());
if (src.hasVerificationStatus())
tgt.setVerificationStatusElement(convertConditionVerificationStatus(src.getVerificationStatusElement()));
if (src.hasSeverity())
tgt.setSeverity(CodeableConcept10_30.convertCodeableConcept(src.getSeverity()));
if (src.hasOnset())
tgt.setOnset(Type10_30.convertType(src.getOnset()));
if (src.hasAbatement())
tgt.setAbatement(Type10_30.convertType(src.getAbatement()));
if (src.hasStage())
tgt.setStage(convertConditionStageComponent(src.getStage()));
for (org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent t : src.getEvidence()) tgt.addEvidence(convertConditionEvidenceComponent(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite()) tgt.addBodySite(CodeableConcept10_30.convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Condition convertCondition(org.hl7.fhir.dstu3.model.Condition src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Condition tgt = new org.hl7.fhir.dstu2.model.Condition();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasSubject())
tgt.setPatient(Reference10_30.convertReference(src.getSubject()));
if (src.hasContext())
tgt.setEncounter(Reference10_30.convertReference(src.getContext()));
if (src.hasAsserter())
tgt.setAsserter(Reference10_30.convertReference(src.getAsserter()));
if (src.hasAssertedDate())
tgt.setDateRecorded(src.getAssertedDate());
if (src.hasCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getCategory())
tgt.setCategory(CodeableConcept10_30.convertCodeableConcept(t));
tgt.setClinicalStatus(src.getClinicalStatus().toCode());
if (src.hasVerificationStatus())
tgt.setVerificationStatusElement(convertConditionVerificationStatus(src.getVerificationStatusElement()));
if (src.hasSeverity())
tgt.setSeverity(CodeableConcept10_30.convertCodeableConcept(src.getSeverity()));
if (src.hasOnset())
tgt.setOnset(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getOnset()));
if (src.hasAbatement())
tgt.setAbatement(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getAbatement()));
if (src.hasStage())
tgt.setStage(convertConditionStageComponent(src.getStage()));
for (org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent t : src.getEvidence())
tgt.addEvidence(convertConditionEvidenceComponent(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getBodySite())
tgt.addBodySite(CodeableConcept10_30.convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent convertConditionEvidenceComponent(org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent();
Element10_30.copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.CodeableConcept cc : src.getCode()) tgt.setCode(CodeableConcept10_30.convertCodeableConcept(cc));
for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(Reference10_30.convertReference(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent convertConditionEvidenceComponent(org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
for (org.hl7.fhir.dstu3.model.CodeableConcept cc : src.getCode())
tgt.setCode(CodeableConcept10_30.convertCodeableConcept(cc));
for (org.hl7.fhir.dstu3.model.Reference t : src.getDetail()) tgt.addDetail(Reference10_30.convertReference(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent convertConditionEvidenceComponent(org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent();
Element10_30.copyElement(src, tgt);
if (src.hasCode())
tgt.addCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(Reference10_30.convertReference(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent convertConditionEvidenceComponent(org.hl7.fhir.dstu2.model.Condition.ConditionEvidenceComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent tgt = new org.hl7.fhir.dstu3.model.Condition.ConditionEvidenceComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasCode())
tgt.addCode(CodeableConcept10_30.convertCodeableConcept(src.getCode()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getDetail()) tgt.addDetail(Reference10_30.convertReference(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.dstu3.model.Condition.ConditionStageComponent();
Element10_30.copyElement(src, tgt);
if (src.hasSummary())
tgt.setSummary(CodeableConcept10_30.convertCodeableConcept(src.getSummary()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getAssessment()) tgt.addAssessment(Reference10_30.convertReference(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.dstu3.model.Condition.ConditionStageComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasSummary())
tgt.setSummary(CodeableConcept10_30.convertCodeableConcept(src.getSummary()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getAssessment())
tgt.addAssessment(Reference10_30.convertReference(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.dstu3.model.Condition.ConditionStageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent();
Element10_30.copyElement(src, tgt);
if (src.hasSummary())
tgt.setSummary(CodeableConcept10_30.convertCodeableConcept(src.getSummary()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getAssessment()) tgt.addAssessment(Reference10_30.convertReference(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent convertConditionStageComponent(org.hl7.fhir.dstu3.model.Condition.ConditionStageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent tgt = new org.hl7.fhir.dstu2.model.Condition.ConditionStageComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasSummary())
tgt.setSummary(CodeableConcept10_30.convertCodeableConcept(src.getSummary()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getAssessment())
tgt.addAssessment(Reference10_30.convertReference(t));
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus> convertConditionVerificationStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case PROVISIONAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.PROVISIONAL);
break;
case DIFFERENTIAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.DIFFERENTIAL);
break;
case CONFIRMED:
tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.CONFIRMED);
break;
case REFUTED:
tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.REFUTED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus> convertConditionVerificationStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case PROVISIONAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.PROVISIONAL);
break;
case DIFFERENTIAL:
tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.DIFFERENTIAL);
break;
case CONFIRMED:
tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.CONFIRMED);
break;
case REFUTED:
tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.REFUTED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus> convertConditionVerificationStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case PROVISIONAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.PROVISIONAL);
break;
case DIFFERENTIAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.DIFFERENTIAL);
break;
case CONFIRMED:
tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.CONFIRMED);
break;
case REFUTED:
tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.REFUTED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus> convertConditionVerificationStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Condition.ConditionVerificationStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case PROVISIONAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.PROVISIONAL);
break;
case DIFFERENTIAL:
tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.DIFFERENTIAL);
break;
case CONFIRMED:
tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.CONFIRMED);
break;
case REFUTED:
tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.REFUTED);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.ENTEREDINERROR);
break;
case UNKNOWN:
tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.UNKNOWN);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Condition.ConditionVerificationStatus.NULL);
break;
}
return tgt;
}
}

View File

@ -1,354 +1,383 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.apache.commons.codec.binary.Base64;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Type10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.*;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Decimal10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Contract10_30 {
public static org.hl7.fhir.dstu3.model.Contract.AgentComponent convertAgentComponent(org.hl7.fhir.dstu2.model.Contract.ActorComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.AgentComponent tgt = new org.hl7.fhir.dstu3.model.Contract.AgentComponent();
Element10_30.copyElement(src, tgt);
if (src.hasEntity())
tgt.setActor(Reference10_30.convertReference(src.getEntity()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(CodeableConcept10_30.convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.AgentComponent convertAgentComponent(org.hl7.fhir.dstu2.model.Contract.ActorComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.AgentComponent tgt = new org.hl7.fhir.dstu3.model.Contract.AgentComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasEntity())
tgt.setActor(Reference10_30.convertReference(src.getEntity()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole())
tgt.addRole(CodeableConcept10_30.convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.ActorComponent convertAgentComponent(org.hl7.fhir.dstu3.model.Contract.AgentComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.ActorComponent tgt = new org.hl7.fhir.dstu2.model.Contract.ActorComponent();
Element10_30.copyElement(src, tgt);
if (src.hasActor())
tgt.setEntity(Reference10_30.convertReference(src.getActor()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(CodeableConcept10_30.convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.ActorComponent convertAgentComponent(org.hl7.fhir.dstu3.model.Contract.AgentComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.ActorComponent tgt = new org.hl7.fhir.dstu2.model.Contract.ActorComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasActor())
tgt.setEntity(Reference10_30.convertReference(src.getActor()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole())
tgt.addRole(CodeableConcept10_30.convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent();
Element10_30.copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(Type10_30.convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent();
Element10_30.copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(Type10_30.convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent convertComputableLanguageComponent(org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent tgt = new org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract convertContract(org.hl7.fhir.dstu3.model.Contract src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract tgt = new org.hl7.fhir.dstu2.model.Contract();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasIssuedElement())
tgt.setIssuedElement(DateTime10_30.convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(Period10_30.convertPeriod(src.getApplies()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getSubject()) tgt.addSubject(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthority()) tgt.addAuthority(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.Reference t : src.getDomain()) tgt.addDomain(Reference10_30.convertReference(t));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSubType()) tgt.addSubType(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction()) tgt.addAction(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu3.model.Contract.AgentComponent t : src.getAgent()) tgt.addActor(convertAgentComponent(t));
for (org.hl7.fhir.dstu3.model.Contract.SignatoryComponent t : src.getSigner()) tgt.addSigner(convertSignatoryComponent(t));
for (org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertValuedItemComponent(t));
for (org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t));
if (src.hasBinding())
tgt.setBinding(Type10_30.convertType(src.getBinding()));
for (org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) tgt.addFriendly(convertFriendlyLanguageComponent(t));
for (org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent t : src.getLegal()) tgt.addLegal(convertLegalLanguageComponent(t));
for (org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent t : src.getRule()) tgt.addRule(convertComputableLanguageComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract convertContract(org.hl7.fhir.dstu3.model.Contract src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract tgt = new org.hl7.fhir.dstu2.model.Contract();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasIssuedElement())
tgt.setIssuedElement(DateTime10_30.convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(Period10_30.convertPeriod(src.getApplies()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getSubject()) tgt.addSubject(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthority())
tgt.addAuthority(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu3.model.Reference t : src.getDomain()) tgt.addDomain(Reference10_30.convertReference(t));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSubType())
tgt.addSubType(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction())
tgt.addAction(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason())
tgt.addActionReason(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu3.model.Contract.AgentComponent t : src.getAgent()) tgt.addActor(convertAgentComponent(t));
for (org.hl7.fhir.dstu3.model.Contract.SignatoryComponent t : src.getSigner())
tgt.addSigner(convertSignatoryComponent(t));
for (org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent t : src.getValuedItem())
tgt.addValuedItem(convertValuedItemComponent(t));
for (org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t));
if (src.hasBinding())
tgt.setBinding(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getBinding()));
for (org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent t : src.getFriendly())
tgt.addFriendly(convertFriendlyLanguageComponent(t));
for (org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent t : src.getLegal())
tgt.addLegal(convertLegalLanguageComponent(t));
for (org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent t : src.getRule())
tgt.addRule(convertComputableLanguageComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract convertContract(org.hl7.fhir.dstu2.model.Contract src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract tgt = new org.hl7.fhir.dstu3.model.Contract();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasIssuedElement())
tgt.setIssuedElement(DateTime10_30.convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(Period10_30.convertPeriod(src.getApplies()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getSubject()) tgt.addSubject(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthority()) tgt.addAuthority(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.Reference t : src.getDomain()) tgt.addDomain(Reference10_30.convertReference(t));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSubType()) tgt.addSubType(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getAction()) tgt.addAction(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu2.model.Contract.ActorComponent t : src.getActor()) tgt.addAgent(convertAgentComponent(t));
for (org.hl7.fhir.dstu2.model.Contract.SignatoryComponent t : src.getSigner()) tgt.addSigner(convertSignatoryComponent(t));
for (org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertValuedItemComponent(t));
for (org.hl7.fhir.dstu2.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t));
if (src.hasBinding())
tgt.setBinding(Type10_30.convertType(src.getBinding()));
for (org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) tgt.addFriendly(convertFriendlyLanguageComponent(t));
for (org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent t : src.getLegal()) tgt.addLegal(convertLegalLanguageComponent(t));
for (org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent t : src.getRule()) tgt.addRule(convertComputableLanguageComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract convertContract(org.hl7.fhir.dstu2.model.Contract src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract tgt = new org.hl7.fhir.dstu3.model.Contract();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasIssuedElement())
tgt.setIssuedElement(DateTime10_30.convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(Period10_30.convertPeriod(src.getApplies()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getSubject()) tgt.addSubject(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.Reference t : src.getAuthority())
tgt.addAuthority(Reference10_30.convertReference(t));
for (org.hl7.fhir.dstu2.model.Reference t : src.getDomain()) tgt.addDomain(Reference10_30.convertReference(t));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getSubType())
tgt.addSubType(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getAction())
tgt.addAction(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getActionReason())
tgt.addActionReason(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu2.model.Contract.ActorComponent t : src.getActor()) tgt.addAgent(convertAgentComponent(t));
for (org.hl7.fhir.dstu2.model.Contract.SignatoryComponent t : src.getSigner())
tgt.addSigner(convertSignatoryComponent(t));
for (org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent t : src.getValuedItem())
tgt.addValuedItem(convertValuedItemComponent(t));
for (org.hl7.fhir.dstu2.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t));
if (src.hasBinding())
tgt.setBinding(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getBinding()));
for (org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent t : src.getFriendly())
tgt.addFriendly(convertFriendlyLanguageComponent(t));
for (org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent t : src.getLegal())
tgt.addLegal(convertLegalLanguageComponent(t));
for (org.hl7.fhir.dstu2.model.Contract.ComputableLanguageComponent t : src.getRule())
tgt.addRule(convertComputableLanguageComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent();
Element10_30.copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(Type10_30.convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent();
Element10_30.copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(Type10_30.convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent convertFriendlyLanguageComponent(org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent tgt = new org.hl7.fhir.dstu2.model.Contract.FriendlyLanguageComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent();
Element10_30.copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(Type10_30.convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent();
Element10_30.copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(Type10_30.convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent convertLegalLanguageComponent(org.hl7.fhir.dstu2.model.Contract.LegalLanguageComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent tgt = new org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasContent())
tgt.setContent(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getContent()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.dstu2.model.Contract.SignatoryComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.dstu3.model.Contract.SignatoryComponent();
Element10_30.copyElement(src, tgt);
if (src.hasType())
tgt.setType(Coding10_30.convertCoding(src.getType()));
if (src.hasParty())
tgt.setParty(Reference10_30.convertReference(src.getParty()));
if (src.hasSignature())
tgt.addSignature(new org.hl7.fhir.dstu3.model.Signature().setBlob(src.getSignature().getBytes()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.dstu2.model.Contract.SignatoryComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.dstu3.model.Contract.SignatoryComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasType())
tgt.setType(Coding10_30.convertCoding(src.getType()));
if (src.hasParty())
tgt.setParty(Reference10_30.convertReference(src.getParty()));
if (src.hasSignature())
tgt.addSignature(new org.hl7.fhir.dstu3.model.Signature().setBlob(src.getSignature().getBytes()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.dstu3.model.Contract.SignatoryComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.dstu2.model.Contract.SignatoryComponent();
Element10_30.copyElement(src, tgt);
if (src.hasType())
tgt.setType(Coding10_30.convertCoding(src.getType()));
if (src.hasParty())
tgt.setParty(Reference10_30.convertReference(src.getParty()));
for (org.hl7.fhir.dstu3.model.Signature t : src.getSignature()) tgt.setSignature(Base64.encodeBase64String(t.getBlob()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.SignatoryComponent convertSignatoryComponent(org.hl7.fhir.dstu3.model.Contract.SignatoryComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.SignatoryComponent tgt = new org.hl7.fhir.dstu2.model.Contract.SignatoryComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasType())
tgt.setType(Coding10_30.convertCoding(src.getType()));
if (src.hasParty())
tgt.setParty(Reference10_30.convertReference(src.getParty()));
for (org.hl7.fhir.dstu3.model.Signature t : src.getSignature())
tgt.setSignature(Base64.encodeBase64String(t.getBlob()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.TermActorComponent convertTermAgentComponent(org.hl7.fhir.dstu3.model.Contract.TermAgentComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.TermActorComponent tgt = new org.hl7.fhir.dstu2.model.Contract.TermActorComponent();
Element10_30.copyElement(src, tgt);
if (src.hasActor())
tgt.setEntity(Reference10_30.convertReference(src.getActor()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole()) tgt.addRole(CodeableConcept10_30.convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.TermActorComponent convertTermAgentComponent(org.hl7.fhir.dstu3.model.Contract.TermAgentComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.TermActorComponent tgt = new org.hl7.fhir.dstu2.model.Contract.TermActorComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasActor())
tgt.setEntity(Reference10_30.convertReference(src.getActor()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getRole())
tgt.addRole(CodeableConcept10_30.convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.TermAgentComponent convertTermAgentComponent(org.hl7.fhir.dstu2.model.Contract.TermActorComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.TermAgentComponent tgt = new org.hl7.fhir.dstu3.model.Contract.TermAgentComponent();
Element10_30.copyElement(src, tgt);
if (src.hasEntity())
tgt.setActor(Reference10_30.convertReference(src.getEntity()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole()) tgt.addRole(CodeableConcept10_30.convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.TermAgentComponent convertTermAgentComponent(org.hl7.fhir.dstu2.model.Contract.TermActorComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.TermAgentComponent tgt = new org.hl7.fhir.dstu3.model.Contract.TermAgentComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasEntity())
tgt.setActor(Reference10_30.convertReference(src.getEntity()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getRole())
tgt.addRole(CodeableConcept10_30.convertCodeableConcept(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.dstu2.model.Contract.TermComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.TermComponent tgt = new org.hl7.fhir.dstu3.model.Contract.TermComponent();
Element10_30.copyElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasIssuedElement())
tgt.setIssuedElement(DateTime10_30.convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(Period10_30.convertPeriod(src.getApplies()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(CodeableConcept10_30.convertCodeableConcept(src.getSubType()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getAction()) tgt.addAction(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu2.model.Contract.TermActorComponent t : src.getActor()) tgt.addAgent(convertTermAgentComponent(t));
if (src.hasTextElement())
tgt.setTextElement(String10_30.convertString(src.getTextElement()));
for (org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertTermValuedItemComponent(t));
for (org.hl7.fhir.dstu2.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.dstu2.model.Contract.TermComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.TermComponent tgt = new org.hl7.fhir.dstu3.model.Contract.TermComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasIssuedElement())
tgt.setIssuedElement(DateTime10_30.convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(Period10_30.convertPeriod(src.getApplies()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(CodeableConcept10_30.convertCodeableConcept(src.getSubType()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getAction())
tgt.addAction(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getActionReason())
tgt.addActionReason(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu2.model.Contract.TermActorComponent t : src.getActor())
tgt.addAgent(convertTermAgentComponent(t));
if (src.hasTextElement())
tgt.setTextElement(String10_30.convertString(src.getTextElement()));
for (org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent t : src.getValuedItem())
tgt.addValuedItem(convertTermValuedItemComponent(t));
for (org.hl7.fhir.dstu2.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.dstu3.model.Contract.TermComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.TermComponent tgt = new org.hl7.fhir.dstu2.model.Contract.TermComponent();
Element10_30.copyElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasIssuedElement())
tgt.setIssuedElement(DateTime10_30.convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(Period10_30.convertPeriod(src.getApplies()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(CodeableConcept10_30.convertCodeableConcept(src.getSubType()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction()) tgt.addAction(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu3.model.Contract.TermAgentComponent t : src.getAgent()) tgt.addActor(convertTermAgentComponent(t));
if (src.hasTextElement())
tgt.setTextElement(String10_30.convertString(src.getTextElement()));
for (org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertTermValuedItemComponent(t));
for (org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.TermComponent convertTermComponent(org.hl7.fhir.dstu3.model.Contract.TermComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.TermComponent tgt = new org.hl7.fhir.dstu2.model.Contract.TermComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasIssuedElement())
tgt.setIssuedElement(DateTime10_30.convertDateTime(src.getIssuedElement()));
if (src.hasApplies())
tgt.setApplies(Period10_30.convertPeriod(src.getApplies()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasSubType())
tgt.setSubType(CodeableConcept10_30.convertCodeableConcept(src.getSubType()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction())
tgt.addAction(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason())
tgt.addActionReason(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu3.model.Contract.TermAgentComponent t : src.getAgent())
tgt.addActor(convertTermAgentComponent(t));
if (src.hasTextElement())
tgt.setTextElement(String10_30.convertString(src.getTextElement()));
for (org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent t : src.getValuedItem())
tgt.addValuedItem(convertTermValuedItemComponent(t));
for (org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getGroup()) tgt.addGroup(convertTermComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent convertTermValuedItemComponent(org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent tgt = new org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent();
Element10_30.copyElement(src, tgt);
if (src.hasEntity())
tgt.setEntity(Type10_30.convertType(src.getEntity()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasEffectiveTimeElement())
tgt.setEffectiveTimeElement(DateTime10_30.convertDateTime(src.getEffectiveTimeElement()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity10_30.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money10_30.convertMoney(src.getUnitPrice()));
if (src.hasFactorElement())
tgt.setFactorElement(Decimal10_30.convertDecimal(src.getFactorElement()));
if (src.hasPointsElement())
tgt.setPointsElement(Decimal10_30.convertDecimal(src.getPointsElement()));
if (src.hasNet())
tgt.setNet(Money10_30.convertMoney(src.getNet()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent convertTermValuedItemComponent(org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent tgt = new org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasEntity())
tgt.setEntity(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getEntity()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasEffectiveTimeElement())
tgt.setEffectiveTimeElement(DateTime10_30.convertDateTime(src.getEffectiveTimeElement()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity10_30.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money10_30.convertMoney(src.getUnitPrice()));
if (src.hasFactorElement())
tgt.setFactorElement(Decimal10_30.convertDecimal(src.getFactorElement()));
if (src.hasPointsElement())
tgt.setPointsElement(Decimal10_30.convertDecimal(src.getPointsElement()));
if (src.hasNet())
tgt.setNet(Money10_30.convertMoney(src.getNet()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent convertTermValuedItemComponent(org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent tgt = new org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent();
Element10_30.copyElement(src, tgt);
if (src.hasEntity())
tgt.setEntity(Type10_30.convertType(src.getEntity()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasEffectiveTimeElement())
tgt.setEffectiveTimeElement(DateTime10_30.convertDateTime(src.getEffectiveTimeElement()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity10_30.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money10_30.convertMoney(src.getUnitPrice()));
if (src.hasFactorElement())
tgt.setFactorElement(Decimal10_30.convertDecimal(src.getFactorElement()));
if (src.hasPointsElement())
tgt.setPointsElement(Decimal10_30.convertDecimal(src.getPointsElement()));
if (src.hasNet())
tgt.setNet(Money10_30.convertMoney(src.getNet()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent convertTermValuedItemComponent(org.hl7.fhir.dstu2.model.Contract.TermValuedItemComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent tgt = new org.hl7.fhir.dstu3.model.Contract.TermValuedItemComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasEntity())
tgt.setEntity(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getEntity()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasEffectiveTimeElement())
tgt.setEffectiveTimeElement(DateTime10_30.convertDateTime(src.getEffectiveTimeElement()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity10_30.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money10_30.convertMoney(src.getUnitPrice()));
if (src.hasFactorElement())
tgt.setFactorElement(Decimal10_30.convertDecimal(src.getFactorElement()));
if (src.hasPointsElement())
tgt.setPointsElement(Decimal10_30.convertDecimal(src.getPointsElement()));
if (src.hasNet())
tgt.setNet(Money10_30.convertMoney(src.getNet()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent();
Element10_30.copyElement(src, tgt);
if (src.hasEntity())
tgt.setEntity(Type10_30.convertType(src.getEntity()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasEffectiveTimeElement())
tgt.setEffectiveTimeElement(DateTime10_30.convertDateTime(src.getEffectiveTimeElement()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity10_30.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money10_30.convertMoney(src.getUnitPrice()));
if (src.hasFactorElement())
tgt.setFactorElement(Decimal10_30.convertDecimal(src.getFactorElement()));
if (src.hasPointsElement())
tgt.setPointsElement(Decimal10_30.convertDecimal(src.getPointsElement()));
if (src.hasNet())
tgt.setNet(Money10_30.convertMoney(src.getNet()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasEntity())
tgt.setEntity(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getEntity()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasEffectiveTimeElement())
tgt.setEffectiveTimeElement(DateTime10_30.convertDateTime(src.getEffectiveTimeElement()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity10_30.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money10_30.convertMoney(src.getUnitPrice()));
if (src.hasFactorElement())
tgt.setFactorElement(Decimal10_30.convertDecimal(src.getFactorElement()));
if (src.hasPointsElement())
tgt.setPointsElement(Decimal10_30.convertDecimal(src.getPointsElement()));
if (src.hasNet())
tgt.setNet(Money10_30.convertMoney(src.getNet()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent();
Element10_30.copyElement(src, tgt);
if (src.hasEntity())
tgt.setEntity(Type10_30.convertType(src.getEntity()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasEffectiveTimeElement())
tgt.setEffectiveTimeElement(DateTime10_30.convertDateTime(src.getEffectiveTimeElement()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity10_30.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money10_30.convertMoney(src.getUnitPrice()));
if (src.hasFactorElement())
tgt.setFactorElement(Decimal10_30.convertDecimal(src.getFactorElement()));
if (src.hasPointsElement())
tgt.setPointsElement(Decimal10_30.convertDecimal(src.getPointsElement()));
if (src.hasNet())
tgt.setNet(Money10_30.convertMoney(src.getNet()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent convertValuedItemComponent(org.hl7.fhir.dstu2.model.Contract.ValuedItemComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent tgt = new org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasEntity())
tgt.setEntity(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getEntity()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasEffectiveTimeElement())
tgt.setEffectiveTimeElement(DateTime10_30.convertDateTime(src.getEffectiveTimeElement()));
if (src.hasQuantity())
tgt.setQuantity(SimpleQuantity10_30.convertSimpleQuantity(src.getQuantity()));
if (src.hasUnitPrice())
tgt.setUnitPrice(Money10_30.convertMoney(src.getUnitPrice()));
if (src.hasFactorElement())
tgt.setFactorElement(Decimal10_30.convertDecimal(src.getFactorElement()));
if (src.hasPointsElement())
tgt.setPointsElement(Decimal10_30.convertDecimal(src.getPointsElement()));
if (src.hasNet())
tgt.setNet(Money10_30.convertMoney(src.getNet()));
return tgt;
}
}

View File

@ -1,203 +1,216 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import java.util.ArrayList;
import java.util.List;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.ElementDefinition10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.ContactPoint10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.*;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.ElementDefinition10_30;
import org.hl7.fhir.exceptions.FHIRException;
import java.util.ArrayList;
import java.util.List;
public class DataElement10_30 {
public static org.hl7.fhir.dstu2.model.DataElement convertDataElement(org.hl7.fhir.dstu3.model.DataElement src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DataElement tgt = new org.hl7.fhir.dstu2.model.DataElement();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasVersionElement())
tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement()));
if (src.hasPublisherElement())
tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t));
for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext()) if (t.hasValueCodeableConcept())
tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t.getValueCodeableConcept()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction()) tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasCopyright())
tgt.setCopyright(src.getCopyright());
if (src.hasStringency())
tgt.setStringencyElement(convertDataElementStringency(src.getStringencyElement()));
for (org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t));
for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement()) tgt.addElement(ElementDefinition10_30.convertElementDefinition(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DataElement convertDataElement(org.hl7.fhir.dstu3.model.DataElement src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DataElement tgt = new org.hl7.fhir.dstu2.model.DataElement();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasVersionElement())
tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement()));
if (src.hasPublisherElement())
tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
for (org.hl7.fhir.dstu3.model.ContactDetail t : src.getContact())
tgt.addContact(convertDataElementContactComponent(t));
for (org.hl7.fhir.dstu3.model.UsageContext t : src.getUseContext())
if (t.hasValueCodeableConcept())
tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t.getValueCodeableConcept()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getJurisdiction())
tgt.addUseContext(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasCopyright())
tgt.setCopyright(src.getCopyright());
if (src.hasStringency())
tgt.setStringencyElement(convertDataElementStringency(src.getStringencyElement()));
for (org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent t : src.getMapping())
tgt.addMapping(convertDataElementMappingComponent(t));
for (org.hl7.fhir.dstu3.model.ElementDefinition t : src.getElement())
tgt.addElement(ElementDefinition10_30.convertElementDefinition(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DataElement convertDataElement(org.hl7.fhir.dstu2.model.DataElement src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DataElement tgt = new org.hl7.fhir.dstu3.model.DataElement();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasVersionElement())
tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement()));
if (src.hasPublisherElement())
tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
for (org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent t : src.getContact()) tgt.addContact(convertDataElementContactComponent(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext()) if (VersionConvertor_10_30.isJurisdiction(t))
tgt.addJurisdiction(CodeableConcept10_30.convertCodeableConcept(t));
else
tgt.addUseContext(CodeableConcept10_30.convertCodeableConceptToUsageContext(t));
if (src.hasCopyright())
tgt.setCopyright(src.getCopyright());
if (src.hasStringency())
tgt.setStringencyElement(convertDataElementStringency(src.getStringencyElement()));
for (org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent t : src.getMapping()) tgt.addMapping(convertDataElementMappingComponent(t));
List<String> slicePaths = new ArrayList<String>();
for (org.hl7.fhir.dstu2.model.ElementDefinition t : src.getElement()) {
if (t.hasSlicing())
slicePaths.add(t.getPath());
tgt.addElement(ElementDefinition10_30.convertElementDefinition(t, slicePaths));
}
return tgt;
public static org.hl7.fhir.dstu3.model.DataElement convertDataElement(org.hl7.fhir.dstu2.model.DataElement src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DataElement tgt = new org.hl7.fhir.dstu3.model.DataElement();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasVersionElement())
tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
if (src.hasStatus())
tgt.setStatusElement(Enumerations10_30.convertConformanceResourceStatus(src.getStatusElement()));
if (src.hasExperimental())
tgt.setExperimentalElement(Boolean10_30.convertBoolean(src.getExperimentalElement()));
if (src.hasPublisherElement())
tgt.setPublisherElement(String10_30.convertString(src.getPublisherElement()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
for (org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent t : src.getContact())
tgt.addContact(convertDataElementContactComponent(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getUseContext())
if (VersionConvertor_10_30.isJurisdiction(t))
tgt.addJurisdiction(CodeableConcept10_30.convertCodeableConcept(t));
else
tgt.addUseContext(CodeableConcept10_30.convertCodeableConceptToUsageContext(t));
if (src.hasCopyright())
tgt.setCopyright(src.getCopyright());
if (src.hasStringency())
tgt.setStringencyElement(convertDataElementStringency(src.getStringencyElement()));
for (org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent t : src.getMapping())
tgt.addMapping(convertDataElementMappingComponent(t));
List<String> slicePaths = new ArrayList<String>();
for (org.hl7.fhir.dstu2.model.ElementDefinition t : src.getElement()) {
if (t.hasSlicing())
slicePaths.add(t.getPath());
tgt.addElement(ElementDefinition10_30.convertElementDefinition(t, slicePaths));
}
return tgt;
}
public static org.hl7.fhir.dstu3.model.ContactDetail convertDataElementContactComponent(org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail();
Element10_30.copyElement(src, tgt);
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(ContactPoint10_30.convertContactPoint(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.ContactDetail convertDataElementContactComponent(org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.ContactDetail tgt = new org.hl7.fhir.dstu3.model.ContactDetail();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(ContactPoint10_30.convertContactPoint(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent convertDataElementContactComponent(org.hl7.fhir.dstu3.model.ContactDetail src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent tgt = new org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent();
Element10_30.copyElement(src, tgt);
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom()) tgt.addTelecom(ContactPoint10_30.convertContactPoint(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent convertDataElementContactComponent(org.hl7.fhir.dstu3.model.ContactDetail src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent tgt = new org.hl7.fhir.dstu2.model.DataElement.DataElementContactComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getTelecom())
tgt.addTelecom(ContactPoint10_30.convertContactPoint(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent convertDataElementMappingComponent(org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent tgt = new org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent();
Element10_30.copyElement(src, tgt);
if (src.hasIdentityElement())
tgt.setIdentityElement(Id10_30.convertId(src.getIdentityElement()));
if (src.hasUriElement())
tgt.setUriElement(Uri10_30.convertUri(src.getUriElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasCommentsElement())
tgt.setCommentElement(String10_30.convertString(src.getCommentsElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent convertDataElementMappingComponent(org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent tgt = new org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasIdentityElement())
tgt.setIdentityElement(Id10_30.convertId(src.getIdentityElement()));
if (src.hasUriElement())
tgt.setUriElement(Uri10_30.convertUri(src.getUriElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasCommentsElement())
tgt.setCommentElement(String10_30.convertString(src.getCommentsElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent convertDataElementMappingComponent(org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent tgt = new org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent();
Element10_30.copyElement(src, tgt);
if (src.hasIdentityElement())
tgt.setIdentityElement(Id10_30.convertId(src.getIdentityElement()));
if (src.hasUriElement())
tgt.setUriElement(Uri10_30.convertUri(src.getUriElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasCommentElement())
tgt.setCommentsElement(String10_30.convertString(src.getCommentElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent convertDataElementMappingComponent(org.hl7.fhir.dstu3.model.DataElement.DataElementMappingComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent tgt = new org.hl7.fhir.dstu2.model.DataElement.DataElementMappingComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasIdentityElement())
tgt.setIdentityElement(Id10_30.convertId(src.getIdentityElement()));
if (src.hasUriElement())
tgt.setUriElement(Uri10_30.convertUri(src.getUriElement()));
if (src.hasNameElement())
tgt.setNameElement(String10_30.convertString(src.getNameElement()));
if (src.hasCommentElement())
tgt.setCommentsElement(String10_30.convertString(src.getCommentElement()));
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DataElement.DataElementStringency> convertDataElementStringency(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DataElement.DataElementStringency> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DataElement.DataElementStringency> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DataElement.DataElementStringencyEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case COMPARABLE:
tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.COMPARABLE);
break;
case FULLYSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.FULLYSPECIFIED);
break;
case EQUIVALENT:
tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.EQUIVALENT);
break;
case CONVERTABLE:
tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.CONVERTABLE);
break;
case SCALEABLE:
tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.SCALEABLE);
break;
case FLEXIBLE:
tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.FLEXIBLE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DataElement.DataElementStringency> convertDataElementStringency(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DataElement.DataElementStringency> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DataElement.DataElementStringency> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DataElement.DataElementStringencyEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case COMPARABLE:
tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.COMPARABLE);
break;
case FULLYSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.FULLYSPECIFIED);
break;
case EQUIVALENT:
tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.EQUIVALENT);
break;
case CONVERTABLE:
tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.CONVERTABLE);
break;
case SCALEABLE:
tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.SCALEABLE);
break;
case FLEXIBLE:
tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.FLEXIBLE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DataElement.DataElementStringency.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DataElement.DataElementStringency> convertDataElementStringency(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DataElement.DataElementStringency> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DataElement.DataElementStringency> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DataElement.DataElementStringencyEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case COMPARABLE:
tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.COMPARABLE);
break;
case FULLYSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.FULLYSPECIFIED);
break;
case EQUIVALENT:
tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.EQUIVALENT);
break;
case CONVERTABLE:
tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.CONVERTABLE);
break;
case SCALEABLE:
tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.SCALEABLE);
break;
case FLEXIBLE:
tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.FLEXIBLE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DataElement.DataElementStringency> convertDataElementStringency(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DataElement.DataElementStringency> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DataElement.DataElementStringency> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DataElement.DataElementStringencyEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case COMPARABLE:
tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.COMPARABLE);
break;
case FULLYSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.FULLYSPECIFIED);
break;
case EQUIVALENT:
tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.EQUIVALENT);
break;
case CONVERTABLE:
tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.CONVERTABLE);
break;
case SCALEABLE:
tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.SCALEABLE);
break;
case FLEXIBLE:
tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.FLEXIBLE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DataElement.DataElementStringency.NULL);
break;
}
return tgt;
}
}

View File

@ -1,138 +1,141 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class DetectedIssue10_30 {
public static org.hl7.fhir.dstu2.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.dstu3.model.DetectedIssue src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DetectedIssue tgt = new org.hl7.fhir.dstu2.model.DetectedIssue();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasPatient())
tgt.setPatient(Reference10_30.convertReference(src.getPatient()));
if (src.hasCategory())
tgt.setCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategory()));
if (src.hasSeverity())
tgt.setSeverityElement(convertDetectedIssueSeverity(src.getSeverityElement()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getImplicated()) tgt.addImplicated(Reference10_30.convertReference(t));
if (src.hasDetailElement())
tgt.setDetailElement(String10_30.convertString(src.getDetailElement()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference10_30.convertReference(src.getAuthor()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasReferenceElement())
tgt.setReferenceElement(Uri10_30.convertUri(src.getReferenceElement()));
for (org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.dstu3.model.DetectedIssue src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DetectedIssue tgt = new org.hl7.fhir.dstu2.model.DetectedIssue();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasPatient())
tgt.setPatient(Reference10_30.convertReference(src.getPatient()));
if (src.hasCategory())
tgt.setCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategory()));
if (src.hasSeverity())
tgt.setSeverityElement(convertDetectedIssueSeverity(src.getSeverityElement()));
for (org.hl7.fhir.dstu3.model.Reference t : src.getImplicated())
tgt.addImplicated(Reference10_30.convertReference(t));
if (src.hasDetailElement())
tgt.setDetailElement(String10_30.convertString(src.getDetailElement()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference10_30.convertReference(src.getAuthor()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasReferenceElement())
tgt.setReferenceElement(Uri10_30.convertUri(src.getReferenceElement()));
for (org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation())
tgt.addMitigation(convertDetectedIssueMitigationComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.dstu2.model.DetectedIssue src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DetectedIssue tgt = new org.hl7.fhir.dstu3.model.DetectedIssue();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasPatient())
tgt.setPatient(Reference10_30.convertReference(src.getPatient()));
if (src.hasCategory())
tgt.setCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategory()));
if (src.hasSeverity())
tgt.setSeverityElement(convertDetectedIssueSeverity(src.getSeverityElement()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getImplicated()) tgt.addImplicated(Reference10_30.convertReference(t));
if (src.hasDetailElement())
tgt.setDetailElement(String10_30.convertString(src.getDetailElement()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference10_30.convertReference(src.getAuthor()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasReferenceElement())
tgt.setReferenceElement(Uri10_30.convertUri(src.getReferenceElement()));
for (org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation()) tgt.addMitigation(convertDetectedIssueMitigationComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DetectedIssue convertDetectedIssue(org.hl7.fhir.dstu2.model.DetectedIssue src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DetectedIssue tgt = new org.hl7.fhir.dstu3.model.DetectedIssue();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasPatient())
tgt.setPatient(Reference10_30.convertReference(src.getPatient()));
if (src.hasCategory())
tgt.setCategory(CodeableConcept10_30.convertCodeableConcept(src.getCategory()));
if (src.hasSeverity())
tgt.setSeverityElement(convertDetectedIssueSeverity(src.getSeverityElement()));
for (org.hl7.fhir.dstu2.model.Reference t : src.getImplicated())
tgt.addImplicated(Reference10_30.convertReference(t));
if (src.hasDetailElement())
tgt.setDetailElement(String10_30.convertString(src.getDetailElement()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference10_30.convertReference(src.getAuthor()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasReferenceElement())
tgt.setReferenceElement(Uri10_30.convertUri(src.getReferenceElement()));
for (org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent t : src.getMitigation())
tgt.addMitigation(convertDetectedIssueMitigationComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent();
Element10_30.copyElement(src, tgt);
if (src.hasAction())
tgt.setAction(CodeableConcept10_30.convertCodeableConcept(src.getAction()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference10_30.convertReference(src.getAuthor()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasAction())
tgt.setAction(CodeableConcept10_30.convertCodeableConcept(src.getAction()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference10_30.convertReference(src.getAuthor()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent();
Element10_30.copyElement(src, tgt);
if (src.hasAction())
tgt.setAction(CodeableConcept10_30.convertCodeableConcept(src.getAction()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference10_30.convertReference(src.getAuthor()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent convertDetectedIssueMitigationComponent(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueMitigationComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent tgt = new org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueMitigationComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasAction())
tgt.setAction(CodeableConcept10_30.convertCodeableConcept(src.getAction()));
if (src.hasDate())
tgt.setDateElement(DateTime10_30.convertDateTime(src.getDateElement()));
if (src.hasAuthor())
tgt.setAuthor(Reference10_30.convertReference(src.getAuthor()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity> convertDetectedIssueSeverity(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverityEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case HIGH:
tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.HIGH);
break;
case MODERATE:
tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.MODERATE);
break;
case LOW:
tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.LOW);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity> convertDetectedIssueSeverity(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverityEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case HIGH:
tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.HIGH);
break;
case MODERATE:
tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.MODERATE);
break;
case LOW:
tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.LOW);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity> convertDetectedIssueSeverity(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverityEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case HIGH:
tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.HIGH);
break;
case MODERATE:
tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.MODERATE);
break;
case LOW:
tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.LOW);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity> convertDetectedIssueSeverity(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DetectedIssue.DetectedIssueSeverity> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverityEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case HIGH:
tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.HIGH);
break;
case MODERATE:
tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.MODERATE);
break;
case LOW:
tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.LOW);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DetectedIssue.DetectedIssueSeverity.NULL);
break;
}
return tgt;
}
}

View File

@ -1,7 +1,7 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Annotation10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.ContactPoint10_30;
@ -9,126 +9,129 @@ import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identi
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Uri10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class Device10_30 {
public static org.hl7.fhir.dstu2.model.Device convertDevice(org.hl7.fhir.dstu3.model.Device src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Device tgt = new org.hl7.fhir.dstu2.model.Device();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasUdi())
tgt.setUdi(src.getUdi().getDeviceIdentifier());
if (src.hasStatus())
tgt.setStatusElement(convertDeviceStatus(src.getStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasLotNumberElement())
tgt.setLotNumberElement(String10_30.convertString(src.getLotNumberElement()));
if (src.hasManufacturerElement())
tgt.setManufacturerElement(String10_30.convertString(src.getManufacturerElement()));
if (src.hasManufactureDateElement())
tgt.setManufactureDateElement(DateTime10_30.convertDateTime(src.getManufactureDateElement()));
if (src.hasExpirationDateElement())
tgt.setExpiryElement(DateTime10_30.convertDateTime(src.getExpirationDateElement()));
if (src.hasModelElement())
tgt.setModelElement(String10_30.convertString(src.getModelElement()));
if (src.hasVersionElement())
tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
if (src.hasPatient())
tgt.setPatient(Reference10_30.convertReference(src.getPatient()));
if (src.hasOwner())
tgt.setOwner(Reference10_30.convertReference(src.getOwner()));
for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getContact()) tgt.addContact(ContactPoint10_30.convertContactPoint(t));
if (src.hasLocation())
tgt.setLocation(Reference10_30.convertReference(src.getLocation()));
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(Annotation10_30.convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.Device convertDevice(org.hl7.fhir.dstu3.model.Device src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Device tgt = new org.hl7.fhir.dstu2.model.Device();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasUdi())
tgt.setUdi(src.getUdi().getDeviceIdentifier());
if (src.hasStatus())
tgt.setStatusElement(convertDeviceStatus(src.getStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasLotNumberElement())
tgt.setLotNumberElement(String10_30.convertString(src.getLotNumberElement()));
if (src.hasManufacturerElement())
tgt.setManufacturerElement(String10_30.convertString(src.getManufacturerElement()));
if (src.hasManufactureDateElement())
tgt.setManufactureDateElement(DateTime10_30.convertDateTime(src.getManufactureDateElement()));
if (src.hasExpirationDateElement())
tgt.setExpiryElement(DateTime10_30.convertDateTime(src.getExpirationDateElement()));
if (src.hasModelElement())
tgt.setModelElement(String10_30.convertString(src.getModelElement()));
if (src.hasVersionElement())
tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
if (src.hasPatient())
tgt.setPatient(Reference10_30.convertReference(src.getPatient()));
if (src.hasOwner())
tgt.setOwner(Reference10_30.convertReference(src.getOwner()));
for (org.hl7.fhir.dstu3.model.ContactPoint t : src.getContact())
tgt.addContact(ContactPoint10_30.convertContactPoint(t));
if (src.hasLocation())
tgt.setLocation(Reference10_30.convertReference(src.getLocation()));
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(Annotation10_30.convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Device convertDevice(org.hl7.fhir.dstu2.model.Device src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Device tgt = new org.hl7.fhir.dstu3.model.Device();
VersionConvertor_10_30.copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasUdi())
tgt.setUdi((new org.hl7.fhir.dstu3.model.Device.DeviceUdiComponent()).setDeviceIdentifier(src.getUdi()));
if (src.hasStatus())
tgt.setStatusElement(convertDeviceStatus(src.getStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasLotNumberElement())
tgt.setLotNumberElement(String10_30.convertString(src.getLotNumberElement()));
if (src.hasManufacturerElement())
tgt.setManufacturerElement(String10_30.convertString(src.getManufacturerElement()));
if (src.hasManufactureDateElement())
tgt.setManufactureDateElement(DateTime10_30.convertDateTime(src.getManufactureDateElement()));
if (src.hasExpiryElement())
tgt.setExpirationDateElement(DateTime10_30.convertDateTime(src.getExpiryElement()));
if (src.hasModelElement())
tgt.setModelElement(String10_30.convertString(src.getModelElement()));
if (src.hasVersionElement())
tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
if (src.hasPatient())
tgt.setPatient(Reference10_30.convertReference(src.getPatient()));
if (src.hasOwner())
tgt.setOwner(Reference10_30.convertReference(src.getOwner()));
for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getContact()) tgt.addContact(ContactPoint10_30.convertContactPoint(t));
if (src.hasLocation())
tgt.setLocation(Reference10_30.convertReference(src.getLocation()));
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
for (org.hl7.fhir.dstu2.model.Annotation t : src.getNote()) tgt.addNote(Annotation10_30.convertAnnotation(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.Device convertDevice(org.hl7.fhir.dstu2.model.Device src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Device tgt = new org.hl7.fhir.dstu3.model.Device();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
if (src.hasUdi())
tgt.setUdi((new org.hl7.fhir.dstu3.model.Device.DeviceUdiComponent()).setDeviceIdentifier(src.getUdi()));
if (src.hasStatus())
tgt.setStatusElement(convertDeviceStatus(src.getStatusElement()));
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasLotNumberElement())
tgt.setLotNumberElement(String10_30.convertString(src.getLotNumberElement()));
if (src.hasManufacturerElement())
tgt.setManufacturerElement(String10_30.convertString(src.getManufacturerElement()));
if (src.hasManufactureDateElement())
tgt.setManufactureDateElement(DateTime10_30.convertDateTime(src.getManufactureDateElement()));
if (src.hasExpiryElement())
tgt.setExpirationDateElement(DateTime10_30.convertDateTime(src.getExpiryElement()));
if (src.hasModelElement())
tgt.setModelElement(String10_30.convertString(src.getModelElement()));
if (src.hasVersionElement())
tgt.setVersionElement(String10_30.convertString(src.getVersionElement()));
if (src.hasPatient())
tgt.setPatient(Reference10_30.convertReference(src.getPatient()));
if (src.hasOwner())
tgt.setOwner(Reference10_30.convertReference(src.getOwner()));
for (org.hl7.fhir.dstu2.model.ContactPoint t : src.getContact())
tgt.addContact(ContactPoint10_30.convertContactPoint(t));
if (src.hasLocation())
tgt.setLocation(Reference10_30.convertReference(src.getLocation()));
if (src.hasUrlElement())
tgt.setUrlElement(Uri10_30.convertUri(src.getUrlElement()));
for (org.hl7.fhir.dstu2.model.Annotation t : src.getNote()) tgt.addNote(Annotation10_30.convertAnnotation(t));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus> convertDeviceStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Device.DeviceStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case AVAILABLE:
tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.ACTIVE);
break;
case NOTAVAILABLE:
tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.INACTIVE);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus> convertDeviceStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Device.DeviceStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case AVAILABLE:
tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.ACTIVE);
break;
case NOTAVAILABLE:
tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.INACTIVE);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Device.DeviceStatus> convertDeviceStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Device.DeviceStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Device.DeviceStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.AVAILABLE);
break;
case INACTIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.NOTAVAILABLE);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Device.DeviceStatus> convertDeviceStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Device.FHIRDeviceStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Device.DeviceStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Device.DeviceStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case ACTIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.AVAILABLE);
break;
case INACTIVE:
tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.NOTAVAILABLE);
break;
case ENTEREDINERROR:
tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.ENTEREDINERROR);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.Device.DeviceStatus.NULL);
break;
}
return tgt;
}
}

View File

@ -1,185 +1,188 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.String10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class DeviceComponent10_30 {
public static org.hl7.fhir.dstu2.model.DeviceComponent convertDeviceComponent(org.hl7.fhir.dstu3.model.DeviceComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DeviceComponent tgt = new org.hl7.fhir.dstu2.model.DeviceComponent();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasLastSystemChangeElement())
tgt.setLastSystemChangeElement(Instant10_30.convertInstant(src.getLastSystemChangeElement()));
if (src.hasSource())
tgt.setSource(Reference10_30.convertReference(src.getSource()));
if (src.hasParent())
tgt.setParent(Reference10_30.convertReference(src.getParent()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getOperationalStatus()) tgt.addOperationalStatus(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasParameterGroup())
tgt.setParameterGroup(CodeableConcept10_30.convertCodeableConcept(src.getParameterGroup()));
if (src.hasMeasurementPrinciple())
tgt.setMeasurementPrincipleElement(convertMeasmntPrinciple(src.getMeasurementPrincipleElement()));
for (org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent t : src.getProductionSpecification()) tgt.addProductionSpecification(convertDeviceComponentProductionSpecificationComponent(t));
if (src.hasLanguageCode())
tgt.setLanguageCode(CodeableConcept10_30.convertCodeableConcept(src.getLanguageCode()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DeviceComponent convertDeviceComponent(org.hl7.fhir.dstu3.model.DeviceComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DeviceComponent tgt = new org.hl7.fhir.dstu2.model.DeviceComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasLastSystemChangeElement())
tgt.setLastSystemChangeElement(Instant10_30.convertInstant(src.getLastSystemChangeElement()));
if (src.hasSource())
tgt.setSource(Reference10_30.convertReference(src.getSource()));
if (src.hasParent())
tgt.setParent(Reference10_30.convertReference(src.getParent()));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getOperationalStatus())
tgt.addOperationalStatus(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasParameterGroup())
tgt.setParameterGroup(CodeableConcept10_30.convertCodeableConcept(src.getParameterGroup()));
if (src.hasMeasurementPrinciple())
tgt.setMeasurementPrincipleElement(convertMeasmntPrinciple(src.getMeasurementPrincipleElement()));
for (org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent t : src.getProductionSpecification())
tgt.addProductionSpecification(convertDeviceComponentProductionSpecificationComponent(t));
if (src.hasLanguageCode())
tgt.setLanguageCode(CodeableConcept10_30.convertCodeableConcept(src.getLanguageCode()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DeviceComponent convertDeviceComponent(org.hl7.fhir.dstu2.model.DeviceComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DeviceComponent tgt = new org.hl7.fhir.dstu3.model.DeviceComponent();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasLastSystemChangeElement())
tgt.setLastSystemChangeElement(Instant10_30.convertInstant(src.getLastSystemChangeElement()));
if (src.hasSource())
tgt.setSource(Reference10_30.convertReference(src.getSource()));
if (src.hasParent())
tgt.setParent(Reference10_30.convertReference(src.getParent()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getOperationalStatus()) tgt.addOperationalStatus(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasParameterGroup())
tgt.setParameterGroup(CodeableConcept10_30.convertCodeableConcept(src.getParameterGroup()));
if (src.hasMeasurementPrinciple())
tgt.setMeasurementPrincipleElement(convertMeasmntPrinciple(src.getMeasurementPrincipleElement()));
for (org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProductionSpecificationComponent t : src.getProductionSpecification()) tgt.addProductionSpecification(convertDeviceComponentProductionSpecificationComponent(t));
if (src.hasLanguageCode())
tgt.setLanguageCode(CodeableConcept10_30.convertCodeableConcept(src.getLanguageCode()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DeviceComponent convertDeviceComponent(org.hl7.fhir.dstu2.model.DeviceComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DeviceComponent tgt = new org.hl7.fhir.dstu3.model.DeviceComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasLastSystemChangeElement())
tgt.setLastSystemChangeElement(Instant10_30.convertInstant(src.getLastSystemChangeElement()));
if (src.hasSource())
tgt.setSource(Reference10_30.convertReference(src.getSource()));
if (src.hasParent())
tgt.setParent(Reference10_30.convertReference(src.getParent()));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getOperationalStatus())
tgt.addOperationalStatus(CodeableConcept10_30.convertCodeableConcept(t));
if (src.hasParameterGroup())
tgt.setParameterGroup(CodeableConcept10_30.convertCodeableConcept(src.getParameterGroup()));
if (src.hasMeasurementPrinciple())
tgt.setMeasurementPrincipleElement(convertMeasmntPrinciple(src.getMeasurementPrincipleElement()));
for (org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProductionSpecificationComponent t : src.getProductionSpecification())
tgt.addProductionSpecification(convertDeviceComponentProductionSpecificationComponent(t));
if (src.hasLanguageCode())
tgt.setLanguageCode(CodeableConcept10_30.convertCodeableConcept(src.getLanguageCode()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent convertDeviceComponentProductionSpecificationComponent(org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProductionSpecificationComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent tgt = new org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent();
Element10_30.copyElement(src, tgt);
if (src.hasSpecType())
tgt.setSpecType(CodeableConcept10_30.convertCodeableConcept(src.getSpecType()));
if (src.hasComponentId())
tgt.setComponentId(Identifier10_30.convertIdentifier(src.getComponentId()));
if (src.hasProductionSpecElement())
tgt.setProductionSpecElement(String10_30.convertString(src.getProductionSpecElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent convertDeviceComponentProductionSpecificationComponent(org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProductionSpecificationComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent tgt = new org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasSpecType())
tgt.setSpecType(CodeableConcept10_30.convertCodeableConcept(src.getSpecType()));
if (src.hasComponentId())
tgt.setComponentId(Identifier10_30.convertIdentifier(src.getComponentId()));
if (src.hasProductionSpecElement())
tgt.setProductionSpecElement(String10_30.convertString(src.getProductionSpecElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProductionSpecificationComponent convertDeviceComponentProductionSpecificationComponent(org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProductionSpecificationComponent tgt = new org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProductionSpecificationComponent();
Element10_30.copyElement(src, tgt);
if (src.hasSpecType())
tgt.setSpecType(CodeableConcept10_30.convertCodeableConcept(src.getSpecType()));
if (src.hasComponentId())
tgt.setComponentId(Identifier10_30.convertIdentifier(src.getComponentId()));
if (src.hasProductionSpecElement())
tgt.setProductionSpecElement(String10_30.convertString(src.getProductionSpecElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProductionSpecificationComponent convertDeviceComponentProductionSpecificationComponent(org.hl7.fhir.dstu3.model.DeviceComponent.DeviceComponentProductionSpecificationComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProductionSpecificationComponent tgt = new org.hl7.fhir.dstu2.model.DeviceComponent.DeviceComponentProductionSpecificationComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasSpecType())
tgt.setSpecType(CodeableConcept10_30.convertCodeableConcept(src.getSpecType()));
if (src.hasComponentId())
tgt.setComponentId(Identifier10_30.convertIdentifier(src.getComponentId()));
if (src.hasProductionSpecElement())
tgt.setProductionSpecElement(String10_30.convertString(src.getProductionSpecElement()));
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple> convertMeasmntPrinciple(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrincipleEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case OTHER:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.OTHER);
break;
case CHEMICAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.CHEMICAL);
break;
case ELECTRICAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.ELECTRICAL);
break;
case IMPEDANCE:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.IMPEDANCE);
break;
case NUCLEAR:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.NUCLEAR);
break;
case OPTICAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.OPTICAL);
break;
case THERMAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.THERMAL);
break;
case BIOLOGICAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.BIOLOGICAL);
break;
case MECHANICAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.MECHANICAL);
break;
case ACOUSTICAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.ACOUSTICAL);
break;
case MANUAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.MANUAL);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple> convertMeasmntPrinciple(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrincipleEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case OTHER:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.OTHER);
break;
case CHEMICAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.CHEMICAL);
break;
case ELECTRICAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.ELECTRICAL);
break;
case IMPEDANCE:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.IMPEDANCE);
break;
case NUCLEAR:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.NUCLEAR);
break;
case OPTICAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.OPTICAL);
break;
case THERMAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.THERMAL);
break;
case BIOLOGICAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.BIOLOGICAL);
break;
case MECHANICAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.MECHANICAL);
break;
case ACOUSTICAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.ACOUSTICAL);
break;
case MANUAL:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.MANUAL);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple> convertMeasmntPrinciple(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrincipleEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case OTHER:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.OTHER);
break;
case CHEMICAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.CHEMICAL);
break;
case ELECTRICAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.ELECTRICAL);
break;
case IMPEDANCE:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.IMPEDANCE);
break;
case NUCLEAR:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.NUCLEAR);
break;
case OPTICAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.OPTICAL);
break;
case THERMAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.THERMAL);
break;
case BIOLOGICAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.BIOLOGICAL);
break;
case MECHANICAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.MECHANICAL);
break;
case ACOUSTICAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.ACOUSTICAL);
break;
case MANUAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.MANUAL);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple> convertMeasmntPrinciple(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceComponent.MeasmntPrinciple> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrincipleEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case OTHER:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.OTHER);
break;
case CHEMICAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.CHEMICAL);
break;
case ELECTRICAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.ELECTRICAL);
break;
case IMPEDANCE:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.IMPEDANCE);
break;
case NUCLEAR:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.NUCLEAR);
break;
case OPTICAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.OPTICAL);
break;
case THERMAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.THERMAL);
break;
case BIOLOGICAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.BIOLOGICAL);
break;
case MECHANICAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.MECHANICAL);
break;
case ACOUSTICAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.ACOUSTICAL);
break;
case MANUAL:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.MANUAL);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceComponent.MeasmntPrinciple.NULL);
break;
}
return tgt;
}
}

View File

@ -1,363 +1,364 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Element10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Timing10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.Instant10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.exceptions.FHIRException;
public class DeviceMetric10_30 {
public static org.hl7.fhir.dstu2.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.dstu3.model.DeviceMetric src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DeviceMetric tgt = new org.hl7.fhir.dstu2.model.DeviceMetric();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasUnit())
tgt.setUnit(CodeableConcept10_30.convertCodeableConcept(src.getUnit()));
if (src.hasSource())
tgt.setSource(Reference10_30.convertReference(src.getSource()));
if (src.hasParent())
tgt.setParent(Reference10_30.convertReference(src.getParent()));
if (src.hasOperationalStatus())
tgt.setOperationalStatusElement(convertDeviceMetricOperationalStatus(src.getOperationalStatusElement()));
if (src.hasColor())
tgt.setColorElement(convertDeviceMetricColor(src.getColorElement()));
if (src.hasCategory())
tgt.setCategoryElement(convertDeviceMetricCategory(src.getCategoryElement()));
if (src.hasMeasurementPeriod())
tgt.setMeasurementPeriod(Timing10_30.convertTiming(src.getMeasurementPeriod()));
for (org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.dstu3.model.DeviceMetric src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DeviceMetric tgt = new org.hl7.fhir.dstu2.model.DeviceMetric();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasUnit())
tgt.setUnit(CodeableConcept10_30.convertCodeableConcept(src.getUnit()));
if (src.hasSource())
tgt.setSource(Reference10_30.convertReference(src.getSource()));
if (src.hasParent())
tgt.setParent(Reference10_30.convertReference(src.getParent()));
if (src.hasOperationalStatus())
tgt.setOperationalStatusElement(convertDeviceMetricOperationalStatus(src.getOperationalStatusElement()));
if (src.hasColor())
tgt.setColorElement(convertDeviceMetricColor(src.getColorElement()));
if (src.hasCategory())
tgt.setCategoryElement(convertDeviceMetricCategory(src.getCategoryElement()));
if (src.hasMeasurementPeriod())
tgt.setMeasurementPeriod(Timing10_30.convertTiming(src.getMeasurementPeriod()));
for (org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration())
tgt.addCalibration(convertDeviceMetricCalibrationComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.dstu2.model.DeviceMetric src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DeviceMetric tgt = new org.hl7.fhir.dstu3.model.DeviceMetric();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasUnit())
tgt.setUnit(CodeableConcept10_30.convertCodeableConcept(src.getUnit()));
if (src.hasSource())
tgt.setSource(Reference10_30.convertReference(src.getSource()));
if (src.hasParent())
tgt.setParent(Reference10_30.convertReference(src.getParent()));
if (src.hasOperationalStatus())
tgt.setOperationalStatusElement(convertDeviceMetricOperationalStatus(src.getOperationalStatusElement()));
if (src.hasColor())
tgt.setColorElement(convertDeviceMetricColor(src.getColorElement()));
if (src.hasCategory())
tgt.setCategoryElement(convertDeviceMetricCategory(src.getCategoryElement()));
if (src.hasMeasurementPeriod())
tgt.setMeasurementPeriod(Timing10_30.convertTiming(src.getMeasurementPeriod()));
for (org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration()) tgt.addCalibration(convertDeviceMetricCalibrationComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DeviceMetric convertDeviceMetric(org.hl7.fhir.dstu2.model.DeviceMetric src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DeviceMetric tgt = new org.hl7.fhir.dstu3.model.DeviceMetric();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasType())
tgt.setType(CodeableConcept10_30.convertCodeableConcept(src.getType()));
if (src.hasIdentifier())
tgt.setIdentifier(Identifier10_30.convertIdentifier(src.getIdentifier()));
if (src.hasUnit())
tgt.setUnit(CodeableConcept10_30.convertCodeableConcept(src.getUnit()));
if (src.hasSource())
tgt.setSource(Reference10_30.convertReference(src.getSource()));
if (src.hasParent())
tgt.setParent(Reference10_30.convertReference(src.getParent()));
if (src.hasOperationalStatus())
tgt.setOperationalStatusElement(convertDeviceMetricOperationalStatus(src.getOperationalStatusElement()));
if (src.hasColor())
tgt.setColorElement(convertDeviceMetricColor(src.getColorElement()));
if (src.hasCategory())
tgt.setCategoryElement(convertDeviceMetricCategory(src.getCategoryElement()));
if (src.hasMeasurementPeriod())
tgt.setMeasurementPeriod(Timing10_30.convertTiming(src.getMeasurementPeriod()));
for (org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent t : src.getCalibration())
tgt.addCalibration(convertDeviceMetricCalibrationComponent(t));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent();
Element10_30.copyElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertDeviceMetricCalibrationType(src.getTypeElement()));
if (src.hasState())
tgt.setStateElement(convertDeviceMetricCalibrationState(src.getStateElement()));
if (src.hasTimeElement())
tgt.setTimeElement(Instant10_30.convertInstant(src.getTimeElement()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertDeviceMetricCalibrationType(src.getTypeElement()));
if (src.hasState())
tgt.setStateElement(convertDeviceMetricCalibrationState(src.getStateElement()));
if (src.hasTimeElement())
tgt.setTimeElement(Instant10_30.convertInstant(src.getTimeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent();
Element10_30.copyElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertDeviceMetricCalibrationType(src.getTypeElement()));
if (src.hasState())
tgt.setStateElement(convertDeviceMetricCalibrationState(src.getStateElement()));
if (src.hasTimeElement())
tgt.setTimeElement(Instant10_30.convertInstant(src.getTimeElement()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent convertDeviceMetricCalibrationComponent(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationComponent src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent tgt = new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationComponent();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
if (src.hasType())
tgt.setTypeElement(convertDeviceMetricCalibrationType(src.getTypeElement()));
if (src.hasState())
tgt.setStateElement(convertDeviceMetricCalibrationState(src.getStateElement()));
if (src.hasTimeElement())
tgt.setTimeElement(Instant10_30.convertInstant(src.getTimeElement()));
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState> convertDeviceMetricCalibrationState(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case NOTCALIBRATED:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED);
break;
case CALIBRATIONREQUIRED:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED);
break;
case CALIBRATED:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED);
break;
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState> convertDeviceMetricCalibrationState(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case NOTCALIBRATED:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED);
break;
case CALIBRATIONREQUIRED:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED);
break;
case CALIBRATED:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED);
break;
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState> convertDeviceMetricCalibrationState(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case NOTCALIBRATED:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED);
break;
case CALIBRATIONREQUIRED:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED);
break;
case CALIBRATED:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED);
break;
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState> convertDeviceMetricCalibrationState(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationState> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationStateEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case NOTCALIBRATED:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.NOTCALIBRATED);
break;
case CALIBRATIONREQUIRED:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATIONREQUIRED);
break;
case CALIBRATED:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.CALIBRATED);
break;
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.UNSPECIFIED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationState.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType> convertDeviceMetricCalibrationType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED);
break;
case OFFSET:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET);
break;
case GAIN:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.GAIN);
break;
case TWOPOINT:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType> convertDeviceMetricCalibrationType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED);
break;
case OFFSET:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET);
break;
case GAIN:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.GAIN);
break;
case TWOPOINT:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType> convertDeviceMetricCalibrationType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED);
break;
case OFFSET:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET);
break;
case GAIN:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.GAIN);
break;
case TWOPOINT:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType> convertDeviceMetricCalibrationType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCalibrationType> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationTypeEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.UNSPECIFIED);
break;
case OFFSET:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.OFFSET);
break;
case GAIN:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.GAIN);
break;
case TWOPOINT:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.TWOPOINT);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCalibrationType.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory> convertDeviceMetricCategory(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategoryEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case MEASUREMENT:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT);
break;
case SETTING:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.SETTING);
break;
case CALCULATION:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.CALCULATION);
break;
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory> convertDeviceMetricCategory(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategoryEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case MEASUREMENT:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT);
break;
case SETTING:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.SETTING);
break;
case CALCULATION:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.CALCULATION);
break;
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory> convertDeviceMetricCategory(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategoryEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case MEASUREMENT:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT);
break;
case SETTING:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.SETTING);
break;
case CALCULATION:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.CALCULATION);
break;
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory> convertDeviceMetricCategory(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricCategory> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategoryEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case MEASUREMENT:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.MEASUREMENT);
break;
case SETTING:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.SETTING);
break;
case CALCULATION:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.CALCULATION);
break;
case UNSPECIFIED:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.UNSPECIFIED);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricCategory.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor> convertDeviceMetricColor(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColorEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case BLACK:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.BLACK);
break;
case RED:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.RED);
break;
case GREEN:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.GREEN);
break;
case YELLOW:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.YELLOW);
break;
case BLUE:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.BLUE);
break;
case MAGENTA:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.MAGENTA);
break;
case CYAN:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.CYAN);
break;
case WHITE:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.WHITE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor> convertDeviceMetricColor(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColorEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case BLACK:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.BLACK);
break;
case RED:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.RED);
break;
case GREEN:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.GREEN);
break;
case YELLOW:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.YELLOW);
break;
case BLUE:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.BLUE);
break;
case MAGENTA:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.MAGENTA);
break;
case CYAN:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.CYAN);
break;
case WHITE:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.WHITE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor> convertDeviceMetricColor(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColorEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case BLACK:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.BLACK);
break;
case RED:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.RED);
break;
case GREEN:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.GREEN);
break;
case YELLOW:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.YELLOW);
break;
case BLUE:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.BLUE);
break;
case MAGENTA:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.MAGENTA);
break;
case CYAN:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.CYAN);
break;
case WHITE:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.WHITE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor> convertDeviceMetricColor(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricColor> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColorEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case BLACK:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.BLACK);
break;
case RED:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.RED);
break;
case GREEN:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.GREEN);
break;
case YELLOW:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.YELLOW);
break;
case BLUE:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.BLUE);
break;
case MAGENTA:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.MAGENTA);
break;
case CYAN:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.CYAN);
break;
case WHITE:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.WHITE);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricColor.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus> convertDeviceMetricOperationalStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case ON:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.ON);
break;
case OFF:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.OFF);
break;
case STANDBY:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus> convertDeviceMetricOperationalStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case ON:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.ON);
break;
case OFF:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.OFF);
break;
case STANDBY:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus.NULL);
break;
}
return tgt;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus> convertDeviceMetricOperationalStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory());
Element10_30.copyElement(src, tgt);
switch(src.getValue()) {
case ON:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.ON);
break;
case OFF:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.OFF);
break;
case STANDBY:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.NULL);
break;
}
return tgt;
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus> convertDeviceMetricOperationalStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DeviceMetric.DeviceMetricOperationalStatus> src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatusEnumFactory());
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
switch (src.getValue()) {
case ON:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.ON);
break;
case OFF:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.OFF);
break;
case STANDBY:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.STANDBY);
break;
default:
tgt.setValue(org.hl7.fhir.dstu3.model.DeviceMetric.DeviceMetricOperationalStatus.NULL);
break;
}
return tgt;
}
}

View File

@ -1,60 +1,63 @@
package org.hl7.fhir.convertors.conv10_30.resources10_30;
import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Type10_30;
import org.hl7.fhir.convertors.context.ConversionContext10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.CodeableConcept10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Identifier10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.complextypes10_30.Period10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.primitivetypes10_30.DateTime10_30;
import org.hl7.fhir.convertors.conv10_30.datatypes10_30.Reference10_30;
import org.hl7.fhir.dstu3.model.Annotation;
import org.hl7.fhir.exceptions.FHIRException;
public class DeviceUseStatement10_30 {
public static org.hl7.fhir.dstu2.model.DeviceUseStatement convertDeviceUseStatement(org.hl7.fhir.dstu3.model.DeviceUseStatement src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DeviceUseStatement tgt = new org.hl7.fhir.dstu2.model.DeviceUseStatement();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasBodySite())
tgt.setBodySite(Type10_30.convertType(src.getBodySite()));
if (src.hasWhenUsed())
tgt.setWhenUsed(Period10_30.convertPeriod(src.getWhenUsed()));
if (src.hasDevice())
tgt.setDevice(Reference10_30.convertReference(src.getDevice()));
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getIndication()) tgt.addIndication(CodeableConcept10_30.convertCodeableConcept(t));
for (Annotation t : src.getNote()) tgt.addNotes(t.getText());
if (src.hasRecordedOnElement())
tgt.setRecordedOnElement(DateTime10_30.convertDateTime(src.getRecordedOnElement()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasTiming())
tgt.setTiming(Type10_30.convertType(src.getTiming()));
return tgt;
}
public static org.hl7.fhir.dstu2.model.DeviceUseStatement convertDeviceUseStatement(org.hl7.fhir.dstu3.model.DeviceUseStatement src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu2.model.DeviceUseStatement tgt = new org.hl7.fhir.dstu2.model.DeviceUseStatement();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasBodySite())
tgt.setBodySite(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getBodySite()));
if (src.hasWhenUsed())
tgt.setWhenUsed(Period10_30.convertPeriod(src.getWhenUsed()));
if (src.hasDevice())
tgt.setDevice(Reference10_30.convertReference(src.getDevice()));
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getIndication())
tgt.addIndication(CodeableConcept10_30.convertCodeableConcept(t));
for (Annotation t : src.getNote()) tgt.addNotes(t.getText());
if (src.hasRecordedOnElement())
tgt.setRecordedOnElement(DateTime10_30.convertDateTime(src.getRecordedOnElement()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasTiming())
tgt.setTiming(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getTiming()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DeviceUseStatement convertDeviceUseStatement(org.hl7.fhir.dstu2.model.DeviceUseStatement src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DeviceUseStatement tgt = new org.hl7.fhir.dstu3.model.DeviceUseStatement();
VersionConvertor_10_30.copyDomainResource(src, tgt);
if (src.hasBodySiteCodeableConcept())
tgt.setBodySite(CodeableConcept10_30.convertCodeableConcept(src.getBodySiteCodeableConcept()));
if (src.hasWhenUsed())
tgt.setWhenUsed(Period10_30.convertPeriod(src.getWhenUsed()));
if (src.hasDevice())
tgt.setDevice(Reference10_30.convertReference(src.getDevice()));
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getIndication()) tgt.addIndication(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu2.model.StringType t : src.getNotes()) tgt.addNote().setText(t.getValue());
if (src.hasRecordedOnElement())
tgt.setRecordedOnElement(DateTime10_30.convertDateTime(src.getRecordedOnElement()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasTiming())
tgt.setTiming(Type10_30.convertType(src.getTiming()));
return tgt;
}
public static org.hl7.fhir.dstu3.model.DeviceUseStatement convertDeviceUseStatement(org.hl7.fhir.dstu2.model.DeviceUseStatement src) throws FHIRException {
if (src == null || src.isEmpty())
return null;
org.hl7.fhir.dstu3.model.DeviceUseStatement tgt = new org.hl7.fhir.dstu3.model.DeviceUseStatement();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyDomainResource(src, tgt);
if (src.hasBodySiteCodeableConcept())
tgt.setBodySite(CodeableConcept10_30.convertCodeableConcept(src.getBodySiteCodeableConcept()));
if (src.hasWhenUsed())
tgt.setWhenUsed(Period10_30.convertPeriod(src.getWhenUsed()));
if (src.hasDevice())
tgt.setDevice(Reference10_30.convertReference(src.getDevice()));
for (org.hl7.fhir.dstu2.model.Identifier t : src.getIdentifier())
tgt.addIdentifier(Identifier10_30.convertIdentifier(t));
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getIndication())
tgt.addIndication(CodeableConcept10_30.convertCodeableConcept(t));
for (org.hl7.fhir.dstu2.model.StringType t : src.getNotes()) tgt.addNote().setText(t.getValue());
if (src.hasRecordedOnElement())
tgt.setRecordedOnElement(DateTime10_30.convertDateTime(src.getRecordedOnElement()));
if (src.hasSubject())
tgt.setSubject(Reference10_30.convertReference(src.getSubject()));
if (src.hasTiming())
tgt.setTiming(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertType(src.getTiming()));
return tgt;
}
}

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