Merge remote-tracking branch 'origin/master' into tx-server-cache-analysis

This commit is contained in:
dotasek 2022-01-04 13:23:32 -05:00
commit 7ee5d0c5e4
886 changed files with 847034 additions and 43581 deletions

View File

@ -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

View File

@ -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.22-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>

View File

@ -0,0 +1,32 @@
About the version conversion routines
The version conversion routines are maintained as part of
the development of the standard, but always under considerable
time pressure. Implementers should regard these as 'scaffolds' for
an actual reliable conversion routine.
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.
In addition to this, some of the conversions have test cases
for particular resources and particular version combinations.
Where test cases exist, they will continue to pass and be
maintained.
So:
* test the conversion routines before using them in production
* contribute test cases to ensure that your use cases continue to be reliable
Test cases are welcome - make them as PRs to the core library, or even better,
to the FHIR test cases library

View File

@ -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");
}
}

View File

@ -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("");
}
}
}

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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())

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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())

View File

@ -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())

View File

@ -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())

View File

@ -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())

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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());

View File

@ -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())

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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())

View File

@ -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())

View File

@ -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())

View File

@ -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);

View File

@ -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())

View File

@ -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())

View File

@ -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())

View File

@ -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())

View File

@ -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()));

View File

@ -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())

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
// }
}

View File

@ -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));

View File

@ -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())

View File

@ -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());

View File

@ -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());

View File

@ -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));

View File

@ -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)

View File

@ -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;
}

View File

@ -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())

View File

@ -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:

View File

@ -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;
}

View File

@ -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())

View File

@ -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())

View File

@ -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)

View File

@ -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()));

View File

@ -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:

View File

@ -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())

View File

@ -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;

View File

@ -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())

View File

@ -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())

View File

@ -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())

View File

@ -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()));

View File

@ -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;
}
}

View File

@ -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/"));
}
}
}
}

View File

@ -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);

View File

@ -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) {

View File

@ -18,4 +18,7 @@
public boolean supportsCopyright() {
return true;
}
public String getVersionedUrl() {
return hasVersion() ? getUrl()+"|"+getVersion() : getUrl();
}

View File

@ -79,4 +79,10 @@
}
return res;
}
public Coding(String theSystem, String theVersion, String theCode, String theDisplay) {
setSystem(theSystem);
setVersion(theVersion);
setCode(theCode);
setDisplay(theDisplay);
}

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r5.model;
package org.hl7.fhir.{{jid}}.model;
// generated

View File

@ -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;

View File

@ -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;

View File

@ -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+"'");
}
}
}

View File

@ -1,4 +1,4 @@
package org.hl7.fhir.r5.model;
package org.hl7.fhir.{{jid}}.model;
{{license}}

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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);
}

View File

@ -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 {

View File

@ -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());

View File

@ -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");

View File

@ -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());

View File

@ -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);

View File

@ -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());

View File

@ -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)) {

View File

@ -83,8 +83,8 @@ public class JavaResourceGenerator extends JavaBaseGenerator {
private long hashSum;
public JavaResourceGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version) throws UnsupportedEncodingException {
super(out, definitions, configuration, version, genDate);
public JavaResourceGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version, String jid) throws UnsupportedEncodingException {
super(out, definitions, configuration, version, genDate, jid);
}
// public void generate(ElementDefinition root, String name, JavaGenClass clss, ProfiledType cd, Date genDate, String version, boolean isAbstract, Map<String, SearchParameterDefn> nameToSearchParamDef, ElementDefinition template) throws Exception {
@ -94,7 +94,7 @@ public class JavaResourceGenerator extends JavaBaseGenerator {
} else {
clss = JavaGenClass.Type;
}
write("package org.hl7.fhir.r5.model;\r\n");
write("package org.hl7.fhir."+jid+".model;\r\n");
startMark(version, genDate);
boolean hl = true; // hasList(root);
@ -121,7 +121,7 @@ public class JavaResourceGenerator extends JavaBaseGenerator {
if (hs)
write("import org.hl7.fhir.utilities.Utilities;\r\n");
if (he)
write("import org.hl7.fhir.r5.model.Enumerations.*;\r\n");
write("import org.hl7.fhir."+jid+".model.Enumerations.*;\r\n");
}
if (hn) {
if (clss == JavaGenClass.Resource) {
@ -150,14 +150,15 @@ public class JavaResourceGenerator extends JavaBaseGenerator {
write("\r\n");
if (config.getIni().hasProperty("imports", analysis.getName())) {
for (String imp : config.getIni().getStringProperty("imports", analysis.getName()).split("\\,")) {
write("import "+imp+";\r\n");
write("import "+imp.replace("{{jid}}", jid)+";\r\n");
}
}
jdoc("", replaceTitle(analysis.getName(), analysis.getStructure().getDescription()));
TypeInfo ti = analysis.getRootType();
boolean hasChildren = ti.getChildren().size() > 0;
String hierarchy = "extends "+analysis.getAncestor().getName();
String hierarchy = analysis.getAncestor() != null ? "extends "+analysis.getAncestor().getName() : "";
if (clss == JavaGenClass.Resource) {
if (!analysis.isAbstract()) {
write("@ResourceDef(name=\""+upFirst(analysis.getName()).replace("ListResource", "List")+"\", profile=\"http://hl7.org/fhir/StructureDefinition/"+upFirst(analysis.getName())+"\")\r\n");
@ -167,7 +168,7 @@ public class JavaResourceGenerator extends JavaBaseGenerator {
hierarchy = hierarchy + " implements ICompositeType";
}
if (config.getIni().hasProperty("hierarchy", analysis.getName())) {
if (config.getIni().hasProperty("hierarchy", analysis.getName()) && analysis.getAncestor() != null) {
hierarchy = config.getIni().getStringProperty("hierarchy", analysis.getName()).replace("{{super}}", analysis.getAncestor().getName());
}
@ -211,7 +212,7 @@ public class JavaResourceGenerator extends JavaBaseGenerator {
generateAccessors(analysis, ti, e, " ", matchingInheritedElement(ti.getInheritedChildren(), e));
}
}
if (!analysis.isInterface()) {
if (!analysis.isInterface() && ti.getInheritedChildren() != null) {
for (ElementDefinition e : filterInherited(ti.getInheritedChildren(), ti.getChildren())) {
generateUnimplementedAccessors(analysis, ti, e, " ");
}
@ -249,7 +250,7 @@ public class JavaResourceGenerator extends JavaBaseGenerator {
write(" return ResourceType."+analysis.getName()+";\r\n");
write(" }\r\n");
write("\r\n");
} else if (analysis.isAbstract() && Utilities.noString(analysis.getAncestor().getName())) {
} else if (analysis.isAbstract() && analysis.getAncestor() != null && Utilities.noString(analysis.getAncestor().getName())) {
write("\r\n");
write(" @Override\r\n");
write(" public String getIdBase() {\r\n");
@ -261,7 +262,7 @@ public class JavaResourceGenerator extends JavaBaseGenerator {
write(" setId(value);\r\n");
write(" }\r\n");
write(" public abstract ResourceType getResourceType();\r\n");
} else if (analysis.isAbstract() && Utilities.noString(analysis.getAncestor().getName())) {
} else if (analysis.isAbstract() && analysis.getAncestor() != null && Utilities.noString(analysis.getAncestor().getName())) {
write(" @Override\r\n");
write(" public String getIdBase() {\r\n");
write(" return getId();\r\n");
@ -1180,6 +1181,7 @@ private void generatePropertyMaker(Analysis analysis, TypeInfo ti, String indent
cc = makeConst(cc);
write(" case "+cc+": return \""+c.getCode()+"\";\r\n");
}
write(" case NULL: return null;\r\n");
write(" default: return \"?\";\r\n");
write(" }\r\n");
write(" }\r\n");
@ -1191,6 +1193,7 @@ private void generatePropertyMaker(Analysis analysis, TypeInfo ti, String indent
cc = makeConst(cc);
write(" case "+cc+": return \""+c.getSystem()+"\";\r\n");
}
write(" case NULL: return null;\r\n");
write(" default: return \"?\";\r\n");
write(" }\r\n");
write(" }\r\n");
@ -1203,6 +1206,7 @@ private void generatePropertyMaker(Analysis analysis, TypeInfo ti, String indent
String definition = definitions.getCodeDefinition(c.getSystem(), c.getCode());
write(" case "+cc+": return \""+Utilities.escapeJava(definition)+"\";\r\n");
}
write(" case NULL: return null;\r\n");
write(" default: return \"?\";\r\n");
write(" }\r\n");
write(" }\r\n");
@ -1214,6 +1218,7 @@ private void generatePropertyMaker(Analysis analysis, TypeInfo ti, String indent
cc = makeConst(cc);
write(" case "+cc+": return \""+Utilities.escapeJava(Utilities.noString(c.getDisplay()) ? c.getCode() : c.getDisplay())+"\";\r\n");
}
write(" case NULL: return null;\r\n");
write(" default: return \"?\";\r\n");
write(" }\r\n");
write(" }\r\n");
@ -1267,7 +1272,7 @@ private void generatePropertyMaker(Analysis analysis, TypeInfo ti, String indent
write(" }\r\n");
write(" }\r\n");
write("\r\n");
// enumInfo.put("org.hl7.fhir.r5.model."+name+"."+tns, url+"|"+el.toString());
// enumInfo.put("org.hl7.fhir."+jid+".model."+name+"."+tns, url+"|"+el.toString());
}
private void generateType(Analysis analysis, TypeInfo ti) throws Exception {
@ -1672,6 +1677,8 @@ private void generatePropertyMaker(Analysis analysis, TypeInfo ti, String indent
}
private void generateAccessors(Analysis analysis, TypeInfo ti, ElementDefinition e, String indent, ElementDefinition inh) throws Exception {
String tn = e.getUserString("java.type");
StructureDefinition sd = e.hasType() ? definitions.getStructures().get(pfxType(e.getTypeFirstRep().getCode())) : null;
boolean abstractTarget = (sd != null) && sd.getAbstract() && !sd.getUrl().equals("http://hl7.org/fhir/StructureDefinition/Element")&& !sd.getUrl().equals("http://hl7.org/fhir/StructureDefinition/BackboneElement");
String className = ti.getName();
if (Utilities.noString(tn)) {
@ -1804,27 +1811,30 @@ private void generatePropertyMaker(Analysis analysis, TypeInfo ti, String indent
write("\r\n");
} else {
if (!definitions.hasResource(tn)) {
/*
* addXXX() for repeatable composite
*/
write(indent+"public "+tn+" add"+getTitle(getElementName(e.getName(), false))+"() { //3\r\n");
if (!e.unbounded()) {
write(indent+" if (this."+getElementName(e.getName(), true)+" == null) {\r\n");
write(indent+" this."+getElementName(e.getName(), true)+" = new "+tn+"();\r\n");
write(indent+" } else {\r\n");
write(indent+" throw new Error(\"Cannot have more than one "+e.getPath()+"\");\r\n");
write(indent+" }\r\n");
write(indent+" return this."+getElementName(e.getName(), true)+";\r\n");
if (abstractTarget) {
System.out.println(e.getPath()+" is abstract");
} else {
write(indent+" "+tn+" t = new "+tn+"();\r\n");
write(indent+" if (this."+getElementName(e.getName(), true)+" == null)\r\n");
write(indent+" this."+getElementName(e.getName(), true)+" = new ArrayList<"+tn+">();\r\n");
write(indent+" this."+getElementName(e.getName(), true)+".add(t);\r\n");
write(indent+" return t;\r\n");
/*
* addXXX() for repeatable composite
*/
write(indent+"public "+tn+" add"+getTitle(getElementName(e.getName(), false))+"() { //3\r\n");
if (!e.unbounded()) {
write(indent+" if (this."+getElementName(e.getName(), true)+" == null) {\r\n");
write(indent+" this."+getElementName(e.getName(), true)+" = new "+tn+"();\r\n");
write(indent+" } else {\r\n");
write(indent+" throw new Error(\"Cannot have more than one "+e.getPath()+"\");\r\n");
write(indent+" }\r\n");
write(indent+" return this."+getElementName(e.getName(), true)+";\r\n");
} else {
write(indent+" "+tn+" t = new "+tn+"();\r\n");
write(indent+" if (this."+getElementName(e.getName(), true)+" == null)\r\n");
write(indent+" this."+getElementName(e.getName(), true)+" = new ArrayList<"+tn+">();\r\n");
write(indent+" this."+getElementName(e.getName(), true)+".add(t);\r\n");
write(indent+" return t;\r\n");
}
write(indent+"}\r\n");
write("\r\n");
}
write(indent+"}\r\n");
write("\r\n");
/*
* addXXX(foo) for repeatable composite
*/
@ -2029,6 +2039,10 @@ private void generatePropertyMaker(Analysis analysis, TypeInfo ti, String indent
}
private String pfxType(String code) {
return "http://hl7.org/fhir/StructureDefinition/"+code;
}
private void generateAbstractAccessors(Analysis analysis, TypeInfo ti, ElementDefinition e, String indent) throws Exception {
String tn = e.getUserString("java.type");

View File

@ -50,12 +50,13 @@ import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule;
public class JavaTypeGenerator extends JavaBaseGenerator {
public JavaTypeGenerator(OutputStream out, Definitions definitions, Configuration configuration, Date genDate, String version) throws UnsupportedEncodingException {
super(out, definitions, configuration, version, genDate);
public JavaTypeGenerator(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("ResourceType");
template = template.replace("{{jid}}", jid);
template = template.replace("{{license}}", config.getLicense());
template = template.replace("{{startMark}}", startVMarkValue());
template = template.replace("{{types-enum}}", genEnums());

View File

@ -45,9 +45,9 @@ import org.hl7.fhir.utilities.Utilities;
public class JavaConverterGenerator extends JavaBaseGenerator {
public JavaConverterGenerator(OutputStream arg0, Definitions definitions, Configuration config, String version, Date genDate)
public JavaConverterGenerator(OutputStream arg0, Definitions definitions, Configuration config, String version, Date genDate, String jid)
throws UnsupportedEncodingException {
super(arg0, definitions, config, version, genDate);
super(arg0, definitions, config, version, genDate, jid);
// TODO Auto-generated constructor stub
}
// public enum JavaGenClass { Structure, Type, Resource, AbstractResource, BackboneElement, Constraint }

View File

@ -58,9 +58,9 @@ changes for James
*/
public class JavaPatternImplGenerator extends JavaBaseGenerator {
public JavaPatternImplGenerator(OutputStream arg0, Definitions definitions, Configuration config, String version, Date genDate)
public JavaPatternImplGenerator(OutputStream arg0, Definitions definitions, Configuration config, String version, Date genDate, String jid)
throws UnsupportedEncodingException {
super(arg0, definitions, config, version, genDate);
super(arg0, definitions, config, version, genDate, jid);
// TODO Auto-generated constructor stub
}
//

View File

@ -59,9 +59,9 @@ changes for James
*/
public class JavaPatternIntfGenerator extends JavaBaseGenerator {
public JavaPatternIntfGenerator(OutputStream arg0, Definitions definitions, Configuration config, String version, Date genDate)
public JavaPatternIntfGenerator(OutputStream arg0, Definitions definitions, Configuration config, String version, Date genDate, String jid)
throws UnsupportedEncodingException {
super(arg0, definitions, config, version, genDate);
super(arg0, definitions, config, version, genDate, jid);
// TODO Auto-generated constructor stub
}
//

View File

@ -6,6 +6,7 @@ import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent;
import org.hl7.fhir.r5.model.CompartmentDefinition;
import org.hl7.fhir.r5.model.ConceptMap;
import org.hl7.fhir.r5.model.ElementDefinition;
import org.hl7.fhir.r5.model.OperationDefinition;
import org.hl7.fhir.r5.model.SearchParameter;
import org.hl7.fhir.r5.model.StructureDefinition;
@ -75,6 +76,27 @@ public class Definitions {
StructureDefinition sd = structures.get("http://hl7.org/fhir/StructureDefinition/"+tn);
return sd;
}
public void fix() {
StructureDefinition aa = structures.get("http://hl7.org/fhir/StructureDefinition/ArtifactAssessment");
if (aa != null) {
for (ElementDefinition ed : aa.getSnapshot().getElement()) {
fixAATypes(ed);
}
for (ElementDefinition ed : aa.getDifferential().getElement()) {
fixAATypes(ed);
}
}
}
private void fixAATypes(ElementDefinition ed) {
if (ed.getPath().equals("ArtifactAssessment.approvalDate")) {
ed.getTypeFirstRep().setCode("date");
}
if (ed.getPath().equals("ArtifactAssessment.lastReviewDate")) {
ed.getTypeFirstRep().setCode("date");
}
}
}

View File

@ -19,7 +19,7 @@ import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.npm.NpmPackage;
import org.hl7.fhir.utilities.npm.ToolsVersion;
public class DefinitionsLoader {
public class DefinitionsLoaderR5 {
public static Definitions load(NpmPackage npm) throws IOException {
Definitions res = new Definitions();
@ -48,29 +48,29 @@ public class DefinitionsLoader {
for (String t : npm.listResources("CompartmentDefinition")) {
res.getCompartments().see((CompartmentDefinition) load(npm, t), null);
}
Bundle bnd = (Bundle) load(npm, "Bundle-searchParams.json");
if (bnd != null) {
for (BundleEntryComponent be : bnd.getEntry()) {
Resource r = be.getResource();
if (r instanceof CodeSystem) {
res.getCodeSystems().see((CodeSystem) r, null);
} else if (r instanceof ValueSet) {
res.getValuesets().see((ValueSet) r, null);
} else if (r instanceof ConceptMap) {
res.getConceptMaps().see((ConceptMap) r, null);
} else if (r instanceof CapabilityStatement) {
res.getStatements().see((CapabilityStatement) r, null);
} else if (r instanceof StructureDefinition) {
res.getStructures().see((StructureDefinition) r, null);
} else if (r instanceof OperationDefinition) {
res.getOperations().see((OperationDefinition) r, null);
} else if (r instanceof SearchParameter) {
res.getSearchParams().see((SearchParameter) r, null);
} else if (r instanceof CompartmentDefinition) {
res.getCompartments().see((CompartmentDefinition) r, null);
}
}
}
// Bundle bnd = (Bundle) load(npm, "Bundle-searchParams.json");
// if (bnd != null) {
// for (BundleEntryComponent be : bnd.getEntry()) {
// Resource r = be.getResource();
// if (r instanceof CodeSystem) {
// res.getCodeSystems().see((CodeSystem) r, null);
// } else if (r instanceof ValueSet) {
// res.getValuesets().see((ValueSet) r, null);
// } else if (r instanceof ConceptMap) {
// res.getConceptMaps().see((ConceptMap) r, null);
// } else if (r instanceof CapabilityStatement) {
// res.getStatements().see((CapabilityStatement) r, null);
// } else if (r instanceof StructureDefinition) {
// res.getStructures().see((StructureDefinition) r, null);
// } else if (r instanceof OperationDefinition) {
// res.getOperations().see((OperationDefinition) r, null);
// } else if (r instanceof SearchParameter) {
// res.getSearchParams().see((SearchParameter) r, null);
// } else if (r instanceof CompartmentDefinition) {
// res.getCompartments().see((CompartmentDefinition) r, null);
// }
// }
// }
return res;
}

View File

@ -3,6 +3,7 @@ package org.hl7.fhir.core.generator.engine;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
@ -30,6 +31,7 @@ import org.hl7.fhir.r5.model.SearchParameter;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
import org.hl7.fhir.utilities.npm.NpmPackage;
import org.hl7.fhir.utilities.npm.ToolsVersion;
@ -61,110 +63,73 @@ public class JavaCoreGenerator {
String ap = Utilities.path(src);
System.out.println("Load Configuration from "+ap);
Configuration config = new Configuration(ap);
String pid = "r5";
String jid = "r5";
String pid = VersionUtilities.isR4BVer(version) ? "r4b" : "r5";
String jid = VersionUtilities.isR4BVer(version) ? "r4b" : "r5";
FilesystemPackageCacheManager pcm = new FilesystemPackageCacheManager(true, ToolsVersion.TOOLS_VERSION);
System.out.println("Cache: "+pcm.getFolder());
System.out.println("Load hl7.fhir."+pid+".core");
NpmPackage npm = pcm.loadPackage("hl7.fhir."+pid+".core", version);
Definitions master = DefinitionsLoader.load(npm);
Definitions master = VersionUtilities.isR4BVer(version) ? DefinitionsLoaderR4B.load(npm) : DefinitionsLoaderR5.load(npm);
master.fix();
markValueSets(master, config);
System.out.println("Load hl7.fhir."+pid+".expansions");
Definitions expansions = DefinitionsLoader.load(pcm.loadPackage("hl7.fhir."+pid+".expansions", version));
Definitions expansions = DefinitionsLoaderR5.load(pcm.loadPackage("hl7.fhir."+pid+".expansions", version));
System.out.println("Process Expansions");
updateExpansions(master, expansions);
System.out.println("Generate Model");
System.out.println(" .. Constants");
JavaConstantsGenerator cgen = new JavaConstantsGenerator(new FileOutputStream(Utilities.path(dest, "src", "org", "hl7", "fhir", "r5", "model", "Constants.java")), master, config, date, npm.version());
JavaConstantsGenerator cgen = new JavaConstantsGenerator(new FileOutputStream(Utilities.path(dest, "src", "org", "hl7", "fhir", jid, "model", "Constants.java")), master, config, date, npm.version(), jid);
cgen.generate();
cgen.close();
System.out.println(" .. Enumerations");
JavaEnumerationsGenerator egen = new JavaEnumerationsGenerator(new FileOutputStream(Utilities.path(dest, "src", "org", "hl7", "fhir", "r5", "model", "Enumerations.java")), master, config, date, npm.version());
JavaEnumerationsGenerator egen = new JavaEnumerationsGenerator(new FileOutputStream(Utilities.path(dest, "src", "org", "hl7", "fhir", jid, "model", "Enumerations.java")), master, config, date, npm.version(), jid);
egen.generate();
egen.close();
JavaFactoryGenerator fgen = new JavaFactoryGenerator(new FileOutputStream(Utilities.path(dest, "src", "org", "hl7", "fhir", "r5", "model", "ResourceFactory.java")), master, config, date, npm.version());
JavaTypeGenerator tgen = new JavaTypeGenerator(new FileOutputStream(Utilities.path(dest, "src", "org", "hl7", "fhir", "r5", "model", "ResourceType.java")), master, config, date, npm.version());
JavaParserJsonGenerator jgen = new JavaParserJsonGenerator(new FileOutputStream(Utilities.path(dest, "src", "org", "hl7", "fhir", "r5", "formats", "JsonParser.java")), master, config, date, npm.version());
JavaParserXmlGenerator xgen = new JavaParserXmlGenerator(new FileOutputStream(Utilities.path(dest, "src", "org", "hl7", "fhir", "r5", "formats", "XmlParser.java")), master, config, date, npm.version());
JavaParserRdfGenerator rgen = new JavaParserRdfGenerator(new FileOutputStream(Utilities.path(dest, "src", "org", "hl7", "fhir", "r5", "formats", "RdfParser.java")), master, config, date, npm.version());
JavaFactoryGenerator fgen = new JavaFactoryGenerator(new FileOutputStream(Utilities.path(dest, "src", "org", "hl7", "fhir", jid, "model", "ResourceFactory.java")), master, config, date, npm.version(), jid);
JavaTypeGenerator tgen = new JavaTypeGenerator(new FileOutputStream(Utilities.path(dest, "src", "org", "hl7", "fhir", jid, "model", "ResourceType.java")), master, config, date, npm.version(), jid);
JavaParserJsonGenerator jgen = new JavaParserJsonGenerator(new FileOutputStream(Utilities.path(dest, "src", "org", "hl7", "fhir", jid, "formats", "JsonParser.java")), master, config, date, npm.version(), jid);
JavaParserXmlGenerator xgen = new JavaParserXmlGenerator(new FileOutputStream(Utilities.path(dest, "src", "org", "hl7", "fhir", jid, "formats", "XmlParser.java")), master, config, date, npm.version(), jid);
JavaParserRdfGenerator rgen = new JavaParserRdfGenerator(new FileOutputStream(Utilities.path(dest, "src", "org", "hl7", "fhir", jid, "formats", "RdfParser.java")), master, config, date, npm.version(), jid);
if (VersionUtilities.isR4BVer(version)) {
StructureDefinition sd = master.getStructures().get("http://hl7.org/fhir/StructureDefinition/Element");
genClass(version, dest, date, config, jid, npm, master, jgen, xgen, rgen, sd);
}
for (StructureDefinition sd : master.getStructures().getList()) {
if (sd.getDerivation() == TypeDerivationRule.SPECIALIZATION && sd.getKind() == StructureDefinitionKind.COMPLEXTYPE) {
if (!Utilities.existsInList(sd.getName(), "Base", "PrimitiveType") && !sd.getName().contains(".") && sd.getAbstract()) {
String name = javaName(sd.getName());
System.out.println(" .. "+name);
Analyser jca = new Analyser(master, config);
Analysis analysis = jca.analyse(sd);
String fn = Utilities.path(dest, "src", "org", "hl7", "fhir", "r5", "model", name+".java");
JavaResourceGenerator gen = new JavaResourceGenerator(new FileOutputStream(fn), master, config, date, npm.version());
gen.generate(analysis);
gen.close();
jgen.seeClass(analysis);
xgen.seeClass(analysis);
rgen.seeClass(analysis);
genClass(version, dest, date, config, jid, npm, master, jgen, xgen, rgen, sd);
}
}
}
for (StructureDefinition sd : master.getStructures().getList()) {
if (sd.getDerivation() == TypeDerivationRule.SPECIALIZATION && sd.getKind() == StructureDefinitionKind.COMPLEXTYPE) {
if (!Utilities.existsInList(sd.getName(), "Base", "PrimitiveType") && !sd.getName().contains(".") && !sd.getAbstract()) {
String name = javaName(sd.getName());
System.out.println(" .. "+name);
Analyser jca = new Analyser(master, config);
Analysis analysis = jca.analyse(sd);
String fn = Utilities.path(dest, "src", "org", "hl7", "fhir", "r5", "model", name+".java");
JavaResourceGenerator gen = new JavaResourceGenerator(new FileOutputStream(fn), master, config, date, npm.version());
gen.generate(analysis);
gen.close();
jgen.seeClass(analysis);
xgen.seeClass(analysis);
rgen.seeClass(analysis);
genClass(version, dest, date, config, jid, npm, master, jgen, xgen, rgen, sd);
}
}
}
if (VersionUtilities.isR4BVer(version)) {
StructureDefinition sd = master.getStructures().get("http://hl7.org/fhir/StructureDefinition/Resource");
genClass(version, dest, date, config, jid, npm, master, jgen, xgen, rgen, sd);
}
for (StructureDefinition sd : master.getStructures().getList()) {
if (sd.getDerivation() == TypeDerivationRule.SPECIALIZATION && sd.getKind() == StructureDefinitionKind.RESOURCE) {
if (!Utilities.existsInList(sd.getName(), "Base", "PrimitiveType") && !sd.getName().contains(".") && sd.getAbstract()) {
String name = javaName(sd.getName());
System.out.println(" .. "+name);
Analyser jca = new Analyser(master, config);
Analysis analysis = jca.analyse(sd);
String fn = Utilities.path(dest, "src", "org", "hl7", "fhir", "r5", "model", name+".java");
JavaResourceGenerator gen = new JavaResourceGenerator(new FileOutputStream(fn), master, config, date, npm.version());
gen.generate(analysis);
gen.close();
jgen.seeClass(analysis);
xgen.seeClass(analysis);
rgen.seeClass(analysis);
genClass(version, dest, date, config, jid, npm, master, jgen, xgen, rgen, sd);
}
}
}
for (StructureDefinition sd : master.getStructures().getList()) {
if (sd.getDerivation() == TypeDerivationRule.SPECIALIZATION && sd.getKind() == StructureDefinitionKind.RESOURCE) {
if (!Utilities.existsInList(sd.getName(), "Base", "PrimitiveType") && !sd.getName().contains(".") && !sd.getAbstract()) {
String name = javaName(sd.getName());
System.out.println(" .. "+name);
Analyser jca = new Analyser(master, config);
Analysis analysis = jca.analyse(sd);
String fn = Utilities.path(dest, "src", "org", "hl7", "fhir", "r5", "model", name+".java");
JavaResourceGenerator gen = new JavaResourceGenerator(new FileOutputStream(fn), master, config, date, npm.version());
gen.generate(analysis);
gen.close();
jgen.seeClass(analysis);
xgen.seeClass(analysis);
rgen.seeClass(analysis);
genClass(version, dest, date, config, jid, npm, master, jgen, xgen, rgen, sd);
}
}
}
@ -187,6 +152,24 @@ public class JavaCoreGenerator {
}
public void genClass(String version, String dest, Date date, Configuration config, String jid, NpmPackage npm, Definitions master,
JavaParserJsonGenerator jgen, JavaParserXmlGenerator xgen, JavaParserRdfGenerator rgen, StructureDefinition sd)
throws Exception, IOException, UnsupportedEncodingException, FileNotFoundException {
String name = javaName(sd.getName());
System.out.println(" .. "+name);
Analyser jca = new Analyser(master, config, version);
Analysis analysis = jca.analyse(sd);
String fn = Utilities.path(dest, "src", "org", "hl7", "fhir", jid, "model", name+".java");
JavaResourceGenerator gen = new JavaResourceGenerator(new FileOutputStream(fn), master, config, date, npm.version(), jid);
gen.generate(analysis);
gen.close();
jgen.seeClass(analysis);
xgen.seeClass(analysis);
rgen.seeClass(analysis);
}
@SuppressWarnings("unchecked")
private void markValueSets(Definitions defns, Configuration config) {
for (StructureDefinition sd : defns.getStructures().getList()) {

View File

@ -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.22-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -10832,7 +10832,9 @@ public class JsonParser extends JsonParserBase {
if (json.has("include")) {
JsonArray array = json.getAsJsonArray("include");
for (int i = 0; i < array.size(); i++) {
res.getInclude().add(parseValueSetConceptSetComponent(array.get(i).getAsJsonObject(), owner));
if (!array.get(i).isJsonNull()) {
res.getInclude().add(parseValueSetConceptSetComponent(array.get(i).getAsJsonObject(), owner));
}
}
};
if (json.has("exclude")) {

View File

@ -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.22-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -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.22-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -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.22-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -10036,6 +10036,7 @@ The primary difference between a medication statement and a medication administr
* R4B - manually added
*/
_4_1_0,
_4_3_0_SNAPSHOT1,
_4_3_0_CIBUILD,
NULL;
public static FHIRVersion fromCode(String codeString) throws FHIRException {
@ -10089,7 +10090,9 @@ The primary difference between a medication statement and a medication administr
return _4_0_1;
if ("4.1.0".equals(codeString))
return _4_1_0;
if ("4.3.0-CIBUILD".equals(codeString))
if ("4.3.0-snapshot1".equals(codeString))
return _4_3_0_SNAPSHOT1;
if ("4.3.0-cibuild".equals(codeString))
return _4_3_0_CIBUILD;
throw new FHIRException("Unknown FHIRVersion code '"+codeString+"'");
}
@ -10123,7 +10126,8 @@ The primary difference between a medication statement and a medication administr
case _4_0_0: return "4.0.0";
case _4_0_1: return "4.0.1";
case _4_1_0: return "4.1.0";
case _4_3_0_CIBUILD: return "4.3.0-CIBUILD";
case _4_3_0_SNAPSHOT1: return "4.3.0-snapshot1";
case _4_3_0_CIBUILD: return "4.3.0-cibuild";
case NULL: return null;
default: return "?";
@ -10155,6 +10159,7 @@ The primary difference between a medication statement and a medication administr
case _4_0_0: return "http://hl7.org/fhir/FHIR-version";
case _4_0_1: return "http://hl7.org/fhir/FHIR-version";
case _4_1_0: return "http://hl7.org/fhir/FHIR-version";
case _4_3_0_SNAPSHOT1: return "http://hl7.org/fhir/FHIR-version";
case _4_3_0_CIBUILD: return "http://hl7.org/fhir/FHIR-version";
case NULL: return null;
default: return "?";
@ -10186,6 +10191,7 @@ The primary difference between a medication statement and a medication administr
case _4_0_0: return "FHIR Release 4 (Normative + STU).";
case _4_0_1: return "FHIR Release 4 Technical Correction #1.";
case _4_1_0: return "FHIR Release 4B Ballot #1";
case _4_3_0_SNAPSHOT1: return "FHIR Release 4B Snapshot #1";
case _4_3_0_CIBUILD: return "FHIR Release 4B CI-Builld";
case NULL: return null;
default: return "?";
@ -10217,7 +10223,8 @@ The primary difference between a medication statement and a medication administr
case _4_0_0: return "4.0.0";
case _4_0_1: return "4.0.1";
case _4_1_0: return "4.1.0";
case _4_3_0_CIBUILD: return "4.3.0-CIBUILD";
case _4_3_0_SNAPSHOT1: return "4.3.0-snapshot";
case _4_3_0_CIBUILD: return "4.3.0-cibuild";
case NULL: return null;
default: return "?";
}
@ -10283,7 +10290,9 @@ The primary difference between a medication statement and a medication administr
return FHIRVersion._4_0_1;
if ("4.1.0".equals(codeString))
return FHIRVersion._4_1_0;
if ("4.3.0-CIBUILD".equals(codeString))
if ("4.3.0-snapshot1".equals(codeString))
return FHIRVersion._4_3_0_SNAPSHOT1;
if ("4.3.0-cibuild".equals(codeString))
return FHIRVersion._4_3_0_CIBUILD;
throw new IllegalArgumentException("Unknown FHIRVersion code '"+codeString+"'");
}
@ -10343,7 +10352,9 @@ The primary difference between a medication statement and a medication administr
return new Enumeration<FHIRVersion>(this, FHIRVersion._4_0_1);
if ("4.1.0".equals(codeString))
return new Enumeration<FHIRVersion>(this, FHIRVersion._4_1_0);
if ("4.3.0-CIBUILD".equals(codeString))
if ("4.3.0-snapshot1".equals(codeString))
return new Enumeration<FHIRVersion>(this, FHIRVersion._4_3_0_SNAPSHOT1);
if ("4.3.0-cibuild".equals(codeString))
return new Enumeration<FHIRVersion>(this, FHIRVersion._4_3_0_CIBUILD);
throw new FHIRException("Unknown FHIRVersion code '"+codeString+"'");
}
@ -10396,8 +10407,10 @@ The primary difference between a medication statement and a medication administr
return "4.0.1";
if (code == FHIRVersion._4_1_0)
return "4.1.0";
if (code == FHIRVersion._4_3_0_SNAPSHOT1)
return "4.3.0-snapshot1";
if (code == FHIRVersion._4_3_0_CIBUILD)
return "4.3.0_CIBUILD";
return "4.3.0-cibuild";
return "?";
}
public String toSystem(FHIRVersion code) {

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

36
org.hl7.fhir.r4b/.project Normal file
View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.hl7.fhir.r4b</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.jetbrains.kotlin.ui.kotlinBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.jetbrains.kotlin.core.kotlinNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<linkedResources>
<link>
<name>kotlin_bin</name>
<type>2</type>
<locationURI>org.jetbrains.kotlin.core.filesystem:/org.hl7.fhir.r4b/kotlin_bin</locationURI>
</link>
</linkedResources>
</projectDescription>

193
org.hl7.fhir.r4b/pom.xml Normal file
View File

@ -0,0 +1,193 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.22-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>org.hl7.fhir.r4b</artifactId>
<packaging>bundle</packaging>
<dependencies>
<!-- HAPI Dependencies -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.utilities</artifactId>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-base</artifactId>
<exclusions>
<exclusion>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-utilities</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- UCUM -->
<dependency>
<groupId>org.fhir</groupId>
<artifactId>ucum</artifactId>
<version>1.0.3</version>
<optional>true</optional>
</dependency>
<!-- XML Parsers -->
<dependency>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>xpp3</groupId>
<artifactId>xpp3_xpath</artifactId>
<optional>true</optional>
</dependency>
<!-- JSON Parsers -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<optional>true</optional>
</dependency>
<!-- HTTP Client -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>4.9.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>4.9.0</version>
<optional>true</optional>
<scope>test</scope>
</dependency>
<!-- Apache POI -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.0.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.0.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.0.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>ooxml-schemas</artifactId>
<version>1.4</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>ST4</artifactId>
<version>4.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<optional>true</optional>
</dependency>
<!-- HTTP Client -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<optional>true</optional>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hl7.fhir.testcases</groupId>
<artifactId>fhir-test-cases</artifactId>
<version>${validator_test_case_version}</version>
<scope>test</scope>
</dependency>
<!-- JUnit Jupiter -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit_jupiter_version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit_jupiter_version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.atlassian.commonmark</groupId>
<artifactId>commonmark</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.atlassian.commonmark</groupId>
<artifactId>commonmark-ext-gfm-tables</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.basepom.maven</groupId>
<artifactId>duplicate-finder-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>**/*.out</exclude>
</excludes>
</resource>
</resources>
</build>
</project>

View File

@ -0,0 +1,318 @@
package org.hl7.fhir.r4b.comparison;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4b.comparison.ResourceComparer.MessageCounts;
import org.hl7.fhir.r4b.model.CanonicalResource;
import org.hl7.fhir.r4b.model.CanonicalType;
import org.hl7.fhir.r4b.model.CapabilityStatement;
import org.hl7.fhir.r4b.model.CodeType;
import org.hl7.fhir.r4b.model.CodeableConcept;
import org.hl7.fhir.r4b.model.Coding;
import org.hl7.fhir.r4b.model.PrimitiveType;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.validation.ValidationMessage;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType;
import org.hl7.fhir.utilities.validation.ValidationMessage.Source;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Row;
import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.TableModel;
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
public abstract class CanonicalResourceComparer extends ResourceComparer {
public abstract class CanonicalResourceComparison<T extends CanonicalResource> extends ResourceComparison {
protected T left;
protected T right;
protected T union;
protected T intersection;
protected Map<String, StructuralMatch<String>> metadata = new HashMap<>();
public CanonicalResourceComparison(T left, T right) {
super(left.getId(), right.getId());
this.left = left;
this.right = right;
}
public T getLeft() {
return left;
}
public T getRight() {
return right;
}
public T getUnion() {
return union;
}
public T getIntersection() {
return intersection;
}
public Map<String, StructuralMatch<String>> getMetadata() {
return metadata;
}
public void setLeft(T left) {
this.left = left;
}
public void setRight(T right) {
this.right = right;
}
public void setUnion(T union) {
this.union = union;
}
public void setIntersection(T intersection) {
this.intersection = intersection;
}
@Override
protected String toTable() {
String s = "";
s = s + refCell(left);
s = s + refCell(right);
s = s + "<td><a href=\""+getId()+".html\">Comparison</a></td>";
s = s + "<td>"+outcomeSummary()+"</td>";
return "<tr style=\"background-color: "+color()+"\">"+s+"</tr>\r\n";
}
@Override
protected void countMessages(MessageCounts cnts) {
for (StructuralMatch<String> sm : metadata.values()) {
sm.countMessages(cnts);
}
}
}
public CanonicalResourceComparer(ComparisonSession session) {
super(session);
}
protected void compareMetadata(CanonicalResource left, CanonicalResource right, Map<String, StructuralMatch<String>> comp, CanonicalResourceComparison<? extends CanonicalResource> res) {
comparePrimitives("url", left.getUrlElement(), right.getUrlElement(), comp, IssueSeverity.ERROR, res);
comparePrimitives("version", left.getVersionElement(), right.getVersionElement(), comp, IssueSeverity.ERROR, res);
comparePrimitives("name", left.getNameElement(), right.getNameElement(), comp, IssueSeverity.INFORMATION, res);
comparePrimitives("title", left.getTitleElement(), right.getTitleElement(), comp, IssueSeverity.INFORMATION, res);
comparePrimitives("status", left.getStatusElement(), right.getStatusElement(), comp, IssueSeverity.INFORMATION, res);
comparePrimitives("experimental", left.getExperimentalElement(), right.getExperimentalElement(), comp, IssueSeverity.WARNING, res);
comparePrimitives("date", left.getDateElement(), right.getDateElement(), comp, IssueSeverity.INFORMATION, res);
comparePrimitives("publisher", left.getPublisherElement(), right.getPublisherElement(), comp, IssueSeverity.INFORMATION, res);
comparePrimitives("description", left.getDescriptionElement(), right.getDescriptionElement(), comp, IssueSeverity.NULL, res);
comparePrimitives("purpose", left.getPurposeElement(), right.getPurposeElement(), comp, IssueSeverity.NULL, res);
comparePrimitives("copyright", left.getCopyrightElement(), right.getCopyrightElement(), comp, IssueSeverity.INFORMATION, res);
compareCodeableConceptList("jurisdiction", left.getJurisdiction(), right.getJurisdiction(), comp, IssueSeverity.INFORMATION, res, res.getUnion().getJurisdiction(), res.getIntersection().getJurisdiction());
}
protected void compareCodeableConceptList(String name, List<CodeableConcept> left, List<CodeableConcept> right, Map<String, StructuralMatch<String>> comp, IssueSeverity level, CanonicalResourceComparison<? extends CanonicalResource> res, List<CodeableConcept> union, List<CodeableConcept> intersection ) {
List<CodeableConcept> matchR = new ArrayList<>();
StructuralMatch<String> combined = new StructuralMatch<String>();
for (CodeableConcept l : left) {
CodeableConcept r = findCodeableConceptInList(right, l);
if (r == null) {
union.add(l);
combined.getChildren().add(new StructuralMatch<String>(gen(l), vm(IssueSeverity.INFORMATION, "Removed the item '"+gen(l)+"'", fhirType()+"."+name, res.getMessages())));
} else {
matchR.add(r);
union.add(r);
intersection.add(r);
StructuralMatch<String> sm = new StructuralMatch<String>(gen(l), gen(r));
combined.getChildren().add(sm);
}
}
for (CodeableConcept r : right) {
if (!matchR.contains(r)) {
union.add(r);
combined.getChildren().add(new StructuralMatch<String>(vm(IssueSeverity.INFORMATION, "Added the item '"+gen(r)+"'", fhirType()+"."+name, res.getMessages()), gen(r)));
}
}
comp.put(name, combined);
}
private CodeableConcept findCodeableConceptInList(List<CodeableConcept> list, CodeableConcept item) {
for (CodeableConcept t : list) {
if (t.matches(item)) {
return t;
}
}
return null;
}
protected String gen(CodeableConcept cc) {
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
for (Coding c : cc.getCoding()) {
b.append(gen(c));
}
return b.toString();
}
protected String gen(Coding c) {
return c.getSystem()+(c.hasVersion() ? "|"+c.getVersion() : "")+"#"+c.getCode();
}
protected void compareCanonicalList(String name, List<CanonicalType> left, List<CanonicalType> right, Map<String, StructuralMatch<String>> comp, IssueSeverity level, CanonicalResourceComparison<? extends CanonicalResource> res, List<CanonicalType> union, List<CanonicalType> intersection ) {
List<CanonicalType> matchR = new ArrayList<>();
StructuralMatch<String> combined = new StructuralMatch<String>();
for (CanonicalType l : left) {
CanonicalType r = findCanonicalInList(right, l);
if (r == null) {
union.add(l);
combined.getChildren().add(new StructuralMatch<String>(l.getValue(), vm(IssueSeverity.INFORMATION, "Removed the item '"+l.getValue()+"'", fhirType()+"."+name, res.getMessages())));
} else {
matchR.add(r);
union.add(r);
intersection.add(r);
StructuralMatch<String> sm = new StructuralMatch<String>(l.getValue(), r.getValue());
combined.getChildren().add(sm);
}
}
for (CanonicalType r : right) {
if (!matchR.contains(r)) {
union.add(r);
combined.getChildren().add(new StructuralMatch<String>(vm(IssueSeverity.INFORMATION, "Added the item '"+r.getValue()+"'", fhirType()+"."+name, res.getMessages()), r.getValue()));
}
}
comp.put(name, combined);
}
private CanonicalType findCanonicalInList(List<CanonicalType> list, CanonicalType item) {
for (CanonicalType t : list) {
if (t.getValue().equals(item.getValue())) {
return t;
}
}
return null;
}
protected void compareCodeList(String name, List<CodeType> left, List<CodeType> right, Map<String, StructuralMatch<String>> comp, IssueSeverity level, CanonicalResourceComparison<? extends CanonicalResource> res, List<CodeType> union, List<CodeType> intersection ) {
List<CodeType> matchR = new ArrayList<>();
StructuralMatch<String> combined = new StructuralMatch<String>();
for (CodeType l : left) {
CodeType r = findCodeInList(right, l);
if (r == null) {
union.add(l);
combined.getChildren().add(new StructuralMatch<String>(l.getValue(), vm(IssueSeverity.INFORMATION, "Removed the item '"+l.getValue()+"'", fhirType()+"."+name, res.getMessages())));
} else {
matchR.add(r);
union.add(r);
intersection.add(r);
StructuralMatch<String> sm = new StructuralMatch<String>(l.getValue(), r.getValue());
combined.getChildren().add(sm);
}
}
for (CodeType r : right) {
if (!matchR.contains(r)) {
union.add(r);
combined.getChildren().add(new StructuralMatch<String>(vm(IssueSeverity.INFORMATION, "Added the item '"+r.getValue()+"'", fhirType()+"."+name, res.getMessages()), r.getValue()));
}
}
comp.put(name, combined);
}
private CodeType findCodeInList(List<CodeType> list, CodeType item) {
for (CodeType t : list) {
if (t.getValue().equals(item.getValue())) {
return t;
}
}
return null;
}
@SuppressWarnings("rawtypes")
protected void comparePrimitives(String name, PrimitiveType l, PrimitiveType r, Map<String, StructuralMatch<String>> comp, IssueSeverity level, CanonicalResourceComparison<? extends CanonicalResource> res) {
StructuralMatch<String> match = null;
if (l.isEmpty() && r.isEmpty()) {
match = new StructuralMatch<>(null, null, null);
} else if (l.isEmpty()) {
match = new StructuralMatch<>(null, r.primitiveValue(), vmI(IssueSeverity.INFORMATION, "Added the item '"+r.primitiveValue()+"'", fhirType()+"."+name));
} else if (r.isEmpty()) {
match = new StructuralMatch<>(l.primitiveValue(), null, vmI(IssueSeverity.INFORMATION, "Removed the item '"+l.primitiveValue()+"'", fhirType()+"."+name));
} else if (!l.hasValue() && !r.hasValue()) {
match = new StructuralMatch<>(null, null, vmI(IssueSeverity.INFORMATION, "No Value", fhirType()+"."+name));
} else if (!l.hasValue()) {
match = new StructuralMatch<>(null, r.primitiveValue(), vmI(IssueSeverity.INFORMATION, "No Value on Left", fhirType()+"."+name));
} else if (!r.hasValue()) {
match = new StructuralMatch<>(l.primitiveValue(), null, vmI(IssueSeverity.INFORMATION, "No Value on Right", fhirType()+"."+name));
} else if (l.getValue().equals(r.getValue())) {
match = new StructuralMatch<>(l.primitiveValue(), r.primitiveValue(), null);
} else {
match = new StructuralMatch<>(l.primitiveValue(), r.primitiveValue(), vmI(level, "Values Differ", fhirType()+"."+name));
if (level != IssueSeverity.NULL) {
res.getMessages().add(new ValidationMessage(Source.ProfileComparer, IssueType.INFORMATIONAL, fhirType()+"."+name, "Values for "+name+" differ: '"+l.primitiveValue()+"' vs '"+r.primitiveValue()+"'", level));
}
}
comp.put(name, match);
}
protected abstract String fhirType();
public XhtmlNode renderMetadata(CanonicalResourceComparison<? extends CanonicalResource> comparison, String id, String prefix) throws FHIRException, IOException {
// columns: code, display (left|right), properties (left|right)
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(Utilities.path("[tmp]", "compare"), false);
TableModel model = gen.new TableModel(id, true);
model.setAlternating(true);
model.getTitles().add(gen.new Title(null, null, "Name", "Property Name", null, 100));
model.getTitles().add(gen.new Title(null, null, "Value", "The value of the property", null, 200, 2));
model.getTitles().add(gen.new Title(null, null, "Comments", "Additional information about the comparison", null, 200));
for (String n : sorted(comparison.getMetadata().keySet())) {
StructuralMatch<String> t = comparison.getMetadata().get(n);
addRow(gen, model.getRows(), n, t);
}
return gen.generate(model, prefix, 0, null);
}
private void addRow(HierarchicalTableGenerator gen, List<Row> rows, String name, StructuralMatch<String> t) {
Row r = gen.new Row();
rows.add(r);
r.getCells().add(gen.new Cell(null, null, name, null, null));
if (t.hasLeft() && t.hasRight()) {
if (t.getLeft().equals(t.getRight())) {
r.getCells().add(gen.new Cell(null, null, t.getLeft(), null, null).span(2));
} else {
r.getCells().add(gen.new Cell(null, null, t.getLeft(), null, null).setStyle("background-color: "+COLOR_DIFFERENT));
r.getCells().add(gen.new Cell(null, null, t.getRight(), null, null).setStyle("background-color: "+COLOR_DIFFERENT));
}
} else if (t.hasLeft()) {
r.setColor(COLOR_NO_ROW_RIGHT);
r.getCells().add(gen.new Cell(null, null, t.getLeft(), null, null));
r.getCells().add(missingCell(gen));
} else if (t.hasRight()) {
r.setColor(COLOR_NO_ROW_LEFT);
r.getCells().add(missingCell(gen));
r.getCells().add(gen.new Cell(null, null, t.getRight(), null, null));
} else {
r.getCells().add(missingCell(gen).span(2));
}
r.getCells().add(cellForMessages(gen, t.getMessages()));
int i = 0;
for (StructuralMatch<String> c : t.getChildren()) {
addRow(gen, r.getSubRows(), name+"["+i+"]", c);
i++;
}
}
private List<String> sorted(Set<String> keys) {
List<String> res = new ArrayList<>();
res.addAll(keys);
Collections.sort(res);
return res;
}
}

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