Merge branch 'hapifhir:master' into master
This commit is contained in:
commit
a63b2b2515
|
@ -304,3 +304,4 @@ local.properties
|
|||
/org.hl7.fhir.r5/src/test/resources/snapshot-generation/logical2-actual.xml
|
||||
/org.hl7.fhir.r5.new
|
||||
/org.hl7.fhir.r5.newc
|
||||
/org.hl7.fhir.r4b.new
|
||||
|
|
26
README.md
26
README.md
|
@ -9,6 +9,7 @@ included in this repo:
|
|||
|
||||
* org.fhir.fhir.utilities: Shared code used by all the other projects - including the internationalization code
|
||||
* org.fhir.fhir.r5: Object models and utilities for R5 candidate (will change regularly as new R5 candidates are released)
|
||||
* org.fhir.fhir.r4b: Object models and utilities for R4B
|
||||
* org.fhir.fhir.r4: Object models and utilities for R4
|
||||
* org.fhir.fhir.dstu3: Object models and utilities for STU3
|
||||
* org.fhir.fhir.dstu2: Object models and utilities for STU2
|
||||
|
@ -42,12 +43,34 @@ This project uses [Apache Maven](http://maven.apache.org) to build. To build:
|
|||
```
|
||||
mvn install
|
||||
```
|
||||
Note that unit tests will run, but are currently not set to fail the build as they do not all pass. This is being worked on.
|
||||
_Note that unit tests will run, but are currently not set to fail the build as they do not all pass. This is being worked on._
|
||||
|
||||
To skip unit tests:
|
||||
```
|
||||
mvn -Dmaven.test.skip install
|
||||
```
|
||||
|
||||
To clean and rebuild the terminology server caches.
|
||||
|
||||
_clean_
|
||||
```
|
||||
mvn clean -Dfhir.txcache.clean=true
|
||||
```
|
||||
|
||||
_rebuild_
|
||||
```
|
||||
mvn test -Dfhir.txcache.rebuild=true
|
||||
```
|
||||
|
||||
_The source contains cached terminology server responses for testing. If the expected responses have changed in any way,
|
||||
this cache should be cleaned and rebuilt with the above so that subsequent `mvn test` calls will have the most current
|
||||
responses cached._
|
||||
|
||||
#### IDE Setup
|
||||
|
||||
This project uses the [Lombok](https://projectlombok.org/) java library, which requires some configuration to work correctly with an IDE. Currently, the
|
||||
project works in Intellij and Eclipse, and you can find instructions on how to configure Lombok for each [here](https://www.baeldung.com/lombok-ide).
|
||||
|
||||
### Publishing Binaries
|
||||
|
||||
An brief overview of our publishing process is [here][Link-Publishing].
|
||||
|
@ -161,6 +184,7 @@ compile group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-structures-r4', version: '(l
|
|||
compile group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-structures-r5', version: '(latest version)'
|
||||
```
|
||||
|
||||
Note that the built binary validator is released through GitHub releases.
|
||||
### Maintenance
|
||||
This project is maintained by [Grahame Grieve][Link-grahameGithub], [James Agnew][Link-jamesGithub] and [Mark Iantorno][Link-markGithub] on behalf of the FHIR community.
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
## Validator Changes
|
||||
|
||||
* no changes
|
||||
|
||||
## Other code changes
|
||||
|
||||
* no changes
|
|
@ -0,0 +1,7 @@
|
|||
## Validator Changes
|
||||
|
||||
* no changes
|
||||
|
||||
## Other code changes
|
||||
|
||||
* no changes
|
|
@ -1,6 +1,15 @@
|
|||
# Resource Conversion
|
||||
|
||||
##### Let's talk about converting resources between the various versions of FHIR...
|
||||
## IMPORTANT
|
||||
-----
|
||||
|
||||
_The conversion code in this module is maintained as part of the development of the standard, but always under
|
||||
considerable time pressure. Only part of the code is rigorously tested [as detailed here](#reliable-conversion-code).
|
||||
Implementers should regard this code as a 'scaffold' for actual reliable conversions._
|
||||
|
||||
**ALWAYS TEST ANY CONVERSION ROUTINES BEFORE USING THEM IN PRODUCTION!**
|
||||
|
||||
_Ideally, this should be via unit tests in your code, or better yet [unit tests contributed to FHIR](#test-cases)._
|
||||
|
||||
### A note regarding syntax
|
||||
|
||||
|
@ -31,7 +40,7 @@ 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
|
||||
## Using the conversion library
|
||||
|
||||
-----
|
||||
The majority of use cases for conversion will involve using the provided VersionConvertorFactory_V1_V2 classes to convert
|
||||
|
@ -193,3 +202,31 @@ Once you've created your new advisor, they can be provided as an argument when c
|
|||
`public static (V1 Resource) convertResource((V2 Resource) src, <T extends BaseAdvisor> advisor)`
|
||||
|
||||
`public static (V2 Resource) convertResource((V1 Resource) src, <T extends BaseAdvisor> advisor)`
|
||||
|
||||
## Development notes
|
||||
-----
|
||||
|
||||
### Reliable conversion code
|
||||
|
||||
The FHIR project maintains and tests conversions on the following resources, from old versions to R5:
|
||||
|
||||
- CodeSystem
|
||||
- ValueSet
|
||||
- ConceptMap
|
||||
- StructureDefinition
|
||||
- StructureMap
|
||||
- ImplementationGuide
|
||||
- CapabilityStatement
|
||||
- OperationDefinition
|
||||
- NamingSystem
|
||||
|
||||
These can be relied on and are subject to extensive testing.
|
||||
|
||||
### Test cases
|
||||
|
||||
Some conversions have test cases for particular resources and particular version combinations. Where test cases exist,
|
||||
they will continue to be maintained and expected to pass.
|
||||
|
||||
Contributing test cases is highly encouraged! To contribute, create a PRs to the
|
||||
[core library](https://github.com/hapifhir/org.hl7.fhir.core), or even better, to the
|
||||
[FHIR test cases library](https://github.com/FHIR/fhir-test-cases).
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>5.6.16-SNAPSHOT</version>
|
||||
<version>5.6.36-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -59,6 +59,11 @@
|
|||
<artifactId>org.hl7.fhir.r4</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.r4b</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.r5</artifactId>
|
||||
|
|
|
@ -0,0 +1,188 @@
|
|||
package org.hl7.fhir.convertors.analytics;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.utilities.SimpleHTTPClient;
|
||||
import org.hl7.fhir.utilities.TextFile;
|
||||
import org.hl7.fhir.utilities.SimpleHTTPClient.HTTPResult;
|
||||
import org.hl7.fhir.utilities.json.JSONUtil;
|
||||
import org.hl7.fhir.utilities.json.JsonTrackingParser;
|
||||
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
|
||||
import org.hl7.fhir.utilities.npm.NpmPackage;
|
||||
import org.hl7.fhir.utilities.npm.PackageClient;
|
||||
import org.hl7.fhir.utilities.npm.PackageInfo;
|
||||
import org.hl7.fhir.utilities.npm.ToolsVersion;
|
||||
import org.hl7.fhir.utilities.xml.XMLUtil;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
public class PackageVisitor {
|
||||
|
||||
public interface IPackageVisitorProcessor {
|
||||
public void processResource(String pid, String version, String type, byte[] content) throws FHIRException;
|
||||
}
|
||||
|
||||
private List<String> resourceTypes = new ArrayList<>();
|
||||
private List<String> versions = new ArrayList<>();
|
||||
private boolean corePackages;
|
||||
private boolean oldVersions;
|
||||
private IPackageVisitorProcessor processor;
|
||||
private FilesystemPackageCacheManager pcm;
|
||||
private PackageClient pc;
|
||||
|
||||
public List<String> getResourceTypes() {
|
||||
return resourceTypes;
|
||||
}
|
||||
|
||||
public void setResourceTypes(List<String> resourceTypes) {
|
||||
this.resourceTypes = resourceTypes;
|
||||
}
|
||||
|
||||
public List<String> getVersions() {
|
||||
return versions;
|
||||
}
|
||||
|
||||
public void setVersions(List<String> versions) {
|
||||
this.versions = versions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean isCorePackages() {
|
||||
return corePackages;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void setCorePackages(boolean corePackages) {
|
||||
this.corePackages = corePackages;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean isOldVersions() {
|
||||
return oldVersions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void setOldVersions(boolean oldVersions) {
|
||||
this.oldVersions = oldVersions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public IPackageVisitorProcessor getProcessor() {
|
||||
return processor;
|
||||
}
|
||||
|
||||
public void setProcessor(IPackageVisitorProcessor processor) {
|
||||
this.processor = processor;
|
||||
}
|
||||
|
||||
public void visitPackages() throws IOException, ParserConfigurationException, SAXException {
|
||||
System.out.println("Finding packages");
|
||||
pc = new PackageClient(PackageClient.PRIMARY_SERVER);
|
||||
pcm = new FilesystemPackageCacheManager(true, ToolsVersion.TOOLS_VERSION);
|
||||
Set<String> pidList = getAllPackages();
|
||||
System.out.println("Go: "+pidList.size()+" packages");
|
||||
for (String pid : pidList) {
|
||||
List<String> vList = listVersions(pid);
|
||||
if (oldVersions) {
|
||||
for (String v : vList) {
|
||||
processPackage(pid, v);
|
||||
}
|
||||
} else if (vList.isEmpty()) {
|
||||
System.out.println("No Packages for "+pid);
|
||||
} else {
|
||||
processPackage(pid, vList.get(vList.size() - 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> listVersions(String pid) throws IOException {
|
||||
List<String> list = new ArrayList<>();
|
||||
if (pid !=null) {
|
||||
for (PackageInfo i : pc.getVersions(pid)) {
|
||||
list.add(i.getVersion());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private Set<String> getAllPackages() throws IOException, ParserConfigurationException, SAXException {
|
||||
Set<String> list = new HashSet<>();
|
||||
for (PackageInfo i : pc.search(null, null, null, false)) {
|
||||
list.add(i.getId());
|
||||
}
|
||||
JsonObject json = JsonTrackingParser.fetchJson("https://raw.githubusercontent.com/FHIR/ig-registry/master/fhir-ig-list.json");
|
||||
for (JsonObject ig : JSONUtil.objects(json, "guides")) {
|
||||
list.add(JSONUtil.str(ig, "npm-name"));
|
||||
}
|
||||
json = JsonTrackingParser.fetchJson("https://raw.githubusercontent.com/FHIR/ig-registry/master/package-feeds.json");
|
||||
for (JsonObject feed : JSONUtil.objects(json, "feeds")) {
|
||||
processFeed(list, JSONUtil.str(feed, "url"));
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private void processFeed(Set<String> list, String str) throws IOException, ParserConfigurationException, SAXException {
|
||||
System.out.println("Feed "+str);
|
||||
try {
|
||||
SimpleHTTPClient fetcher = new SimpleHTTPClient();
|
||||
HTTPResult res = fetcher.get(str+"?nocache=" + System.currentTimeMillis());
|
||||
res.checkThrowException();
|
||||
Document xml = XMLUtil.parseToDom(res.getContent());
|
||||
for (Element channel : XMLUtil.getNamedChildren(xml.getDocumentElement(), "channel")) {
|
||||
for (Element item : XMLUtil.getNamedChildren(channel, "item")) {
|
||||
String pid = XMLUtil.getNamedChildText(item, "title");
|
||||
if (pid.contains("#")) {
|
||||
list.add(pid.substring(0, pid.indexOf("#")));
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println(" "+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void processPackage(String pid, String v) throws IOException {
|
||||
NpmPackage npm = null;
|
||||
String fv = null;
|
||||
try {
|
||||
npm = pcm.loadPackage(pid, v);
|
||||
fv = npm.fhirVersion();
|
||||
} catch (Throwable e) {
|
||||
System.out.println("Unable to process: "+pid+"#"+v+": "+e.getMessage());
|
||||
}
|
||||
int c = 0;
|
||||
if (fv != null && (versions.isEmpty() || versions.contains(fv))) {
|
||||
for (String type : resourceTypes) {
|
||||
for (String s : npm.listResources(type)) {
|
||||
c++;
|
||||
processor.processResource(pid+"#"+v, fv, type, TextFile.streamToBytes(npm.load("package", s)));
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("Processed: "+pid+"#"+v+": "+c+" resources");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,211 @@
|
|||
package org.hl7.fhir.convertors.analytics;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.hl7.fhir.convertors.analytics.PackageVisitor.IPackageVisitorProcessor;
|
||||
import org.hl7.fhir.dstu2.model.SearchParameter;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.VersionUtilities;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
public class SearchParameterAnalysis implements IPackageVisitorProcessor {
|
||||
|
||||
public static class SearchParameterTypeUsage {
|
||||
private Set<String> coreUsage = new HashSet<>();
|
||||
private Set<String> igUsage = new HashSet<>();
|
||||
public String summary() {
|
||||
return ""+coreUsage.size()+" / "+igUsage.size();
|
||||
}
|
||||
}
|
||||
|
||||
public static class SearchParameterType {
|
||||
private Map<String, SearchParameterTypeUsage> usages = new HashMap<>();
|
||||
public void seeUsage(boolean core, String usage, String url) {
|
||||
if (!usages.containsKey(usage)) {
|
||||
usages.put(usage, new SearchParameterTypeUsage());
|
||||
}
|
||||
SearchParameterTypeUsage tu = usages.get(usage);
|
||||
if (core) {
|
||||
tu.coreUsage.add(url);
|
||||
} else {
|
||||
tu.igUsage.add(url);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static class SearchParameterVersionAnalysis {
|
||||
private Map<String, SearchParameterType> types = new HashMap<>();
|
||||
private String version;
|
||||
|
||||
public void seeUsage(boolean core, String type, String usage, String url) {
|
||||
// System.out.println("v"+version+" "+Utilities.padRight(url, ' ', 60)+" "+type+"/"+usage);
|
||||
if (type == null) {
|
||||
type = "n/a";
|
||||
}
|
||||
if (usage == null) {
|
||||
usage = "n/a";
|
||||
}
|
||||
if (!types.containsKey(type)) {
|
||||
types.put(type, new SearchParameterType());
|
||||
}
|
||||
SearchParameterType tu = types.get(type);
|
||||
tu.seeUsage(core, usage, url);
|
||||
}
|
||||
|
||||
public void printSummary() {
|
||||
Set<String> usages = new HashSet<>();
|
||||
for (SearchParameterType tu : types.values()) {
|
||||
usages.addAll(tu.usages.keySet());
|
||||
}
|
||||
List<String> ul = new ArrayList<String>();
|
||||
ul.addAll(usages);
|
||||
Collections.sort(ul);
|
||||
System.out.print(Utilities.padRight("", ' ', 10));
|
||||
for (String u : ul) {
|
||||
System.out.print(Utilities.padRight(u, ' ', 10));
|
||||
}
|
||||
System.out.println();
|
||||
for (String t : types.keySet()) {
|
||||
System.out.print(Utilities.padRight(t, ' ', 10));
|
||||
SearchParameterType tu = types.get(t);
|
||||
for (String u : ul) {
|
||||
SearchParameterTypeUsage uu = tu.usages.get(u);
|
||||
if (uu == null) {
|
||||
System.out.print(Utilities.padRight("0 / 0", ' ', 10));
|
||||
} else {
|
||||
System.out.print(Utilities.padRight(uu.summary(), ' ', 10));
|
||||
}
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Map<String, SearchParameterVersionAnalysis> versions = new HashMap<String, SearchParameterAnalysis.SearchParameterVersionAnalysis>();
|
||||
|
||||
@Override
|
||||
public void processResource(String pid, String version, String type, byte[] content) throws FHIRException {
|
||||
// System.out.println("v"+version+" "+type+" from "+pid);
|
||||
boolean core = pid.startsWith("hl7.fhir.r") && (pid.contains(".core") || pid.contains(".examples"));
|
||||
version = VersionUtilities.getMajMin(version);
|
||||
if (!versions.containsKey(version)) {
|
||||
versions.put(version, new SearchParameterVersionAnalysis());
|
||||
versions.get(version).version = version;
|
||||
}
|
||||
try {
|
||||
if (VersionUtilities.isR5Ver(version)) {
|
||||
processR5SP(core, versions.get(version), content);
|
||||
} else if (VersionUtilities.isR4BVer(version)) {
|
||||
processR4SP(core, versions.get(version), content);
|
||||
} else if (VersionUtilities.isR4Ver(version)) {
|
||||
processR4SP(core, versions.get(version), content);
|
||||
} else if (VersionUtilities.isR3Ver(version)) {
|
||||
processR3SP(core, versions.get(version), content);
|
||||
} else if (VersionUtilities.isR2Ver(version)) {
|
||||
processR2SP(core, versions.get(version), content);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new FHIRException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void processR5SP(boolean core, SearchParameterVersionAnalysis analysis, byte[] content) throws FHIRFormatError, IOException {
|
||||
org.hl7.fhir.r5.model.Resource res = new org.hl7.fhir.r5.formats.JsonParser().parse(content);
|
||||
if (res instanceof org.hl7.fhir.r5.model.Bundle) {
|
||||
for (org.hl7.fhir.r5.model.Bundle.BundleEntryComponent bnd : ((org.hl7.fhir.r5.model.Bundle) res).getEntry()) {
|
||||
if (bnd.getResource() != null && bnd.getResource() instanceof org.hl7.fhir.r5.model.SearchParameter) {
|
||||
org.hl7.fhir.r5.model.SearchParameter sp = (org.hl7.fhir.r5.model.SearchParameter) bnd.getResource();
|
||||
analysis.seeUsage(core, sp.getTypeElement().primitiveValue(), sp.getXpathUsageElement().primitiveValue(), sp.getUrl());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
org.hl7.fhir.r5.model.SearchParameter sp = (org.hl7.fhir.r5.model.SearchParameter) res;
|
||||
analysis.seeUsage(core, sp.getTypeElement().primitiveValue(), sp.getXpathUsageElement().primitiveValue(), sp.getUrl());
|
||||
}
|
||||
}
|
||||
|
||||
private void processR4SP(boolean core, SearchParameterVersionAnalysis analysis, byte[] content) throws FHIRFormatError, IOException {
|
||||
org.hl7.fhir.r4.model.Resource res = new org.hl7.fhir.r4.formats.JsonParser().parse(content);
|
||||
if (res instanceof org.hl7.fhir.r4.model.Bundle) {
|
||||
for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent bnd : ((org.hl7.fhir.r4.model.Bundle) res).getEntry()) {
|
||||
if (bnd.getResource() != null && bnd.getResource() instanceof org.hl7.fhir.r4.model.SearchParameter) {
|
||||
org.hl7.fhir.r4.model.SearchParameter sp = (org.hl7.fhir.r4.model.SearchParameter) bnd.getResource();
|
||||
analysis.seeUsage(core, sp.getTypeElement().primitiveValue(), sp.getXpathUsageElement().primitiveValue(), sp.getUrl());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
org.hl7.fhir.r4.model.SearchParameter sp = (org.hl7.fhir.r4.model.SearchParameter) res;
|
||||
analysis.seeUsage(core, sp.getTypeElement().primitiveValue(), sp.getXpathUsageElement().primitiveValue(), sp.getUrl());
|
||||
}
|
||||
}
|
||||
|
||||
private void processR3SP(boolean core, SearchParameterVersionAnalysis analysis, byte[] content) throws FHIRFormatError, IOException {
|
||||
org.hl7.fhir.dstu3.model.Resource res = new org.hl7.fhir.dstu3.formats.JsonParser().parse(content);
|
||||
if (res instanceof org.hl7.fhir.dstu3.model.Bundle) {
|
||||
for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent bnd : ((org.hl7.fhir.dstu3.model.Bundle) res).getEntry()) {
|
||||
if (bnd.getResource() != null && bnd.getResource() instanceof org.hl7.fhir.dstu3.model.SearchParameter) {
|
||||
org.hl7.fhir.dstu3.model.SearchParameter sp = (org.hl7.fhir.dstu3.model.SearchParameter) bnd.getResource();
|
||||
analysis.seeUsage(core, sp.getTypeElement().primitiveValue(), sp.getXpathUsageElement().primitiveValue(), sp.getUrl());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
org.hl7.fhir.dstu3.model.SearchParameter sp = (org.hl7.fhir.dstu3.model.SearchParameter) res;
|
||||
analysis.seeUsage(core, sp.getTypeElement().primitiveValue(), sp.getXpathUsageElement().primitiveValue(), sp.getUrl());
|
||||
}
|
||||
}
|
||||
|
||||
private void processR2SP(boolean core, SearchParameterVersionAnalysis analysis, byte[] content) throws FHIRFormatError, IOException {
|
||||
org.hl7.fhir.dstu2.model.Resource res = new org.hl7.fhir.dstu2.formats.JsonParser().parse(content);
|
||||
if (res instanceof org.hl7.fhir.dstu2.model.Bundle) {
|
||||
for (org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent bnd : ((org.hl7.fhir.dstu2.model.Bundle) res).getEntry()) {
|
||||
if (bnd.getResource() != null && bnd.getResource() instanceof org.hl7.fhir.dstu2.model.SearchParameter) {
|
||||
org.hl7.fhir.dstu2.model.SearchParameter sp = (org.hl7.fhir.dstu2.model.SearchParameter) bnd.getResource();
|
||||
analysis.seeUsage(core, sp.getTypeElement().primitiveValue(), sp.getXpathUsageElement().primitiveValue(), sp.getUrl());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
org.hl7.fhir.dstu2.model.SearchParameter sp = (org.hl7.fhir.dstu2.model.SearchParameter) res;
|
||||
analysis.seeUsage(core, sp.getTypeElement().primitiveValue(), sp.getXpathUsageElement().primitiveValue(), sp.getUrl());
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new SearchParameterAnalysis().execute();
|
||||
}
|
||||
|
||||
private void execute() throws IOException, ParserConfigurationException, SAXException {
|
||||
PackageVisitor pv = new PackageVisitor();
|
||||
pv.getResourceTypes().add("SearchParameter");
|
||||
pv.getResourceTypes().add("Bundle");
|
||||
pv.setOldVersions(false);
|
||||
pv.setCorePackages(true);
|
||||
pv.setProcessor(this);
|
||||
pv.visitPackages();
|
||||
|
||||
printSummary();
|
||||
}
|
||||
|
||||
private void printSummary() {
|
||||
for (String v : versions.keySet()) {
|
||||
System.out.println("-- v"+v+"---------------------");
|
||||
versions.get(v).printSummary();
|
||||
System.out.println("");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -60,8 +60,8 @@ public class Bundle10_30 {
|
|||
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.hasResource())
|
||||
tgt.setResource(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertResource(src.getResource()));
|
||||
if (src.hasSearch())
|
||||
tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch()));
|
||||
if (src.hasRequest())
|
||||
|
|
|
@ -78,8 +78,8 @@ public class Bundle10_40 {
|
|||
for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));
|
||||
if (src.hasFullUrlElement())
|
||||
tgt.setFullUrlElement(Uri10_40.convertUri(src.getFullUrlElement()));
|
||||
org.hl7.fhir.dstu2.model.Resource res = ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().convertResource(src.getResource());
|
||||
tgt.setResource(res);
|
||||
if (src.hasResource())
|
||||
tgt.setResource(ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().convertResource(src.getResource()));
|
||||
if (src.hasSearch())
|
||||
tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch()));
|
||||
if (src.hasRequest())
|
||||
|
|
|
@ -5,6 +5,7 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.Reference10_50;
|
|||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.CodeableConcept10_50;
|
||||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Identifier10_50;
|
||||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Instant10_50;
|
||||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.MarkDown10_50;
|
||||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.PositiveInt10_50;
|
||||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50;
|
||||
import org.hl7.fhir.dstu2.model.UnsignedIntType;
|
||||
|
@ -35,8 +36,8 @@ public class Appointment10_50 {
|
|||
if (src.hasMinutesDurationElement())
|
||||
tgt.setMinutesDurationElement(PositiveInt10_50.convertPositiveInt(src.getMinutesDurationElement()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getSlot()) tgt.addSlot(Reference10_50.convertReference(t));
|
||||
if (src.hasCommentElement())
|
||||
tgt.setCommentElement(String10_50.convertString(src.getCommentElement()));
|
||||
if (src.hasNote())
|
||||
tgt.setCommentElement(String10_50.convertString(src.getNoteFirstRep().getTextElement()));
|
||||
for (org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent t : src.getParticipant())
|
||||
tgt.addParticipant(convertAppointmentParticipantComponent(t));
|
||||
return tgt;
|
||||
|
@ -85,7 +86,7 @@ public class Appointment10_50 {
|
|||
tgt.setMinutesDurationElement(PositiveInt10_50.convertPositiveInt(src.getMinutesDurationElement()));
|
||||
for (org.hl7.fhir.dstu2.model.Reference t : src.getSlot()) tgt.addSlot(Reference10_50.convertReference(t));
|
||||
if (src.hasCommentElement())
|
||||
tgt.setCommentElement(String10_50.convertString(src.getCommentElement()));
|
||||
tgt.getNoteFirstRep().setTextElement(MarkDown10_50.convertStringToMarkdown(src.getCommentElement()));
|
||||
for (org.hl7.fhir.dstu2.model.Appointment.AppointmentParticipantComponent t : src.getParticipant())
|
||||
tgt.addParticipant(convertAppointmentParticipantComponent(t));
|
||||
return tgt;
|
||||
|
@ -192,45 +193,35 @@ public class Appointment10_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired> convertParticipantRequired(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Appointment.ParticipantRequired> src) throws FHIRException {
|
||||
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired> convertParticipantRequired(org.hl7.fhir.r5.model.BooleanType 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_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case REQUIRED:
|
||||
if (src.getValue()) {
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired.REQUIRED);
|
||||
break;
|
||||
case OPTIONAL:
|
||||
} else { // 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.r5.model.Enumeration<org.hl7.fhir.r5.model.Appointment.ParticipantRequired> convertParticipantRequired(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Appointment.ParticipantRequired> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r5.model.BooleanType 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.r5.model.Enumeration<org.hl7.fhir.r5.model.Appointment.ParticipantRequired> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Appointment.ParticipantRequiredEnumFactory());
|
||||
org.hl7.fhir.r5.model.BooleanType tgt = new org.hl7.fhir.r5.model.BooleanType();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case REQUIRED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipantRequired.REQUIRED);
|
||||
tgt.setValue(true);
|
||||
break;
|
||||
case OPTIONAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipantRequired.OPTIONAL);
|
||||
tgt.setValue(false);
|
||||
break;
|
||||
case INFORMATIONONLY:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipantRequired.INFORMATIONONLY);
|
||||
tgt.setValue(false);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipantRequired.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Base
|
|||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Boolean10_50;
|
||||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.String10_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.CodeableConcept;
|
||||
|
||||
public class AuditEvent10_50 {
|
||||
|
||||
|
@ -17,16 +18,18 @@ public class AuditEvent10_50 {
|
|||
return null;
|
||||
org.hl7.fhir.dstu2.model.AuditEvent tgt = new org.hl7.fhir.dstu2.model.AuditEvent();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyDomainResource(src, tgt);
|
||||
tgt.getEvent().setType(Coding10_50.convertCoding(src.getType()));
|
||||
for (org.hl7.fhir.r5.model.Coding t : src.getSubtype()) tgt.getEvent().addSubtype(Coding10_50.convertCoding(t));
|
||||
if (src.getCategoryFirstRep().hasCoding()) {
|
||||
tgt.getEvent().setType(Coding10_50.convertCoding(src.getCategoryFirstRep().getCodingFirstRep()));
|
||||
}
|
||||
for (org.hl7.fhir.r5.model.Coding t : src.getCode().getCoding()) tgt.getEvent().addSubtype(Coding10_50.convertCoding(t));
|
||||
tgt.getEvent().setActionElement(convertAuditEventAction(src.getActionElement()));
|
||||
tgt.getEvent().setDateTime(src.getRecorded());
|
||||
|
||||
if (src.hasOutcome() && src.getOutcome().hasCoding("http://terminology.hl7.org/CodeSystem/audit-event-outcome"))
|
||||
tgt.getEvent().getOutcomeElement().setValueAsString(src.getOutcome().getCode("http://terminology.hl7.org/CodeSystem/audit-event-outcome"));
|
||||
if (src.getOutcome().hasText())
|
||||
tgt.getEvent().setOutcomeDescElement(String10_50.convertString(src.getOutcome().getTextElement()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfEvent())
|
||||
if (src.hasOutcome() && "http://terminology.hl7.org/CodeSystem/audit-event-outcome".equals(src.getOutcome().getCode().getSystem()))
|
||||
tgt.getEvent().getOutcomeElement().setValueAsString(src.getOutcome().getCode().getCode());
|
||||
if (src.getOutcome().getDetailFirstRep().hasText())
|
||||
tgt.getEvent().setOutcomeDescElement(String10_50.convertString(src.getOutcome().getDetailFirstRep().getTextElement()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorization())
|
||||
for (org.hl7.fhir.r5.model.Coding cc : t.getCoding())
|
||||
tgt.getEvent().addPurposeOfEvent(Coding10_50.convertCoding(cc));
|
||||
for (org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent t : src.getAgent())
|
||||
|
@ -45,19 +48,19 @@ public class AuditEvent10_50 {
|
|||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyDomainResource(src, tgt);
|
||||
if (src.hasEvent()) {
|
||||
if (src.hasType())
|
||||
tgt.setType(Coding10_50.convertCoding(src.getEvent().getType()));
|
||||
tgt.getCategoryFirstRep().addCoding(Coding10_50.convertCoding(src.getEvent().getType()));
|
||||
for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getSubtype())
|
||||
tgt.addSubtype(Coding10_50.convertCoding(t));
|
||||
tgt.getCode().addCoding(Coding10_50.convertCoding(t));
|
||||
tgt.setActionElement(convertAuditEventAction(src.getEvent().getActionElement()));
|
||||
tgt.setRecorded(src.getEvent().getDateTime());
|
||||
|
||||
if (src.getEvent().hasOutcome())
|
||||
tgt.getOutcome().addCoding().setSystem("http://terminology.hl7.org/CodeSystem/audit-event-outcome").setCode(src.getEvent().getOutcome().toCode());
|
||||
tgt.getOutcome().getCode().setSystem("http://terminology.hl7.org/CodeSystem/audit-event-outcome").setCode(src.getEvent().getOutcome().toCode());
|
||||
if (src.getEvent().hasOutcomeDesc())
|
||||
tgt.getOutcome().setTextElement(String10_50.convertString(src.getEvent().getOutcomeDescElement()));
|
||||
tgt.getOutcome().getDetailFirstRep().setTextElement(String10_50.convertString(src.getEvent().getOutcomeDescElement()));
|
||||
|
||||
for (org.hl7.fhir.dstu2.model.Coding t : src.getEvent().getPurposeOfEvent())
|
||||
tgt.addPurposeOfEvent().addCoding(Coding10_50.convertCoding(t));
|
||||
tgt.addAuthorization().addCoding(Coding10_50.convertCoding(t));
|
||||
}
|
||||
for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantComponent t : src.getParticipant())
|
||||
tgt.addAgent(convertAuditEventAgentComponent(t));
|
||||
|
@ -137,20 +140,20 @@ public class AuditEvent10_50 {
|
|||
if (src.getWho().hasReference() || src.getWho().hasDisplay() || src.getWho().hasExtension() || src.getWho().hasId())
|
||||
tgt.setReference(Reference10_50.convertReference(src.getWho()));
|
||||
}
|
||||
if (src.hasAltIdElement())
|
||||
tgt.setAltIdElement(String10_50.convertString(src.getAltIdElement()));
|
||||
if (src.hasNameElement())
|
||||
tgt.setNameElement(String10_50.convertString(src.getNameElement()));
|
||||
// if (src.hasAltIdElement())
|
||||
// tgt.setAltIdElement(String10_50.convertString(src.getAltIdElement()));
|
||||
// if (src.hasNameElement())
|
||||
// tgt.setNameElement(String10_50.convertString(src.getNameElement()));
|
||||
if (src.hasRequestorElement())
|
||||
tgt.setRequestorElement(Boolean10_50.convertBoolean(src.getRequestorElement()));
|
||||
if (src.hasLocation())
|
||||
tgt.setLocation(Reference10_50.convertReference(src.getLocation()));
|
||||
for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue());
|
||||
if (src.hasMedia())
|
||||
tgt.setMedia(Coding10_50.convertCoding(src.getMedia()));
|
||||
if (src.hasNetwork())
|
||||
tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfUse())
|
||||
// if (src.hasMedia())
|
||||
// tgt.setMedia(Coding10_50.convertCoding(src.getMedia()));
|
||||
// if (src.hasNetwork())
|
||||
// tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorization())
|
||||
for (org.hl7.fhir.r5.model.Coding cc : t.getCoding()) tgt.addPurposeOfUse(Coding10_50.convertCoding(cc));
|
||||
return tgt;
|
||||
}
|
||||
|
@ -166,47 +169,47 @@ public class AuditEvent10_50 {
|
|||
tgt.setWho(Reference10_50.convertReference(src.getReference()));
|
||||
if (src.hasUserId())
|
||||
tgt.getWho().setIdentifier(Identifier10_50.convertIdentifier(src.getUserId()));
|
||||
if (src.hasAltIdElement())
|
||||
tgt.setAltIdElement(String10_50.convertString(src.getAltIdElement()));
|
||||
if (src.hasNameElement())
|
||||
tgt.setNameElement(String10_50.convertString(src.getNameElement()));
|
||||
// if (src.hasAltIdElement())
|
||||
// tgt.setAltIdElement(String10_50.convertString(src.getAltIdElement()));
|
||||
// if (src.hasNameElement())
|
||||
// tgt.setNameElement(String10_50.convertString(src.getNameElement()));
|
||||
if (src.hasRequestorElement())
|
||||
tgt.setRequestorElement(Boolean10_50.convertBoolean(src.getRequestorElement()));
|
||||
if (src.hasLocation())
|
||||
tgt.setLocation(Reference10_50.convertReference(src.getLocation()));
|
||||
for (org.hl7.fhir.dstu2.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue());
|
||||
if (src.hasMedia())
|
||||
tgt.setMedia(Coding10_50.convertCoding(src.getMedia()));
|
||||
if (src.hasNetwork())
|
||||
tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
|
||||
// if (src.hasMedia())
|
||||
// tgt.setMedia(Coding10_50.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_50.convertCoding(t));
|
||||
tgt.addAuthorization().addCoding(Coding10_50.convertCoding(t));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
if (src.hasAddressElement())
|
||||
tgt.setAddressElement(String10_50.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.r5.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_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
if (src.hasAddressElement())
|
||||
tgt.setAddressElement(String10_50.convertString(src.getAddressElement()));
|
||||
if (src.hasType())
|
||||
tgt.setTypeElement(convertAuditEventParticipantNetworkType(src.getTypeElement()));
|
||||
return tgt;
|
||||
}
|
||||
// public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkComponent src) throws FHIRException {
|
||||
// if (src == null || src.isEmpty())
|
||||
// return null;
|
||||
// org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent();
|
||||
// ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
// if (src.hasAddressElement())
|
||||
// tgt.setAddressElement(String10_50.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.r5.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_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
// if (src.hasAddressElement())
|
||||
// tgt.setAddressElement(String10_50.convertString(src.getAddressElement()));
|
||||
// if (src.hasType())
|
||||
// tgt.setTypeElement(convertAuditEventParticipantNetworkType(src.getTypeElement()));
|
||||
// return tgt;
|
||||
// }
|
||||
|
||||
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectComponent src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
|
@ -217,15 +220,15 @@ public class AuditEvent10_50 {
|
|||
tgt.getWhat().setIdentifier(Identifier10_50.convertIdentifier(src.getIdentifier()));
|
||||
if (src.hasReference())
|
||||
tgt.setWhat(Reference10_50.convertReference(src.getReference()));
|
||||
if (src.hasType())
|
||||
tgt.setType(Coding10_50.convertCoding(src.getType()));
|
||||
// if (src.hasType())
|
||||
// tgt.setType(Coding10_50.convertCoding(src.getType()));
|
||||
if (src.hasRole())
|
||||
tgt.setRole(Coding10_50.convertCoding(src.getRole()));
|
||||
if (src.hasLifecycle())
|
||||
tgt.setLifecycle(Coding10_50.convertCoding(src.getLifecycle()));
|
||||
for (org.hl7.fhir.dstu2.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding10_50.convertCoding(t));
|
||||
if (src.hasNameElement())
|
||||
tgt.setNameElement(String10_50.convertString(src.getNameElement()));
|
||||
tgt.getRole().addCoding(Coding10_50.convertCoding(src.getRole()));
|
||||
// if (src.hasLifecycle())
|
||||
// tgt.setLifecycle(Coding10_50.convertCoding(src.getLifecycle()));
|
||||
for (org.hl7.fhir.dstu2.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel().addCoding(Coding10_50.convertCoding(t));
|
||||
// if (src.hasNameElement())
|
||||
// tgt.setNameElement(String10_50.convertString(src.getNameElement()));
|
||||
if (src.hasQueryElement())
|
||||
tgt.setQueryElement(Base64Binary10_50.convertBase64Binary(src.getQueryElement()));
|
||||
for (org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent t : src.getDetail())
|
||||
|
@ -244,15 +247,15 @@ public class AuditEvent10_50 {
|
|||
if (src.getWhat().hasReference() || src.getWhat().hasDisplay() || src.getWhat().hasExtension() || src.getWhat().hasId())
|
||||
tgt.setReference(Reference10_50.convertReference(src.getWhat()));
|
||||
}
|
||||
if (src.hasType())
|
||||
tgt.setType(Coding10_50.convertCoding(src.getType()));
|
||||
// if (src.hasType())
|
||||
// tgt.setType(Coding10_50.convertCoding(src.getType()));
|
||||
if (src.hasRole())
|
||||
tgt.setRole(Coding10_50.convertCoding(src.getRole()));
|
||||
if (src.hasLifecycle())
|
||||
tgt.setLifecycle(Coding10_50.convertCoding(src.getLifecycle()));
|
||||
for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding10_50.convertCoding(t));
|
||||
if (src.hasNameElement())
|
||||
tgt.setNameElement(String10_50.convertString(src.getNameElement()));
|
||||
tgt.setRole(Coding10_50.convertCoding(src.getRole().getCodingFirstRep()));
|
||||
// if (src.hasLifecycle())
|
||||
// tgt.setLifecycle(Coding10_50.convertCoding(src.getLifecycle()));
|
||||
for (CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding10_50.convertCoding(t.getCodingFirstRep()));
|
||||
// if (src.hasNameElement())
|
||||
// tgt.setNameElement(String10_50.convertString(src.getNameElement()));
|
||||
if (src.hasQueryElement())
|
||||
tgt.setQueryElement(Base64Binary10_50.convertBase64Binary(src.getQueryElement()));
|
||||
for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail())
|
||||
|
@ -266,7 +269,7 @@ public class AuditEvent10_50 {
|
|||
org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
if (src.hasTypeElement())
|
||||
tgt.setTypeElement(String10_50.convertString(src.getTypeElement()));
|
||||
tgt.getType().setTextElement(String10_50.convertString(src.getTypeElement()));
|
||||
if (src.hasValue())
|
||||
tgt.setValue(new org.hl7.fhir.r5.model.Base64BinaryType(src.getValue()));
|
||||
return tgt;
|
||||
|
@ -277,8 +280,8 @@ public class AuditEvent10_50 {
|
|||
return null;
|
||||
org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent tgt = new org.hl7.fhir.dstu2.model.AuditEvent.AuditEventObjectDetailComponent();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
if (src.hasTypeElement())
|
||||
tgt.setTypeElement(String10_50.convertString(src.getTypeElement()));
|
||||
if (src.getType().hasTextElement())
|
||||
tgt.setTypeElement(String10_50.convertString(src.getType().getTextElement()));
|
||||
if (src.hasValueStringType())
|
||||
tgt.setValue(src.getValueStringType().getValue().getBytes());
|
||||
else if (src.hasValueBase64BinaryType())
|
||||
|
@ -286,73 +289,73 @@ public class AuditEvent10_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.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.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case _1:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._1);
|
||||
break;
|
||||
case _2:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._2);
|
||||
break;
|
||||
case _3:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._3);
|
||||
break;
|
||||
case _4:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._4);
|
||||
break;
|
||||
case _5:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._5);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType> convertAuditEventParticipantNetworkType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.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_50.INSTANCE.getVersionConvertor_10_50().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.r5.model.Enumeration<org.hl7.fhir.r5.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.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
|
||||
// ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
// switch (src.getValue()) {
|
||||
// case _1:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._1);
|
||||
// break;
|
||||
// case _2:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._2);
|
||||
// break;
|
||||
// case _3:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._3);
|
||||
// break;
|
||||
// case _4:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._4);
|
||||
// break;
|
||||
// case _5:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._5);
|
||||
// break;
|
||||
// default:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType.NULL);
|
||||
// break;
|
||||
// }
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.AuditEvent.AuditEventParticipantNetworkType> convertAuditEventParticipantNetworkType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
|
||||
// if (src == null || src.isEmpty())
|
||||
// return null;
|
||||
// org.hl7.fhir.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_50.INSTANCE.getVersionConvertor_10_50().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;
|
||||
// }
|
||||
|
||||
public static org.hl7.fhir.dstu2.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r5.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_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
if (src.hasSiteElement())
|
||||
tgt.setSiteElement(String10_50.convertString(src.getSiteElement()));
|
||||
// if (src.hasSiteElement())
|
||||
// tgt.setSiteElement(String10_50.convertString(src.getSiteElement()));
|
||||
if (src.hasObserver())
|
||||
tgt.setIdentifier(Identifier10_50.convertIdentifier(src.getObserver().getIdentifier()));
|
||||
for (org.hl7.fhir.r5.model.Coding t : src.getType()) tgt.addType(Coding10_50.convertCoding(t));
|
||||
for (CodeableConcept t : src.getType()) tgt.addType(Coding10_50.convertCoding(t.getCodingFirstRep()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -361,11 +364,11 @@ public class AuditEvent10_50 {
|
|||
return null;
|
||||
org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
if (src.hasSiteElement())
|
||||
tgt.setSiteElement(String10_50.convertString(src.getSiteElement()));
|
||||
// if (src.hasSiteElement())
|
||||
// tgt.setSiteElement(String10_50.convertString(src.getSiteElement()));
|
||||
if (src.hasIdentifier())
|
||||
tgt.getObserver().setIdentifier(Identifier10_50.convertIdentifier(src.getIdentifier()));
|
||||
for (org.hl7.fhir.dstu2.model.Coding t : src.getType()) tgt.addType(Coding10_50.convertCoding(t));
|
||||
for (org.hl7.fhir.dstu2.model.Coding t : src.getType()) tgt.addType().addCoding(Coding10_50.convertCoding(t));
|
||||
return tgt;
|
||||
}
|
||||
}
|
|
@ -78,8 +78,8 @@ public class Bundle10_50 {
|
|||
for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t));
|
||||
if (src.hasFullUrlElement())
|
||||
tgt.setFullUrlElement(Uri10_50.convertUri(src.getFullUrlElement()));
|
||||
org.hl7.fhir.dstu2.model.Resource res = ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().convertResource(src.getResource());
|
||||
tgt.setResource(res);
|
||||
if (src.hasResource())
|
||||
tgt.setResource(ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().convertResource(src.getResource()));
|
||||
if (src.hasSearch())
|
||||
tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch()));
|
||||
if (src.hasRequest())
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.hl7.fhir.convertors.conv10_50.resources10_50;
|
||||
|
||||
import org.hl7.fhir.convertors.context.ConversionContext10_50;
|
||||
import org.hl7.fhir.convertors.context.ConversionContext40_50;
|
||||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.Narrative10_50;
|
||||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.Reference10_50;
|
||||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.CodeableConcept10_50;
|
||||
|
@ -87,22 +88,22 @@ public class Composition10_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Composition.CompositionAttestationMode> src) throws FHIRException {
|
||||
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.r5.model.CodeableConcept 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_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case PERSONAL:
|
||||
switch (src.getCode("http://hl7.org/fhir/composition-attestation-mode")) {
|
||||
case "personal":
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.PERSONAL);
|
||||
break;
|
||||
case PROFESSIONAL:
|
||||
case "professional":
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.PROFESSIONAL);
|
||||
break;
|
||||
case LEGAL:
|
||||
case "legal":
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.LEGAL);
|
||||
break;
|
||||
case OFFICIAL:
|
||||
case "official":
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode.OFFICIAL);
|
||||
break;
|
||||
default:
|
||||
|
@ -112,38 +113,36 @@ public class Composition10_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Composition.CompositionAttestationMode> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r5.model.CodeableConcept 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.r5.model.Enumeration<org.hl7.fhir.r5.model.Composition.CompositionAttestationMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Composition.CompositionAttestationModeEnumFactory());
|
||||
org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case PERSONAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.PERSONAL);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("personal");
|
||||
break;
|
||||
case PROFESSIONAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.PROFESSIONAL);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("professional");
|
||||
break;
|
||||
case LEGAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.LEGAL);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("legal");
|
||||
break;
|
||||
case OFFICIAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.OFFICIAL);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("official");
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.dstu2.model.Composition.CompositionAttesterComponent convertCompositionAttesterComponent(org.hl7.fhir.r5.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_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
if (src.hasMode())
|
||||
tgt.setMode(Collections.singletonList(convertCompositionAttestationMode(src.getModeElement())));
|
||||
tgt.setMode(Collections.singletonList(convertCompositionAttestationMode(src.getMode())));
|
||||
if (src.hasTimeElement())
|
||||
tgt.setTimeElement(DateTime10_50.convertDateTime(src.getTimeElement()));
|
||||
if (src.hasParty())
|
||||
|
@ -157,7 +156,7 @@ public class Composition10_50 {
|
|||
org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
if (src.hasMode())
|
||||
tgt.setModeElement(convertCompositionAttestationMode(src.getMode().get(0)));
|
||||
tgt.setMode(convertCompositionAttestationMode(src.getMode().get(0)));
|
||||
if (src.hasTimeElement())
|
||||
tgt.setTimeElement(DateTime10_50.convertDateTime(src.getTimeElement()));
|
||||
if (src.hasParty())
|
||||
|
|
|
@ -28,7 +28,7 @@ public class DeviceUseStatement10_50 {
|
|||
if (src.hasRecordedOnElement())
|
||||
tgt.setDateAssertedElement(DateTime10_50.convertDateTime(src.getRecordedOnElement()));
|
||||
if (src.hasSubject())
|
||||
tgt.setSubject(Reference10_50.convertReference(src.getSubject()));
|
||||
tgt.setPatient(Reference10_50.convertReference(src.getSubject()));
|
||||
if (src.hasTiming())
|
||||
tgt.setTiming(ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().convertType(src.getTiming()));
|
||||
return tgt;
|
||||
|
@ -51,8 +51,8 @@ public class DeviceUseStatement10_50 {
|
|||
for (Annotation t : src.getNote()) tgt.addNotes(t.getText());
|
||||
if (src.hasDateAssertedElement())
|
||||
tgt.setRecordedOnElement(DateTime10_50.convertDateTime(src.getDateAssertedElement()));
|
||||
if (src.hasSubject())
|
||||
tgt.setSubject(Reference10_50.convertReference(src.getSubject()));
|
||||
if (src.hasPatient())
|
||||
tgt.setSubject(Reference10_50.convertReference(src.getPatient()));
|
||||
if (src.hasTiming())
|
||||
tgt.setTiming(ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().convertType(src.getTiming()));
|
||||
return tgt;
|
||||
|
|
|
@ -15,20 +15,20 @@ public class DocumentReference10_50 {
|
|||
static public CodeableConcept convertDocStatus(org.hl7.fhir.r5.model.Enumerations.CompositionStatus docStatus) {
|
||||
CodeableConcept cc = new CodeableConcept();
|
||||
switch (docStatus) {
|
||||
case AMENDED:
|
||||
cc.addCoding().setSystem("http://hl7.org/fhir/composition-status").setCode("amended");
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
cc.addCoding().setSystem("http://hl7.org/fhir/composition-status").setCode("entered-in-error");
|
||||
break;
|
||||
case FINAL:
|
||||
cc.addCoding().setSystem("http://hl7.org/fhir/composition-status").setCode("final");
|
||||
break;
|
||||
case PRELIMINARY:
|
||||
cc.addCoding().setSystem("http://hl7.org/fhir/composition-status").setCode("preliminary");
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
case AMENDED:
|
||||
cc.addCoding().setSystem("http://hl7.org/fhir/composition-status").setCode("amended");
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
cc.addCoding().setSystem("http://hl7.org/fhir/composition-status").setCode("entered-in-error");
|
||||
break;
|
||||
case FINAL:
|
||||
cc.addCoding().setSystem("http://hl7.org/fhir/composition-status").setCode("final");
|
||||
break;
|
||||
case PRELIMINARY:
|
||||
cc.addCoding().setSystem("http://hl7.org/fhir/composition-status").setCode("preliminary");
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
return cc;
|
||||
}
|
||||
|
@ -50,8 +50,8 @@ public class DocumentReference10_50 {
|
|||
return null;
|
||||
org.hl7.fhir.dstu2.model.DocumentReference tgt = new org.hl7.fhir.dstu2.model.DocumentReference();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyDomainResource(src, tgt);
|
||||
// if (src.hasMasterIdentifier())
|
||||
// tgt.setMasterIdentifier(VersionConvertor_10_50.convertIdentifier(src.getMasterIdentifier()));
|
||||
// if (src.hasMasterIdentifier())
|
||||
// tgt.setMasterIdentifier(VersionConvertor_10_50.convertIdentifier(src.getMasterIdentifier()));
|
||||
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
|
||||
tgt.addIdentifier(Identifier10_50.convertIdentifier(t));
|
||||
if (src.hasSubject())
|
||||
|
@ -205,7 +205,7 @@ public class DocumentReference10_50 {
|
|||
org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.dstu2.model.DocumentReference.DocumentReferenceRelatesToComponent();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
if (src.hasCode())
|
||||
tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement()));
|
||||
tgt.setCodeElement(convertDocumentRelationshipType(src.getCode()));
|
||||
if (src.hasTarget())
|
||||
tgt.setTarget(Reference10_50.convertReference(src.getTarget()));
|
||||
return tgt;
|
||||
|
@ -217,7 +217,7 @@ public class DocumentReference10_50 {
|
|||
org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
if (src.hasCode())
|
||||
tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement()));
|
||||
tgt.setCode(convertDocumentRelationshipType(src.getCodeElement()));
|
||||
if (src.hasTarget())
|
||||
tgt.setTarget(Reference10_50.convertReference(src.getTarget()));
|
||||
return tgt;
|
||||
|
@ -229,18 +229,18 @@ public class DocumentReference10_50 {
|
|||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatusEnumFactory());
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case CURRENT:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.CURRENT);
|
||||
break;
|
||||
case SUPERSEDED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.SUPERSEDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.NULL);
|
||||
break;
|
||||
case CURRENT:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.CURRENT);
|
||||
break;
|
||||
case SUPERSEDED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.SUPERSEDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
@ -251,69 +251,70 @@ public class DocumentReference10_50 {
|
|||
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatusEnumFactory());
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case CURRENT:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.CURRENT);
|
||||
break;
|
||||
case SUPERSEDED:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.SUPERSEDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.NULL);
|
||||
break;
|
||||
case CURRENT:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.CURRENT);
|
||||
break;
|
||||
case SUPERSEDED:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.SUPERSEDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.Enumerations.DocumentReferenceStatus.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r5.model.CodeableConcept convertDocumentRelationshipType(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipTypeEnumFactory());
|
||||
org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case REPLACES:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.REPLACES);
|
||||
break;
|
||||
case TRANSFORMS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.TRANSFORMS);
|
||||
break;
|
||||
case SIGNS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.SIGNS);
|
||||
break;
|
||||
case APPENDS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.APPENDS);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.NULL);
|
||||
break;
|
||||
case REPLACES:
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("replaces");
|
||||
break;
|
||||
case TRANSFORMS:
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("transforms");
|
||||
break;
|
||||
case SIGNS:
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("signs");
|
||||
break;
|
||||
case APPENDS:
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("appends");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> src) throws FHIRException {
|
||||
static public org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType> tgt = new org.hl7.fhir.dstu2.model.Enumeration<>(new org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipTypeEnumFactory());
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case REPLACES:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.REPLACES);
|
||||
break;
|
||||
case TRANSFORMS:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.TRANSFORMS);
|
||||
break;
|
||||
case SIGNS:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.SIGNS);
|
||||
break;
|
||||
case APPENDS:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.APPENDS);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.NULL);
|
||||
break;
|
||||
switch (src.getCode("http://hl7.org/fhir/document-relationship-type")) {
|
||||
case "replaces":
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.REPLACES);
|
||||
break;
|
||||
case "transforms":
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.TRANSFORMS);
|
||||
break;
|
||||
case "signs":
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.SIGNS);
|
||||
break;
|
||||
case "appends":
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.APPENDS);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.DocumentReference.DocumentRelationshipType.NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
return tgt;
|
||||
}
|
||||
}
|
|
@ -36,8 +36,8 @@ public class Encounter10_50 {
|
|||
tgt.addParticipant(convertEncounterParticipantComponent(t));
|
||||
if (src.hasAppointment())
|
||||
tgt.setAppointment(Reference10_50.convertReference(src.getAppointmentFirstRep()));
|
||||
if (src.hasPeriod())
|
||||
tgt.setPeriod(Period10_50.convertPeriod(src.getPeriod()));
|
||||
if (src.hasActualPeriod())
|
||||
tgt.setPeriod(Period10_50.convertPeriod(src.getActualPeriod()));
|
||||
if (src.hasLength())
|
||||
tgt.setLength(Duration10_50.convertDuration(src.getLength()));
|
||||
for (CodeableReference t : src.getReason())
|
||||
|
@ -80,7 +80,7 @@ public class Encounter10_50 {
|
|||
if (src.hasAppointment())
|
||||
tgt.addAppointment(Reference10_50.convertReference(src.getAppointment()));
|
||||
if (src.hasPeriod())
|
||||
tgt.setPeriod(Period10_50.convertPeriod(src.getPeriod()));
|
||||
tgt.setActualPeriod(Period10_50.convertPeriod(src.getPeriod()));
|
||||
if (src.hasLength())
|
||||
tgt.setLength(Duration10_50.convertDuration(src.getLength()));
|
||||
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason())
|
||||
|
@ -283,7 +283,7 @@ public class Encounter10_50 {
|
|||
if (src.hasPeriod())
|
||||
tgt.setPeriod(Period10_50.convertPeriod(src.getPeriod()));
|
||||
if (src.hasIndividual())
|
||||
tgt.setIndividual(Reference10_50.convertReference(src.getIndividual()));
|
||||
tgt.setActor(Reference10_50.convertReference(src.getIndividual()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -296,8 +296,8 @@ public class Encounter10_50 {
|
|||
tgt.addType(CodeableConcept10_50.convertCodeableConcept(t));
|
||||
if (src.hasPeriod())
|
||||
tgt.setPeriod(Period10_50.convertPeriod(src.getPeriod()));
|
||||
if (src.hasIndividual())
|
||||
tgt.setIndividual(Reference10_50.convertReference(src.getIndividual()));
|
||||
if (src.hasActor())
|
||||
tgt.setIndividual(Reference10_50.convertReference(src.getActor()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
|
|
@ -133,16 +133,16 @@ public class MedicationStatement10_50 {
|
|||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case ACTIVE:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.COMPLETED);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
case COMPLETED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.COMPLETED);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.ENTEREDINERROR);
|
||||
break;
|
||||
case INTENDED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.UNKNOWN);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.NULL);
|
||||
|
@ -160,14 +160,14 @@ public class MedicationStatement10_50 {
|
|||
// case ACTIVE:
|
||||
// tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ACTIVE);
|
||||
// break;
|
||||
case COMPLETED:
|
||||
case RECORDED:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.COMPLETED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR);
|
||||
break;
|
||||
case UNKNOWN:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.INTENDED);
|
||||
case DRAFT:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.ACTIVE);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.dstu2.model.MedicationStatement.MedicationStatementStatus.NULL);
|
||||
|
|
|
@ -75,7 +75,7 @@ public class Person10_50 {
|
|||
tgt.setBirthDateElement(Date10_50.convertDate(src.getBirthDateElement()));
|
||||
for (org.hl7.fhir.dstu2.model.Address t : src.getAddress()) tgt.addAddress(Address10_50.convertAddress(t));
|
||||
if (src.hasPhoto())
|
||||
tgt.setPhoto(Attachment10_50.convertAttachment(src.getPhoto()));
|
||||
tgt.addPhoto(Attachment10_50.convertAttachment(src.getPhoto()));
|
||||
if (src.hasManagingOrganization())
|
||||
tgt.setManagingOrganization(Reference10_50.convertReference(src.getManagingOrganization()));
|
||||
if (src.hasActiveElement())
|
||||
|
@ -101,7 +101,7 @@ public class Person10_50 {
|
|||
tgt.setBirthDateElement(Date10_50.convertDate(src.getBirthDateElement()));
|
||||
for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(Address10_50.convertAddress(t));
|
||||
if (src.hasPhoto())
|
||||
tgt.setPhoto(Attachment10_50.convertAttachment(src.getPhoto()));
|
||||
tgt.setPhoto(Attachment10_50.convertAttachment(src.getPhotoFirstRep()));
|
||||
if (src.hasManagingOrganization())
|
||||
tgt.setManagingOrganization(Reference10_50.convertReference(src.getManagingOrganization()));
|
||||
if (src.hasActiveElement())
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.hl7.fhir.convertors.conv10_50.datatypes10_50.complextypes10_50.Signat
|
|||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Instant10_50;
|
||||
import org.hl7.fhir.convertors.conv10_50.datatypes10_50.primitivetypes10_50.Uri10_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.CodeableReference;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
|
||||
/*
|
||||
|
@ -57,7 +58,7 @@ public class Provenance10_50 {
|
|||
if (src.hasLocation())
|
||||
tgt.setLocation(Reference10_50.convertReference(src.getLocation()));
|
||||
for (org.hl7.fhir.dstu2.model.CodeableConcept t : src.getReason())
|
||||
tgt.addReason(CodeableConcept10_50.convertCodeableConcept(t));
|
||||
tgt.addAuthorization().setConcept(CodeableConcept10_50.convertCodeableConcept(t));
|
||||
if (src.hasActivity())
|
||||
tgt.setActivity(CodeableConcept10_50.convertCodeableConcept(src.getActivity()));
|
||||
for (org.hl7.fhir.dstu2.model.Provenance.ProvenanceAgentComponent t : src.getAgent())
|
||||
|
@ -82,8 +83,9 @@ public class Provenance10_50 {
|
|||
for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.getPolicy().add(Uri10_50.convertUri(t));
|
||||
if (src.hasLocation())
|
||||
tgt.setLocation(Reference10_50.convertReference(src.getLocation()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason())
|
||||
tgt.addReason(CodeableConcept10_50.convertCodeableConcept(t));
|
||||
for (CodeableReference t : src.getAuthorization())
|
||||
if (t.hasConcept())
|
||||
tgt.addReason(CodeableConcept10_50.convertCodeableConcept(t.getConcept()));
|
||||
if (src.hasActivity())
|
||||
tgt.setActivity(CodeableConcept10_50.convertCodeableConcept(src.getActivity()));
|
||||
for (org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent t : src.getAgent())
|
||||
|
|
|
@ -46,7 +46,7 @@ public class QuestionnaireResponse10_50 {
|
|||
org.hl7.fhir.dstu2.model.QuestionnaireResponse tgt = new org.hl7.fhir.dstu2.model.QuestionnaireResponse();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyDomainResource(src, tgt);
|
||||
if (src.hasIdentifier())
|
||||
tgt.setIdentifier(Identifier10_50.convertIdentifier(src.getIdentifier()));
|
||||
tgt.setIdentifier(Identifier10_50.convertIdentifier(src.getIdentifierFirstRep()));
|
||||
if (src.hasQuestionnaireElement())
|
||||
tgt.setQuestionnaire(Reference10_50.convertCanonicalToReference(src.getQuestionnaireElement()));
|
||||
if (src.hasStatus())
|
||||
|
@ -73,7 +73,7 @@ public class QuestionnaireResponse10_50 {
|
|||
org.hl7.fhir.r5.model.QuestionnaireResponse tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse();
|
||||
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyDomainResource(src, tgt);
|
||||
if (src.hasIdentifier())
|
||||
tgt.setIdentifier(Identifier10_50.convertIdentifier(src.getIdentifier()));
|
||||
tgt.addIdentifier(Identifier10_50.convertIdentifier(src.getIdentifier()));
|
||||
if (src.hasQuestionnaire())
|
||||
tgt.setQuestionnaireElement(Reference10_50.convertReferenceToCanonical(src.getQuestionnaire()));
|
||||
if (src.hasStatus())
|
||||
|
|
|
@ -15,7 +15,7 @@ public class QuestionnaireResponse14_50 {
|
|||
org.hl7.fhir.dstu2016may.model.QuestionnaireResponse tgt = new org.hl7.fhir.dstu2016may.model.QuestionnaireResponse();
|
||||
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyDomainResource(src, tgt);
|
||||
if (src.hasIdentifier())
|
||||
tgt.setIdentifier(Identifier14_50.convertIdentifier(src.getIdentifier()));
|
||||
tgt.setIdentifier(Identifier14_50.convertIdentifier(src.getIdentifierFirstRep()));
|
||||
if (src.hasQuestionnaireElement())
|
||||
tgt.setQuestionnaire(Reference14_50.convertCanonicalToReference(src.getQuestionnaireElement()));
|
||||
if (src.hasStatus())
|
||||
|
@ -41,7 +41,7 @@ public class QuestionnaireResponse14_50 {
|
|||
org.hl7.fhir.r5.model.QuestionnaireResponse tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse();
|
||||
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyDomainResource(src, tgt);
|
||||
if (src.hasIdentifier())
|
||||
tgt.setIdentifier(Identifier14_50.convertIdentifier(src.getIdentifier()));
|
||||
tgt.addIdentifier(Identifier14_50.convertIdentifier(src.getIdentifier()));
|
||||
if (src.hasQuestionnaire())
|
||||
tgt.setQuestionnaireElement(Reference14_50.convertReferenceToCanonical(src.getQuestionnaire()));
|
||||
if (src.hasStatus())
|
||||
|
|
|
@ -5,9 +5,11 @@ import org.hl7.fhir.convertors.conv14_50.datatypes14_50.complextypes14_50.Codeab
|
|||
import org.hl7.fhir.convertors.conv14_50.datatypes14_50.complextypes14_50.ContactPoint14_50;
|
||||
import org.hl7.fhir.convertors.conv14_50.datatypes14_50.complextypes14_50.Identifier14_50;
|
||||
import org.hl7.fhir.convertors.conv14_50.datatypes14_50.primitivetypes14_50.*;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50;
|
||||
import org.hl7.fhir.dstu2016may.model.StructureMap;
|
||||
import org.hl7.fhir.dstu2016may.model.StructureMap.StructureMapContextType;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -238,7 +240,7 @@ public class StructureMap14_50 {
|
|||
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt);
|
||||
if (src.hasNameElement())
|
||||
tgt.setNameElement(Id14_50.convertId(src.getNameElement()));
|
||||
for (org.hl7.fhir.r5.model.StringType t : src.getVariable()) tgt.addVariable(t.asStringValue());
|
||||
for (StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addVariable(t.getValue().primitiveValue());
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -249,7 +251,7 @@ public class StructureMap14_50 {
|
|||
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt);
|
||||
if (src.hasNameElement())
|
||||
tgt.setNameElement(Id14_50.convertId(src.getNameElement()));
|
||||
for (org.hl7.fhir.dstu2016may.model.StringType t : src.getVariable()) tgt.addVariable(t.asStringValue());
|
||||
for (org.hl7.fhir.dstu2016may.model.StringType t : src.getVariable()) tgt.addParameter().setValue(String14_50.convertString(t));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ public class RelatedArtifact30_50 {
|
|||
if (src.hasType()) tgt.setTypeElement(convertRelatedArtifactType(src.getTypeElement()));
|
||||
if (src.hasDisplay()) tgt.setDisplayElement(String30_50.convertString(src.getDisplayElement()));
|
||||
if (src.hasCitation()) tgt.setCitation(src.getCitation());
|
||||
if (src.hasUrl()) tgt.setUrl(src.getUrl());
|
||||
if (src.hasUrl()) tgt.getDocument().setUrl(src.getUrl());
|
||||
if (src.hasDocument()) tgt.setDocument(Attachment30_50.convertAttachment(src.getDocument()));
|
||||
if (src.hasResource()) tgt.setResourceElement(Reference30_50.convertReferenceToCanonical(src.getResource()));
|
||||
return tgt;
|
||||
|
@ -26,7 +26,7 @@ public class RelatedArtifact30_50 {
|
|||
if (src.hasType()) tgt.setTypeElement(convertRelatedArtifactType(src.getTypeElement()));
|
||||
if (src.hasDisplay()) tgt.setDisplayElement(String30_50.convertString(src.getDisplayElement()));
|
||||
if (src.hasCitation()) tgt.setCitation(src.getCitation());
|
||||
if (src.hasUrl()) tgt.setUrl(src.getUrl());
|
||||
if (src.getDocument().hasUrl()) tgt.setUrl(src.getDocument().getUrl());
|
||||
if (src.hasDocument()) tgt.setDocument(Attachment30_50.convertAttachment(src.getDocument()));
|
||||
if (src.hasResource()) tgt.setResource(Reference30_50.convertCanonicalToReference(src.getResourceElement()));
|
||||
return tgt;
|
||||
|
|
|
@ -54,8 +54,8 @@ public class Appointment30_50 {
|
|||
for (org.hl7.fhir.r5.model.Reference t : src.getSlot()) tgt.addSlot(Reference30_50.convertReference(t));
|
||||
if (src.hasCreated())
|
||||
tgt.setCreatedElement(DateTime30_50.convertDateTime(src.getCreatedElement()));
|
||||
if (src.hasComment())
|
||||
tgt.setCommentElement(String30_50.convertString(src.getCommentElement()));
|
||||
if (src.hasNote())
|
||||
tgt.setCommentElement(String30_50.convertString(src.getNoteFirstRep().getTextElement()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn())
|
||||
tgt.addIncomingReferral(Reference30_50.convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent t : src.getParticipant())
|
||||
|
@ -123,7 +123,7 @@ public class Appointment30_50 {
|
|||
if (src.hasCreated())
|
||||
tgt.setCreatedElement(DateTime30_50.convertDateTime(src.getCreatedElement()));
|
||||
if (src.hasComment())
|
||||
tgt.setCommentElement(String30_50.convertString(src.getCommentElement()));
|
||||
tgt.getNoteFirstRep().setTextElement(String30_50.convertStringToMarkdown(src.getCommentElement()));
|
||||
for (org.hl7.fhir.dstu3.model.Reference t : src.getIncomingReferral())
|
||||
tgt.addBasedOn(Reference30_50.convertReference(t));
|
||||
for (org.hl7.fhir.dstu3.model.Appointment.AppointmentParticipantComponent t : src.getParticipant())
|
||||
|
@ -239,45 +239,35 @@ public class Appointment30_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired> convertParticipantRequired(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Appointment.ParticipantRequired> src) throws FHIRException {
|
||||
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired> convertParticipantRequired(org.hl7.fhir.r5.model.BooleanType 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());
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().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;
|
||||
if (src.getValue()) { // case REQUIRED:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.REQUIRED);
|
||||
} else { // case OPTIONAL and others:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired.OPTIONAL);
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Appointment.ParticipantRequired> convertParticipantRequired(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Appointment.ParticipantRequired> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r5.model.BooleanType 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.r5.model.Enumeration<org.hl7.fhir.r5.model.Appointment.ParticipantRequired> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Appointment.ParticipantRequiredEnumFactory());
|
||||
org.hl7.fhir.r5.model.BooleanType tgt = new org.hl7.fhir.r5.model.BooleanType();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case REQUIRED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipantRequired.REQUIRED);
|
||||
tgt.setValue(true);
|
||||
break;
|
||||
case OPTIONAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipantRequired.OPTIONAL);
|
||||
tgt.setValue(false);
|
||||
break;
|
||||
case INFORMATIONONLY:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipantRequired.INFORMATIONONLY);
|
||||
tgt.setValue(false);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipantRequired.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Bool
|
|||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Instant30_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.CodeableConcept;
|
||||
|
||||
public class AuditEvent30_50 {
|
||||
|
||||
|
@ -19,18 +20,18 @@ public class AuditEvent30_50 {
|
|||
org.hl7.fhir.r5.model.AuditEvent tgt = new org.hl7.fhir.r5.model.AuditEvent();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setType(Coding30_50.convertCoding(src.getType()));
|
||||
for (org.hl7.fhir.dstu3.model.Coding t : src.getSubtype()) tgt.addSubtype(Coding30_50.convertCoding(t));
|
||||
tgt.getCategoryFirstRep().addCoding(Coding30_50.convertCoding(src.getType()));
|
||||
for (org.hl7.fhir.dstu3.model.Coding t : src.getSubtype()) tgt.getCode().addCoding(Coding30_50.convertCoding(t));
|
||||
if (src.hasAction())
|
||||
tgt.setActionElement(convertAuditEventAction(src.getActionElement()));
|
||||
if (src.hasRecorded())
|
||||
tgt.setRecordedElement(Instant30_50.convertInstant(src.getRecordedElement()));
|
||||
if (src.hasOutcome())
|
||||
tgt.getOutcome().addCoding().setSystem("http://terminology.hl7.org/CodeSystem/audit-event-outcome").setCode(src.getOutcome().toCode());
|
||||
tgt.getOutcome().getCode().setSystem("http://terminology.hl7.org/CodeSystem/audit-event-outcome").setCode(src.getOutcome().toCode());
|
||||
if (src.hasOutcomeDesc())
|
||||
tgt.getOutcome().setTextElement(String30_50.convertString(src.getOutcomeDescElement()));
|
||||
tgt.getOutcome().getDetailFirstRep().setTextElement(String30_50.convertString(src.getOutcomeDescElement()));
|
||||
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfEvent())
|
||||
tgt.addPurposeOfEvent(CodeableConcept30_50.convertCodeableConcept(t));
|
||||
tgt.addAuthorization(CodeableConcept30_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentComponent t : src.getAgent())
|
||||
tgt.addAgent(convertAuditEventAgentComponent(t));
|
||||
if (src.hasSource())
|
||||
|
@ -45,18 +46,19 @@ public class AuditEvent30_50 {
|
|||
return null;
|
||||
org.hl7.fhir.dstu3.model.AuditEvent tgt = new org.hl7.fhir.dstu3.model.AuditEvent();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setType(Coding30_50.convertCoding(src.getType()));
|
||||
for (org.hl7.fhir.r5.model.Coding t : src.getSubtype()) tgt.addSubtype(Coding30_50.convertCoding(t));
|
||||
if (src.getCategoryFirstRep().hasCoding()) {
|
||||
tgt.setType(Coding30_50.convertCoding(src.getCategoryFirstRep().getCodingFirstRep()));
|
||||
}
|
||||
for (org.hl7.fhir.r5.model.Coding t : src.getCode().getCoding()) tgt.addSubtype(Coding30_50.convertCoding(t));
|
||||
if (src.hasAction())
|
||||
tgt.setActionElement(convertAuditEventAction(src.getActionElement()));
|
||||
if (src.hasRecorded())
|
||||
tgt.setRecordedElement(Instant30_50.convertInstant(src.getRecordedElement()));
|
||||
if (src.hasOutcome() && src.getOutcome().hasCoding("http://terminology.hl7.org/CodeSystem/audit-event-outcome"))
|
||||
tgt.getOutcomeElement().setValueAsString(src.getOutcome().getCode("http://terminology.hl7.org/CodeSystem/audit-event-outcome"));
|
||||
if (src.getOutcome().hasText())
|
||||
tgt.setOutcomeDescElement(String30_50.convertString(src.getOutcome().getTextElement()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfEvent())
|
||||
if (src.hasOutcome() && "http://terminology.hl7.org/CodeSystem/audit-event-outcome".equals(src.getOutcome().getCode().getSystem()))
|
||||
tgt.getOutcomeElement().setValueAsString(src.getOutcome().getCode().getCode());
|
||||
if (src.getOutcome().getDetailFirstRep().hasText())
|
||||
tgt.setOutcomeDescElement(String30_50.convertString(src.getOutcome().getDetailFirstRep().getTextElement()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorization())
|
||||
tgt.addPurposeOfEvent(CodeableConcept30_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent t : src.getAgent())
|
||||
tgt.addAgent(convertAuditEventAgentComponent(t));
|
||||
|
@ -134,21 +136,21 @@ public class AuditEvent30_50 {
|
|||
tgt.setWho(Reference30_50.convertReference(src.getReference()));
|
||||
if (src.hasUserId())
|
||||
tgt.getWho().setIdentifier(Identifier30_50.convertIdentifier(src.getUserId()));
|
||||
if (src.hasAltId())
|
||||
tgt.setAltIdElement(String30_50.convertString(src.getAltIdElement()));
|
||||
if (src.hasName())
|
||||
tgt.setNameElement(String30_50.convertString(src.getNameElement()));
|
||||
// if (src.hasAltId())
|
||||
// tgt.setAltIdElement(String30_50.convertString(src.getAltIdElement()));
|
||||
// if (src.hasName())
|
||||
// tgt.setNameElement(String30_50.convertString(src.getNameElement()));
|
||||
if (src.hasRequestor())
|
||||
tgt.setRequestorElement(Boolean30_50.convertBoolean(src.getRequestorElement()));
|
||||
if (src.hasLocation())
|
||||
tgt.setLocation(Reference30_50.convertReference(src.getLocation()));
|
||||
for (org.hl7.fhir.dstu3.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue());
|
||||
if (src.hasMedia())
|
||||
tgt.setMedia(Coding30_50.convertCoding(src.getMedia()));
|
||||
if (src.hasNetwork())
|
||||
tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
|
||||
// if (src.hasMedia())
|
||||
// tgt.setMedia(Coding30_50.convertCoding(src.getMedia()));
|
||||
// if (src.hasNetwork())
|
||||
// tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
|
||||
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getPurposeOfUse())
|
||||
tgt.addPurposeOfUse(CodeableConcept30_50.convertCodeableConcept(t));
|
||||
tgt.addAuthorization(CodeableConcept30_50.convertCodeableConcept(t));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -165,104 +167,104 @@ public class AuditEvent30_50 {
|
|||
if (src.getWho().hasReference() || src.getWho().hasDisplay() || src.getWho().hasExtension() || src.getWho().hasId())
|
||||
tgt.setReference(Reference30_50.convertReference(src.getWho()));
|
||||
}
|
||||
if (src.hasAltId())
|
||||
tgt.setAltIdElement(String30_50.convertString(src.getAltIdElement()));
|
||||
if (src.hasName())
|
||||
tgt.setNameElement(String30_50.convertString(src.getNameElement()));
|
||||
// if (src.hasAltId())
|
||||
// tgt.setAltIdElement(String30_50.convertString(src.getAltIdElement()));
|
||||
// if (src.hasName())
|
||||
// tgt.setNameElement(String30_50.convertString(src.getNameElement()));
|
||||
if (src.hasRequestor())
|
||||
tgt.setRequestorElement(Boolean30_50.convertBoolean(src.getRequestorElement()));
|
||||
if (src.hasLocation())
|
||||
tgt.setLocation(Reference30_50.convertReference(src.getLocation()));
|
||||
for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.addPolicy(t.getValue());
|
||||
if (src.hasMedia())
|
||||
tgt.setMedia(Coding30_50.convertCoding(src.getMedia()));
|
||||
if (src.hasNetwork())
|
||||
tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfUse())
|
||||
// if (src.hasMedia())
|
||||
// tgt.setMedia(Coding30_50.convertCoding(src.getMedia()));
|
||||
// if (src.hasNetwork())
|
||||
// tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorization())
|
||||
tgt.addPurposeOfUse(CodeableConcept30_50.convertCodeableConcept(t));
|
||||
return tgt;
|
||||
}
|
||||
//
|
||||
// public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent();
|
||||
// ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
// if (src.hasAddress())
|
||||
// tgt.setAddressElement(String30_50.convertString(src.getAddressElement()));
|
||||
// if (src.hasType())
|
||||
// tgt.setTypeElement(convertAuditEventAgentNetworkType(src.getTypeElement()));
|
||||
// return tgt;
|
||||
// }
|
||||
|
||||
public static org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasAddress())
|
||||
tgt.setAddressElement(String30_50.convertString(src.getAddressElement()));
|
||||
if (src.hasType())
|
||||
tgt.setTypeElement(convertAuditEventAgentNetworkType(src.getTypeElement()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasAddress())
|
||||
tgt.setAddressElement(String30_50.convertString(src.getAddressElement()));
|
||||
if (src.hasType())
|
||||
tgt.setTypeElement(convertAuditEventAgentNetworkType(src.getTypeElement()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> convertAuditEventAgentNetworkType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case _1:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._1);
|
||||
break;
|
||||
case _2:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._2);
|
||||
break;
|
||||
case _3:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._3);
|
||||
break;
|
||||
case _4:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._4);
|
||||
break;
|
||||
case _5:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._5);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType> convertAuditEventAgentNetworkType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.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());
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().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.r5.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent();
|
||||
// ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
// if (src.hasAddress())
|
||||
// tgt.setAddressElement(String30_50.convertString(src.getAddressElement()));
|
||||
// if (src.hasType())
|
||||
// tgt.setTypeElement(convertAuditEventAgentNetworkType(src.getTypeElement()));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> convertAuditEventAgentNetworkType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
|
||||
// if (src == null || src.isEmpty())
|
||||
// return null;
|
||||
// org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
|
||||
// ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
// switch (src.getValue()) {
|
||||
// case _1:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._1);
|
||||
// break;
|
||||
// case _2:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._2);
|
||||
// break;
|
||||
// case _3:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._3);
|
||||
// break;
|
||||
// case _4:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._4);
|
||||
// break;
|
||||
// case _5:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._5);
|
||||
// break;
|
||||
// default:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType.NULL);
|
||||
// break;
|
||||
// }
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.AuditEvent.AuditEventAgentNetworkType> convertAuditEventAgentNetworkType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
|
||||
// if (src == null || src.isEmpty())
|
||||
// return null;
|
||||
// org.hl7.fhir.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());
|
||||
// ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().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.r5.model.AuditEvent.AuditEventEntityComponent convertAuditEventEntityComponent(org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
|
@ -272,15 +274,15 @@ public class AuditEvent30_50 {
|
|||
tgt.getWhat().setIdentifier(Identifier30_50.convertIdentifier(src.getIdentifier()));
|
||||
if (src.hasReference())
|
||||
tgt.setWhat(Reference30_50.convertReference(src.getReference()));
|
||||
if (src.hasType())
|
||||
tgt.setType(Coding30_50.convertCoding(src.getType()));
|
||||
// if (src.hasType())
|
||||
// tgt.setType(Coding30_50.convertCoding(src.getType()));
|
||||
if (src.hasRole())
|
||||
tgt.setRole(Coding30_50.convertCoding(src.getRole()));
|
||||
if (src.hasLifecycle())
|
||||
tgt.setLifecycle(Coding30_50.convertCoding(src.getLifecycle()));
|
||||
for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding30_50.convertCoding(t));
|
||||
if (src.hasName())
|
||||
tgt.setNameElement(String30_50.convertString(src.getNameElement()));
|
||||
tgt.getRole().addCoding(Coding30_50.convertCoding(src.getRole()));
|
||||
// if (src.hasLifecycle())
|
||||
// tgt.setLifecycle(Coding30_50.convertCoding(src.getLifecycle()));
|
||||
for (org.hl7.fhir.dstu3.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel().addCoding(Coding30_50.convertCoding(t));
|
||||
// if (src.hasName())
|
||||
// tgt.setNameElement(String30_50.convertString(src.getNameElement()));
|
||||
if (src.hasQuery())
|
||||
tgt.setQueryElement(Base64Binary30_50.convertBase64Binary(src.getQueryElement()));
|
||||
for (org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail())
|
||||
|
@ -299,15 +301,15 @@ public class AuditEvent30_50 {
|
|||
if (src.getWhat().hasReference() || src.getWhat().hasDisplay() || src.getWhat().hasExtension() || src.getWhat().hasId())
|
||||
tgt.setReference(Reference30_50.convertReference(src.getWhat()));
|
||||
}
|
||||
if (src.hasType())
|
||||
tgt.setType(Coding30_50.convertCoding(src.getType()));
|
||||
// if (src.hasType())
|
||||
// tgt.setType(Coding30_50.convertCoding(src.getType()));
|
||||
if (src.hasRole())
|
||||
tgt.setRole(Coding30_50.convertCoding(src.getRole()));
|
||||
if (src.hasLifecycle())
|
||||
tgt.setLifecycle(Coding30_50.convertCoding(src.getLifecycle()));
|
||||
for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding30_50.convertCoding(t));
|
||||
if (src.hasName())
|
||||
tgt.setNameElement(String30_50.convertString(src.getNameElement()));
|
||||
// if (src.hasLifecycle())
|
||||
// tgt.setLifecycle(Coding30_50.convertCoding(src.getLifecycle()));
|
||||
for (CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding30_50.convertCoding(t.getCodingFirstRep()));
|
||||
// if (src.hasName())
|
||||
// tgt.setNameElement(String30_50.convertString(src.getNameElement()));
|
||||
if (src.hasQuery())
|
||||
tgt.setQueryElement(Base64Binary30_50.convertBase64Binary(src.getQueryElement()));
|
||||
for (org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent t : src.getDetail())
|
||||
|
@ -320,8 +322,8 @@ public class AuditEvent30_50 {
|
|||
return null;
|
||||
org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventEntityDetailComponent();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setTypeElement(String30_50.convertString(src.getTypeElement()));
|
||||
if (src.getType().hasTextElement())
|
||||
tgt.setTypeElement(String30_50.convertString(src.getType().getTextElement()));
|
||||
if (src.hasValueStringType())
|
||||
tgt.setValue(src.getValueStringType().getValue().getBytes());
|
||||
else if (src.hasValueBase64BinaryType())
|
||||
|
@ -335,7 +337,7 @@ public class AuditEvent30_50 {
|
|||
org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setTypeElement(String30_50.convertString(src.getTypeElement()));
|
||||
tgt.getType().setTextElement(String30_50.convertString(src.getTypeElement()));
|
||||
if (src.hasValue())
|
||||
tgt.setValue(new org.hl7.fhir.r5.model.Base64BinaryType(src.getValue()));
|
||||
return tgt;
|
||||
|
@ -347,11 +349,11 @@ public class AuditEvent30_50 {
|
|||
return null;
|
||||
org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.dstu3.model.AuditEvent.AuditEventSourceComponent();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasSite())
|
||||
tgt.setSiteElement(String30_50.convertString(src.getSiteElement()));
|
||||
// if (src.hasSite())
|
||||
// tgt.setSiteElement(String30_50.convertString(src.getSiteElement()));
|
||||
if (src.hasObserver())
|
||||
tgt.setIdentifier(Identifier30_50.convertIdentifier(src.getObserver().getIdentifier()));
|
||||
for (org.hl7.fhir.r5.model.Coding t : src.getType()) tgt.addType(Coding30_50.convertCoding(t));
|
||||
for (CodeableConcept t : src.getType()) tgt.addType(Coding30_50.convertCoding(t.getCodingFirstRep()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -360,11 +362,11 @@ public class AuditEvent30_50 {
|
|||
return null;
|
||||
org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasSite())
|
||||
tgt.setSiteElement(String30_50.convertString(src.getSiteElement()));
|
||||
// if (src.hasSite())
|
||||
// tgt.setSiteElement(String30_50.convertString(src.getSiteElement()));
|
||||
if (src.hasIdentifier())
|
||||
tgt.getObserver().setIdentifier(Identifier30_50.convertIdentifier(src.getIdentifier()));
|
||||
for (org.hl7.fhir.dstu3.model.Coding t : src.getType()) tgt.addType(Coding30_50.convertCoding(t));
|
||||
for (org.hl7.fhir.dstu3.model.Coding t : src.getType()) tgt.addType().addCoding(Coding30_50.convertCoding(t));
|
||||
return tgt;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
package org.hl7.fhir.convertors.conv30_50.resources30_50;
|
||||
|
||||
import org.hl7.fhir.convertors.context.ConversionContext10_50;
|
||||
import org.hl7.fhir.convertors.context.ConversionContext30_50;
|
||||
import org.hl7.fhir.convertors.context.ConversionContext40_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.Narrative30_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.Reference30_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.CodeableConcept30_50;
|
||||
|
@ -9,6 +11,7 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Period
|
|||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.DateTime30_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.String30_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.RelatedArtifact;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
|
@ -79,7 +82,7 @@ public class Composition30_50 {
|
|||
tgt.addAttester(convertCompositionAttesterComponent(t));
|
||||
if (src.hasCustodian())
|
||||
tgt.setCustodian(Reference30_50.convertReference(src.getCustodian()));
|
||||
for (org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo())
|
||||
for (RelatedArtifact t : src.getRelatesTo())
|
||||
tgt.addRelatesTo(convertCompositionRelatesToComponent(t));
|
||||
for (org.hl7.fhir.r5.model.Composition.CompositionEventComponent t : src.getEvent())
|
||||
tgt.addEvent(convertCompositionEventComponent(t));
|
||||
|
@ -88,22 +91,22 @@ public class Composition30_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Composition.CompositionAttestationMode> src) throws FHIRException {
|
||||
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.r5.model.CodeableConcept 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());
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case PERSONAL:
|
||||
switch (src.getCode("http://hl7.org/fhir/composition-attestation-mode")) {
|
||||
case "personal":
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.PERSONAL);
|
||||
break;
|
||||
case PROFESSIONAL:
|
||||
case "professional":
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.PROFESSIONAL);
|
||||
break;
|
||||
case LEGAL:
|
||||
case "legal":
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.LEGAL);
|
||||
break;
|
||||
case OFFICIAL:
|
||||
case "official":
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode.OFFICIAL);
|
||||
break;
|
||||
default:
|
||||
|
@ -113,26 +116,26 @@ public class Composition30_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.CompositionAttestationMode> src) throws FHIRException {
|
||||
|
||||
static public org.hl7.fhir.r5.model.CodeableConcept 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.r5.model.Enumeration<org.hl7.fhir.r5.model.Composition.CompositionAttestationMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Composition.CompositionAttestationModeEnumFactory());
|
||||
org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case PERSONAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.PERSONAL);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("personal");
|
||||
break;
|
||||
case PROFESSIONAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.PROFESSIONAL);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("professional");
|
||||
break;
|
||||
case LEGAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.LEGAL);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("legal");
|
||||
break;
|
||||
case OFFICIAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.OFFICIAL);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("official");
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
|
@ -144,7 +147,7 @@ public class Composition30_50 {
|
|||
org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasMode())
|
||||
tgt.setModeElement(convertCompositionAttestationMode(src.getMode().get(0)));
|
||||
tgt.setMode(convertCompositionAttestationMode(src.getMode().get(0)));
|
||||
if (src.hasTime())
|
||||
tgt.setTimeElement(DateTime30_50.convertDateTime(src.getTimeElement()));
|
||||
if (src.hasParty())
|
||||
|
@ -158,7 +161,7 @@ public class Composition30_50 {
|
|||
org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.dstu3.model.Composition.CompositionAttesterComponent();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasMode())
|
||||
tgt.setMode(Collections.singletonList(convertCompositionAttestationMode(src.getModeElement())));
|
||||
tgt.setMode(Collections.singletonList(convertCompositionAttestationMode(src.getMode())));
|
||||
if (src.hasTime())
|
||||
tgt.setTimeElement(DateTime30_50.convertDateTime(src.getTimeElement()));
|
||||
if (src.hasParty())
|
||||
|
@ -192,31 +195,31 @@ public class Composition30_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent src) throws FHIRException {
|
||||
public static org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.r5.model.RelatedArtifact src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent tgt = new org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasCode())
|
||||
tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement()));
|
||||
if (src.hasTarget())
|
||||
tgt.setTarget(ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getTarget()));
|
||||
if (src.hasType())
|
||||
tgt.setCodeElement(convertDocumentRelationshipType(src.getTypeElement()));
|
||||
if (src.hasResourceReference())
|
||||
tgt.setTarget(ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getResourceReference()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent src) throws FHIRException {
|
||||
public static org.hl7.fhir.r5.model.RelatedArtifact convertCompositionRelatesToComponent(org.hl7.fhir.dstu3.model.Composition.CompositionRelatesToComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent();
|
||||
org.hl7.fhir.r5.model.RelatedArtifact tgt = new org.hl7.fhir.r5.model.RelatedArtifact();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasCode())
|
||||
tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement()));
|
||||
if (src.hasTarget())
|
||||
tgt.setTarget(ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getTarget()));
|
||||
tgt.setTypeElement(convertDocumentRelationshipType(src.getCodeElement()));
|
||||
if (src.hasTargetReference())
|
||||
tgt.setResourceReference(Reference30_50.convertReference(src.getTargetReference()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> src) throws FHIRException {
|
||||
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType> src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipTypeEnumFactory());
|
||||
|
@ -241,26 +244,26 @@ public class Composition30_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType> convertDocumentRelationshipType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Composition.DocumentRelationshipType> src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipTypeEnumFactory());
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactTypeEnumFactory());
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case REPLACES:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.REPLACES);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.REPLACES);
|
||||
break;
|
||||
case TRANSFORMS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.TRANSFORMS);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.TRANSFORMS);
|
||||
break;
|
||||
case SIGNS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.SIGNS);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.SIGNS);
|
||||
break;
|
||||
case APPENDS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.APPENDS);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.APPENDS);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.NULL);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
|
|
|
@ -197,29 +197,29 @@ public class ConceptMap30_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode> convertConceptMapGroupUnmappedMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedMode> convertConceptMapGroupUnmappedMode(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory());
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedModeEnumFactory());
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case PROVIDED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedMode.PROVIDED);
|
||||
break;
|
||||
case FIXED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedMode.FIXED);
|
||||
break;
|
||||
case OTHERMAP:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedMode.OTHERMAP);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedMode.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode> convertConceptMapGroupUnmappedMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode> src) throws FHIRException {
|
||||
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode> convertConceptMapGroupUnmappedMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedMode> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedMode> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory());
|
||||
|
|
|
@ -20,8 +20,8 @@ public class DeviceUseStatement30_50 {
|
|||
tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
|
||||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertDeviceUseStatementStatus(src.getStatusElement()));
|
||||
if (src.hasSubject())
|
||||
tgt.setSubject(Reference30_50.convertReference(src.getSubject()));
|
||||
if (src.hasPatient())
|
||||
tgt.setSubject(Reference30_50.convertReference(src.getPatient()));
|
||||
if (src.hasTiming())
|
||||
tgt.setTiming(ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getTiming()));
|
||||
if (src.hasDateAsserted())
|
||||
|
@ -49,7 +49,7 @@ public class DeviceUseStatement30_50 {
|
|||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertDeviceUseStatementStatus(src.getStatusElement()));
|
||||
if (src.hasSubject())
|
||||
tgt.setSubject(Reference30_50.convertReference(src.getSubject()));
|
||||
tgt.setPatient(Reference30_50.convertReference(src.getSubject()));
|
||||
if (src.hasTiming())
|
||||
tgt.setTiming(ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getTiming()));
|
||||
if (src.hasRecordedOn())
|
||||
|
|
|
@ -53,8 +53,8 @@ public class DocumentReference30_50 {
|
|||
return null;
|
||||
org.hl7.fhir.dstu3.model.DocumentReference tgt = new org.hl7.fhir.dstu3.model.DocumentReference();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
|
||||
// if (src.hasMasterIdentifier())
|
||||
// tgt.setMasterIdentifier(VersionConvertor_30_50.convertIdentifier(src.getMasterIdentifier()));
|
||||
// if (src.hasMasterIdentifier())
|
||||
// tgt.setMasterIdentifier(VersionConvertor_30_50.convertIdentifier(src.getMasterIdentifier()));
|
||||
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
|
||||
tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
|
||||
if (src.hasStatus())
|
||||
|
@ -172,7 +172,7 @@ public class DocumentReference30_50 {
|
|||
org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasCode())
|
||||
tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement()));
|
||||
tgt.setCode(convertDocumentRelationshipType(src.getCodeElement()));
|
||||
if (src.hasTarget())
|
||||
tgt.setTarget(Reference30_50.convertReference(src.getTarget()));
|
||||
return tgt;
|
||||
|
@ -184,7 +184,7 @@ public class DocumentReference30_50 {
|
|||
org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.dstu3.model.DocumentReference.DocumentReferenceRelatesToComponent();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasCode())
|
||||
tgt.setCodeElement(convertDocumentRelationshipType2(src.getCodeElement()));
|
||||
tgt.setCodeElement(convertDocumentRelationshipType2(src.getCode()));
|
||||
if (src.hasTarget())
|
||||
tgt.setTarget(Reference30_50.convertReference(src.getTarget()));
|
||||
return tgt;
|
||||
|
@ -196,18 +196,18 @@ public class DocumentReference30_50 {
|
|||
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatusEnumFactory());
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case CURRENT:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.CURRENT);
|
||||
break;
|
||||
case SUPERSEDED:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.SUPERSEDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.NULL);
|
||||
break;
|
||||
case CURRENT:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.CURRENT);
|
||||
break;
|
||||
case SUPERSEDED:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.SUPERSEDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.DocumentReferenceStatus.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
@ -218,44 +218,45 @@ public class DocumentReference30_50 {
|
|||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatusEnumFactory());
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case CURRENT:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.CURRENT);
|
||||
break;
|
||||
case SUPERSEDED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.SUPERSEDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.NULL);
|
||||
break;
|
||||
case CURRENT:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.CURRENT);
|
||||
break;
|
||||
case SUPERSEDED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.SUPERSEDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentReferenceStatus.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType> convertDocumentRelationshipType2(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> src) throws FHIRException {
|
||||
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType> convertDocumentRelationshipType2(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipTypeEnumFactory());
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case REPLACES:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.REPLACES);
|
||||
break;
|
||||
case TRANSFORMS:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.TRANSFORMS);
|
||||
break;
|
||||
case SIGNS:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.SIGNS);
|
||||
break;
|
||||
case APPENDS:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.APPENDS);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.NULL);
|
||||
break;
|
||||
switch (src.getCode("http://hl7.org/fhir/document-relationship-type")) {
|
||||
case "replaces":
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.REPLACES);
|
||||
break;
|
||||
case "transforms":
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.TRANSFORMS);
|
||||
break;
|
||||
case "signs":
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.SIGNS);
|
||||
break;
|
||||
case "appends":
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.APPENDS);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType.NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -265,21 +266,21 @@ public class DocumentReference30_50 {
|
|||
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatusEnumFactory());
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case PRELIMINARY:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.PRELIMINARY);
|
||||
break;
|
||||
case FINAL:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.FINAL);
|
||||
break;
|
||||
case AMENDED:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.AMENDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.ENTEREDINERROR);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.NULL);
|
||||
break;
|
||||
case PRELIMINARY:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.PRELIMINARY);
|
||||
break;
|
||||
case FINAL:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.FINAL);
|
||||
break;
|
||||
case AMENDED:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.AMENDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.ENTEREDINERROR);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.DocumentReference.ReferredDocumentStatus.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
@ -290,49 +291,48 @@ public class DocumentReference30_50 {
|
|||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.CompositionStatus> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.CompositionStatusEnumFactory());
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case PRELIMINARY:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY);
|
||||
break;
|
||||
case FINAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL);
|
||||
break;
|
||||
case AMENDED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL);
|
||||
break;
|
||||
case PRELIMINARY:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.PRELIMINARY);
|
||||
break;
|
||||
case FINAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.FINAL);
|
||||
break;
|
||||
case AMENDED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.AMENDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.ENTEREDINERROR);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.CompositionStatus.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r5.model.CodeableConcept convertDocumentRelationshipType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.DocumentReference.DocumentRelationshipType> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty()) return null;
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipTypeEnumFactory());
|
||||
org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.getValue() == null) {
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.NULL);
|
||||
} else {
|
||||
switch (src.getValue()) {
|
||||
case REPLACES:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.REPLACES);
|
||||
break;
|
||||
case TRANSFORMS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.TRANSFORMS);
|
||||
break;
|
||||
case SIGNS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.SIGNS);
|
||||
break;
|
||||
case APPENDS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.APPENDS);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.NULL);
|
||||
break;
|
||||
case REPLACES:
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("replaces");
|
||||
break;
|
||||
case TRANSFORMS:
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("transforms");
|
||||
break;
|
||||
case SIGNS:
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("signs");
|
||||
break;
|
||||
case APPENDS:
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("appends");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public class Encounter30_50 {
|
|||
if (src.hasAppointment())
|
||||
tgt.addAppointment(Reference30_50.convertReference(src.getAppointment()));
|
||||
if (src.hasPeriod())
|
||||
tgt.setPeriod(Period30_50.convertPeriod(src.getPeriod()));
|
||||
tgt.setActualPeriod(Period30_50.convertPeriod(src.getPeriod()));
|
||||
if (src.hasLength())
|
||||
tgt.setLength(Duration30_50.convertDuration(src.getLength()));
|
||||
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getReason())
|
||||
|
@ -111,8 +111,8 @@ public class Encounter30_50 {
|
|||
tgt.addParticipant(convertEncounterParticipantComponent(t));
|
||||
if (src.hasAppointment())
|
||||
tgt.setAppointment(Reference30_50.convertReference(src.getAppointmentFirstRep()));
|
||||
if (src.hasPeriod())
|
||||
tgt.setPeriod(Period30_50.convertPeriod(src.getPeriod()));
|
||||
if (src.hasActualPeriod())
|
||||
tgt.setPeriod(Period30_50.convertPeriod(src.getActualPeriod()));
|
||||
if (src.hasLength())
|
||||
tgt.setLength(Duration30_50.convertDuration(src.getLength()));
|
||||
for (CodeableReference t : src.getReason())
|
||||
|
@ -271,8 +271,8 @@ public class Encounter30_50 {
|
|||
tgt.addType(CodeableConcept30_50.convertCodeableConcept(t));
|
||||
if (src.hasPeriod())
|
||||
tgt.setPeriod(Period30_50.convertPeriod(src.getPeriod()));
|
||||
if (src.hasIndividual())
|
||||
tgt.setIndividual(Reference30_50.convertReference(src.getIndividual()));
|
||||
if (src.hasActor())
|
||||
tgt.setIndividual(Reference30_50.convertReference(src.getActor()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -286,7 +286,7 @@ public class Encounter30_50 {
|
|||
if (src.hasPeriod())
|
||||
tgt.setPeriod(Period30_50.convertPeriod(src.getPeriod()));
|
||||
if (src.hasIndividual())
|
||||
tgt.setIndividual(Reference30_50.convertReference(src.getIndividual()));
|
||||
tgt.setActor(Reference30_50.convertReference(src.getIndividual()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Unsi
|
|||
import org.hl7.fhir.dstu3.model.Reference;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.CodeableReference;
|
||||
import org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyProcedureComponent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -85,11 +84,11 @@ public class ImagingStudy30_50 {
|
|||
if (src.hasNumberOfInstancesElement())
|
||||
tgt.setNumberOfInstancesElement(UnsignedInt30_50.convertUnsignedInt(src.getNumberOfInstancesElement()));
|
||||
}
|
||||
for (ImagingStudyProcedureComponent t : src.getProcedure()) {
|
||||
if (t.hasValueReference()) {
|
||||
tgt.addProcedureReference(Reference30_50.convertReference(t.getValueReference()));
|
||||
for (CodeableReference t : src.getProcedure()) {
|
||||
if (t.hasReference()) {
|
||||
tgt.addProcedureReference(Reference30_50.convertReference(t.getReference()));
|
||||
} else {
|
||||
tgt.addProcedureCode(CodeableConcept30_50.convertCodeableConcept(t.getValueCodeableConcept()));
|
||||
tgt.addProcedureCode(CodeableConcept30_50.convertCodeableConcept(t.getConcept()));
|
||||
}
|
||||
}
|
||||
List<CodeableReference> reasonCodes = src.getReason();
|
||||
|
@ -179,10 +178,10 @@ public class ImagingStudy30_50 {
|
|||
}
|
||||
List<Reference> procedureReferences = src.getProcedureReference();
|
||||
if (procedureReferences.size() > 0) {
|
||||
tgt.addProcedure().setValue(Reference30_50.convertReference(procedureReferences.get(0)));
|
||||
tgt.addProcedure().setReference(Reference30_50.convertReference(procedureReferences.get(0)));
|
||||
}
|
||||
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getProcedureCode()) {
|
||||
tgt.addProcedure().setValue(CodeableConcept30_50.convertCodeableConcept(t));
|
||||
tgt.addProcedure().setConcept(CodeableConcept30_50.convertCodeableConcept(t));
|
||||
}
|
||||
if (src.hasReason()) {
|
||||
if (src.hasReason())
|
||||
|
|
|
@ -21,7 +21,7 @@ public class Medication30_50 {
|
|||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertMedicationStatus(src.getStatusElement()));
|
||||
if (src.hasManufacturer())
|
||||
tgt.setSponsor(Reference30_50.convertReference(src.getManufacturer()));
|
||||
tgt.setMarketingAuthorizationHolder(Reference30_50.convertReference(src.getManufacturer()));
|
||||
if (src.hasForm())
|
||||
tgt.setDoseForm(CodeableConcept30_50.convertCodeableConcept(src.getForm()));
|
||||
for (org.hl7.fhir.dstu3.model.Medication.MedicationIngredientComponent t : src.getIngredient())
|
||||
|
@ -40,8 +40,8 @@ public class Medication30_50 {
|
|||
tgt.setCode(CodeableConcept30_50.convertCodeableConcept(src.getCode()));
|
||||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertMedicationStatus(src.getStatusElement()));
|
||||
if (src.hasSponsor())
|
||||
tgt.setManufacturer(Reference30_50.convertReference(src.getSponsor()));
|
||||
if (src.hasMarketingAuthorizationHolder())
|
||||
tgt.setManufacturer(Reference30_50.convertReference(src.getMarketingAuthorizationHolder()));
|
||||
if (src.hasDoseForm())
|
||||
tgt.setForm(CodeableConcept30_50.convertCodeableConcept(src.getDoseForm()));
|
||||
for (org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent t : src.getIngredient())
|
||||
|
|
|
@ -50,7 +50,7 @@ public class MedicationRequest30_50 {
|
|||
}
|
||||
}
|
||||
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation30_50.convertAnnotation(t));
|
||||
for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction())
|
||||
for (org.hl7.fhir.r5.model.Dosage t : src.getDose().getDosageInstruction())
|
||||
tgt.addDosageInstruction(Dosage30_50.convertDosage(t));
|
||||
if (src.hasDispenseRequest())
|
||||
tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest()));
|
||||
|
@ -101,7 +101,7 @@ public class MedicationRequest30_50 {
|
|||
tgt.addReason(new CodeableReference().setReference(Reference30_50.convertReference(t)));
|
||||
for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(Annotation30_50.convertAnnotation(t));
|
||||
for (org.hl7.fhir.dstu3.model.Dosage t : src.getDosageInstruction())
|
||||
tgt.addDosageInstruction(Dosage30_50.convertDosage(t));
|
||||
tgt.getDose().addDosageInstruction(Dosage30_50.convertDosage(t));
|
||||
if (src.hasDispenseRequest())
|
||||
tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest()));
|
||||
if (src.hasSubstitution())
|
||||
|
|
|
@ -19,8 +19,8 @@ public class MedicationStatement30_50 {
|
|||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
|
||||
for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier())
|
||||
tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
|
||||
for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference30_50.convertReference(t));
|
||||
for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference30_50.convertReference(t));
|
||||
// for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference30_50.convertReference(t));
|
||||
// for (org.hl7.fhir.dstu3.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference30_50.convertReference(t));
|
||||
if (src.hasContext())
|
||||
tgt.setEncounter(Reference30_50.convertReference(src.getContext()));
|
||||
if (src.hasStatus())
|
||||
|
@ -59,8 +59,8 @@ public class MedicationStatement30_50 {
|
|||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
|
||||
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
|
||||
tgt.addIdentifier(Identifier30_50.convertIdentifier(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference30_50.convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference30_50.convertReference(t));
|
||||
// for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference30_50.convertReference(t));
|
||||
// for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference30_50.convertReference(t));
|
||||
if (src.hasEncounter())
|
||||
tgt.setContext(Reference30_50.convertReference(src.getEncounter()));
|
||||
if (src.hasStatus())
|
||||
|
@ -103,14 +103,14 @@ public class MedicationStatement30_50 {
|
|||
// case ACTIVE:
|
||||
// tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.ACTIVE);
|
||||
// break;
|
||||
case COMPLETED:
|
||||
case RECORDED:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.COMPLETED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR);
|
||||
break;
|
||||
case UNKNOWN:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.INTENDED);
|
||||
case DRAFT:
|
||||
tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.COMPLETED);
|
||||
break;
|
||||
// case STOPPED:
|
||||
// tgt.setValue(org.hl7.fhir.dstu3.model.MedicationStatement.MedicationStatementStatus.STOPPED);
|
||||
|
@ -132,22 +132,22 @@ public class MedicationStatement30_50 {
|
|||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case ACTIVE:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.COMPLETED);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
case COMPLETED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.COMPLETED);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.ENTEREDINERROR);
|
||||
break;
|
||||
case INTENDED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.UNKNOWN);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
case STOPPED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.UNKNOWN);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
case ONHOLD:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.UNKNOWN);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.NULL);
|
||||
|
|
|
@ -75,7 +75,7 @@ public class Person30_50 {
|
|||
tgt.setBirthDateElement(Date30_50.convertDate(src.getBirthDateElement()));
|
||||
for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(Address30_50.convertAddress(t));
|
||||
if (src.hasPhoto())
|
||||
tgt.setPhoto(Attachment30_50.convertAttachment(src.getPhoto()));
|
||||
tgt.setPhoto(Attachment30_50.convertAttachment(src.getPhotoFirstRep()));
|
||||
if (src.hasManagingOrganization())
|
||||
tgt.setManagingOrganization(Reference30_50.convertReference(src.getManagingOrganization()));
|
||||
if (src.hasActive())
|
||||
|
@ -100,7 +100,7 @@ public class Person30_50 {
|
|||
tgt.setBirthDateElement(Date30_50.convertDate(src.getBirthDateElement()));
|
||||
for (org.hl7.fhir.dstu3.model.Address t : src.getAddress()) tgt.addAddress(Address30_50.convertAddress(t));
|
||||
if (src.hasPhoto())
|
||||
tgt.setPhoto(Attachment30_50.convertAttachment(src.getPhoto()));
|
||||
tgt.addPhoto(Attachment30_50.convertAttachment(src.getPhoto()));
|
||||
if (src.hasManagingOrganization())
|
||||
tgt.setManagingOrganization(Reference30_50.convertReference(src.getManagingOrganization()));
|
||||
if (src.hasActive())
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Signat
|
|||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Instant30_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.Uri30_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.CodeableReference;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
|
@ -56,7 +57,7 @@ public class Provenance30_50 {
|
|||
if (src.hasLocation())
|
||||
tgt.setLocation(Reference30_50.convertReference(src.getLocation()));
|
||||
for (org.hl7.fhir.dstu3.model.Coding t : src.getReason())
|
||||
tgt.addReason().addCoding(Coding30_50.convertCoding(t));
|
||||
tgt.addAuthorization().getConcept().addCoding(Coding30_50.convertCoding(t));
|
||||
if (src.hasActivity())
|
||||
tgt.getActivity().addCoding(Coding30_50.convertCoding(src.getActivity()));
|
||||
for (org.hl7.fhir.dstu3.model.Provenance.ProvenanceAgentComponent t : src.getAgent())
|
||||
|
@ -81,9 +82,10 @@ public class Provenance30_50 {
|
|||
for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.getPolicy().add(Uri30_50.convertUri(t));
|
||||
if (src.hasLocation())
|
||||
tgt.setLocation(Reference30_50.convertReference(src.getLocation()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason())
|
||||
for (org.hl7.fhir.r5.model.Coding t2 : t.getCoding())
|
||||
tgt.addReason(Coding30_50.convertCoding(t2));
|
||||
for (CodeableReference t : src.getAuthorization())
|
||||
if (t.hasConcept())
|
||||
for (org.hl7.fhir.r5.model.Coding t2 : t.getConcept().getCoding())
|
||||
tgt.addReason(Coding30_50.convertCoding(t2));
|
||||
if (src.hasActivity())
|
||||
tgt.setActivity(Coding30_50.convertCoding(src.getActivity().getCodingFirstRep()));
|
||||
for (org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent t : src.getAgent())
|
||||
|
|
|
@ -16,7 +16,7 @@ public class QuestionnaireResponse30_50 {
|
|||
org.hl7.fhir.r5.model.QuestionnaireResponse tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
|
||||
if (src.hasIdentifier())
|
||||
tgt.setIdentifier(Identifier30_50.convertIdentifier(src.getIdentifier()));
|
||||
tgt.addIdentifier(Identifier30_50.convertIdentifier(src.getIdentifier()));
|
||||
for (org.hl7.fhir.dstu3.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference30_50.convertReference(t));
|
||||
for (org.hl7.fhir.dstu3.model.Reference t : src.getParent()) tgt.addPartOf(Reference30_50.convertReference(t));
|
||||
if (src.hasQuestionnaire())
|
||||
|
@ -44,7 +44,7 @@ public class QuestionnaireResponse30_50 {
|
|||
org.hl7.fhir.dstu3.model.QuestionnaireResponse tgt = new org.hl7.fhir.dstu3.model.QuestionnaireResponse();
|
||||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyDomainResource(src, tgt);
|
||||
if (src.hasIdentifier())
|
||||
tgt.setIdentifier(Identifier30_50.convertIdentifier(src.getIdentifier()));
|
||||
tgt.setIdentifier(Identifier30_50.convertIdentifier(src.getIdentifierFirstRep()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference30_50.convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addParent(Reference30_50.convertReference(t));
|
||||
if (src.hasQuestionnaire())
|
||||
|
|
|
@ -25,7 +25,7 @@ public class Slot30_50 {
|
|||
for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSpecialty())
|
||||
tgt.addSpecialty(CodeableConcept30_50.convertCodeableConcept(t));
|
||||
if (src.hasAppointmentType())
|
||||
tgt.setAppointmentType(CodeableConcept30_50.convertCodeableConcept(src.getAppointmentType()));
|
||||
tgt.addAppointmentType(CodeableConcept30_50.convertCodeableConcept(src.getAppointmentType()));
|
||||
if (src.hasSchedule())
|
||||
tgt.setSchedule(Reference30_50.convertReference(src.getSchedule()));
|
||||
if (src.hasStatus())
|
||||
|
@ -55,7 +55,7 @@ public class Slot30_50 {
|
|||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty())
|
||||
tgt.addSpecialty(CodeableConcept30_50.convertCodeableConcept(t));
|
||||
if (src.hasAppointmentType())
|
||||
tgt.setAppointmentType(CodeableConcept30_50.convertCodeableConcept(src.getAppointmentType()));
|
||||
tgt.setAppointmentType(CodeableConcept30_50.convertCodeableConcept(src.getAppointmentTypeFirstRep()));
|
||||
if (src.hasSchedule())
|
||||
tgt.setSchedule(Reference30_50.convertReference(src.getSchedule()));
|
||||
if (src.hasStatus())
|
||||
|
|
|
@ -84,7 +84,7 @@ public class Specimen30_50 {
|
|||
if (src.hasMethod())
|
||||
tgt.setMethod(CodeableConcept30_50.convertCodeableConcept(src.getMethod()));
|
||||
if (src.hasBodySite())
|
||||
tgt.setBodySite(CodeableConcept30_50.convertCodeableConcept(src.getBodySite()));
|
||||
tgt.getBodySite().setConcept(CodeableConcept30_50.convertCodeableConcept(src.getBodySite()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -101,8 +101,8 @@ public class Specimen30_50 {
|
|||
tgt.setQuantity(SimpleQuantity30_50.convertSimpleQuantity(src.getQuantity()));
|
||||
if (src.hasMethod())
|
||||
tgt.setMethod(CodeableConcept30_50.convertCodeableConcept(src.getMethod()));
|
||||
if (src.hasBodySite())
|
||||
tgt.setBodySite(CodeableConcept30_50.convertCodeableConcept(src.getBodySite()));
|
||||
if (src.getBodySite().hasConcept())
|
||||
tgt.setBodySite(CodeableConcept30_50.convertCodeableConcept(src.getBodySite().getConcept()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -153,8 +153,8 @@ public class Specimen30_50 {
|
|||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
|
||||
if (src.hasProcedure())
|
||||
tgt.setProcedure(CodeableConcept30_50.convertCodeableConcept(src.getProcedure()));
|
||||
// if (src.hasProcedure())
|
||||
// tgt.setProcedure(CodeableConcept30_50.convertCodeableConcept(src.getProcedure()));
|
||||
for (org.hl7.fhir.dstu3.model.Reference t : src.getAdditive()) tgt.addAdditive(Reference30_50.convertReference(t));
|
||||
if (src.hasTime())
|
||||
tgt.setTime(ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getTime()));
|
||||
|
@ -168,8 +168,8 @@ public class Specimen30_50 {
|
|||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(String30_50.convertString(src.getDescriptionElement()));
|
||||
if (src.hasProcedure())
|
||||
tgt.setProcedure(CodeableConcept30_50.convertCodeableConcept(src.getProcedure()));
|
||||
// if (src.hasProcedure())
|
||||
// tgt.setProcedure(CodeableConcept30_50.convertCodeableConcept(src.getProcedure()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getAdditive()) tgt.addAdditive(Reference30_50.convertReference(t));
|
||||
if (src.hasTime())
|
||||
tgt.setTime(ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getTime()));
|
||||
|
|
|
@ -6,7 +6,10 @@ import org.hl7.fhir.convertors.conv30_50.datatypes30_50.UsageContext30_50;
|
|||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.CodeableConcept30_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.complextypes30_50.Identifier30_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.primitivetypes30_50.*;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.StringType;
|
||||
import org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -218,7 +221,7 @@ public class StructureMap30_50 {
|
|||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasName())
|
||||
tgt.setNameElement(Id30_50.convertId(src.getNameElement()));
|
||||
for (org.hl7.fhir.dstu3.model.StringType t : src.getVariable()) tgt.addVariable(t.getValue());
|
||||
for (org.hl7.fhir.dstu3.model.StringType t : src.getVariable()) tgt.addParameter().setValue(String30_50.convertString(t));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -229,7 +232,7 @@ public class StructureMap30_50 {
|
|||
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
|
||||
if (src.hasName())
|
||||
tgt.setNameElement(Id30_50.convertId(src.getNameElement()));
|
||||
for (org.hl7.fhir.r5.model.StringType t : src.getVariable()) tgt.addVariable(t.getValue());
|
||||
for (StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.addVariable(t.getValue().primitiveValue());
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -247,7 +250,7 @@ public class StructureMap30_50 {
|
|||
if (src.hasType())
|
||||
tgt.setTypeElement(String30_50.convertString(src.getTypeElement()));
|
||||
if (src.hasDefaultValue())
|
||||
tgt.setDefaultValue(ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getDefaultValue()));
|
||||
tgt.setDefaultValue(ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getDefaultValueElement()));
|
||||
if (src.hasElement())
|
||||
tgt.setElementElement(String30_50.convertString(src.getElementElement()));
|
||||
if (src.hasListMode())
|
||||
|
@ -275,7 +278,7 @@ public class StructureMap30_50 {
|
|||
if (src.hasType())
|
||||
tgt.setTypeElement(String30_50.convertString(src.getTypeElement()));
|
||||
if (src.hasDefaultValue())
|
||||
tgt.setDefaultValue(ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getDefaultValue()));
|
||||
tgt.setDefaultValueElement((StringType) ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().convertType(src.getDefaultValue()));
|
||||
if (src.hasElement())
|
||||
tgt.setElementElement(String30_50.convertString(src.getElementElement()));
|
||||
if (src.hasListMode())
|
||||
|
|
|
@ -17,7 +17,7 @@ public class RelatedArtifact40_50 {
|
|||
if (src.hasLabel()) tgt.setLabelElement(String40_50.convertString(src.getLabelElement()));
|
||||
if (src.hasDisplay()) tgt.setDisplayElement(String40_50.convertString(src.getDisplayElement()));
|
||||
if (src.hasCitation()) tgt.setCitationElement(MarkDown40_50.convertMarkdown(src.getCitationElement()));
|
||||
if (src.hasUrl()) tgt.setUrlElement(Url40_50.convertUrl(src.getUrlElement()));
|
||||
if (src.hasUrl()) tgt.getDocument().setUrlElement(Url40_50.convertUrl(src.getUrlElement()));
|
||||
if (src.hasDocument()) tgt.setDocument(Attachment40_50.convertAttachment(src.getDocument()));
|
||||
if (src.hasResource()) tgt.setResourceElement(Canonical40_50.convertCanonical(src.getResourceElement()));
|
||||
return tgt;
|
||||
|
@ -31,7 +31,7 @@ public class RelatedArtifact40_50 {
|
|||
if (src.hasLabel()) tgt.setLabelElement(String40_50.convertString(src.getLabelElement()));
|
||||
if (src.hasDisplay()) tgt.setDisplayElement(String40_50.convertString(src.getDisplayElement()));
|
||||
if (src.hasCitation()) tgt.setCitationElement(MarkDown40_50.convertMarkdown(src.getCitationElement()));
|
||||
if (src.hasUrl()) tgt.setUrlElement(Url40_50.convertUrl(src.getUrlElement()));
|
||||
if (src.getDocument().hasUrl()) tgt.setUrlElement(Url40_50.convertUrl(src.getDocument().getUrlElement()));
|
||||
if (src.hasDocument()) tgt.setDocument(Attachment40_50.convertAttachment(src.getDocument()));
|
||||
if (src.hasResource()) tgt.setResourceElement(Canonical40_50.convertCanonical(src.getResourceElement()));
|
||||
return tgt;
|
||||
|
|
|
@ -6,6 +6,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Identifier4
|
|||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Period40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.DateTime40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Instant40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.MarkDown40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.PositiveInt40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50;
|
||||
|
@ -55,7 +56,7 @@ public class Appointment40_50 {
|
|||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertAppointmentStatus(src.getStatusElement()));
|
||||
if (src.hasCancelationReason())
|
||||
tgt.setCancelationReason(CodeableConcept40_50.convertCodeableConcept(src.getCancelationReason()));
|
||||
tgt.setCancellationReason(CodeableConcept40_50.convertCodeableConcept(src.getCancelationReason()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceCategory())
|
||||
tgt.addServiceCategory(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getServiceType())
|
||||
|
@ -84,9 +85,9 @@ public class Appointment40_50 {
|
|||
if (src.hasCreated())
|
||||
tgt.setCreatedElement(DateTime40_50.convertDateTime(src.getCreatedElement()));
|
||||
if (src.hasComment())
|
||||
tgt.setCommentElement(String40_50.convertString(src.getCommentElement()));
|
||||
if (src.hasPatientInstruction())
|
||||
tgt.setPatientInstructionElement(String40_50.convertString(src.getPatientInstructionElement()));
|
||||
tgt.getNoteFirstRep().setTextElement(MarkDown40_50.convertStringToMarkdown(src.getCommentElement()));
|
||||
// if (src.hasPatientInstruction())
|
||||
// tgt.setPatientInstructionElement(String40_50.convertString(src.getPatientInstructionElement()));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r4.model.Appointment.AppointmentParticipantComponent t : src.getParticipant())
|
||||
tgt.addParticipant(convertAppointmentParticipantComponent(t));
|
||||
|
@ -104,8 +105,8 @@ public class Appointment40_50 {
|
|||
tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
|
||||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertAppointmentStatus(src.getStatusElement()));
|
||||
if (src.hasCancelationReason())
|
||||
tgt.setCancelationReason(CodeableConcept40_50.convertCodeableConcept(src.getCancelationReason()));
|
||||
if (src.hasCancellationReason())
|
||||
tgt.setCancelationReason(CodeableConcept40_50.convertCodeableConcept(src.getCancellationReason()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceCategory())
|
||||
tgt.addServiceCategory(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getServiceType())
|
||||
|
@ -135,10 +136,10 @@ public class Appointment40_50 {
|
|||
for (org.hl7.fhir.r5.model.Reference t : src.getSlot()) tgt.addSlot(Reference40_50.convertReference(t));
|
||||
if (src.hasCreated())
|
||||
tgt.setCreatedElement(DateTime40_50.convertDateTime(src.getCreatedElement()));
|
||||
if (src.hasComment())
|
||||
tgt.setCommentElement(String40_50.convertString(src.getCommentElement()));
|
||||
if (src.hasPatientInstruction())
|
||||
tgt.setPatientInstructionElement(String40_50.convertString(src.getPatientInstructionElement()));
|
||||
if (src.hasNote())
|
||||
tgt.setCommentElement(String40_50.convertString(src.getNoteFirstRep().getTextElement()));
|
||||
// if (src.hasPatientInstruction())
|
||||
// tgt.setPatientInstructionElement(String40_50.convertString(src.getPatientInstructionElement()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.Appointment.AppointmentParticipantComponent t : src.getParticipant())
|
||||
tgt.addParticipant(convertAppointmentParticipantComponent(t));
|
||||
|
@ -290,46 +291,36 @@ public class Appointment40_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Appointment.ParticipantRequired> convertParticipantRequired(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Appointment.ParticipantRequired> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r5.model.BooleanType convertParticipantRequired(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Appointment.ParticipantRequired> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Appointment.ParticipantRequired> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Appointment.ParticipantRequiredEnumFactory());
|
||||
org.hl7.fhir.r5.model.BooleanType tgt = new org.hl7.fhir.r5.model.BooleanType();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case REQUIRED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipantRequired.REQUIRED);
|
||||
tgt.setValue(true);
|
||||
break;
|
||||
case OPTIONAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipantRequired.OPTIONAL);
|
||||
tgt.setValue(false);
|
||||
break;
|
||||
case INFORMATIONONLY:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipantRequired.INFORMATIONONLY);
|
||||
tgt.setValue(false);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Appointment.ParticipantRequired.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Appointment.ParticipantRequired> convertParticipantRequired(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Appointment.ParticipantRequired> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Appointment.ParticipantRequired> convertParticipantRequired(org.hl7.fhir.r5.model.BooleanType src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Appointment.ParticipantRequired> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Appointment.ParticipantRequiredEnumFactory());
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case REQUIRED:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.REQUIRED);
|
||||
break;
|
||||
case OPTIONAL:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.OPTIONAL);
|
||||
break;
|
||||
case INFORMATIONONLY:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.INFORMATIONONLY);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.NULL);
|
||||
break;
|
||||
if (src.getValue()) { // case REQUIRED:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.REQUIRED);
|
||||
} else { // case OPTIONAL + others:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Appointment.ParticipantRequired.OPTIONAL);
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Period40_50
|
|||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.*;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.CodeableConcept;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
|
@ -45,20 +46,20 @@ public class AuditEvent40_50 {
|
|||
org.hl7.fhir.r5.model.AuditEvent tgt = new org.hl7.fhir.r5.model.AuditEvent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setType(Coding40_50.convertCoding(src.getType()));
|
||||
for (org.hl7.fhir.r4.model.Coding t : src.getSubtype()) tgt.addSubtype(Coding40_50.convertCoding(t));
|
||||
tgt.getCategoryFirstRep().addCoding(Coding40_50.convertCoding(src.getType()));
|
||||
for (org.hl7.fhir.r4.model.Coding t : src.getSubtype()) tgt.getCode().addCoding(Coding40_50.convertCoding(t));
|
||||
if (src.hasAction())
|
||||
tgt.setActionElement(convertAuditEventAction(src.getActionElement()));
|
||||
if (src.hasPeriod())
|
||||
tgt.setPeriod(Period40_50.convertPeriod(src.getPeriod()));
|
||||
tgt.setOccurred(Period40_50.convertPeriod(src.getPeriod()));
|
||||
if (src.hasRecorded())
|
||||
tgt.setRecordedElement(Instant40_50.convertInstant(src.getRecordedElement()));
|
||||
if (src.hasOutcome())
|
||||
tgt.getOutcome().addCoding().setSystem("http://terminology.hl7.org/CodeSystem/audit-event-outcome").setCode(src.getOutcome().toCode());
|
||||
tgt.getOutcome().getCode().setSystem("http://terminology.hl7.org/CodeSystem/audit-event-outcome").setCode(src.getOutcome().toCode());
|
||||
if (src.hasOutcomeDesc())
|
||||
tgt.getOutcome().setTextElement(String40_50.convertString(src.getOutcomeDescElement()));
|
||||
tgt.getOutcome().getDetailFirstRep().setTextElement(String40_50.convertString(src.getOutcomeDescElement()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfEvent())
|
||||
tgt.addPurposeOfEvent(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
tgt.addAuthorization(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentComponent t : src.getAgent())
|
||||
tgt.addAgent(convertAuditEventAgentComponent(t));
|
||||
if (src.hasSource())
|
||||
|
@ -73,20 +74,21 @@ public class AuditEvent40_50 {
|
|||
return null;
|
||||
org.hl7.fhir.r4.model.AuditEvent tgt = new org.hl7.fhir.r4.model.AuditEvent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setType(Coding40_50.convertCoding(src.getType()));
|
||||
for (org.hl7.fhir.r5.model.Coding t : src.getSubtype()) tgt.addSubtype(Coding40_50.convertCoding(t));
|
||||
if (src.getCategoryFirstRep().hasCoding()) {
|
||||
tgt.setType(Coding40_50.convertCoding(src.getCategoryFirstRep().getCodingFirstRep()));
|
||||
}
|
||||
for (org.hl7.fhir.r5.model.Coding t : src.getCode().getCoding()) tgt.addSubtype(Coding40_50.convertCoding(t));
|
||||
if (src.hasAction())
|
||||
tgt.setActionElement(convertAuditEventAction(src.getActionElement()));
|
||||
if (src.hasPeriod())
|
||||
tgt.setPeriod(Period40_50.convertPeriod(src.getPeriod()));
|
||||
if (src.hasOccurredPeriod())
|
||||
tgt.setPeriod(Period40_50.convertPeriod(src.getOccurredPeriod()));
|
||||
if (src.hasRecorded())
|
||||
tgt.setRecordedElement(Instant40_50.convertInstant(src.getRecordedElement()));
|
||||
if (src.hasOutcome() && src.getOutcome().hasCoding("http://terminology.hl7.org/CodeSystem/audit-event-outcome"))
|
||||
tgt.getOutcomeElement().setValueAsString(src.getOutcome().getCode("http://terminology.hl7.org/CodeSystem/audit-event-outcome"));
|
||||
if (src.getOutcome().hasText())
|
||||
tgt.setOutcomeDescElement(String40_50.convertString(src.getOutcome().getTextElement()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfEvent())
|
||||
if (src.hasOutcome() && "http://terminology.hl7.org/CodeSystem/audit-event-outcome".equals(src.getOutcome().getCode().getSystem()))
|
||||
tgt.getOutcomeElement().setValueAsString(src.getOutcome().getCode().getCode());
|
||||
if (src.getOutcome().getDetailFirstRep().hasText())
|
||||
tgt.setOutcomeDescElement(String40_50.convertString(src.getOutcome().getDetailFirstRep().getTextElement()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorization())
|
||||
tgt.addPurposeOfEvent(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentComponent t : src.getAgent())
|
||||
tgt.addAgent(convertAuditEventAgentComponent(t));
|
||||
|
@ -165,21 +167,21 @@ public class AuditEvent40_50 {
|
|||
tgt.addRole(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasWho())
|
||||
tgt.setWho(Reference40_50.convertReference(src.getWho()));
|
||||
if (src.hasAltId())
|
||||
tgt.setAltIdElement(String40_50.convertString(src.getAltIdElement()));
|
||||
if (src.hasName())
|
||||
tgt.setNameElement(String40_50.convertString(src.getNameElement()));
|
||||
// if (src.hasAltId())
|
||||
// tgt.setAltIdElement(String40_50.convertString(src.getAltIdElement()));
|
||||
// if (src.hasName())
|
||||
// tgt.setNameElement(String40_50.convertString(src.getNameElement()));
|
||||
if (src.hasRequestor())
|
||||
tgt.setRequestorElement(Boolean40_50.convertBoolean(src.getRequestorElement()));
|
||||
if (src.hasLocation())
|
||||
tgt.setLocation(Reference40_50.convertReference(src.getLocation()));
|
||||
for (org.hl7.fhir.r4.model.UriType t : src.getPolicy()) tgt.getPolicy().add(Uri40_50.convertUri(t));
|
||||
if (src.hasMedia())
|
||||
tgt.setMedia(Coding40_50.convertCoding(src.getMedia()));
|
||||
if (src.hasNetwork())
|
||||
tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
|
||||
// if (src.hasMedia())
|
||||
// tgt.setMedia(Coding40_50.convertCoding(src.getMedia()));
|
||||
// if (src.hasNetwork())
|
||||
// tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getPurposeOfUse())
|
||||
tgt.addPurposeOfUse(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
tgt.addAuthorization(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -194,114 +196,114 @@ public class AuditEvent40_50 {
|
|||
tgt.addRole(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasWho())
|
||||
tgt.setWho(Reference40_50.convertReference(src.getWho()));
|
||||
if (src.hasAltId())
|
||||
tgt.setAltIdElement(String40_50.convertString(src.getAltIdElement()));
|
||||
if (src.hasName())
|
||||
tgt.setNameElement(String40_50.convertString(src.getNameElement()));
|
||||
// if (src.hasAltId())
|
||||
// tgt.setAltIdElement(String40_50.convertString(src.getAltIdElement()));
|
||||
// if (src.hasName())
|
||||
// tgt.setNameElement(String40_50.convertString(src.getNameElement()));
|
||||
if (src.hasRequestor())
|
||||
tgt.setRequestorElement(Boolean40_50.convertBoolean(src.getRequestorElement()));
|
||||
if (src.hasLocation())
|
||||
tgt.setLocation(Reference40_50.convertReference(src.getLocation()));
|
||||
for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.getPolicy().add(Uri40_50.convertUri(t));
|
||||
if (src.hasMedia())
|
||||
tgt.setMedia(Coding40_50.convertCoding(src.getMedia()));
|
||||
if (src.hasNetwork())
|
||||
tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getPurposeOfUse())
|
||||
// if (src.hasMedia())
|
||||
// tgt.setMedia(Coding40_50.convertCoding(src.getMedia()));
|
||||
// if (src.hasNetwork())
|
||||
// tgt.setNetwork(convertAuditEventAgentNetworkComponent(src.getNetwork()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getAuthorization())
|
||||
tgt.addPurposeOfUse(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasAddress())
|
||||
tgt.setAddressElement(String40_50.convertString(src.getAddressElement()));
|
||||
if (src.hasType())
|
||||
tgt.setTypeElement(convertAuditEventAgentNetworkType(src.getTypeElement()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasAddress())
|
||||
tgt.setAddressElement(String40_50.convertString(src.getAddressElement()));
|
||||
if (src.hasType())
|
||||
tgt.setTypeElement(convertAuditEventAgentNetworkType(src.getTypeElement()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> convertAuditEventAgentNetworkType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case _1:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._1);
|
||||
break;
|
||||
case _2:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._2);
|
||||
break;
|
||||
case _3:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._3);
|
||||
break;
|
||||
case _4:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._4);
|
||||
break;
|
||||
case _5:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._5);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType> convertAuditEventAgentNetworkType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case _1:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._1);
|
||||
break;
|
||||
case _2:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._2);
|
||||
break;
|
||||
case _3:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._3);
|
||||
break;
|
||||
case _4:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._4);
|
||||
break;
|
||||
case _5:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._5);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
// public static org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasAddress())
|
||||
// tgt.setAddressElement(String40_50.convertString(src.getAddressElement()));
|
||||
// if (src.hasType())
|
||||
// tgt.setTypeElement(convertAuditEventAgentNetworkType(src.getTypeElement()));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// public static org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent convertAuditEventAgentNetworkComponent(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasAddress())
|
||||
// tgt.setAddressElement(String40_50.convertString(src.getAddressElement()));
|
||||
// if (src.hasType())
|
||||
// tgt.setTypeElement(convertAuditEventAgentNetworkType(src.getTypeElement()));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> convertAuditEventAgentNetworkType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
|
||||
// if (src == null || src.isEmpty())
|
||||
// return null;
|
||||
// org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// switch (src.getValue()) {
|
||||
// case _1:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._1);
|
||||
// break;
|
||||
// case _2:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._2);
|
||||
// break;
|
||||
// case _3:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._3);
|
||||
// break;
|
||||
// case _4:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._4);
|
||||
// break;
|
||||
// case _5:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType._5);
|
||||
// break;
|
||||
// default:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType.NULL);
|
||||
// break;
|
||||
// }
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType> convertAuditEventAgentNetworkType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AuditEvent.AuditEventAgentNetworkType> src) throws FHIRException {
|
||||
// if (src == null || src.isEmpty())
|
||||
// return null;
|
||||
// org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkTypeEnumFactory());
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// switch (src.getValue()) {
|
||||
// case _1:
|
||||
// tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._1);
|
||||
// break;
|
||||
// case _2:
|
||||
// tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._2);
|
||||
// break;
|
||||
// case _3:
|
||||
// tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._3);
|
||||
// break;
|
||||
// case _4:
|
||||
// tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._4);
|
||||
// break;
|
||||
// case _5:
|
||||
// tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType._5);
|
||||
// break;
|
||||
// default:
|
||||
// tgt.setValue(org.hl7.fhir.r4.model.AuditEvent.AuditEventAgentNetworkType.NULL);
|
||||
// break;
|
||||
// }
|
||||
// return tgt;
|
||||
// }
|
||||
|
||||
public static org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent convertAuditEventSourceComponent(org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventSourceComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasSite())
|
||||
tgt.setSiteElement(String40_50.convertString(src.getSiteElement()));
|
||||
// if (src.hasSite())
|
||||
// tgt.setSiteElement(String40_50.convertString(src.getSiteElement()));
|
||||
if (src.hasObserver())
|
||||
tgt.setObserver(Reference40_50.convertReference(src.getObserver()));
|
||||
for (org.hl7.fhir.r4.model.Coding t : src.getType()) tgt.addType(Coding40_50.convertCoding(t));
|
||||
for (org.hl7.fhir.r4.model.Coding t : src.getType()) tgt.addType().addCoding(Coding40_50.convertCoding(t));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -310,11 +312,11 @@ public class AuditEvent40_50 {
|
|||
return null;
|
||||
org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventSourceComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasSite())
|
||||
tgt.setSiteElement(String40_50.convertString(src.getSiteElement()));
|
||||
// if (src.hasSite())
|
||||
// tgt.setSiteElement(String40_50.convertString(src.getSiteElement()));
|
||||
if (src.hasObserver())
|
||||
tgt.setObserver(Reference40_50.convertReference(src.getObserver()));
|
||||
for (org.hl7.fhir.r5.model.Coding t : src.getType()) tgt.addType(Coding40_50.convertCoding(t));
|
||||
for (CodeableConcept t : src.getType()) tgt.addType(Coding40_50.convertCoding(t.getCodingFirstRep()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -325,15 +327,15 @@ public class AuditEvent40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasWhat())
|
||||
tgt.setWhat(Reference40_50.convertReference(src.getWhat()));
|
||||
if (src.hasType())
|
||||
tgt.setType(Coding40_50.convertCoding(src.getType()));
|
||||
// if (src.hasType())
|
||||
// tgt.setType(Coding40_50.convertCoding(src.getType()));
|
||||
if (src.hasRole())
|
||||
tgt.setRole(Coding40_50.convertCoding(src.getRole()));
|
||||
if (src.hasLifecycle())
|
||||
tgt.setLifecycle(Coding40_50.convertCoding(src.getLifecycle()));
|
||||
for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding40_50.convertCoding(t));
|
||||
if (src.hasName())
|
||||
tgt.setNameElement(String40_50.convertString(src.getNameElement()));
|
||||
tgt.getRole().addCoding(Coding40_50.convertCoding(src.getRole()));
|
||||
// if (src.hasLifecycle())
|
||||
// tgt.setLifecycle(Coding40_50.convertCoding(src.getLifecycle()));
|
||||
for (org.hl7.fhir.r4.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel().addCoding(Coding40_50.convertCoding(t));
|
||||
// if (src.hasName())
|
||||
// tgt.setNameElement(String40_50.convertString(src.getNameElement()));
|
||||
// if (src.hasDescription())
|
||||
// tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
|
||||
if (src.hasQuery())
|
||||
|
@ -350,15 +352,15 @@ public class AuditEvent40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasWhat())
|
||||
tgt.setWhat(Reference40_50.convertReference(src.getWhat()));
|
||||
if (src.hasType())
|
||||
tgt.setType(Coding40_50.convertCoding(src.getType()));
|
||||
// if (src.hasType())
|
||||
// tgt.setType(Coding40_50.convertCoding(src.getType()));
|
||||
if (src.hasRole())
|
||||
tgt.setRole(Coding40_50.convertCoding(src.getRole()));
|
||||
if (src.hasLifecycle())
|
||||
tgt.setLifecycle(Coding40_50.convertCoding(src.getLifecycle()));
|
||||
for (org.hl7.fhir.r5.model.Coding t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding40_50.convertCoding(t));
|
||||
if (src.hasName())
|
||||
tgt.setNameElement(String40_50.convertString(src.getNameElement()));
|
||||
tgt.setRole(Coding40_50.convertCoding(src.getRole().getCodingFirstRep()));
|
||||
// if (src.hasLifecycle())
|
||||
// tgt.setLifecycle(Coding40_50.convertCoding(src.getLifecycle()));
|
||||
for (CodeableConcept t : src.getSecurityLabel()) tgt.addSecurityLabel(Coding40_50.convertCoding(t.getCodingFirstRep()));
|
||||
// if (src.hasName())
|
||||
// tgt.setNameElement(String40_50.convertString(src.getNameElement()));
|
||||
// if (src.hasDescription())
|
||||
// tgt.setDescriptionElement(convertString(src.getDescriptionElement()));
|
||||
if (src.hasQuery())
|
||||
|
@ -374,7 +376,7 @@ public class AuditEvent40_50 {
|
|||
org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r5.model.AuditEvent.AuditEventEntityDetailComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setTypeElement(String40_50.convertString(src.getTypeElement()));
|
||||
tgt.getType().setTextElement(String40_50.convertString(src.getTypeElement()));
|
||||
if (src.hasValue())
|
||||
tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
|
||||
return tgt;
|
||||
|
@ -385,8 +387,8 @@ public class AuditEvent40_50 {
|
|||
return null;
|
||||
org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent tgt = new org.hl7.fhir.r4.model.AuditEvent.AuditEventEntityDetailComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setTypeElement(String40_50.convertString(src.getTypeElement()));
|
||||
if (src.getType().hasTextElement())
|
||||
tgt.setTypeElement(String40_50.convertString(src.getType().getTextElement()));
|
||||
if (src.hasValue())
|
||||
tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
|
||||
return tgt;
|
||||
|
|
|
@ -55,17 +55,17 @@ public class BiologicallyDerivedProduct40_50 {
|
|||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertBiologicallyDerivedProductStatus(src.getStatusElement()));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getRequest()) tgt.addRequest(Reference40_50.convertReference(t));
|
||||
if (src.hasQuantity())
|
||||
tgt.setQuantityElement(Integer40_50.convertInteger(src.getQuantityElement()));
|
||||
// if (src.hasQuantity())
|
||||
// tgt.setQuantityElement(Integer40_50.convertInteger(src.getQuantityElement()));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getParent()) tgt.addParent(Reference40_50.convertReference(t));
|
||||
if (src.hasCollection())
|
||||
tgt.setCollection(convertBiologicallyDerivedProductCollectionComponent(src.getCollection()));
|
||||
for (org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent t : src.getProcessing())
|
||||
tgt.addProcessing(convertBiologicallyDerivedProductProcessingComponent(t));
|
||||
if (src.hasManipulation())
|
||||
tgt.setManipulation(convertBiologicallyDerivedProductManipulationComponent(src.getManipulation()));
|
||||
for (org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent t : src.getStorage())
|
||||
tgt.addStorage(convertBiologicallyDerivedProductStorageComponent(t));
|
||||
// for (org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent t : src.getProcessing())
|
||||
// tgt.addProcessing(convertBiologicallyDerivedProductProcessingComponent(t));
|
||||
// if (src.hasManipulation())
|
||||
// tgt.setManipulation(convertBiologicallyDerivedProductManipulationComponent(src.getManipulation()));
|
||||
// for (org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent t : src.getStorage())
|
||||
// tgt.addStorage(convertBiologicallyDerivedProductStorageComponent(t));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -83,17 +83,17 @@ public class BiologicallyDerivedProduct40_50 {
|
|||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertBiologicallyDerivedProductStatus(src.getStatusElement()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getRequest()) tgt.addRequest(Reference40_50.convertReference(t));
|
||||
if (src.hasQuantity())
|
||||
tgt.setQuantityElement(Integer40_50.convertInteger(src.getQuantityElement()));
|
||||
// if (src.hasQuantity())
|
||||
// tgt.setQuantityElement(Integer40_50.convertInteger(src.getQuantityElement()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getParent()) tgt.addParent(Reference40_50.convertReference(t));
|
||||
if (src.hasCollection())
|
||||
tgt.setCollection(convertBiologicallyDerivedProductCollectionComponent(src.getCollection()));
|
||||
for (org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent t : src.getProcessing())
|
||||
tgt.addProcessing(convertBiologicallyDerivedProductProcessingComponent(t));
|
||||
if (src.hasManipulation())
|
||||
tgt.setManipulation(convertBiologicallyDerivedProductManipulationComponent(src.getManipulation()));
|
||||
for (org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent t : src.getStorage())
|
||||
tgt.addStorage(convertBiologicallyDerivedProductStorageComponent(t));
|
||||
// for (org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent t : src.getProcessing())
|
||||
// tgt.addProcessing(convertBiologicallyDerivedProductProcessingComponent(t));
|
||||
// if (src.hasManipulation())
|
||||
// tgt.setManipulation(convertBiologicallyDerivedProductManipulationComponent(src.getManipulation()));
|
||||
// for (org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent t : src.getStorage())
|
||||
// tgt.addStorage(convertBiologicallyDerivedProductStorageComponent(t));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -219,135 +219,135 @@ public class BiologicallyDerivedProduct40_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent convertBiologicallyDerivedProductProcessingComponent(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
if (src.hasProcedure())
|
||||
tgt.setProcedure(CodeableConcept40_50.convertCodeableConcept(src.getProcedure()));
|
||||
if (src.hasAdditive())
|
||||
tgt.setAdditive(Reference40_50.convertReference(src.getAdditive()));
|
||||
if (src.hasTime())
|
||||
tgt.setTime(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getTime()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent convertBiologicallyDerivedProductProcessingComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
if (src.hasProcedure())
|
||||
tgt.setProcedure(CodeableConcept40_50.convertCodeableConcept(src.getProcedure()));
|
||||
if (src.hasAdditive())
|
||||
tgt.setAdditive(Reference40_50.convertReference(src.getAdditive()));
|
||||
if (src.hasTime())
|
||||
tgt.setTime(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getTime()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent convertBiologicallyDerivedProductManipulationComponent(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
if (src.hasTime())
|
||||
tgt.setTime(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getTime()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent convertBiologicallyDerivedProductManipulationComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
if (src.hasTime())
|
||||
tgt.setTime(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getTime()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent convertBiologicallyDerivedProductStorageComponent(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
if (src.hasTemperature())
|
||||
tgt.setTemperatureElement(Decimal40_50.convertDecimal(src.getTemperatureElement()));
|
||||
if (src.hasScale())
|
||||
tgt.setScaleElement(convertBiologicallyDerivedProductStorageScale(src.getScaleElement()));
|
||||
if (src.hasDuration())
|
||||
tgt.setDuration(Period40_50.convertPeriod(src.getDuration()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent convertBiologicallyDerivedProductStorageComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
if (src.hasTemperature())
|
||||
tgt.setTemperatureElement(Decimal40_50.convertDecimal(src.getTemperatureElement()));
|
||||
if (src.hasScale())
|
||||
tgt.setScaleElement(convertBiologicallyDerivedProductStorageScale(src.getScaleElement()));
|
||||
if (src.hasDuration())
|
||||
tgt.setDuration(Period40_50.convertPeriod(src.getDuration()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> convertBiologicallyDerivedProductStorageScale(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScaleEnumFactory());
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case FARENHEIT:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.FARENHEIT);
|
||||
break;
|
||||
case CELSIUS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.CELSIUS);
|
||||
break;
|
||||
case KELVIN:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.KELVIN);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> convertBiologicallyDerivedProductStorageScale(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScaleEnumFactory());
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case FARENHEIT:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.FARENHEIT);
|
||||
break;
|
||||
case CELSIUS:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.CELSIUS);
|
||||
break;
|
||||
case KELVIN:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.KELVIN);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
// public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent convertBiologicallyDerivedProductProcessingComponent(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasDescription())
|
||||
// tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
// if (src.hasProcedure())
|
||||
// tgt.setProcedure(CodeableConcept40_50.convertCodeableConcept(src.getProcedure()));
|
||||
// if (src.hasAdditive())
|
||||
// tgt.setAdditive(Reference40_50.convertReference(src.getAdditive()));
|
||||
// if (src.hasTime())
|
||||
// tgt.setTime(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getTime()));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent convertBiologicallyDerivedProductProcessingComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductProcessingComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasDescription())
|
||||
// tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
// if (src.hasProcedure())
|
||||
// tgt.setProcedure(CodeableConcept40_50.convertCodeableConcept(src.getProcedure()));
|
||||
// if (src.hasAdditive())
|
||||
// tgt.setAdditive(Reference40_50.convertReference(src.getAdditive()));
|
||||
// if (src.hasTime())
|
||||
// tgt.setTime(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getTime()));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent convertBiologicallyDerivedProductManipulationComponent(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasDescription())
|
||||
// tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
// if (src.hasTime())
|
||||
// tgt.setTime(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getTime()));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent convertBiologicallyDerivedProductManipulationComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductManipulationComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasDescription())
|
||||
// tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
// if (src.hasTime())
|
||||
// tgt.setTime(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getTime()));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// public static org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent convertBiologicallyDerivedProductStorageComponent(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent tgt = new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasDescription())
|
||||
// tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
// if (src.hasTemperature())
|
||||
// tgt.setTemperatureElement(Decimal40_50.convertDecimal(src.getTemperatureElement()));
|
||||
// if (src.hasScale())
|
||||
// tgt.setScaleElement(convertBiologicallyDerivedProductStorageScale(src.getScaleElement()));
|
||||
// if (src.hasDuration())
|
||||
// tgt.setDuration(Period40_50.convertPeriod(src.getDuration()));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// public static org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent convertBiologicallyDerivedProductStorageComponent(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent tgt = new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasDescription())
|
||||
// tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
// if (src.hasTemperature())
|
||||
// tgt.setTemperatureElement(Decimal40_50.convertDecimal(src.getTemperatureElement()));
|
||||
// if (src.hasScale())
|
||||
// tgt.setScaleElement(convertBiologicallyDerivedProductStorageScale(src.getScaleElement()));
|
||||
// if (src.hasDuration())
|
||||
// tgt.setDuration(Period40_50.convertPeriod(src.getDuration()));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> convertBiologicallyDerivedProductStorageScale(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> src) throws FHIRException {
|
||||
// if (src == null || src.isEmpty())
|
||||
// return null;
|
||||
// org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScaleEnumFactory());
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// switch (src.getValue()) {
|
||||
// case FARENHEIT:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.FARENHEIT);
|
||||
// break;
|
||||
// case CELSIUS:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.CELSIUS);
|
||||
// break;
|
||||
// case KELVIN:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.KELVIN);
|
||||
// break;
|
||||
// default:
|
||||
// tgt.setValue(org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL);
|
||||
// break;
|
||||
// }
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> convertBiologicallyDerivedProductStorageScale(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> src) throws FHIRException {
|
||||
// if (src == null || src.isEmpty())
|
||||
// return null;
|
||||
// org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScaleEnumFactory());
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// switch (src.getValue()) {
|
||||
// case FARENHEIT:
|
||||
// tgt.setValue(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.FARENHEIT);
|
||||
// break;
|
||||
// case CELSIUS:
|
||||
// tgt.setValue(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.CELSIUS);
|
||||
// break;
|
||||
// case KELVIN:
|
||||
// tgt.setValue(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.KELVIN);
|
||||
// break;
|
||||
// default:
|
||||
// tgt.setValue(org.hl7.fhir.r4.model.BiologicallyDerivedProduct.BiologicallyDerivedProductStorageScale.NULL);
|
||||
// break;
|
||||
// }
|
||||
// return tgt;
|
||||
// }
|
||||
}
|
|
@ -53,8 +53,8 @@ public class BodyStructure40_50 {
|
|||
tgt.setMorphology(CodeableConcept40_50.convertCodeableConcept(src.getMorphology()));
|
||||
if (src.hasLocation())
|
||||
tgt.setLocation(CodeableConcept40_50.convertCodeableConcept(src.getLocation()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getLocationQualifier())
|
||||
tgt.addLocationQualifier(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
// for (org.hl7.fhir.r4.model.CodeableConcept t : src.getLocationQualifier())
|
||||
// tgt.addLocationQualifier(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
for (org.hl7.fhir.r4.model.Attachment t : src.getImage()) tgt.addImage(Attachment40_50.convertAttachment(t));
|
||||
|
@ -76,8 +76,8 @@ public class BodyStructure40_50 {
|
|||
tgt.setMorphology(CodeableConcept40_50.convertCodeableConcept(src.getMorphology()));
|
||||
if (src.hasLocation())
|
||||
tgt.setLocation(CodeableConcept40_50.convertCodeableConcept(src.getLocation()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLocationQualifier())
|
||||
tgt.addLocationQualifier(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
// for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLocationQualifier())
|
||||
// tgt.addLocationQualifier(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
for (org.hl7.fhir.r5.model.Attachment t : src.getImage()) tgt.addImage(Attachment40_50.convertAttachment(t));
|
||||
|
|
|
@ -83,8 +83,10 @@ public class ChargeItem40_50 {
|
|||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason())
|
||||
tgt.addReason(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getService()) tgt.addService(Reference40_50.convertReference(t));
|
||||
if (src.hasProduct())
|
||||
tgt.setProduct(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getProduct()));
|
||||
if (src.hasProductCodeableConcept())
|
||||
tgt.addProduct().setConcept(CodeableConcept40_50.convertCodeableConcept(src.getProductCodeableConcept()));
|
||||
else if (src.hasProductReference())
|
||||
tgt.addProduct().setReference(Reference40_50.convertReference(src.getProductReference()));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getAccount()) tgt.addAccount(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getSupportingInformation())
|
||||
|
@ -138,8 +140,10 @@ public class ChargeItem40_50 {
|
|||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason())
|
||||
tgt.addReason(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getService()) tgt.addService(Reference40_50.convertReference(t));
|
||||
if (src.hasProduct())
|
||||
tgt.setProduct(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getProduct()));
|
||||
if (src.getProductFirstRep().hasConcept())
|
||||
tgt.setProduct(CodeableConcept40_50.convertCodeableConcept(src.getProductFirstRep().getConcept()));
|
||||
if (src.getProductFirstRep().hasReference())
|
||||
tgt.setProduct(Reference40_50.convertReference(src.getProductFirstRep().getReference()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getAccount()) tgt.addAccount(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getSupportingInformation())
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package org.hl7.fhir.convertors.conv40_50.resources40_50;
|
||||
|
||||
import org.hl7.fhir.convertors.context.ConversionContext30_50;
|
||||
import org.hl7.fhir.convertors.context.ConversionContext40_50;
|
||||
import org.hl7.fhir.convertors.conv30_50.datatypes30_50.Reference30_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.CodeableConcept40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Identifier40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Period40_50;
|
||||
|
@ -9,6 +11,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_
|
|||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Narrative40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.RelatedArtifact;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
|
@ -106,7 +109,7 @@ public class Composition40_50 {
|
|||
tgt.addAttester(convertCompositionAttesterComponent(t));
|
||||
if (src.hasCustodian())
|
||||
tgt.setCustodian(Reference40_50.convertReference(src.getCustodian()));
|
||||
for (org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent t : src.getRelatesTo())
|
||||
for (RelatedArtifact t : src.getRelatesTo())
|
||||
tgt.addRelatesTo(convertCompositionRelatesToComponent(t));
|
||||
for (org.hl7.fhir.r5.model.Composition.CompositionEventComponent t : src.getEvent())
|
||||
tgt.addEvent(convertCompositionEventComponent(t));
|
||||
|
@ -211,7 +214,7 @@ public class Composition40_50 {
|
|||
org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionAttesterComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasMode())
|
||||
tgt.setModeElement(convertCompositionAttestationMode(src.getModeElement()));
|
||||
tgt.setMode(convertCompositionAttestationMode(src.getModeElement()));
|
||||
if (src.hasTime())
|
||||
tgt.setTimeElement(DateTime40_50.convertDateTime(src.getTimeElement()));
|
||||
if (src.hasParty())
|
||||
|
@ -225,7 +228,7 @@ public class Composition40_50 {
|
|||
org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionAttesterComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasMode())
|
||||
tgt.setModeElement(convertCompositionAttestationMode(src.getModeElement()));
|
||||
tgt.setModeElement(convertCompositionAttestationMode(src.getMode()));
|
||||
if (src.hasTime())
|
||||
tgt.setTimeElement(DateTime40_50.convertDateTime(src.getTimeElement()));
|
||||
if (src.hasParty())
|
||||
|
@ -233,47 +236,46 @@ public class Composition40_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.CompositionAttestationMode> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r5.model.CodeableConcept convertCompositionAttestationMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.CompositionAttestationMode> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Composition.CompositionAttestationMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Composition.CompositionAttestationModeEnumFactory());
|
||||
org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case PERSONAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.PERSONAL);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("personal");
|
||||
break;
|
||||
case PROFESSIONAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.PROFESSIONAL);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("professional");
|
||||
break;
|
||||
case LEGAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.LEGAL);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("legal");
|
||||
break;
|
||||
case OFFICIAL:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.OFFICIAL);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/composition-attestation-mode").setCode("official");
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Composition.CompositionAttestationMode.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Composition.CompositionAttestationMode> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.CompositionAttestationMode> convertCompositionAttestationMode(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.CompositionAttestationMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.CompositionAttestationModeEnumFactory());
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case PERSONAL:
|
||||
switch (src.getCode("http://hl7.org/fhir/composition-attestation-mode")) {
|
||||
case "personal":
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PERSONAL);
|
||||
break;
|
||||
case PROFESSIONAL:
|
||||
case "professional":
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.PROFESSIONAL);
|
||||
break;
|
||||
case LEGAL:
|
||||
case "legal":
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.LEGAL);
|
||||
break;
|
||||
case OFFICIAL:
|
||||
case "official":
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Composition.CompositionAttestationMode.OFFICIAL);
|
||||
break;
|
||||
default:
|
||||
|
@ -283,56 +285,56 @@ public class Composition40_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent src) throws FHIRException {
|
||||
public static org.hl7.fhir.r5.model.RelatedArtifact convertCompositionRelatesToComponent(org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent tgt = new org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent();
|
||||
org.hl7.fhir.r5.model.RelatedArtifact tgt = new org.hl7.fhir.r5.model.RelatedArtifact();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasCode())
|
||||
tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement()));
|
||||
if (src.hasTarget())
|
||||
tgt.setTarget(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getTarget()));
|
||||
tgt.setTypeElement(convertDocumentRelationshipType(src.getCodeElement()));
|
||||
if (src.hasTargetReference())
|
||||
tgt.setResourceReference(Reference40_50.convertReference(src.getTargetReference()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.r5.model.Composition.CompositionRelatesToComponent src) throws FHIRException {
|
||||
public static org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent convertCompositionRelatesToComponent(org.hl7.fhir.r5.model.RelatedArtifact src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent tgt = new org.hl7.fhir.r4.model.Composition.CompositionRelatesToComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasCode())
|
||||
tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement()));
|
||||
if (src.hasTarget())
|
||||
tgt.setTarget(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getTarget()));
|
||||
if (src.hasType())
|
||||
tgt.setCodeElement(convertDocumentRelationshipType(src.getTypeElement()));
|
||||
if (src.hasResourceReference())
|
||||
tgt.setTarget(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getResourceReference()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.DocumentRelationshipType> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType> convertDocumentRelationshipType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.DocumentRelationshipType> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipTypeEnumFactory());
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactTypeEnumFactory());
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case REPLACES:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.REPLACES);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.REPLACES);
|
||||
break;
|
||||
case TRANSFORMS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.TRANSFORMS);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.TRANSFORMS);
|
||||
break;
|
||||
case SIGNS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.SIGNS);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.SIGNS);
|
||||
break;
|
||||
case APPENDS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.APPENDS);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.APPENDS);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.NULL);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.RelatedArtifact.RelatedArtifactType> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Composition.DocumentRelationshipType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Composition.DocumentRelationshipTypeEnumFactory());
|
||||
|
|
|
@ -407,29 +407,29 @@ public class ConceptMap40_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode> convertConceptMapGroupUnmappedMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedMode> convertConceptMapGroupUnmappedMode(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory());
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedMode> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedModeEnumFactory());
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case PROVIDED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.PROVIDED);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedMode.PROVIDED);
|
||||
break;
|
||||
case FIXED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.FIXED);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedMode.FIXED);
|
||||
break;
|
||||
case OTHERMAP:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.OTHERMAP);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedMode.OTHERMAP);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode.NULL);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedMode.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode> convertConceptMapGroupUnmappedMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupUnmappedMode> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode> convertConceptMapGroupUnmappedMode(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ConceptMapGroupUnmappedMode> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedMode> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.ConceptMap.ConceptMapGroupUnmappedModeEnumFactory());
|
||||
|
|
|
@ -48,15 +48,15 @@ public class Consent40_50 {
|
|||
tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
|
||||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertConsentState(src.getStatusElement()));
|
||||
if (src.hasScope())
|
||||
tgt.setScope(CodeableConcept40_50.convertCodeableConcept(src.getScope()));
|
||||
// if (src.hasScope())
|
||||
// tgt.setScope(CodeableConcept40_50.convertCodeableConcept(src.getScope()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getCategory())
|
||||
tgt.addCategory(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasPatient())
|
||||
tgt.setSubject(Reference40_50.convertReference(src.getPatient()));
|
||||
if (src.hasDateTime())
|
||||
tgt.setDateTimeElement(DateTime40_50.convertDateTime(src.getDateTimeElement()));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getPerformer()) tgt.addGrantee(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getOrganization()) tgt.addManager(Reference40_50.convertReference(t));
|
||||
if (src.hasSourceAttachment())
|
||||
tgt.addSourceAttachment(Attachment40_50.convertAttachment(src.getSourceAttachment()));
|
||||
|
@ -82,15 +82,15 @@ public class Consent40_50 {
|
|||
tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
|
||||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertConsentState(src.getStatusElement()));
|
||||
if (src.hasScope())
|
||||
tgt.setScope(CodeableConcept40_50.convertCodeableConcept(src.getScope()));
|
||||
// if (src.hasScope())
|
||||
// tgt.setScope(CodeableConcept40_50.convertCodeableConcept(src.getScope()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getCategory())
|
||||
tgt.addCategory(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasSubject())
|
||||
tgt.setPatient(Reference40_50.convertReference(src.getSubject()));
|
||||
if (src.hasDateTime())
|
||||
tgt.setDateTimeElement(DateTime40_50.convertDateTime(src.getDateTimeElement()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getPerformer()) tgt.addPerformer(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getGrantee()) tgt.addPerformer(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getManager()) tgt.addOrganization(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getController())
|
||||
tgt.addOrganization(Reference40_50.convertReference(t));
|
||||
|
|
|
@ -48,7 +48,7 @@ public class Device40_50 {
|
|||
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
|
||||
tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
|
||||
if (src.hasDefinition())
|
||||
tgt.setDefinition(Reference40_50.convertReference(src.getDefinition()));
|
||||
tgt.getDefinition().setReference(Reference40_50.convertReference(src.getDefinition()));
|
||||
for (org.hl7.fhir.r4.model.Device.DeviceUdiCarrierComponent t : src.getUdiCarrier())
|
||||
tgt.addUdiCarrier(convertDeviceUdiCarrierComponent(t));
|
||||
if (src.hasStatus())
|
||||
|
@ -56,7 +56,7 @@ public class Device40_50 {
|
|||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getStatusReason())
|
||||
tgt.addStatusReason(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasDistinctIdentifier())
|
||||
tgt.setDistinctIdentifierElement(String40_50.convertString(src.getDistinctIdentifierElement()));
|
||||
tgt.getBiologicalSource().setValueElement(String40_50.convertString(src.getDistinctIdentifierElement()));
|
||||
if (src.hasManufacturer())
|
||||
tgt.setManufacturerElement(String40_50.convertString(src.getManufacturerElement()));
|
||||
if (src.hasManufactureDate())
|
||||
|
@ -75,14 +75,14 @@ public class Device40_50 {
|
|||
tgt.setPartNumberElement(String40_50.convertString(src.getPartNumberElement()));
|
||||
if (src.hasType())
|
||||
tgt.addType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
for (org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent t : src.getSpecialization())
|
||||
tgt.addSpecialization(convertDeviceSpecializationComponent(t));
|
||||
// for (org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent t : src.getSpecialization())
|
||||
// tgt.addSpecialization(convertDeviceSpecializationComponent(t));
|
||||
for (org.hl7.fhir.r4.model.Device.DeviceVersionComponent t : src.getVersion())
|
||||
tgt.addVersion(convertDeviceVersionComponent(t));
|
||||
for (org.hl7.fhir.r4.model.Device.DevicePropertyComponent t : src.getProperty())
|
||||
tgt.addProperty(convertDevicePropertyComponent(t));
|
||||
if (src.hasPatient())
|
||||
tgt.setPatient(Reference40_50.convertReference(src.getPatient()));
|
||||
tgt.setSubject(Reference40_50.convertReference(src.getPatient()));
|
||||
if (src.hasOwner())
|
||||
tgt.setOwner(Reference40_50.convertReference(src.getOwner()));
|
||||
for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact())
|
||||
|
@ -106,16 +106,16 @@ public class Device40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
|
||||
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
|
||||
tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
|
||||
if (src.hasDefinition())
|
||||
tgt.setDefinition(Reference40_50.convertReference(src.getDefinition()));
|
||||
if (src.getDefinition().hasReference())
|
||||
tgt.setDefinition(Reference40_50.convertReference(src.getDefinition().getReference()));
|
||||
for (org.hl7.fhir.r5.model.Device.DeviceUdiCarrierComponent t : src.getUdiCarrier())
|
||||
tgt.addUdiCarrier(convertDeviceUdiCarrierComponent(t));
|
||||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertFHIRDeviceStatus(src.getStatusElement()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason())
|
||||
tgt.addStatusReason(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasDistinctIdentifier())
|
||||
tgt.setDistinctIdentifierElement(String40_50.convertString(src.getDistinctIdentifierElement()));
|
||||
if (src.hasBiologicalSource())
|
||||
tgt.setDistinctIdentifierElement(String40_50.convertString(src.getBiologicalSource().getValueElement()));
|
||||
if (src.hasManufacturer())
|
||||
tgt.setManufacturerElement(String40_50.convertString(src.getManufacturerElement()));
|
||||
if (src.hasManufactureDate())
|
||||
|
@ -134,14 +134,14 @@ public class Device40_50 {
|
|||
tgt.setPartNumberElement(String40_50.convertString(src.getPartNumberElement()));
|
||||
if (src.hasType())
|
||||
tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getTypeFirstRep()));
|
||||
for (org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent t : src.getSpecialization())
|
||||
tgt.addSpecialization(convertDeviceSpecializationComponent(t));
|
||||
// for (org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent t : src.getSpecialization())
|
||||
// tgt.addSpecialization(convertDeviceSpecializationComponent(t));
|
||||
for (org.hl7.fhir.r5.model.Device.DeviceVersionComponent t : src.getVersion())
|
||||
tgt.addVersion(convertDeviceVersionComponent(t));
|
||||
for (org.hl7.fhir.r5.model.Device.DevicePropertyComponent t : src.getProperty())
|
||||
tgt.addProperty(convertDevicePropertyComponent(t));
|
||||
if (src.hasPatient())
|
||||
tgt.setPatient(Reference40_50.convertReference(src.getPatient()));
|
||||
if (src.hasSubject())
|
||||
tgt.setPatient(Reference40_50.convertReference(src.getSubject()));
|
||||
if (src.hasOwner())
|
||||
tgt.setOwner(Reference40_50.convertReference(src.getOwner()));
|
||||
for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact())
|
||||
|
@ -174,7 +174,7 @@ public class Device40_50 {
|
|||
tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.ENTEREDINERROR);
|
||||
break;
|
||||
case UNKNOWN:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.UNKNOWN);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.NULL);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Device.FHIRDeviceStatus.NULL);
|
||||
|
@ -198,9 +198,6 @@ public class Device40_50 {
|
|||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.ENTEREDINERROR);
|
||||
break;
|
||||
case UNKNOWN:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.UNKNOWN);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Device.FHIRDeviceStatus.NULL);
|
||||
break;
|
||||
|
@ -340,9 +337,6 @@ public class Device40_50 {
|
|||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DeviceNameType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DeviceNameTypeEnumFactory());
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case UDILABELNAME:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.UDILABELNAME);
|
||||
break;
|
||||
case USERFRIENDLYNAME:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME);
|
||||
break;
|
||||
|
@ -350,13 +344,13 @@ public class Device40_50 {
|
|||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME);
|
||||
break;
|
||||
case MANUFACTURERNAME:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.MANUFACTURERNAME);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.REGISTEREDNAME);
|
||||
break;
|
||||
case MODELNAME:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.MODELNAME);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME);
|
||||
break;
|
||||
case OTHER:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.OTHER);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL);
|
||||
|
@ -371,24 +365,15 @@ public class Device40_50 {
|
|||
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Device.DeviceNameType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Device.DeviceNameTypeEnumFactory());
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case UDILABELNAME:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.UDILABELNAME);
|
||||
break;
|
||||
case USERFRIENDLYNAME:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.USERFRIENDLYNAME);
|
||||
break;
|
||||
case PATIENTREPORTEDNAME:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.PATIENTREPORTEDNAME);
|
||||
break;
|
||||
case MANUFACTURERNAME:
|
||||
case REGISTEREDNAME:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.MANUFACTURERNAME);
|
||||
break;
|
||||
case MODELNAME:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.MODELNAME);
|
||||
break;
|
||||
case OTHER:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.OTHER);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.Device.DeviceNameType.NULL);
|
||||
break;
|
||||
|
@ -396,29 +381,29 @@ public class Device40_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasSystemType())
|
||||
tgt.setSystemType(CodeableConcept40_50.convertCodeableConcept(src.getSystemType()));
|
||||
if (src.hasVersion())
|
||||
tgt.setVersionElement(String40_50.convertString(src.getVersionElement()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent tgt = new org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasSystemType())
|
||||
tgt.setSystemType(CodeableConcept40_50.convertCodeableConcept(src.getSystemType()));
|
||||
if (src.hasVersion())
|
||||
tgt.setVersionElement(String40_50.convertString(src.getVersionElement()));
|
||||
return tgt;
|
||||
}
|
||||
// public static org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent tgt = new org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasSystemType())
|
||||
// tgt.setSystemType(CodeableConcept40_50.convertCodeableConcept(src.getSystemType()));
|
||||
// if (src.hasVersion())
|
||||
// tgt.setVersionElement(String40_50.convertString(src.getVersionElement()));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// public static org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent convertDeviceSpecializationComponent(org.hl7.fhir.r5.model.Device.DeviceSpecializationComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent tgt = new org.hl7.fhir.r4.model.Device.DeviceSpecializationComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasSystemType())
|
||||
// tgt.setSystemType(CodeableConcept40_50.convertCodeableConcept(src.getSystemType()));
|
||||
// if (src.hasVersion())
|
||||
// tgt.setVersionElement(String40_50.convertString(src.getVersionElement()));
|
||||
// return tgt;
|
||||
// }
|
||||
|
||||
public static org.hl7.fhir.r5.model.Device.DeviceVersionComponent convertDeviceVersionComponent(org.hl7.fhir.r4.model.Device.DeviceVersionComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_
|
|||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionClassificationComponent;
|
||||
import org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionVersionComponent;
|
||||
|
||||
/*
|
||||
|
@ -56,29 +57,29 @@ public class DeviceDefinition40_50 {
|
|||
if (src.hasModelNumber())
|
||||
tgt.setModelNumberElement(String40_50.convertString(src.getModelNumberElement()));
|
||||
if (src.hasType())
|
||||
tgt.addType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent t : src.getSpecialization())
|
||||
tgt.addSpecialization(convertDeviceDefinitionSpecializationComponent(t));
|
||||
tgt.addClassification().setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
// for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent t : src.getSpecialization())
|
||||
// tgt.addSpecialization(convertDeviceDefinitionSpecializationComponent(t));
|
||||
for (org.hl7.fhir.r4.model.StringType t : src.getVersion())
|
||||
tgt.getVersion().add(new DeviceDefinitionVersionComponent().setValueElement(String40_50.convertString(t)));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSafety())
|
||||
tgt.addSafety(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r4.model.ProductShelfLife t : src.getShelfLifeStorage())
|
||||
tgt.addShelfLifeStorage(ProductShelfLife40_50.convertProductShelfLife(t));
|
||||
if (src.hasPhysicalCharacteristics())
|
||||
tgt.setPhysicalCharacteristics(ProdCharacteristic40_50.convertProdCharacteristic(src.getPhysicalCharacteristics()));
|
||||
// if (src.hasPhysicalCharacteristics())
|
||||
// tgt.setPhysicalCharacteristics(ProdCharacteristic40_50.convertProdCharacteristic(src.getPhysicalCharacteristics()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getLanguageCode())
|
||||
tgt.addLanguageCode(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent t : src.getCapability())
|
||||
tgt.addCapability(convertDeviceDefinitionCapabilityComponent(t));
|
||||
// for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent t : src.getCapability())
|
||||
// tgt.addCapability(convertDeviceDefinitionCapabilityComponent(t));
|
||||
for (org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent t : src.getProperty())
|
||||
tgt.addProperty(convertDeviceDefinitionPropertyComponent(t));
|
||||
if (src.hasOwner())
|
||||
tgt.setOwner(Reference40_50.convertReference(src.getOwner()));
|
||||
for (org.hl7.fhir.r4.model.ContactPoint t : src.getContact())
|
||||
tgt.addContact(ContactPoint40_50.convertContactPoint(t));
|
||||
if (src.hasOnlineInformation())
|
||||
tgt.setOnlineInformationElement(Uri40_50.convertUri(src.getOnlineInformationElement()));
|
||||
// if (src.hasOnlineInformation())
|
||||
// tgt.setOnlineInformationElement(Uri40_50.convertUri(src.getOnlineInformationElement()));
|
||||
for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
|
||||
if (src.hasParentDevice())
|
||||
tgt.setParentDevice(Reference40_50.convertReference(src.getParentDevice()));
|
||||
|
@ -102,30 +103,30 @@ public class DeviceDefinition40_50 {
|
|||
tgt.addDeviceName(convertDeviceDefinitionDeviceNameComponent(t));
|
||||
if (src.hasModelNumber())
|
||||
tgt.setModelNumberElement(String40_50.convertString(src.getModelNumberElement()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getType())
|
||||
tgt.setType(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent t : src.getSpecialization())
|
||||
tgt.addSpecialization(convertDeviceDefinitionSpecializationComponent(t));
|
||||
for (DeviceDefinitionClassificationComponent t : src.getClassification())
|
||||
tgt.setType(CodeableConcept40_50.convertCodeableConcept(t.getType()));
|
||||
// for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent t : src.getSpecialization())
|
||||
// tgt.addSpecialization(convertDeviceDefinitionSpecializationComponent(t));
|
||||
for (DeviceDefinitionVersionComponent t : src.getVersion())
|
||||
tgt.getVersion().add(String40_50.convertString(t.getValueElement()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSafety())
|
||||
tgt.addSafety(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r5.model.ProductShelfLife t : src.getShelfLifeStorage())
|
||||
tgt.addShelfLifeStorage(ProductShelfLife40_50.convertProductShelfLife(t));
|
||||
if (src.hasPhysicalCharacteristics())
|
||||
tgt.setPhysicalCharacteristics(ProdCharacteristic40_50.convertProdCharacteristic(src.getPhysicalCharacteristics()));
|
||||
// if (src.hasPhysicalCharacteristics())
|
||||
// tgt.setPhysicalCharacteristics(ProdCharacteristic40_50.convertProdCharacteristic(src.getPhysicalCharacteristics()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getLanguageCode())
|
||||
tgt.addLanguageCode(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent t : src.getCapability())
|
||||
tgt.addCapability(convertDeviceDefinitionCapabilityComponent(t));
|
||||
// for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent t : src.getCapability())
|
||||
// tgt.addCapability(convertDeviceDefinitionCapabilityComponent(t));
|
||||
for (org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent t : src.getProperty())
|
||||
tgt.addProperty(convertDeviceDefinitionPropertyComponent(t));
|
||||
if (src.hasOwner())
|
||||
tgt.setOwner(Reference40_50.convertReference(src.getOwner()));
|
||||
for (org.hl7.fhir.r5.model.ContactPoint t : src.getContact())
|
||||
tgt.addContact(ContactPoint40_50.convertContactPoint(t));
|
||||
if (src.hasOnlineInformation())
|
||||
tgt.setOnlineInformationElement(Uri40_50.convertUri(src.getOnlineInformationElement()));
|
||||
// if (src.hasOnlineInformation())
|
||||
// tgt.setOnlineInformationElement(Uri40_50.convertUri(src.getOnlineInformationElement()));
|
||||
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
|
||||
if (src.hasParentDevice())
|
||||
tgt.setParentDevice(Reference40_50.convertReference(src.getParentDevice()));
|
||||
|
@ -192,9 +193,6 @@ public class DeviceDefinition40_50 {
|
|||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DeviceNameType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DeviceNameTypeEnumFactory());
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case UDILABELNAME:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.UDILABELNAME);
|
||||
break;
|
||||
case USERFRIENDLYNAME:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME);
|
||||
break;
|
||||
|
@ -202,13 +200,10 @@ public class DeviceDefinition40_50 {
|
|||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.PATIENTREPORTEDNAME);
|
||||
break;
|
||||
case MANUFACTURERNAME:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.MANUFACTURERNAME);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.REGISTEREDNAME);
|
||||
break;
|
||||
case MODELNAME:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.MODELNAME);
|
||||
break;
|
||||
case OTHER:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.OTHER);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.USERFRIENDLYNAME);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DeviceNameType.NULL);
|
||||
|
@ -223,78 +218,69 @@ public class DeviceDefinition40_50 {
|
|||
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameTypeEnumFactory());
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case UDILABELNAME:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.UDILABELNAME);
|
||||
break;
|
||||
case USERFRIENDLYNAME:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.USERFRIENDLYNAME);
|
||||
break;
|
||||
case PATIENTREPORTEDNAME:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.PATIENTREPORTEDNAME);
|
||||
break;
|
||||
case MANUFACTURERNAME:
|
||||
case REGISTEREDNAME:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.MANUFACTURERNAME);
|
||||
break;
|
||||
case MODELNAME:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.MODELNAME);
|
||||
break;
|
||||
case OTHER:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.OTHER);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.DeviceDefinition.DeviceNameType.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasSystemType())
|
||||
tgt.setSystemTypeElement(String40_50.convertString(src.getSystemTypeElement()));
|
||||
if (src.hasVersion())
|
||||
tgt.setVersionElement(String40_50.convertString(src.getVersionElement()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasSystemType())
|
||||
tgt.setSystemTypeElement(String40_50.convertString(src.getSystemTypeElement()));
|
||||
if (src.hasVersion())
|
||||
tgt.setVersionElement(String40_50.convertString(src.getVersionElement()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent convertDeviceDefinitionCapabilityComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDescription())
|
||||
tgt.addDescription(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent convertDeviceDefinitionCapabilityComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDescription())
|
||||
tgt.addDescription(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
return tgt;
|
||||
}
|
||||
//
|
||||
// public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasSystemType())
|
||||
// tgt.setSystemTypeElement(String40_50.convertString(src.getSystemTypeElement()));
|
||||
// if (src.hasVersion())
|
||||
// tgt.setVersionElement(String40_50.convertString(src.getVersionElement()));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent convertDeviceDefinitionSpecializationComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionSpecializationComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionSpecializationComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasSystemType())
|
||||
// tgt.setSystemTypeElement(String40_50.convertString(src.getSystemTypeElement()));
|
||||
// if (src.hasVersion())
|
||||
// tgt.setVersionElement(String40_50.convertString(src.getVersionElement()));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent convertDeviceDefinitionCapabilityComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent tgt = new org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasType())
|
||||
// tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
// for (org.hl7.fhir.r4.model.CodeableConcept t : src.getDescription())
|
||||
// tgt.addDescription(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// public static org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent convertDeviceDefinitionCapabilityComponent(org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionCapabilityComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent tgt = new org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionCapabilityComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasType())
|
||||
// tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
// for (org.hl7.fhir.r5.model.CodeableConcept t : src.getDescription())
|
||||
// tgt.addDescription(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
// return tgt;
|
||||
// }
|
||||
|
||||
public static org.hl7.fhir.r5.model.DeviceDefinition.DeviceDefinitionPropertyComponent convertDeviceDefinitionPropertyComponent(org.hl7.fhir.r4.model.DeviceDefinition.DeviceDefinitionPropertyComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
|
@ -304,9 +290,9 @@ public class DeviceDefinition40_50 {
|
|||
if (src.hasType())
|
||||
tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
for (org.hl7.fhir.r4.model.Quantity t : src.getValueQuantity())
|
||||
tgt.addValueQuantity(Quantity40_50.convertQuantity(t));
|
||||
tgt.setValue(Quantity40_50.convertQuantity(t));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getValueCode())
|
||||
tgt.addValueCode(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
tgt.setValue(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -317,10 +303,10 @@ public class DeviceDefinition40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
for (org.hl7.fhir.r5.model.Quantity t : src.getValueQuantity())
|
||||
tgt.addValueQuantity(Quantity40_50.convertQuantity(t));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getValueCode())
|
||||
tgt.addValueCode(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasValueQuantity())
|
||||
tgt.addValueQuantity(Quantity40_50.convertQuantity(src.getValueQuantity()));
|
||||
if (src.hasValueCodeableConcept())
|
||||
tgt.addValueCode(CodeableConcept40_50.convertCodeableConcept(src.getValueCodeableConcept()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public class DeviceUseStatement40_50 {
|
|||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertDeviceUseStatementStatus(src.getStatusElement()));
|
||||
if (src.hasSubject())
|
||||
tgt.setSubject(Reference40_50.convertReference(src.getSubject()));
|
||||
tgt.setPatient(Reference40_50.convertReference(src.getSubject()));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getDerivedFrom())
|
||||
tgt.addDerivedFrom(Reference40_50.convertReference(t));
|
||||
if (src.hasTiming())
|
||||
|
@ -82,8 +82,8 @@ public class DeviceUseStatement40_50 {
|
|||
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference40_50.convertReference(t));
|
||||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertDeviceUseStatementStatus(src.getStatusElement()));
|
||||
if (src.hasSubject())
|
||||
tgt.setSubject(Reference40_50.convertReference(src.getSubject()));
|
||||
if (src.hasPatient())
|
||||
tgt.setSubject(Reference40_50.convertReference(src.getPatient()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getDerivedFrom())
|
||||
tgt.addDerivedFrom(Reference40_50.convertReference(t));
|
||||
if (src.hasTiming())
|
||||
|
|
|
@ -176,7 +176,7 @@ public class DocumentReference40_50 {
|
|||
org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceRelatesToComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasCode())
|
||||
tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement()));
|
||||
tgt.setCode(convertDocumentRelationshipType(src.getCodeElement()));
|
||||
if (src.hasTarget())
|
||||
tgt.setTarget(Reference40_50.convertReference(src.getTarget()));
|
||||
return tgt;
|
||||
|
@ -188,53 +188,52 @@ public class DocumentReference40_50 {
|
|||
org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent tgt = new org.hl7.fhir.r4.model.DocumentReference.DocumentReferenceRelatesToComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasCode())
|
||||
tgt.setCodeElement(convertDocumentRelationshipType(src.getCodeElement()));
|
||||
tgt.setCodeElement(convertDocumentRelationshipType(src.getCode()));
|
||||
if (src.hasTarget())
|
||||
tgt.setTarget(Reference40_50.convertReference(src.getTarget()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r5.model.CodeableConcept convertDocumentRelationshipType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipTypeEnumFactory());
|
||||
org.hl7.fhir.r5.model.CodeableConcept tgt = new org.hl7.fhir.r5.model.CodeableConcept();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case REPLACES:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.REPLACES);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("replaces");
|
||||
break;
|
||||
case TRANSFORMS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.TRANSFORMS);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("transforms");
|
||||
break;
|
||||
case SIGNS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.SIGNS);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("signs");
|
||||
break;
|
||||
case APPENDS:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.APPENDS);
|
||||
tgt.addCoding().setSystem("http://hl7.org/fhir/document-relationship-type").setCode("appends");
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.DocumentRelationshipType> src) throws FHIRException {
|
||||
static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType> convertDocumentRelationshipType(org.hl7.fhir.r5.model.CodeableConcept src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipTypeEnumFactory());
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case REPLACES:
|
||||
switch (src.getCode("http://hl7.org/fhir/document-relationship-type")) {
|
||||
case "replaces":
|
||||
tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.REPLACES);
|
||||
break;
|
||||
case TRANSFORMS:
|
||||
case "transforms":
|
||||
tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.TRANSFORMS);
|
||||
break;
|
||||
case SIGNS:
|
||||
case "signs":
|
||||
tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.SIGNS);
|
||||
break;
|
||||
case APPENDS:
|
||||
case "appends":
|
||||
tgt.setValue(org.hl7.fhir.r4.model.DocumentReference.DocumentRelationshipType.APPENDS);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -69,7 +69,7 @@ public class Encounter40_50 {
|
|||
for (org.hl7.fhir.r4.model.Reference t : src.getAppointment())
|
||||
tgt.addAppointment(Reference40_50.convertReference(t));
|
||||
if (src.hasPeriod())
|
||||
tgt.setPeriod(Period40_50.convertPeriod(src.getPeriod()));
|
||||
tgt.setActualPeriod(Period40_50.convertPeriod(src.getPeriod()));
|
||||
if (src.hasLength())
|
||||
tgt.setLength(Duration40_50.convertDuration(src.getLength()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
|
||||
|
@ -120,8 +120,8 @@ public class Encounter40_50 {
|
|||
tgt.addParticipant(convertEncounterParticipantComponent(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getAppointment())
|
||||
tgt.addAppointment(Reference40_50.convertReference(t));
|
||||
if (src.hasPeriod())
|
||||
tgt.setPeriod(Period40_50.convertPeriod(src.getPeriod()));
|
||||
if (src.hasActualPeriod())
|
||||
tgt.setPeriod(Period40_50.convertPeriod(src.getActualPeriod()));
|
||||
if (src.hasLength())
|
||||
tgt.setLength(Duration40_50.convertDuration(src.getLength()));
|
||||
for (CodeableReference t : src.getReason())
|
||||
|
@ -273,7 +273,7 @@ public class Encounter40_50 {
|
|||
if (src.hasPeriod())
|
||||
tgt.setPeriod(Period40_50.convertPeriod(src.getPeriod()));
|
||||
if (src.hasIndividual())
|
||||
tgt.setIndividual(Reference40_50.convertReference(src.getIndividual()));
|
||||
tgt.setActor(Reference40_50.convertReference(src.getIndividual()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -286,8 +286,8 @@ public class Encounter40_50 {
|
|||
tgt.addType(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasPeriod())
|
||||
tgt.setPeriod(Period40_50.convertPeriod(src.getPeriod()));
|
||||
if (src.hasIndividual())
|
||||
tgt.setIndividual(Reference40_50.convertReference(src.getIndividual()));
|
||||
if (src.hasActor())
|
||||
tgt.setIndividual(Reference40_50.convertReference(src.getActor()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.UnsignedI
|
|||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.CodeableReference;
|
||||
import org.hl7.fhir.r5.model.ImagingStudy.ImagingStudyProcedureComponent;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
|
@ -72,9 +71,9 @@ public class ImagingStudy40_50 {
|
|||
if (src.hasNumberOfInstances())
|
||||
tgt.setNumberOfInstancesElement(UnsignedInt40_50.convertUnsignedInt(src.getNumberOfInstancesElement()));
|
||||
if (src.hasProcedureReference())
|
||||
tgt.addProcedure().setValue(Reference40_50.convertReference(src.getProcedureReference()));
|
||||
tgt.addProcedure().setReference(Reference40_50.convertReference(src.getProcedureReference()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProcedureCode())
|
||||
tgt.addProcedure().setValue(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
tgt.addProcedure().setConcept(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasLocation())
|
||||
tgt.setLocation(Reference40_50.convertReference(src.getLocation()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReasonCode())
|
||||
|
@ -115,11 +114,11 @@ public class ImagingStudy40_50 {
|
|||
tgt.setNumberOfSeriesElement(UnsignedInt40_50.convertUnsignedInt(src.getNumberOfSeriesElement()));
|
||||
if (src.hasNumberOfInstances())
|
||||
tgt.setNumberOfInstancesElement(UnsignedInt40_50.convertUnsignedInt(src.getNumberOfInstancesElement()));
|
||||
for (ImagingStudyProcedureComponent t : src.getProcedure()) {
|
||||
if (t.hasValueCodeableConcept())
|
||||
tgt.addProcedureCode(CodeableConcept40_50.convertCodeableConcept(t.getValueCodeableConcept()));
|
||||
if (t.hasValueReference()) {
|
||||
tgt.setProcedureReference(Reference40_50.convertReference(t.getValueReference()));
|
||||
for (CodeableReference t : src.getProcedure()) {
|
||||
if (t.hasConcept())
|
||||
tgt.addProcedureCode(CodeableConcept40_50.convertCodeableConcept(t.getConcept()));
|
||||
if (t.hasReference()) {
|
||||
tgt.setProcedureReference(Reference40_50.convertReference(t.getReference()));
|
||||
}
|
||||
}
|
||||
if (src.hasLocation())
|
||||
|
|
|
@ -53,11 +53,11 @@ public class Medication40_50 {
|
|||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertMedicationStatus(src.getStatusElement()));
|
||||
if (src.hasManufacturer())
|
||||
tgt.setSponsor(Reference40_50.convertReference(src.getManufacturer()));
|
||||
tgt.setMarketingAuthorizationHolder(Reference40_50.convertReference(src.getManufacturer()));
|
||||
if (src.hasForm())
|
||||
tgt.setDoseForm(CodeableConcept40_50.convertCodeableConcept(src.getForm()));
|
||||
if (src.hasAmount())
|
||||
tgt.setAmount(Ratio40_50.convertRatio(src.getAmount()));
|
||||
tgt.setTotalVolume(Ratio40_50.convertRatio(src.getAmount()));
|
||||
for (org.hl7.fhir.r4.model.Medication.MedicationIngredientComponent t : src.getIngredient())
|
||||
tgt.addIngredient(convertMedicationIngredientComponent(t));
|
||||
if (src.hasBatch())
|
||||
|
@ -76,12 +76,12 @@ public class Medication40_50 {
|
|||
tgt.setCode(CodeableConcept40_50.convertCodeableConcept(src.getCode()));
|
||||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertMedicationStatus(src.getStatusElement()));
|
||||
if (src.hasSponsor())
|
||||
tgt.setManufacturer(Reference40_50.convertReference(src.getSponsor()));
|
||||
if (src.hasMarketingAuthorizationHolder())
|
||||
tgt.setManufacturer(Reference40_50.convertReference(src.getMarketingAuthorizationHolder()));
|
||||
if (src.hasDoseForm())
|
||||
tgt.setForm(CodeableConcept40_50.convertCodeableConcept(src.getDoseForm()));
|
||||
if (src.hasAmount())
|
||||
tgt.setAmount(Ratio40_50.convertRatio(src.getAmount()));
|
||||
if (src.hasTotalVolume())
|
||||
tgt.setAmount(Ratio40_50.convertRatio(src.getTotalVolume()));
|
||||
for (org.hl7.fhir.r5.model.Medication.MedicationIngredientComponent t : src.getIngredient())
|
||||
tgt.addIngredient(convertMedicationIngredientComponent(t));
|
||||
if (src.hasBatch())
|
||||
|
|
|
@ -52,13 +52,13 @@ public class MedicationKnowledge40_50 {
|
|||
tgt.setCode(CodeableConcept40_50.convertCodeableConcept(src.getCode()));
|
||||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertMedicationKnowledgeStatus(src.getStatusElement()));
|
||||
if (src.hasManufacturer())
|
||||
tgt.setSponsor(Reference40_50.convertReference(src.getManufacturer()));
|
||||
if (src.hasDoseForm())
|
||||
tgt.setDoseForm(CodeableConcept40_50.convertCodeableConcept(src.getDoseForm()));
|
||||
if (src.hasAmount())
|
||||
tgt.setAmount(SimpleQuantity40_50.convertSimpleQuantity(src.getAmount()));
|
||||
for (org.hl7.fhir.r4.model.StringType t : src.getSynonym()) tgt.getSynonym().add(String40_50.convertString(t));
|
||||
// if (src.hasManufacturer())
|
||||
// tgt.setSponsor(Reference40_50.convertReference(src.getManufacturer()));
|
||||
// if (src.hasDoseForm())
|
||||
// tgt.setDoseForm(CodeableConcept40_50.convertCodeableConcept(src.getDoseForm()));
|
||||
// if (src.hasAmount())
|
||||
// tgt.setAmount(SimpleQuantity40_50.convertSimpleQuantity(src.getAmount()));
|
||||
for (org.hl7.fhir.r4.model.StringType t : src.getSynonym()) tgt.getName().add(String40_50.convertString(t));
|
||||
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent t : src.getRelatedMedicationKnowledge())
|
||||
tgt.addRelatedMedicationKnowledge(convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(t));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getAssociatedMedication())
|
||||
|
@ -67,12 +67,12 @@ public class MedicationKnowledge40_50 {
|
|||
tgt.addProductType(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonographComponent t : src.getMonograph())
|
||||
tgt.addMonograph(convertMedicationKnowledgeMonographComponent(t));
|
||||
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent t : src.getIngredient())
|
||||
tgt.addIngredient(convertMedicationKnowledgeIngredientComponent(t));
|
||||
// for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent t : src.getIngredient())
|
||||
// tgt.addIngredient(convertMedicationKnowledgeIngredientComponent(t));
|
||||
if (src.hasPreparationInstruction())
|
||||
tgt.setPreparationInstructionElement(MarkDown40_50.convertMarkdown(src.getPreparationInstructionElement()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getIntendedRoute())
|
||||
tgt.addIntendedRoute(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
// for (org.hl7.fhir.r4.model.CodeableConcept t : src.getIntendedRoute())
|
||||
// tgt.addIntendedRoute(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent t : src.getCost())
|
||||
tgt.addCost(convertMedicationKnowledgeCostComponent(t));
|
||||
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent t : src.getMonitoringProgram())
|
||||
|
@ -83,8 +83,8 @@ public class MedicationKnowledge40_50 {
|
|||
tgt.addMedicineClassification(convertMedicationKnowledgeMedicineClassificationComponent(t));
|
||||
if (src.hasPackaging())
|
||||
tgt.addPackaging(convertMedicationKnowledgePackagingComponent(src.getPackaging()));
|
||||
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent t : src.getDrugCharacteristic())
|
||||
tgt.addDrugCharacteristic(convertMedicationKnowledgeDrugCharacteristicComponent(t));
|
||||
// for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent t : src.getDrugCharacteristic())
|
||||
// tgt.addDrugCharacteristic(convertMedicationKnowledgeDrugCharacteristicComponent(t));
|
||||
// for (org.hl7.fhir.r4.model.Reference t : src.getContraindication())
|
||||
// tgt.addContraindication(convertReference(t));
|
||||
for (org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent t : src.getRegulatory())
|
||||
|
@ -103,13 +103,13 @@ public class MedicationKnowledge40_50 {
|
|||
tgt.setCode(CodeableConcept40_50.convertCodeableConcept(src.getCode()));
|
||||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertMedicationKnowledgeStatus(src.getStatusElement()));
|
||||
if (src.hasSponsor())
|
||||
tgt.setManufacturer(Reference40_50.convertReference(src.getSponsor()));
|
||||
if (src.hasDoseForm())
|
||||
tgt.setDoseForm(CodeableConcept40_50.convertCodeableConcept(src.getDoseForm()));
|
||||
if (src.hasAmount())
|
||||
tgt.setAmount(SimpleQuantity40_50.convertSimpleQuantity(src.getAmount()));
|
||||
for (org.hl7.fhir.r5.model.StringType t : src.getSynonym()) tgt.getSynonym().add(String40_50.convertString(t));
|
||||
// if (src.hasSponsor())
|
||||
// tgt.setManufacturer(Reference40_50.convertReference(src.getSponsor()));
|
||||
// if (src.hasDoseForm())
|
||||
// tgt.setDoseForm(CodeableConcept40_50.convertCodeableConcept(src.getDoseForm()));
|
||||
// if (src.hasAmount())
|
||||
// tgt.setAmount(SimpleQuantity40_50.convertSimpleQuantity(src.getAmount()));
|
||||
for (org.hl7.fhir.r5.model.StringType t : src.getName()) tgt.getSynonym().add(String40_50.convertString(t));
|
||||
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRelatedMedicationKnowledgeComponent t : src.getRelatedMedicationKnowledge())
|
||||
tgt.addRelatedMedicationKnowledge(convertMedicationKnowledgeRelatedMedicationKnowledgeComponent(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getAssociatedMedication())
|
||||
|
@ -118,12 +118,12 @@ public class MedicationKnowledge40_50 {
|
|||
tgt.addProductType(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonographComponent t : src.getMonograph())
|
||||
tgt.addMonograph(convertMedicationKnowledgeMonographComponent(t));
|
||||
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent t : src.getIngredient())
|
||||
tgt.addIngredient(convertMedicationKnowledgeIngredientComponent(t));
|
||||
// for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent t : src.getIngredient())
|
||||
// tgt.addIngredient(convertMedicationKnowledgeIngredientComponent(t));
|
||||
if (src.hasPreparationInstruction())
|
||||
tgt.setPreparationInstructionElement(MarkDown40_50.convertMarkdown(src.getPreparationInstructionElement()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getIntendedRoute())
|
||||
tgt.addIntendedRoute(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
// for (org.hl7.fhir.r5.model.CodeableConcept t : src.getIntendedRoute())
|
||||
// tgt.addIntendedRoute(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent t : src.getCost())
|
||||
tgt.addCost(convertMedicationKnowledgeCostComponent(t));
|
||||
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeMonitoringProgramComponent t : src.getMonitoringProgram())
|
||||
|
@ -134,8 +134,8 @@ public class MedicationKnowledge40_50 {
|
|||
tgt.addMedicineClassification(convertMedicationKnowledgeMedicineClassificationComponent(t));
|
||||
for (MedicationKnowledgePackagingComponent t : src.getPackaging())
|
||||
tgt.setPackaging(convertMedicationKnowledgePackagingComponent(t));
|
||||
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent t : src.getDrugCharacteristic())
|
||||
tgt.addDrugCharacteristic(convertMedicationKnowledgeDrugCharacteristicComponent(t));
|
||||
// for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent t : src.getDrugCharacteristic())
|
||||
// tgt.addDrugCharacteristic(convertMedicationKnowledgeDrugCharacteristicComponent(t));
|
||||
// for (org.hl7.fhir.r5.model.Reference t : src.getContraindication())
|
||||
// tgt.addContraindication(convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent t : src.getRegulatory())
|
||||
|
@ -236,37 +236,37 @@ public class MedicationKnowledge40_50 {
|
|||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent convertMedicationKnowledgeIngredientComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasItemCodeableConcept())
|
||||
tgt.getItem().setConcept(CodeableConcept40_50.convertCodeableConcept(src.getItemCodeableConcept()));
|
||||
if (src.hasItemReference())
|
||||
tgt.getItem().setReference(Reference40_50.convertReference(src.getItemReference()));
|
||||
if (src.getIsActive())
|
||||
tgt.setIsActive(new CodeableConcept(new Coding("ttp://terminology.hl7.org/CodeSystem/v3-RoleClass", "ACTI", "active ingredient ")));
|
||||
if (src.hasStrength())
|
||||
tgt.setStrength(Ratio40_50.convertRatio(src.getStrength()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent convertMedicationKnowledgeIngredientComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.getItem().hasConcept())
|
||||
tgt.setItem(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getItem().getConcept()));
|
||||
if (src.getItem().hasReference())
|
||||
tgt.setItem(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getItem().getReference()));
|
||||
if (src.hasIsActive())
|
||||
tgt.setIsActive(src.getIsActive().hasCoding("http://terminology.hl7.org/CodeSystem/v3-RoleClass", "ACTI"));
|
||||
if (src.hasStrengthRatio())
|
||||
tgt.setStrength(Ratio40_50.convertRatio(src.getStrengthRatio()));
|
||||
return tgt;
|
||||
}
|
||||
// public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent convertMedicationKnowledgeIngredientComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasItemCodeableConcept())
|
||||
// tgt.getItem().setConcept(CodeableConcept40_50.convertCodeableConcept(src.getItemCodeableConcept()));
|
||||
// if (src.hasItemReference())
|
||||
// tgt.getItem().setReference(Reference40_50.convertReference(src.getItemReference()));
|
||||
// if (src.getIsActive())
|
||||
// tgt.setIsActive(new CodeableConcept(new Coding("ttp://terminology.hl7.org/CodeSystem/v3-RoleClass", "ACTI", "active ingredient ")));
|
||||
// if (src.hasStrength())
|
||||
// tgt.setStrength(Ratio40_50.convertRatio(src.getStrength()));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent convertMedicationKnowledgeIngredientComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeIngredientComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.getItem().hasConcept())
|
||||
// tgt.setItem(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getItem().getConcept()));
|
||||
// if (src.getItem().hasReference())
|
||||
// tgt.setItem(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getItem().getReference()));
|
||||
// if (src.hasIsActive())
|
||||
// tgt.setIsActive(src.getIsActive().hasCoding("http://terminology.hl7.org/CodeSystem/v3-RoleClass", "ACTI"));
|
||||
// if (src.hasStrengthRatio())
|
||||
// tgt.setStrength(Ratio40_50.convertRatio(src.getStrengthRatio()));
|
||||
// return tgt;
|
||||
// }
|
||||
|
||||
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeCostComponent convertMedicationKnowledgeCostComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeCostComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
|
@ -424,10 +424,10 @@ public class MedicationKnowledge40_50 {
|
|||
return null;
|
||||
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgePackagingComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
if (src.hasQuantity())
|
||||
tgt.setQuantity(SimpleQuantity40_50.convertSimpleQuantity(src.getQuantity()));
|
||||
// if (src.hasType())
|
||||
// tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
// if (src.hasQuantity())
|
||||
// tgt.setQuantity(SimpleQuantity40_50.convertSimpleQuantity(src.getQuantity()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -436,36 +436,36 @@ public class MedicationKnowledge40_50 {
|
|||
return null;
|
||||
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgePackagingComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgePackagingComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
if (src.hasQuantity())
|
||||
tgt.setQuantity(SimpleQuantity40_50.convertSimpleQuantity(src.getQuantity()));
|
||||
// if (src.hasType())
|
||||
// tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
// if (src.hasQuantity())
|
||||
// tgt.setQuantity(SimpleQuantity40_50.convertSimpleQuantity(src.getQuantity()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent convertMedicationKnowledgeDrugCharacteristicComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
if (src.hasValue())
|
||||
tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent convertMedicationKnowledgeDrugCharacteristicComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasType())
|
||||
tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
if (src.hasValue())
|
||||
tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
|
||||
return tgt;
|
||||
}
|
||||
// public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent convertMedicationKnowledgeDrugCharacteristicComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent tgt = new org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasType())
|
||||
// tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
// if (src.hasValue())
|
||||
// tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
|
||||
// return tgt;
|
||||
// }
|
||||
//
|
||||
// public static org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent convertMedicationKnowledgeDrugCharacteristicComponent(org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent src) throws FHIRException {
|
||||
// if (src == null)
|
||||
// return null;
|
||||
// org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent tgt = new org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeDrugCharacteristicComponent();
|
||||
// ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
// if (src.hasType())
|
||||
// tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
// if (src.hasValue())
|
||||
// tgt.setValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getValue()));
|
||||
// return tgt;
|
||||
// }
|
||||
|
||||
public static org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent convertMedicationKnowledgeRegulatoryComponent(org.hl7.fhir.r4.model.MedicationKnowledge.MedicationKnowledgeRegulatoryComponent src) throws FHIRException {
|
||||
if (src == null)
|
||||
|
|
|
@ -97,7 +97,7 @@ public class MedicationRequest40_50 {
|
|||
for (org.hl7.fhir.r4.model.Reference t : src.getInsurance()) tgt.addInsurance(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
|
||||
for (org.hl7.fhir.r4.model.Dosage t : src.getDosageInstruction())
|
||||
tgt.addDosageInstruction(Dosage40_50.convertDosage(t));
|
||||
tgt.getDose().addDosageInstruction(Dosage40_50.convertDosage(t));
|
||||
if (src.hasDispenseRequest())
|
||||
tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest()));
|
||||
if (src.hasSubstitution())
|
||||
|
@ -171,7 +171,7 @@ public class MedicationRequest40_50 {
|
|||
tgt.setCourseOfTherapyType(CodeableConcept40_50.convertCodeableConcept(src.getCourseOfTherapyType()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getInsurance()) tgt.addInsurance(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
|
||||
for (org.hl7.fhir.r5.model.Dosage t : src.getDosageInstruction())
|
||||
for (org.hl7.fhir.r5.model.Dosage t : src.getDose().getDosageInstruction())
|
||||
tgt.addDosageInstruction(Dosage40_50.convertDosage(t));
|
||||
if (src.hasDispenseRequest())
|
||||
tgt.setDispenseRequest(convertMedicationRequestDispenseRequestComponent(src.getDispenseRequest()));
|
||||
|
|
|
@ -48,12 +48,12 @@ public class MedicationStatement40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
|
||||
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
|
||||
tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference40_50.convertReference(t));
|
||||
// for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference40_50.convertReference(t));
|
||||
// for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference40_50.convertReference(t));
|
||||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertMedicationStatementStatus(src.getStatusElement()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getStatusReason())
|
||||
tgt.addStatusReason(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
// for (org.hl7.fhir.r4.model.CodeableConcept t : src.getStatusReason())
|
||||
// tgt.addStatusReason(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasCategory())
|
||||
tgt.addCategory(CodeableConcept40_50.convertCodeableConcept(src.getCategory()));
|
||||
if (src.hasMedicationCodeableConcept()) {
|
||||
|
@ -90,12 +90,12 @@ public class MedicationStatement40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
|
||||
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
|
||||
tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference40_50.convertReference(t));
|
||||
// for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference40_50.convertReference(t));
|
||||
// for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference40_50.convertReference(t));
|
||||
if (src.hasStatus())
|
||||
tgt.setStatusElement(convertMedicationStatementStatus(src.getStatusElement()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason())
|
||||
tgt.addStatusReason(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
// for (org.hl7.fhir.r5.model.CodeableConcept t : src.getStatusReason())
|
||||
// tgt.addStatusReason(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasCategory())
|
||||
tgt.setCategory(CodeableConcept40_50.convertCodeableConcept(src.getCategoryFirstRep()));
|
||||
if (src.getMedication().hasConcept()) {
|
||||
|
@ -134,28 +134,28 @@ public class MedicationStatement40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
switch (src.getValue()) {
|
||||
case ACTIVE:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.COMPLETED);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
case COMPLETED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.COMPLETED);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.ENTEREDINERROR);
|
||||
break;
|
||||
case INTENDED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.UNKNOWN);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
case STOPPED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.UNKNOWN);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
case ONHOLD:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.UNKNOWN);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
case UNKNOWN:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.UNKNOWN);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
case NOTTAKEN:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.COMPLETED);
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.RECORDED);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.NULL);
|
||||
|
@ -173,7 +173,7 @@ public class MedicationStatement40_50 {
|
|||
// case ACTIVE:
|
||||
// tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ACTIVE);
|
||||
// break;
|
||||
case COMPLETED:
|
||||
case RECORDED:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.COMPLETED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
|
@ -188,7 +188,7 @@ public class MedicationStatement40_50 {
|
|||
// case ONHOLD:
|
||||
// tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ONHOLD);
|
||||
// break;
|
||||
case UNKNOWN:
|
||||
case DRAFT:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.UNKNOWN);
|
||||
break;
|
||||
// case NOTTAKEN:
|
||||
|
|
|
@ -54,7 +54,7 @@ public class Person40_50 {
|
|||
tgt.setBirthDateElement(Date40_50.convertDate(src.getBirthDateElement()));
|
||||
for (org.hl7.fhir.r4.model.Address t : src.getAddress()) tgt.addAddress(Address40_50.convertAddress(t));
|
||||
if (src.hasPhoto())
|
||||
tgt.setPhoto(Attachment40_50.convertAttachment(src.getPhoto()));
|
||||
tgt.addPhoto(Attachment40_50.convertAttachment(src.getPhoto()));
|
||||
if (src.hasManagingOrganization())
|
||||
tgt.setManagingOrganization(Reference40_50.convertReference(src.getManagingOrganization()));
|
||||
if (src.hasActive())
|
||||
|
@ -79,7 +79,7 @@ public class Person40_50 {
|
|||
tgt.setBirthDateElement(Date40_50.convertDate(src.getBirthDateElement()));
|
||||
for (org.hl7.fhir.r5.model.Address t : src.getAddress()) tgt.addAddress(Address40_50.convertAddress(t));
|
||||
if (src.hasPhoto())
|
||||
tgt.setPhoto(Attachment40_50.convertAttachment(src.getPhoto()));
|
||||
tgt.setPhoto(Attachment40_50.convertAttachment(src.getPhotoFirstRep()));
|
||||
if (src.hasManagingOrganization())
|
||||
tgt.setManagingOrganization(Reference40_50.convertReference(src.getManagingOrganization()));
|
||||
if (src.hasActive())
|
||||
|
|
|
@ -22,7 +22,7 @@ public class ProductShelfLife40_50 {
|
|||
org.hl7.fhir.r4.model.ProductShelfLife tgt = new org.hl7.fhir.r4.model.ProductShelfLife();
|
||||
BackboneElement40_50.copyBackboneElement(src, tgt);
|
||||
if (src.hasType()) tgt.setType(CodeableConcept40_50.convertCodeableConcept(src.getType()));
|
||||
if (src.hasPeriodQuantity()) tgt.setPeriod(Quantity40_50.convertQuantity(src.getPeriodQuantity()));
|
||||
if (src.hasPeriodDuration()) tgt.setPeriod(Quantity40_50.convertQuantity(src.getPeriodDuration()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialPrecautionsForStorage())
|
||||
tgt.addSpecialPrecautionsForStorage(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
return tgt;
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Instant40
|
|||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.Uri40_50;
|
||||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r5.model.CodeableReference;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
|
@ -53,7 +54,7 @@ public class Provenance40_50 {
|
|||
if (src.hasLocation())
|
||||
tgt.setLocation(Reference40_50.convertReference(src.getLocation()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getReason())
|
||||
tgt.addReason(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
tgt.addAuthorization().setConcept(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasActivity())
|
||||
tgt.setActivity(CodeableConcept40_50.convertCodeableConcept(src.getActivity()));
|
||||
for (org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent t : src.getAgent())
|
||||
|
@ -77,8 +78,9 @@ public class Provenance40_50 {
|
|||
for (org.hl7.fhir.r5.model.UriType t : src.getPolicy()) tgt.getPolicy().add(Uri40_50.convertUri(t));
|
||||
if (src.hasLocation())
|
||||
tgt.setLocation(Reference40_50.convertReference(src.getLocation()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getReason())
|
||||
tgt.addReason(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
for (CodeableReference t : src.getAuthorization())
|
||||
if (t.hasConcept())
|
||||
tgt.addReason(CodeableConcept40_50.convertCodeableConcept(t.getConcept()));
|
||||
if (src.hasActivity())
|
||||
tgt.setActivity(CodeableConcept40_50.convertCodeableConcept(src.getActivity()));
|
||||
for (org.hl7.fhir.r5.model.Provenance.ProvenanceAgentComponent t : src.getAgent())
|
||||
|
|
|
@ -46,7 +46,7 @@ public class QuestionnaireResponse40_50 {
|
|||
org.hl7.fhir.r5.model.QuestionnaireResponse tgt = new org.hl7.fhir.r5.model.QuestionnaireResponse();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
|
||||
if (src.hasIdentifier())
|
||||
tgt.setIdentifier(Identifier40_50.convertIdentifier(src.getIdentifier()));
|
||||
tgt.addIdentifier(Identifier40_50.convertIdentifier(src.getIdentifier()));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference40_50.convertReference(t));
|
||||
if (src.hasQuestionnaire())
|
||||
|
@ -74,7 +74,7 @@ public class QuestionnaireResponse40_50 {
|
|||
org.hl7.fhir.r4.model.QuestionnaireResponse tgt = new org.hl7.fhir.r4.model.QuestionnaireResponse();
|
||||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
|
||||
if (src.hasIdentifier())
|
||||
tgt.setIdentifier(Identifier40_50.convertIdentifier(src.getIdentifier()));
|
||||
tgt.setIdentifier(Identifier40_50.convertIdentifier(src.getIdentifierFirstRep()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getBasedOn()) tgt.addBasedOn(Reference40_50.convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getPartOf()) tgt.addPartOf(Reference40_50.convertReference(t));
|
||||
if (src.hasQuestionnaire())
|
||||
|
|
|
@ -54,7 +54,7 @@ public class Slot40_50 {
|
|||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getSpecialty())
|
||||
tgt.addSpecialty(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasAppointmentType())
|
||||
tgt.setAppointmentType(CodeableConcept40_50.convertCodeableConcept(src.getAppointmentType()));
|
||||
tgt.addAppointmentType(CodeableConcept40_50.convertCodeableConcept(src.getAppointmentType()));
|
||||
if (src.hasSchedule())
|
||||
tgt.setSchedule(Reference40_50.convertReference(src.getSchedule()));
|
||||
if (src.hasStatus())
|
||||
|
@ -84,7 +84,7 @@ public class Slot40_50 {
|
|||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialty())
|
||||
tgt.addSpecialty(CodeableConcept40_50.convertCodeableConcept(t));
|
||||
if (src.hasAppointmentType())
|
||||
tgt.setAppointmentType(CodeableConcept40_50.convertCodeableConcept(src.getAppointmentType()));
|
||||
tgt.setAppointmentType(CodeableConcept40_50.convertCodeableConcept(src.getAppointmentTypeFirstRep()));
|
||||
if (src.hasSchedule())
|
||||
tgt.setSchedule(Reference40_50.convertReference(src.getSchedule()));
|
||||
if (src.hasStatus())
|
||||
|
|
|
@ -166,7 +166,7 @@ public class Specimen40_50 {
|
|||
if (src.hasMethod())
|
||||
tgt.setMethod(CodeableConcept40_50.convertCodeableConcept(src.getMethod()));
|
||||
if (src.hasBodySite())
|
||||
tgt.setBodySite(CodeableConcept40_50.convertCodeableConcept(src.getBodySite()));
|
||||
tgt.getBodySite().setConcept(CodeableConcept40_50.convertCodeableConcept(src.getBodySite()));
|
||||
if (src.hasFastingStatus())
|
||||
tgt.setFastingStatus(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getFastingStatus()));
|
||||
return tgt;
|
||||
|
@ -187,8 +187,8 @@ public class Specimen40_50 {
|
|||
tgt.setQuantity(SimpleQuantity40_50.convertSimpleQuantity(src.getQuantity()));
|
||||
if (src.hasMethod())
|
||||
tgt.setMethod(CodeableConcept40_50.convertCodeableConcept(src.getMethod()));
|
||||
if (src.hasBodySite())
|
||||
tgt.setBodySite(CodeableConcept40_50.convertCodeableConcept(src.getBodySite()));
|
||||
if (src.getBodySite().hasConcept())
|
||||
tgt.setBodySite(CodeableConcept40_50.convertCodeableConcept(src.getBodySite().getConcept()));
|
||||
if (src.hasFastingStatus())
|
||||
tgt.setFastingStatus(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getFastingStatus()));
|
||||
return tgt;
|
||||
|
@ -201,8 +201,8 @@ public class Specimen40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
if (src.hasProcedure())
|
||||
tgt.setProcedure(CodeableConcept40_50.convertCodeableConcept(src.getProcedure()));
|
||||
// if (src.hasProcedure())
|
||||
// tgt.setProcedure(CodeableConcept40_50.convertCodeableConcept(src.getProcedure()));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getAdditive()) tgt.addAdditive(Reference40_50.convertReference(t));
|
||||
if (src.hasTime())
|
||||
tgt.setTime(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getTime()));
|
||||
|
@ -216,8 +216,8 @@ public class Specimen40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasDescription())
|
||||
tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
|
||||
if (src.hasProcedure())
|
||||
tgt.setProcedure(CodeableConcept40_50.convertCodeableConcept(src.getProcedure()));
|
||||
// if (src.hasProcedure())
|
||||
// tgt.setProcedure(CodeableConcept40_50.convertCodeableConcept(src.getProcedure()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getAdditive()) tgt.addAdditive(Reference40_50.convertReference(t));
|
||||
if (src.hasTime())
|
||||
tgt.setTime(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getTime()));
|
||||
|
|
|
@ -8,6 +8,8 @@ import org.hl7.fhir.convertors.conv40_50.datatypes40_50.metadata40_50.UsageConte
|
|||
import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.*;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r4.model.StructureMap.StructureMapGroupTypeMode;
|
||||
import org.hl7.fhir.r5.model.StringType;
|
||||
import org.hl7.fhir.r5.model.StructureMap.StructureMapGroupRuleTargetParameterComponent;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -421,7 +423,7 @@ public class StructureMap40_50 {
|
|||
if (src.hasType())
|
||||
tgt.setTypeElement(String40_50.convertString(src.getTypeElement()));
|
||||
if (src.hasDefaultValue())
|
||||
tgt.setDefaultValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getDefaultValue()));
|
||||
tgt.setDefaultValueElement((StringType) ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getDefaultValue()));
|
||||
if (src.hasElement())
|
||||
tgt.setElementElement(String40_50.convertString(src.getElementElement()));
|
||||
if (src.hasListMode())
|
||||
|
@ -451,7 +453,7 @@ public class StructureMap40_50 {
|
|||
if (src.hasType())
|
||||
tgt.setTypeElement(String40_50.convertString(src.getTypeElement()));
|
||||
if (src.hasDefaultValue())
|
||||
tgt.setDefaultValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getDefaultValue()));
|
||||
tgt.setDefaultValue(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getDefaultValueElement()));
|
||||
if (src.hasElement())
|
||||
tgt.setElementElement(String40_50.convertString(src.getElementElement()));
|
||||
if (src.hasListMode())
|
||||
|
@ -777,7 +779,7 @@ public class StructureMap40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasName())
|
||||
tgt.setNameElement(Id40_50.convertId(src.getNameElement()));
|
||||
for (org.hl7.fhir.r4.model.StringType t : src.getVariable()) tgt.getVariable().add(String40_50.convertString(t));
|
||||
for (org.hl7.fhir.r4.model.StringType t : src.getVariable()) tgt.addParameter().setValue(String40_50.convertString(t));
|
||||
return tgt;
|
||||
}
|
||||
|
||||
|
@ -788,7 +790,7 @@ public class StructureMap40_50 {
|
|||
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
|
||||
if (src.hasName())
|
||||
tgt.setNameElement(Id40_50.convertId(src.getNameElement()));
|
||||
for (org.hl7.fhir.r5.model.StringType t : src.getVariable()) tgt.getVariable().add(String40_50.convertString(t));
|
||||
for (StructureMapGroupRuleTargetParameterComponent t : src.getParameter()) tgt.getVariable().add(String40_50.convertString(t.getValueStringType()));
|
||||
return tgt;
|
||||
}
|
||||
}
|
|
@ -38,6 +38,11 @@ public abstract class BaseLoaderR5 implements IContextResourceLoader {
|
|||
|
||||
public void setPath(Resource r) {
|
||||
String path = lkp.getResourcePath(r);
|
||||
if (lkp.getWebRoot() != null) {
|
||||
r.setUserData("webroot", lkp.getWebRoot());
|
||||
} else {
|
||||
r.setUserData("webroot", "");
|
||||
}
|
||||
if (path != null) {
|
||||
r.setUserData("path", path);
|
||||
}
|
||||
|
|
|
@ -16,4 +16,6 @@ public interface ILoaderKnowledgeProviderR5 {
|
|||
String getResourcePath(Resource resource);
|
||||
|
||||
ILoaderKnowledgeProviderR5 forNewPackage(NpmPackage npm) throws JsonSyntaxException, IOException;
|
||||
|
||||
String getWebRoot();
|
||||
}
|
||||
|
|
|
@ -13,4 +13,9 @@ public class NullLoaderKnowledgeProviderR5 implements ILoaderKnowledgeProviderR5
|
|||
public ILoaderKnowledgeProviderR5 forNewPackage(NpmPackage npm) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getWebRoot() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,157 @@
|
|||
package org.hl7.fhir.convertors.loaders.loaderR5;
|
||||
|
||||
/*
|
||||
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.advisors.impl.BaseAdvisor_40_50;
|
||||
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_40_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r4.formats.JsonParser;
|
||||
import org.hl7.fhir.r4.formats.XmlParser;
|
||||
import org.hl7.fhir.r4.model.Resource;
|
||||
import org.hl7.fhir.r5.conformance.StructureDefinitionHacker;
|
||||
import org.hl7.fhir.r5.context.IWorkerContext.IContextResourceLoader;
|
||||
import org.hl7.fhir.r5.model.*;
|
||||
import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.r5.model.Bundle.BundleType;
|
||||
import org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent;
|
||||
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
|
||||
import org.hl7.fhir.utilities.VersionUtilities;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class R4BToR5Loader extends BaseLoaderR5 implements IContextResourceLoader {
|
||||
|
||||
private final BaseAdvisor_40_50 advisor = new BaseAdvisor_40_50();
|
||||
private String version;
|
||||
|
||||
public R4BToR5Loader(String[] types, ILoaderKnowledgeProviderR5 lkp, String version) { // might be 4B
|
||||
super(types, lkp);
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bundle loadBundle(InputStream stream, boolean isJson) throws FHIRException, IOException {
|
||||
Resource r4 = null;
|
||||
if (isJson)
|
||||
r4 = new JsonParser().parse(stream);
|
||||
else
|
||||
r4 = new XmlParser().parse(stream);
|
||||
org.hl7.fhir.r5.model.Resource r5 = VersionConvertorFactory_40_50.convertResource(r4, advisor);
|
||||
|
||||
Bundle b;
|
||||
if (r5 instanceof Bundle)
|
||||
b = (Bundle) r5;
|
||||
else {
|
||||
b = new Bundle();
|
||||
b.setId(UUID.randomUUID().toString().toLowerCase());
|
||||
b.setType(BundleType.COLLECTION);
|
||||
b.addEntry().setResource(r5).setFullUrl(r5 instanceof CanonicalResource ? ((CanonicalResource) r5).getUrl() : null);
|
||||
}
|
||||
for (CodeSystem cs : advisor.getCslist()) {
|
||||
BundleEntryComponent be = b.addEntry();
|
||||
be.setFullUrl(cs.getUrl());
|
||||
be.setResource(cs);
|
||||
}
|
||||
if (killPrimitives) {
|
||||
List<BundleEntryComponent> remove = new ArrayList<BundleEntryComponent>();
|
||||
for (BundleEntryComponent be : b.getEntry()) {
|
||||
if (be.hasResource() && be.getResource() instanceof StructureDefinition) {
|
||||
StructureDefinition sd = (StructureDefinition) be.getResource();
|
||||
if (sd.getKind() == StructureDefinitionKind.PRIMITIVETYPE)
|
||||
remove.add(be);
|
||||
}
|
||||
}
|
||||
b.getEntry().removeAll(remove);
|
||||
}
|
||||
if (patchUrls) {
|
||||
for (BundleEntryComponent be : b.getEntry()) {
|
||||
if (be.hasResource() && be.getResource() instanceof StructureDefinition) {
|
||||
StructureDefinition sd = (StructureDefinition) be.getResource();
|
||||
sd.setUrl(sd.getUrl().replace(URL_BASE, URL_R4));
|
||||
sd.addExtension().setUrl(URL_ELEMENT_DEF_NAMESPACE).setValue(new UriType(URL_BASE));
|
||||
for (ElementDefinition ed : sd.getSnapshot().getElement())
|
||||
patchUrl(ed);
|
||||
for (ElementDefinition ed : sd.getDifferential().getElement())
|
||||
patchUrl(ed);
|
||||
}
|
||||
}
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.hl7.fhir.r5.model.Resource loadResource(InputStream stream, boolean isJson) throws FHIRException, IOException {
|
||||
Resource r4 = null;
|
||||
if (isJson)
|
||||
r4 = new JsonParser().parse(stream);
|
||||
else
|
||||
r4 = new XmlParser().parse(stream);
|
||||
org.hl7.fhir.r5.model.Resource r5 = VersionConvertorFactory_40_50.convertResource(r4);
|
||||
setPath(r5);
|
||||
|
||||
if (!advisor.getCslist().isEmpty()) {
|
||||
throw new FHIRException("Error: Cannot have included code systems");
|
||||
}
|
||||
if (killPrimitives) {
|
||||
throw new FHIRException("Cannot kill primitives when using deferred loading");
|
||||
}
|
||||
if (r5 instanceof StructureDefinition && VersionUtilities.isR4BVer(version)) {
|
||||
r5 = new StructureDefinitionHacker(version).fixSD((StructureDefinition) r5);
|
||||
}
|
||||
if (patchUrls) {
|
||||
if (r5 instanceof StructureDefinition) {
|
||||
StructureDefinition sd = (StructureDefinition) r5;
|
||||
sd.setUrl(sd.getUrl().replace(URL_BASE, "http://hl7.org/fhir/4.0/"));
|
||||
sd.addExtension().setUrl(URL_ELEMENT_DEF_NAMESPACE).setValue(new UriType("http://hl7.org/fhir"));
|
||||
for (ElementDefinition ed : sd.getSnapshot().getElement())
|
||||
patchUrl(ed);
|
||||
for (ElementDefinition ed : sd.getDifferential().getElement())
|
||||
patchUrl(ed);
|
||||
}
|
||||
}
|
||||
return r5;
|
||||
}
|
||||
|
||||
private void patchUrl(ElementDefinition ed) {
|
||||
for (TypeRefComponent tr : ed.getType()) {
|
||||
for (CanonicalType s : tr.getTargetProfile()) {
|
||||
s.setValue(s.getValue().replace(URL_BASE, "http://hl7.org/fhir/4.0/"));
|
||||
}
|
||||
for (CanonicalType s : tr.getProfile()) {
|
||||
s.setValue(s.getValue().replace(URL_BASE, "http://hl7.org/fhir/4.0/"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package org.hl7.fhir.convertors.misc;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_50;
|
||||
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_40_50;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r4b.formats.JsonParser;
|
||||
import org.hl7.fhir.r4b.model.Bundle;
|
||||
import org.hl7.fhir.r4b.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.utilities.TextFile;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.json.JsonTrackingParser;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import org.hl7.fhir.r4b.model.SearchParameter;
|
||||
import org.hl7.fhir.r4b.utils.NPMPackageGenerator;
|
||||
import org.hl7.fhir.r4b.utils.NPMPackageGenerator.Category;
|
||||
|
||||
public class ExamplesPackageBuilder {
|
||||
|
||||
public static void main(String[] args) throws FHIRFormatError, FileNotFoundException, IOException {
|
||||
new ExamplesPackageBuilder().process(args[0]);
|
||||
|
||||
}
|
||||
|
||||
private void process(String source) throws FHIRFormatError, FileNotFoundException, IOException {
|
||||
Set<String> set = new HashSet<>();
|
||||
for (File f : new File(source).listFiles()) {
|
||||
if (f.getName().endsWith(".json")) {
|
||||
JsonObject obj = JsonTrackingParser.parseJson(new FileInputStream(f));
|
||||
if (obj.has("resourceType") && obj.has("id")) {
|
||||
String type = obj.get("resourceType").getAsString();
|
||||
String id = obj.get("id").getAsString();
|
||||
byte[] content = TextFile.fileToBytes(f);
|
||||
if (type.equals("ConceptMap")) {
|
||||
System.out.println("convert "+f.getName());
|
||||
content = r5ToR4B(content);
|
||||
TextFile.bytesToFile(content, f);
|
||||
}
|
||||
// TextFile.bytesToFile(content, Utilities.path(dest2, type+"-"+id+".json"));
|
||||
// if (!set.contains(type+"/"+id)) {
|
||||
// set.add(type+"/"+id);
|
||||
// pck.addFile(Category.RESOURCE, type+"-"+id+".json", content);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
// pck.finish();
|
||||
//
|
||||
}
|
||||
|
||||
private byte[] r5ToR4B(byte[] content) throws FHIRFormatError, IOException {
|
||||
try {
|
||||
org.hl7.fhir.r5.model.Resource r5 = new org.hl7.fhir.r5.formats.JsonParser().parse(content);
|
||||
org.hl7.fhir.r4.model.Resource r4 = VersionConvertorFactory_40_50.convertResource(r5);
|
||||
return new org.hl7.fhir.r4.formats.JsonParser().composeBytes(r4);
|
||||
} catch (Exception e) {
|
||||
System.out.println(" .. failed: "+e.getMessage());
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -18,10 +18,9 @@ public class OIDBasedValueSetImporter {
|
|||
protected void init() throws FHIRException, IOException {
|
||||
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager(true, ToolsVersion.TOOLS_VERSION);
|
||||
NpmPackage npm = pcm.loadPackage("hl7.fhir.r5.core", "current");
|
||||
SimpleWorkerContext ctxt = SimpleWorkerContext.fromPackage(npm);
|
||||
ctxt.setAllowLoadingDuplicates(true);
|
||||
ctxt.loadFromPackage(pcm.loadPackage("hl7.terminology"), null);
|
||||
context = ctxt;
|
||||
SimpleWorkerContext context = new SimpleWorkerContext.SimpleWorkerContextBuilder().withAllowLoadingDuplicates(true).fromPackage(npm);
|
||||
context.loadFromPackage(pcm.loadPackage("hl7.terminology"), null);
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
protected String fixVersionforSystem(String url, String csver) {
|
||||
|
|
|
@ -48,7 +48,7 @@ import java.io.FileOutputStream;
|
|||
|
||||
public class Test {
|
||||
public final static String DEF_TS_SERVER = "http://fhir-dev.healthintersections.com.au/open";
|
||||
public final static String DEV_TS_SERVER = "http://local.fhir.org:960/open";
|
||||
public final static String DEV_TS_SERVER = "http://local.fhir.org:8080/open";
|
||||
|
||||
|
||||
public static final String DEF_PATH = "c:\\work\\org.hl7.fhir\\build\\implementations\\java\\org.hl7.fhir.convertors\\samples\\";
|
||||
|
|
|
@ -78,7 +78,7 @@ import java.util.*;
|
|||
|
||||
public class ArgonautConverter extends ConverterBase {
|
||||
// public final static String DEF_TS_SERVER = "http://fhir-dev.healthintersections.com.au/open";
|
||||
public final static String DEV_TS_SERVER = "http://local.fhir.org:960/open";
|
||||
public final static String DEV_TS_SERVER = "http://local.fhir.org:8080/open";
|
||||
public static final String UCUM_PATH = "c:\\work\\org.hl7.fhir\\build\\implementations\\java\\org.hl7.fhir.convertors\\samples\\ucum-essence.xml";
|
||||
public static final String SRC_PATH = "c:\\work\\org.hl7.fhir\\build\\publish\\";
|
||||
private static final String DEFAULT_ID_SPACE = "urn:uuid:e8e06b15-0f74-4b8e-b5e2-609dae7119dc";
|
||||
|
|
|
@ -0,0 +1,105 @@
|
|||
package org.hl7.fhir.convertors.misc.utg;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.r4.formats.IParser;
|
||||
import org.hl7.fhir.r4.formats.IParser.OutputStyle;
|
||||
import org.hl7.fhir.r4.formats.JsonParser;
|
||||
import org.hl7.fhir.r4.formats.XmlParser;
|
||||
import org.hl7.fhir.r4.model.Bundle;
|
||||
import org.hl7.fhir.r4.model.Bundle.BundleType;
|
||||
import org.hl7.fhir.r4.model.CodeSystem;
|
||||
import org.hl7.fhir.r4.model.CodeSystem.CodeSystemContentMode;
|
||||
import org.hl7.fhir.r4.model.Period;
|
||||
import org.hl7.fhir.r4.model.Provenance;
|
||||
import org.hl7.fhir.r4.model.Provenance.ProvenanceAgentComponent;
|
||||
import org.hl7.fhir.r4.model.Resource;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
|
||||
public class UTGCaseSensitivePopulator {
|
||||
|
||||
public static void main(String[] args) throws FileNotFoundException, IOException {
|
||||
new UTGCaseSensitivePopulator().process(new File(args[0]));
|
||||
|
||||
}
|
||||
|
||||
private void process(File root) throws FileNotFoundException, IOException {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.setType(BundleType.COLLECTION);
|
||||
bundle.setId("hxutg1-1-0-12");
|
||||
|
||||
scanFolders(root, bundle);
|
||||
new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(root.getAbsolutePath(), "input", "sourceOfTruth", "history", "utgrel1hx-1-0-12.json")), bundle);
|
||||
System.out.println("Done");
|
||||
}
|
||||
|
||||
private void scanFolders(File folder, Bundle bundle) throws FileNotFoundException, IOException {
|
||||
Calendar today = Calendar.getInstance();
|
||||
Date dt = today.getTime();
|
||||
today.set(Calendar.HOUR_OF_DAY, 0);
|
||||
Date d = today.getTime();
|
||||
System.out.println("Scan "+folder.getAbsolutePath());
|
||||
|
||||
for (File f : folder.listFiles()) {
|
||||
if (f.isDirectory() && !f.getName().equals("retired")) {
|
||||
scanFolders(f, bundle);
|
||||
} else if (f.getName().endsWith(".xml")) {
|
||||
processFile(f, bundle, new XmlParser(), d, dt);
|
||||
} else if (f.getName().endsWith(".json")) {
|
||||
processFile(f, bundle, new JsonParser(), d, dt);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void processFile(File f, Bundle bundle, IParser parser, Date d, Date dt) {
|
||||
try {
|
||||
Resource r = parser.parse(new FileInputStream(f));
|
||||
if (r instanceof CodeSystem) {
|
||||
if (processCodeSystem((CodeSystem) r, bundle, d, dt)) {
|
||||
parser.setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(f), r);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private boolean processCodeSystem(CodeSystem cs, Bundle bundle, Date d, Date dt) {
|
||||
if (cs.hasCaseSensitive()) {
|
||||
return false;
|
||||
}
|
||||
if (!cs.getUrl().startsWith("http://terminology.hl7.org") || cs.getContent() == CodeSystemContentMode.NOTPRESENT) {
|
||||
return false;
|
||||
}
|
||||
cs.setCaseSensitive(true);
|
||||
Provenance p = new Provenance();
|
||||
p.setId("cs-286-"+cs.getId());
|
||||
p.addTarget().setReference("CodeSystem/"+cs.getId());
|
||||
p.setOccurred(new Period());
|
||||
p.getOccurredPeriod().setEnd(d);
|
||||
p.setRecorded(dt);
|
||||
p.addReason().setText("Populate Missing caseSensitive property;UP-286").addCoding().setSystem("http://terminology.hl7.org/CodeSystem/v3-ActReason").setCode("METAMGT");
|
||||
p.getActivity().addCoding().setSystem("http://terminology.hl7.org/CodeSystem/v3-DataOperation").setCode("UPDATE");
|
||||
ProvenanceAgentComponent agent = p.addAgent();
|
||||
agent.getType().addCoding().setSystem("http://terminology.hl7.org/CodeSystem/provenance-participant-type").setCode("author");
|
||||
agent.getWho().setDisplay("Grahame Grieve");
|
||||
agent = p.addAgent();
|
||||
agent.getType().addCoding().setSystem("http://terminology.hl7.org/CodeSystem/provenance-participant-type").setCode("custodian");
|
||||
agent.getWho().setDisplay("Vocabulary WG");
|
||||
|
||||
bundle.addEntry().setFullUrl("http://terminology.hl7.org/fhir/Provenance/cs-286-"+cs.getId()).setResource(p);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -59,7 +59,7 @@ public class UTGVersionSorter {
|
|||
p.addTarget().setReference(cr.fhirType() + "/" + cr.getId());
|
||||
p.getOccurredPeriod().setEnd(runTime, TemporalPrecisionEnum.DAY);
|
||||
p.setRecorded(runTime);
|
||||
p.addReason().setText("Reset Version after migration to UTG").addCoding("http://terminology.hl7.org/CodeSystem/v3-ActReason", "METAMGT", null);
|
||||
p.addAuthorization().getConcept().setText("Reset Version after migration to UTG").addCoding("http://terminology.hl7.org/CodeSystem/v3-ActReason", "METAMGT", null);
|
||||
p.getActivity().addCoding("http://terminology.hl7.org/CodeSystem/v3-DataOperation", "UPDATE", null);
|
||||
ProvenanceAgentComponent pa = p.addAgent();
|
||||
pa.getType().addCoding("http://terminology.hl7.org/CodeSystem/provenance-participant-type", "author", null);
|
||||
|
|
|
@ -51,6 +51,8 @@ public class TerminologyClientFactory {
|
|||
return new TerminologyClientR2(checkEndsWith("/r2", url), userAgent);
|
||||
case R4:
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url), userAgent);
|
||||
case R4B:
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url), userAgent);
|
||||
case R5:
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url), userAgent); // r4 for now, since the terminology is currently the same
|
||||
case STU3:
|
||||
|
@ -64,20 +66,25 @@ public class TerminologyClientFactory {
|
|||
if (v == null)
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url), userAgent);
|
||||
v = VersionUtilities.getMajMin(v);
|
||||
switch (v) {
|
||||
case "1.0":
|
||||
return new TerminologyClientR2(checkEndsWith("/r2", url), userAgent);
|
||||
case "1.4":
|
||||
return new TerminologyClientR3(checkEndsWith("/r3", url), userAgent); // r3 is the least worst match
|
||||
case "3.0":
|
||||
return new TerminologyClientR3(checkEndsWith("/r3", url), userAgent);
|
||||
case "4.0":
|
||||
return new TerminologyClientR4(checkEndsWith("/r4", url), userAgent);
|
||||
case "4.5":
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url), userAgent); // r4 for now, since the terminology is currently the same
|
||||
default:
|
||||
throw new Error("The version " + v + " is not currently supported");
|
||||
if (VersionUtilities.isR2Ver(v)) {
|
||||
return new TerminologyClientR2(checkEndsWith("/r2", url), userAgent);
|
||||
}
|
||||
if (VersionUtilities.isR2BVer(v)) {
|
||||
return new TerminologyClientR3(checkEndsWith("/r3", url), userAgent); // r3 is the least worst match
|
||||
}
|
||||
if (VersionUtilities.isR3Ver(v)) {
|
||||
return new TerminologyClientR3(checkEndsWith("/r3", url), userAgent); // r3 is the least worst match
|
||||
}
|
||||
if (VersionUtilities.isR4Ver(v)) {
|
||||
return new TerminologyClientR4(checkEndsWith("/r4", url), userAgent);
|
||||
}
|
||||
if (VersionUtilities.isR4BVer(v)) {
|
||||
return new TerminologyClientR4(checkEndsWith("/r4", url), userAgent);
|
||||
}
|
||||
if (VersionUtilities.isR5Ver(v)) {
|
||||
return new TerminologyClientR5(checkEndsWith("/r4", url), userAgent); // r4 for now, since the terminology is currently the same
|
||||
}
|
||||
throw new Error("The version " + v + " is not currently supported");
|
||||
}
|
||||
|
||||
private static String checkEndsWith(String term, String url) {
|
||||
|
@ -85,7 +92,7 @@ public class TerminologyClientFactory {
|
|||
return url;
|
||||
if (url.startsWith("http://tx.fhir.org"))
|
||||
return Utilities.pathURL(url, term);
|
||||
if (url.equals("http://local.fhir.org:960"))
|
||||
if (url.equals("http://local.fhir.org:8080"))
|
||||
return Utilities.pathURL(url, term);
|
||||
return url;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,8 @@ import org.hl7.fhir.r5.utils.client.FHIRToolingClient;
|
|||
import org.hl7.fhir.r5.utils.client.network.ClientHeaders;
|
||||
import org.hl7.fhir.utilities.ToolingClientLogger;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Map;
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
package org.hl7.fhir.convertors.conv10_30;
|
||||
|
||||
|
||||
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_30;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Bundle10_30Test {
|
||||
|
||||
@Test
|
||||
@DisplayName("Test 10_30 bundle conversion when resource is null")
|
||||
public void testNoResourceBundleConversion() throws IOException {
|
||||
org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent bec = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent()
|
||||
.setRequest(
|
||||
new org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent()
|
||||
.setMethod(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.DELETE)
|
||||
.setUrl("Patient?identifier=123456")
|
||||
);
|
||||
|
||||
org.hl7.fhir.dstu3.model.Bundle stu3Bundle = new org.hl7.fhir.dstu3.model.Bundle()
|
||||
.addEntry(bec);
|
||||
|
||||
org.hl7.fhir.dstu2.model.Resource dstu2Resource = VersionConvertorFactory_10_30.convertResource(stu3Bundle);
|
||||
Assertions.assertNotNull(dstu2Resource);
|
||||
Assertions.assertTrue(dstu2Resource instanceof org.hl7.fhir.dstu2.model.Bundle);
|
||||
|
||||
org.hl7.fhir.dstu2.model.Bundle dstu2Bundle = (org.hl7.fhir.dstu2.model.Bundle) dstu2Resource;
|
||||
Assertions.assertEquals(1, dstu2Bundle.getEntry().size());
|
||||
|
||||
Assertions.assertNull(dstu2Bundle.getEntry().get(0).getResource());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package org.hl7.fhir.convertors.conv10_40;
|
||||
|
||||
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_40;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Bundle10_40Test {
|
||||
|
||||
@Test
|
||||
@DisplayName("Test 10_40 bundle conversion when resource is null")
|
||||
public void testNoResourceBundleConversion() throws IOException {
|
||||
org.hl7.fhir.r4.model.Bundle.BundleEntryComponent bec = new org.hl7.fhir.r4.model.Bundle.BundleEntryComponent()
|
||||
.setRequest(
|
||||
new org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent()
|
||||
.setMethod(org.hl7.fhir.r4.model.Bundle.HTTPVerb.DELETE)
|
||||
.setUrl("Patient?identifier=123456")
|
||||
);
|
||||
|
||||
org.hl7.fhir.r4.model.Bundle r4Bundle = new org.hl7.fhir.r4.model.Bundle()
|
||||
.addEntry(bec);
|
||||
|
||||
org.hl7.fhir.dstu2.model.Resource dstu2Resource = VersionConvertorFactory_10_40.convertResource(r4Bundle);
|
||||
Assertions.assertNotNull(dstu2Resource);
|
||||
Assertions.assertTrue(dstu2Resource instanceof org.hl7.fhir.dstu2.model.Bundle);
|
||||
|
||||
org.hl7.fhir.dstu2.model.Bundle dstu2Bundle = (org.hl7.fhir.dstu2.model.Bundle) dstu2Resource;
|
||||
Assertions.assertEquals(1, dstu2Bundle.getEntry().size());
|
||||
|
||||
Assertions.assertNull(dstu2Bundle.getEntry().get(0).getResource());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package org.hl7.fhir.convertors.conv10_50;
|
||||
|
||||
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_50;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Bundle10_50Test {
|
||||
|
||||
@Test
|
||||
@DisplayName("Test 10_50 bundle conversion when resource is null")
|
||||
public void testNoResourceBundleConversion() throws IOException {
|
||||
org.hl7.fhir.r5.model.Bundle.BundleEntryComponent bec = new org.hl7.fhir.r5.model.Bundle.BundleEntryComponent()
|
||||
.setRequest(
|
||||
new org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent()
|
||||
.setMethod(org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE)
|
||||
.setUrl("Patient?identifier=123456")
|
||||
);
|
||||
|
||||
org.hl7.fhir.r5.model.Bundle r5Bundle = new org.hl7.fhir.r5.model.Bundle()
|
||||
.addEntry(bec);
|
||||
|
||||
org.hl7.fhir.dstu2.model.Resource dstu2Resource = VersionConvertorFactory_10_50.convertResource(r5Bundle);
|
||||
Assertions.assertNotNull(dstu2Resource);
|
||||
Assertions.assertTrue(dstu2Resource instanceof org.hl7.fhir.dstu2.model.Bundle);
|
||||
|
||||
org.hl7.fhir.dstu2.model.Bundle dstu2Bundle = (org.hl7.fhir.dstu2.model.Bundle) dstu2Resource;
|
||||
Assertions.assertEquals(1, dstu2Bundle.getEntry().size());
|
||||
|
||||
Assertions.assertNull(dstu2Bundle.getEntry().get(0).getResource());
|
||||
}
|
||||
}
|
|
@ -18,4 +18,7 @@
|
|||
public boolean supportsCopyright() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public String getVersionedUrl() {
|
||||
return hasVersion() ? getUrl()+"|"+getVersion() : getUrl();
|
||||
}
|
|
@ -79,4 +79,10 @@
|
|||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
public Coding(String theSystem, String theVersion, String theCode, String theDisplay) {
|
||||
setSystem(theSystem);
|
||||
setVersion(theVersion);
|
||||
setCode(theCode);
|
||||
setDisplay(theDisplay);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.hl7.fhir.r5.model;
|
||||
package org.hl7.fhir.{{jid}}.model;
|
||||
|
||||
// generated
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.hl7.fhir.r5.formats;
|
||||
package org.hl7.fhir.{{jid}}.formats;
|
||||
|
||||
// generated
|
||||
|
||||
|
@ -6,7 +6,7 @@ package org.hl7.fhir.r5.formats;
|
|||
|
||||
{{startMark}}
|
||||
|
||||
import org.hl7.fhir.r5.model.*;
|
||||
import org.hl7.fhir.{{jid}}.model.*;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.hl7.fhir.r5.formats;
|
||||
package org.hl7.fhir.{{jid}}.formats;
|
||||
|
||||
|
||||
// generated
|
||||
|
@ -7,8 +7,8 @@ package org.hl7.fhir.r5.formats;
|
|||
|
||||
{{startMark}}
|
||||
|
||||
import org.hl7.fhir.r5.model.*;
|
||||
import org.hl7.fhir.r5.model.StringType;
|
||||
import org.hl7.fhir.{{jid}}.model.*;
|
||||
import org.hl7.fhir.{{jid}}.model.StringType;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.hl7.fhir.r5.model;
|
||||
package org.hl7.fhir.{{jid}}.model;
|
||||
|
||||
{{license}}
|
||||
|
||||
|
@ -86,5 +86,31 @@ public class ResourceFactory extends Factory {
|
|||
}
|
||||
}
|
||||
|
||||
public static DataType createPrimitive(String type, String value) {
|
||||
switch (type) {
|
||||
case "boolean": return new BooleanType(value);
|
||||
case "integer": return new IntegerType(value);
|
||||
case "integer64": return new Integer64Type(value);
|
||||
case "string": return new StringType(value);
|
||||
case "decimal": return new DecimalType(value);
|
||||
case "uri": return new UriType(value);
|
||||
case "url": return new UrlType(value);
|
||||
case "canonical": return new CanonicalType(value);
|
||||
case "base64Binary": return new Base64BinaryType(value);
|
||||
case "instant": return new InstantType(value);
|
||||
case "date": return new DateType(value);
|
||||
case "dateTime": return new DateTimeType(value);
|
||||
case "time": return new TimeType(value);
|
||||
case "code": return new CodeType(value);
|
||||
case "oid": return new OidType(value);
|
||||
case "id": return new IdType(value);
|
||||
case "markdown": return new MarkdownType(value);
|
||||
case "unsignedInt": return new UnsignedIntType(value);
|
||||
case "positiveInt": return new PositiveIntType(value);
|
||||
case "uuid": return new UuidType(value);
|
||||
default:
|
||||
throw new FHIRException("Unknown Primitive Type '"+type+"'");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.hl7.fhir.r5.model;
|
||||
package org.hl7.fhir.{{jid}}.model;
|
||||
|
||||
{{license}}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.hl7.fhir.r5.formats;
|
||||
package org.hl7.fhir.{{jid}}.formats;
|
||||
|
||||
// generated
|
||||
|
||||
|
@ -6,8 +6,8 @@ package org.hl7.fhir.r5.formats;
|
|||
|
||||
{{startMark}}
|
||||
|
||||
import org.hl7.fhir.r5.model.*;
|
||||
import org.hl7.fhir.r5.model.Enumerations.FHIRVersion;
|
||||
import org.hl7.fhir.{{jid}}.model.*;
|
||||
import org.hl7.fhir.{{jid}}.model.Enumerations.FHIRVersion;
|
||||
import org.xmlpull.v1.*;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.exceptions.FHIRFormatError;
|
||||
|
|
|
@ -30,15 +30,15 @@ Resource = org.hl7.fhir.instance.model.api.IAnyResource
|
|||
Period = ca.uhn.fhir.model.api.TemporalPrecisionEnum
|
||||
Extension = org.hl7.fhir.instance.model.api.IBaseExtension, org.hl7.fhir.instance.model.api.IBaseDatatype, org.hl7.fhir.instance.model.api.IBaseHasExtensions
|
||||
HumanName = ca.uhn.fhir.util.DatatypeUtil, org.hl7.fhir.instance.model.api.IPrimitiveType
|
||||
StructureMap = org.hl7.fhir.r5.utils.structuremap.StructureMapUtilities
|
||||
StructureMap = org.hl7.fhir.{{jid}}.utils.structuremap.StructureMapUtilities
|
||||
Narrative = org.hl7.fhir.instance.model.api.INarrative
|
||||
Coding = org.hl7.fhir.instance.model.api.IBaseCoding
|
||||
OperationOutcome = org.hl7.fhir.instance.model.api.IBaseOperationOutcome
|
||||
CapabilityStatement = org.hl7.fhir.instance.model.api.IBaseConformance
|
||||
DataType = org.hl7.fhir.instance.model.api.IBaseDatatype, ca.uhn.fhir.model.api.IElement
|
||||
ElementDefinition = org.hl7.fhir.instance.model.api.ICompositeType, org.hl7.fhir.r5.model.Enumerations.BindingStrength, org.hl7.fhir.r5.model.Enumerations.BindingStrengthEnumFactory, org.hl7.fhir.r5.utils.ToolingExtensions, org.hl7.fhir.instance.model.api.IBaseDatatypeElement, org.hl7.fhir.utilities.CommaSeparatedStringBuilder
|
||||
ElementDefinition = org.hl7.fhir.instance.model.api.ICompositeType, org.hl7.fhir.{{jid}}.model.Enumerations.BindingStrength, org.hl7.fhir.{{jid}}.model.Enumerations.BindingStrengthEnumFactory, org.hl7.fhir.{{jid}}.utils.ToolingExtensions, org.hl7.fhir.instance.model.api.IBaseDatatypeElement, org.hl7.fhir.utilities.CommaSeparatedStringBuilder
|
||||
Binary = org.hl7.fhir.instance.model.api.IBaseBinary
|
||||
ContactDetail = org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem
|
||||
ContactDetail = org.hl7.fhir.{{jid}}.model.ContactPoint.ContactPointSystem
|
||||
|
||||
[shared]
|
||||
http://hl7.org/fhir/ValueSet/concept-map-relationship = true
|
||||
|
|
|
@ -10,12 +10,12 @@ import java.util.List;
|
|||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.hl7.fhir.r5.formats.IParser.OutputStyle;
|
||||
import org.hl7.fhir.r5.formats.JsonParser;
|
||||
import org.hl7.fhir.r5.formats.XmlParser;
|
||||
import org.hl7.fhir.r5.model.DomainResource;
|
||||
import org.hl7.fhir.r5.model.Resource;
|
||||
import org.hl7.fhir.r5.test.utils.TestingUtilities;
|
||||
import org.hl7.fhir.{{jid}}.formats.IParser.OutputStyle;
|
||||
import org.hl7.fhir.{{jid}}.formats.JsonParser;
|
||||
import org.hl7.fhir.{{jid}}.formats.XmlParser;
|
||||
import org.hl7.fhir.{{jid}}.model.DomainResource;
|
||||
import org.hl7.fhir.{{jid}}.model.Resource;
|
||||
import org.hl7.fhir.{{jid}}.test.utils.TestingUtilities;
|
||||
import org.hl7.fhir.utilities.TextFile;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.xml.XMLUtil;
|
||||
|
|
|
@ -19,35 +19,46 @@ import org.hl7.fhir.r5.model.Enumerations.ResourceTypeEnum;
|
|||
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
|
||||
import org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.VersionUtilities;
|
||||
|
||||
public class Analyser {
|
||||
|
||||
private Definitions definitions;
|
||||
private Configuration config;
|
||||
private String version;
|
||||
|
||||
public Analyser(Definitions definitions, Configuration config) {
|
||||
public Analyser(Definitions definitions, Configuration config, String version) {
|
||||
this.definitions = definitions;
|
||||
this.config = config;
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Analysis analyse(StructureDefinition sd) throws Exception {
|
||||
Analysis res = new Analysis(definitions, sd);
|
||||
|
||||
res.setAncestor(definitions.getStructures().get(sd.getBaseDefinition()));
|
||||
if (VersionUtilities.isR4BVer(version)) {
|
||||
res.setAncestor(definitions.getStructures().get(getR4bAncestor(sd)));
|
||||
} else {
|
||||
res.setAncestor(definitions.getStructures().get(sd.getBaseDefinition()));
|
||||
}
|
||||
res.setAbstract(sd.getAbstract());
|
||||
res.setInterface(sd.hasExtension("http://hl7.org/fhir/StructureDefinition/structuredefinition-interface"));
|
||||
res.setClassName(sd.getName().equals("List") ? "ListResource" : sd.getName());
|
||||
|
||||
TypeInfo type = new TypeInfo();
|
||||
type.setName(res.getClassName());
|
||||
type.setAncestorName(res.getAncestor().getName());
|
||||
if (res.getAncestor() != null) {
|
||||
type.setAncestorName(res.getAncestor().getName());
|
||||
}
|
||||
res.getTypes().put(type.getName(), type);
|
||||
res.setRootType(type);
|
||||
sd.setUserData("java.type.info", type);
|
||||
|
||||
type.setDefn(sd.getSnapshot().getElementFirstRep());
|
||||
type.setChildren(filterChildren(new ProfileUtilities(null, null, null).getChildList(sd, type.getDefn())));
|
||||
type.setInheritedChildren(getAbstractChildren(res.getAncestor()));
|
||||
if (res.getAncestor() != null) {
|
||||
type.setInheritedChildren(getAbstractChildren(res.getAncestor()));
|
||||
}
|
||||
|
||||
for (ElementDefinition e : type.getChildren()) {
|
||||
scanNestedTypes(res, type, type.getName(), e);
|
||||
|
@ -72,6 +83,16 @@ public class Analyser {
|
|||
return res;
|
||||
}
|
||||
|
||||
private String getR4bAncestor(StructureDefinition sd) {
|
||||
switch (sd.getKind()) {
|
||||
case COMPLEXTYPE: return "http://hl7.org/fhir/StructureDefinition/DataType";
|
||||
case LOGICAL: return "http://hl7.org/fhir/StructureDefinition/Element";
|
||||
case PRIMITIVETYPE: return "http://hl7.org/fhir/StructureDefinition/PrimitiveType";
|
||||
case RESOURCE: return sd.getBaseDefinition();
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected List<ElementDefinition> filterChildren(List<ElementDefinition> childList) {
|
||||
List<ElementDefinition> res = new ArrayList<>();
|
||||
res.addAll(childList);
|
||||
|
@ -110,6 +131,9 @@ public class Analyser {
|
|||
analysis.getEnums().put(tn, ei);
|
||||
ei.setValueSet(vs);
|
||||
}
|
||||
if (tn.equals("SubscriptionStatus")) { // work around cause there's a Resource with the same name
|
||||
tn = "org.hl7.fhir.r4b.model.Enumerations."+tn;
|
||||
}
|
||||
e.setUserData("java.type", "Enumeration<"+tn+">");
|
||||
e.setUserData("java.enum", ei);
|
||||
}
|
||||
|
|
|
@ -54,13 +54,15 @@ public class JavaBaseGenerator extends OutputStreamWriter {
|
|||
protected Configuration config;
|
||||
protected String version;
|
||||
protected Date genDate;
|
||||
protected String jid;
|
||||
|
||||
public JavaBaseGenerator(OutputStream arg0, Definitions definitions, Configuration config, String version, Date genDate) throws UnsupportedEncodingException {
|
||||
public JavaBaseGenerator(OutputStream arg0, Definitions definitions, Configuration config, String version, Date genDate, String jid) throws UnsupportedEncodingException {
|
||||
super(arg0, "UTF-8");
|
||||
this.definitions = definitions;
|
||||
this.config = config;
|
||||
this.version = version;
|
||||
this.genDate = genDate;
|
||||
this.jid = jid;
|
||||
}
|
||||
|
||||
public void startMark(String version, Date genDate) throws IOException {
|
||||
|
|
|
@ -13,8 +13,8 @@ import org.hl7.fhir.utilities.VersionUtilities;
|
|||
public class JavaConstantsGenerator extends JavaBaseGenerator {
|
||||
|
||||
|
||||
public JavaConstantsGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version) throws UnsupportedEncodingException {
|
||||
super(out, definitions, configuration, version, genDate);
|
||||
public JavaConstantsGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version, String jid) throws UnsupportedEncodingException {
|
||||
super(out, definitions, configuration, version, genDate, jid);
|
||||
}
|
||||
|
||||
public void generate() throws Exception {
|
||||
|
@ -29,6 +29,7 @@ public class JavaConstantsGenerator extends JavaBaseGenerator {
|
|||
}
|
||||
|
||||
String template = config.getAdornments().get("Constants");
|
||||
template = template.replace("{{jid}}", jid);
|
||||
template = template.replace("{{license}}", config.getLicense());
|
||||
template = template.replace("{{startMark}}", startVMarkValue());
|
||||
|
||||
|
|
|
@ -57,12 +57,12 @@ changes for James
|
|||
*/
|
||||
public class JavaEnumerationsGenerator extends JavaBaseGenerator {
|
||||
|
||||
public JavaEnumerationsGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version) throws UnsupportedEncodingException {
|
||||
super(out, definitions, configuration, version, genDate);
|
||||
public JavaEnumerationsGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version, String jid) throws UnsupportedEncodingException {
|
||||
super(out, definitions, configuration, version, genDate, jid);
|
||||
}
|
||||
|
||||
public void generate() throws Exception {
|
||||
write("package org.hl7.fhir.r5.model;\r\n");
|
||||
write("package org.hl7.fhir."+jid+".model;\r\n");
|
||||
startMark(version, genDate);
|
||||
write("\r\n");
|
||||
write("import org.hl7.fhir.instance.model.api.*;\r\n");
|
||||
|
@ -153,7 +153,7 @@ public class JavaEnumerationsGenerator extends JavaBaseGenerator {
|
|||
for (ValueSetExpansionContainsComponent c : vs.getExpansion().getContains()) {
|
||||
String cc = Utilities.camelCase(c.getCode());
|
||||
cc = makeConst(cc);
|
||||
write(" case "+cc+": return \""+c.getCode()+"\";\r\n");
|
||||
write(" case "+cc+": return \""+c.getCode()+"\";\r\n");
|
||||
}
|
||||
write(" case NULL: return null;\r\n");
|
||||
write(" default: return \"?\";\r\n");
|
||||
|
|
|
@ -50,13 +50,14 @@ import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule;
|
|||
public class JavaFactoryGenerator extends JavaBaseGenerator {
|
||||
|
||||
|
||||
public JavaFactoryGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version) throws UnsupportedEncodingException {
|
||||
super(out, definitions, configuration, version, genDate);
|
||||
public JavaFactoryGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version, String jid) throws UnsupportedEncodingException {
|
||||
super(out, definitions, configuration, version, genDate, jid);
|
||||
}
|
||||
|
||||
public void generate() throws Exception {
|
||||
String template = config.getAdornments().get("ResourceFactory");
|
||||
template = template.replace("{{license}}", config.getLicense());
|
||||
template = template.replace("{{jid}}", jid);
|
||||
template = template.replace("{{license}}", config.getLicense());
|
||||
template = template.replace("{{startMark}}", startVMarkValue());
|
||||
template = template.replace("{{resource-factory}}", genResourceFactory());
|
||||
template = template.replace("{{type-factory}}", genTypeFactory());
|
||||
|
|
|
@ -67,8 +67,8 @@ public class JavaParserJsonGenerator extends JavaBaseGenerator {
|
|||
private StringBuilder cregtp = new StringBuilder();
|
||||
private StringBuilder cregti = new StringBuilder();
|
||||
|
||||
public JavaParserJsonGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version) throws UnsupportedEncodingException {
|
||||
super(out, definitions, configuration, version, genDate);
|
||||
public JavaParserJsonGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version, String jid) throws UnsupportedEncodingException {
|
||||
super(out, definitions, configuration, version, genDate, jid);
|
||||
}
|
||||
|
||||
public void seeClass(Analysis analysis) throws Exception {
|
||||
|
@ -93,6 +93,7 @@ public class JavaParserJsonGenerator extends JavaBaseGenerator {
|
|||
public void generate() throws Exception {
|
||||
|
||||
String template = config.getAdornments().get("JsonParser");
|
||||
template = template.replace("{{jid}}", jid);
|
||||
template = template.replace("{{license}}", config.getLicense());
|
||||
template = template.replace("{{startMark}}", startVMarkValue());
|
||||
|
||||
|
@ -168,7 +169,9 @@ public class JavaParserJsonGenerator extends JavaBaseGenerator {
|
|||
|
||||
parser.append(" protected void parse"+upFirst(tn).replace(".", "")+"Properties(JsonObject json, "+tn+" res) throws IOException, FHIRFormatError {\r\n");
|
||||
|
||||
parser.append(" parse"+analysis.getAncestor().getName()+"Properties(json, res);\r\n");
|
||||
if (!"Element".equals(tn) && analysis.getAncestor() != null) {
|
||||
parser.append(" parse"+analysis.getAncestor().getName()+"Properties(json, res);\r\n");
|
||||
}
|
||||
if (!analysis.isInterface()) {
|
||||
for (ElementDefinition e : analysis.getRootType().getChildren()) {
|
||||
genElementParser(analysis, analysis.getRootType(), e, bUseOwner, null);
|
||||
|
@ -312,7 +315,9 @@ public class JavaParserJsonGenerator extends JavaBaseGenerator {
|
|||
String tn = analysis.getRootType().getName();
|
||||
|
||||
composer.append(" protected void compose"+tn+"Properties("+tn+" element) throws IOException {\r\n");
|
||||
composer.append(" compose"+analysis.getAncestor().getName()+"Properties(element);\r\n");
|
||||
if (!"Element".equals(tn) && analysis.getAncestor() != null) {
|
||||
composer.append(" compose"+analysis.getAncestor().getName()+"Properties(element);\r\n");
|
||||
}
|
||||
if (!analysis.isInterface()) {
|
||||
for (ElementDefinition e : analysis.getRootType().getChildren()) {
|
||||
genElementComposer(analysis, analysis.getRootType(), e, null);
|
||||
|
|
|
@ -51,8 +51,8 @@ public class JavaParserRdfGenerator extends JavaBaseGenerator {
|
|||
private StringBuilder reg = new StringBuilder();
|
||||
private StringBuilder regt = new StringBuilder();
|
||||
|
||||
public JavaParserRdfGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version) throws UnsupportedEncodingException {
|
||||
super(out, definitions, configuration, version, genDate);
|
||||
public JavaParserRdfGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version, String jid) throws UnsupportedEncodingException {
|
||||
super(out, definitions, configuration, version, genDate, jid);
|
||||
}
|
||||
|
||||
public void seeClass(Analysis analysis) throws Exception {
|
||||
|
@ -70,6 +70,7 @@ public class JavaParserRdfGenerator extends JavaBaseGenerator {
|
|||
|
||||
public void generate() throws Exception {
|
||||
String template = config.getAdornments().get("RdfParser");
|
||||
template = template.replace("{{jid}}", jid);
|
||||
template = template.replace("{{license}}", config.getLicense());
|
||||
template = template.replace("{{startMark}}", startVMarkValue());
|
||||
|
||||
|
|
|
@ -62,8 +62,8 @@ public class JavaParserXmlGenerator extends JavaBaseGenerator {
|
|||
private StringBuilder cRN = new StringBuilder();
|
||||
private StringBuilder cType = new StringBuilder();
|
||||
|
||||
public JavaParserXmlGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version) throws UnsupportedEncodingException {
|
||||
super(out, definitions, configuration, version, genDate);
|
||||
public JavaParserXmlGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version, String jid) throws UnsupportedEncodingException {
|
||||
super(out, definitions, configuration, version, genDate, jid);
|
||||
}
|
||||
|
||||
public void seeClass(Analysis analysis) throws Exception {
|
||||
|
@ -88,6 +88,7 @@ public class JavaParserXmlGenerator extends JavaBaseGenerator {
|
|||
public void generate() throws Exception {
|
||||
|
||||
String template = config.getAdornments().get("XmlParser");
|
||||
template = template.replace("{{jid}}", jid);
|
||||
template = template.replace("{{license}}", config.getLicense());
|
||||
template = template.replace("{{startMark}}", startVMarkValue());
|
||||
|
||||
|
@ -128,7 +129,7 @@ public class JavaParserXmlGenerator extends JavaBaseGenerator {
|
|||
|
||||
if (!analysis.isAbstract() || ti != analysis.getRootType()) {
|
||||
parser.append(" protected "+stn+" parse"+pfx+tn+"(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {\r\n");
|
||||
parser.append(" "+stn+" res = new "+stn+"();\r\n");
|
||||
parser.append(" "+stn+" res = new "+stn+"();\r\n");
|
||||
if (ti == analysis.getRootType() && analysis.getStructure().getKind() == StructureDefinitionKind.RESOURCE) {
|
||||
parser.append(" parseResourceAttributes(xpp, res);\r\n");
|
||||
} else {
|
||||
|
@ -187,7 +188,11 @@ public class JavaParserXmlGenerator extends JavaBaseGenerator {
|
|||
parser.append(" } else ");
|
||||
else
|
||||
parser.append(" ");
|
||||
parser.append("if (!parse"+ti.getAncestorName()+"Content(eventType, xpp, res)){ \r\n");
|
||||
if (ti.getAncestorName() != null) {
|
||||
parser.append("if (!parse"+ti.getAncestorName()+"Content(eventType, xpp, res)){ \r\n");
|
||||
} else {
|
||||
parser.append(" { \r\n");
|
||||
}
|
||||
parser.append(" return false;\r\n");
|
||||
parser.append(" }\r\n");
|
||||
parser.append(" return true;\r\n");
|
||||
|
@ -296,7 +301,9 @@ public class JavaParserXmlGenerator extends JavaBaseGenerator {
|
|||
composer.append(" }\r\n\r\n");
|
||||
|
||||
composer.append(" protected void compose"+pfx+tn+"Elements("+stn+" element) throws IOException {\r\n");
|
||||
composer.append(" compose"+ti.getAncestorName()+"Elements(element);\r\n");
|
||||
if (!"Element".equals(tn) && analysis.getAncestor() != null) {
|
||||
composer.append(" compose"+ti.getAncestorName()+"Elements(element);\r\n");
|
||||
}
|
||||
|
||||
for (ElementDefinition ed : ti.getChildren()) {
|
||||
if (!ed.hasRepresentation(PropertyRepresentation.XMLATTR)) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue