Convertor advisor 1 (#490)

* RELEASE THE ~~KRAKEN~~ KOTLIN

* doing some cleanup before going into more details

* renaming folder

* commit merge issues

* release notes
This commit is contained in:
Mark Iantorno 2021-05-06 09:18:11 -04:00 committed by GitHub
parent f329c4ac3f
commit 05cd371796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
55 changed files with 782 additions and 881 deletions

View File

@ -4,3 +4,5 @@
* Do not flag internal references as suspicious
* XMLParser allows passing a schema location
* Issue 484 https://github.com/hapifhir/org.hl7.fhir.core/issues/484
* Adding Kotlin to the build process
* random cleaning up in convertors

View File

@ -30,18 +30,9 @@ package org.hl7.fhir.convertors;
*/
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.TimeZone;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.loaders.R2016MayToR4Loader;
import org.hl7.fhir.convertors.loaders.R2ToR4Loader;
import org.hl7.fhir.convertors.loaders.R3ToR4Loader;
@ -67,26 +58,16 @@ import org.hl7.fhir.r4.utils.NPMPackageGenerator.Category;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager;
import org.hl7.fhir.utilities.npm.NpmPackage;
import org.hl7.fhir.utilities.npm.ToolsVersion;
import org.hl7.fhir.utilities.npm.PackageGenerator.PackageType;
import org.hl7.fhir.utilities.npm.ToolsVersion;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.*;
public class ExtensionDefinitionGenerator {
public class StringReplacement {
public String source;
public String replacement;
public StringReplacement(String source, String replacement) {
super();
this.source = source;
this.replacement = replacement;
}
}
public static void main(String[] args) throws IOException, FHIRException {
if (args.length == 0) {
System.out.println("Extension Generator");
@ -107,7 +88,7 @@ public class ExtensionDefinitionGenerator {
self.generate();
}
}
private static String getNamedParam(String[] args, String param) {
boolean found = false;
@ -118,7 +99,7 @@ public class ExtensionDefinitionGenerator {
found = true;
}
}
throw new Error("Unable to find parameter "+param);
throw new Error("Unable to find parameter " + param);
}
private FHIRVersion sourceVersion;
@ -128,7 +109,7 @@ public class ExtensionDefinitionGenerator {
private ElementDefinition extv;
private ProfileUtilities pu;
private BaseWorkerContext context;
public FHIRVersion getSourceVersion() {
return sourceVersion;
}
@ -152,7 +133,7 @@ public class ExtensionDefinitionGenerator {
public void setFilename(String filename) {
this.filename = filename;
}
private void generate() throws IOException, FHIRException {
List<StructureDefinition> definitions = loadSource();
@ -160,7 +141,7 @@ public class ExtensionDefinitionGenerator {
for (StructureDefinition ext : extensions)
pu.generateSnapshot(extbase, ext, ext.getUrl(), "http://hl7.org/fhir/R4", ext.getName());
savePackage(extensions);
}
private List<StructureDefinition> buildExtensions(List<StructureDefinition> definitions) throws DefinitionException, FHIRException {
@ -191,13 +172,13 @@ public class ExtensionDefinitionGenerator {
private StructureDefinition generateExtension(StructureDefinition type, ElementDefinition ed) throws DefinitionException, FHIRException {
StructureDefinition ext = new StructureDefinition();
ext.setId("extension-"+ed.getPath().replace("[x]", ""));
ext.setUrl("http://hl7.org/fhir/"+sourceVersion.toCode(3)+"/StructureDefinition/"+ext.getId());
ext.setId("extension-" + ed.getPath().replace("[x]", ""));
ext.setUrl("http://hl7.org/fhir/" + sourceVersion.toCode(3) + "/StructureDefinition/" + ext.getId());
if (ext.getId().length() > 64)
ext.setId(contract(ext.getId()));
ext.setVersion(sourceVersion.toCode());
ext.setName("ExtensionR"+sourceVersion.toCode(1)+ed.getPath().replace(".", ""));
ext.setTitle("Extension definition for R"+sourceVersion.toCode(1)+" element " +ed.getPath());
ext.setName("ExtensionR" + sourceVersion.toCode(1) + ed.getPath().replace(".", ""));
ext.setTitle("Extension definition for R" + sourceVersion.toCode(1) + " element " + ed.getPath());
ext.setStatus(PublicationStatus.ACTIVE);
ext.setDate(type.getDate());
ext.setFhirVersion(type.getFhirVersion());
@ -216,20 +197,20 @@ public class ExtensionDefinitionGenerator {
String n = tail(child.getPath());
if (!Utilities.existsInList(n, "id", "extension", "modifierExtension") && !hasNonValidType(child)) {
v = child.copy();
v.setId("Extension.extension:"+n);
v.setId("Extension.extension:" + n);
v.setPath("Extension.extension");
v.setSliceName(n);
v.getType().clear();
v.setIsSummaryElement(null);
v.addType().setCode("Extension").addProfile("http://hl7.org/fhir/"+sourceVersion.toCode(3)+"/StructureDefinition/extension-"+child.getPath().replace("[x]", ""));
v.addType().setCode("Extension").addProfile("http://hl7.org/fhir/" + sourceVersion.toCode(3) + "/StructureDefinition/extension-" + child.getPath().replace("[x]", ""));
ext.getDifferential().addElement(v);
}
}
ext.getDifferential().addElement(genElement("Extension.url").setFixed(new UriType(ext.getUrl())));
ext.getDifferential().addElement(genElement("Extension.value[x]").setMax("0"));
} else if (ed.hasType() && Utilities.existsInList(ed.getType().get(0).getCode(), "Resource", "Narrative")) {
return null;
return null;
} else if (ed.hasType() && !goesInExtension(ed.getType().get(0).getCode())) {
ElementDefinition v = ed.copy();
v.setPath("Extension");
@ -241,12 +222,12 @@ public class ExtensionDefinitionGenerator {
String n = tail(child.getPath());
if (!Utilities.existsInList(n, "id", "extension", "modifierExtension") && !hasNonValidType(child)) {
v = child.copy();
v.setId("Extension.extension:"+n);
v.setId("Extension.extension:" + n);
v.setPath("Extension.extension");
v.setSliceName(n);
v.getType().clear();
v.setIsSummaryElement(null);
v.addType().setCode("Extension").addProfile("http://hl7.org/fhir/"+sourceVersion.toCode(3)+"/StructureDefinition/extension-"+child.getPath().replace("[x]", ""));
v.addType().setCode("Extension").addProfile("http://hl7.org/fhir/" + sourceVersion.toCode(3) + "/StructureDefinition/extension-" + child.getPath().replace("[x]", ""));
ext.getDifferential().addElement(v);
}
}
@ -288,7 +269,7 @@ public class ExtensionDefinitionGenerator {
private String tail(String path) {
return path.substring(path.lastIndexOf(".")+1);
return path.substring(path.lastIndexOf(".") + 1);
}
@ -315,13 +296,13 @@ public class ExtensionDefinitionGenerator {
abbrevs.add(new StringReplacement("MedicationOrder", "MO"));
abbrevs.add(new StringReplacement("MedicationDispense", "MD"));
abbrevs.add(new StringReplacement("NutritionOrder", "NO"));
abbrevs.add(new StringReplacement("MedicinalProductAuthorization", "MPA"));
abbrevs.add(new StringReplacement("MedicinalProductContraindication", "MPC"));
abbrevs.add(new StringReplacement("MedicinalProductIngredient", "MPI"));
abbrevs.add(new StringReplacement("MedicinalProductPharmaceutical", "MPP"));
abbrevs.add(new StringReplacement("MedicinalProductAuthorization", "MPA"));
abbrevs.add(new StringReplacement("MedicinalProductContraindication", "MPC"));
abbrevs.add(new StringReplacement("MedicinalProductIngredient", "MPI"));
abbrevs.add(new StringReplacement("MedicinalProductPharmaceutical", "MPP"));
abbrevs.add(new StringReplacement("MedicinalProduct", "MP"));
abbrevs.add(new StringReplacement("ResearchElementDefinition", "RED"));
abbrevs.add(new StringReplacement("RiskEvidenceSynthesis", "RES"));
abbrevs.add(new StringReplacement("RiskEvidenceSynthesis", "RES"));
abbrevs.add(new StringReplacement("ObservationDefinition", "OD"));
abbrevs.add(new StringReplacement("SubstanceReferenceInformation", "SRI"));
abbrevs.add(new StringReplacement("SubstanceSourceMaterial", "SSM"));
@ -333,7 +314,7 @@ public class ExtensionDefinitionGenerator {
abbrevs.add(new StringReplacement("EligibilityResponse", "ERsp"));
abbrevs.add(new StringReplacement("ExpansionProfile", "EP"));
abbrevs.add(new StringReplacement("ImagingObjectSelection", "IOS"));
abbrevs.add(new StringReplacement("administrationGuidelines.patientCharacteristics", "ag.pc"));
abbrevs.add(new StringReplacement("manufacturingBusinessOperation", "mbo"));
@ -343,18 +324,18 @@ public class ExtensionDefinitionGenerator {
abbrevs.add(new StringReplacement("structuralRepresentation", "sr"));
abbrevs.add(new StringReplacement("compareToSourceExpression", "ctse"));
abbrevs.add(new StringReplacement("TestScript.setup.action.assert", "TestScript.s.a.a"));
for (StringReplacement s : abbrevs)
if (id.contains(s.source))
id = id.replace(s.source,s.replacement);
if (id.contains(s.getSource()))
id = id.replace(s.getSource(), s.getReplacement());
if (id.length() > 64)
throw new Error("Still too long: "+id);
throw new Error("Still too long: " + id);
return id;
}
private String timezone() {
TimeZone tz = TimeZone.getDefault();
TimeZone tz = TimeZone.getDefault();
Calendar cal = GregorianCalendar.getInstance(tz);
int offsetInMillis = tz.getOffset(cal.getTimeInMillis());
@ -366,15 +347,15 @@ public class ExtensionDefinitionGenerator {
private void savePackage(List<StructureDefinition> extensions) throws FHIRException, IOException {
JsonObject npm = new JsonObject();
npm.addProperty("name", "hl7.fhir.extensions.r"+sourceVersion.toCode(1));
npm.addProperty("name", "hl7.fhir.extensions.r" + sourceVersion.toCode(1));
npm.addProperty("version", targetVersion.toCode(3));
npm.addProperty("tools-version", ToolsVersion.TOOLS_VERSION);
npm.addProperty("type", PackageType.IG.getCode());
npm.addProperty("license", SPDXLicense.CC01_0.toCode());
npm.addProperty("canonical", "http://hl7.org/fhir/"+sourceVersion.toCode(3)+"/extensions/"+targetVersion.toCode(3));
npm.addProperty("url", "http://hl7.org/fhir/"+sourceVersion.toCode(3)+"/extensions/"+targetVersion.toCode(3));
npm.addProperty("title", "Extension Definitions for representing elements from "+sourceVersion.toCode()+" in "+targetVersion.toCode());
npm.addProperty("description", "Extension Definitions for representing elements from "+sourceVersion.toCode()+" in "+targetVersion.toCode()+" built "+new SimpleDateFormat("EEE, MMM d, yyyy HH:mmZ", new Locale("en", "US")).format(Calendar.getInstance().getTime())+timezone()+")");
npm.addProperty("canonical", "http://hl7.org/fhir/" + sourceVersion.toCode(3) + "/extensions/" + targetVersion.toCode(3));
npm.addProperty("url", "http://hl7.org/fhir/" + sourceVersion.toCode(3) + "/extensions/" + targetVersion.toCode(3));
npm.addProperty("title", "Extension Definitions for representing elements from " + sourceVersion.toCode() + " in " + targetVersion.toCode());
npm.addProperty("description", "Extension Definitions for representing elements from " + sourceVersion.toCode() + " in " + targetVersion.toCode() + " built " + new SimpleDateFormat("EEE, MMM d, yyyy HH:mmZ", new Locale("en", "US")).format(Calendar.getInstance().getTime()) + timezone() + ")");
JsonObject dep = new JsonObject();
npm.add("dependencies", dep);
dep.addProperty("hl7.fhir.core", targetVersion.toCode());
@ -386,8 +367,8 @@ public class ExtensionDefinitionGenerator {
md.addProperty("url", "http://hl7.org/fhir");
NPMPackageGenerator pi = new NPMPackageGenerator(filename, npm);
for (StructureDefinition sd : extensions) {
byte[] cnt = saveResource(sd, targetVersion);
pi.addFile(Category.RESOURCE, "StructureDefinition-"+sd.getId()+".json", cnt);
byte[] cnt = saveResource(sd, targetVersion);
pi.addFile(Category.RESOURCE, "StructureDefinition-" + sd.getId() + ".json", cnt);
}
pi.finish();
@ -406,15 +387,15 @@ public class ExtensionDefinitionGenerator {
context = SimpleWorkerContext.fromPackage(npm, new R2016MayToR4Loader());
else if (sourceVersion == FHIRVersion._1_0_2)
context = SimpleWorkerContext.fromPackage(npm, new R2ToR4Loader());
pu = new ProfileUtilities(context, null, null);
pu = new ProfileUtilities(context, null, null);
for (String fn : npm.listResources("StructureDefinition")) {
list.add((StructureDefinition) loadResource(npm.load("package", fn), sourceVersion));
}
for (StructureDefinition sd : list)
if (sd.getName().equals("Extension")) {
extbase = sd;
extv = extbase.getSnapshot().getElement().get(extbase.getSnapshot().getElement().size() -1);
}
extv = extbase.getSnapshot().getElement().get(extbase.getSnapshot().getElement().size() - 1);
}
return list;
}
@ -432,7 +413,7 @@ public class ExtensionDefinitionGenerator {
} else if (v == FHIRVersion._4_0_0) {
return new JsonParser().composeBytes(resource);
} else
throw new Error("Unsupported version "+v);
throw new Error("Unsupported version " + v);
}
private Resource loadResource(InputStream inputStream, FHIRVersion v) throws IOException, FHIRException {
@ -449,7 +430,7 @@ public class ExtensionDefinitionGenerator {
} else if (v == FHIRVersion._4_0_0) {
return new JsonParser().parse(inputStream);
} else
throw new Error("Unsupported version "+v);
throw new Error("Unsupported version " + v);
}
}

View File

@ -29,8 +29,6 @@ package org.hl7.fhir.convertors;
*/
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
@ -89,26 +87,6 @@ import org.hl7.fhir.utilities.TextFile;
*/
public class R2R3ConversionManager implements ITransformerServices {
public class TransformContext {
private SimpleWorkerContext context;
private String id;
public TransformContext(SimpleWorkerContext context, String id) {
this.context = context;
this.id = id;
}
public SimpleWorkerContext getContext() {
return context;
}
public String getId() {
return id;
}
}
private SimpleWorkerContext contextR2;
private SimpleWorkerContext contextR3;
private Map<String, StructureMap> library = new HashMap<String, StructureMap>();
@ -288,7 +266,7 @@ public class R2R3ConversionManager implements ITransformerServices {
throw new FHIRException("No Map Found from R2 to R3 for "+r2.fhirType());
String tn = smu3.getTargetType(map).getType();
Resource r3 = ResourceFactory.createResource(tn);
smu3.transform(new TransformContext(contextR3, r2.getChildValue("id")), r2, map, r3);
smu3.transform(new TransformContextR2R3(contextR3, r2.getChildValue("id")), r2, map, r3);
FormatUtilities.makeParser(format).setOutputStyle(style).compose(dest, r3);
}
@ -309,7 +287,7 @@ public class R2R3ConversionManager implements ITransformerServices {
@Override
public Base createType(Object appInfo, String name) throws FHIRException {
SimpleWorkerContext context = ((TransformContext) appInfo).getContext();
SimpleWorkerContext context = ((TransformContextR2R3) appInfo).getContext();
if (context == contextR2) {
StructureDefinition sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/DSTU2/StructureDefinition/"+name);
if (sd == null)
@ -324,7 +302,7 @@ public class R2R3ConversionManager implements ITransformerServices {
if (res instanceof Resource && (res.fhirType().equals("CodeSystem") || res.fhirType().equals("CareTeam")) || res.fhirType().equals("PractitionerRole")) {
Resource r = (Resource) res;
extras.add(r);
r.setId(((TransformContext) appInfo).getId()+"-"+extras.size()); //todo: get this into appinfo
r.setId(((TransformContextR2R3) appInfo).getId()+"-"+extras.size()); //todo: get this into appinfo
}
return res;
}

View File

@ -1,5 +1,6 @@
package org.hl7.fhir.convertors;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor30;
import org.hl7.fhir.convertors.conv10_30.*;
import org.hl7.fhir.dstu2.model.CodeableConcept;
import org.hl7.fhir.dstu2.utils.ToolingExtensions;
@ -7,7 +8,6 @@ import org.hl7.fhir.dstu3.conformance.ProfileUtilities;
import org.hl7.fhir.dstu3.model.CodeSystem;
import org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent;
import org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent;
import org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent;
import org.hl7.fhir.dstu3.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent;
import org.hl7.fhir.dstu3.terminologies.CodeSystemUtilities;
import org.hl7.fhir.exceptions.FHIRException;
@ -2351,19 +2351,6 @@ public class VersionConvertor_10_30 extends VersionConvertor_Base {
return tgt;
}
static public class SourceElementComponentWrapper {
public SourceElementComponentWrapper(SourceElementComponent comp, String source, String target) {
super();
this.source = source;
this.target = target;
this.comp = comp;
}
public String source;
public String target;
public org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent comp;
}
public static org.hl7.fhir.dstu3.model.UsageContext convertCodeableConceptToUsageContext(org.hl7.fhir.dstu2.model.CodeableConcept t) throws FHIRException {
org.hl7.fhir.dstu3.model.UsageContext result = new org.hl7.fhir.dstu3.model.UsageContext();
result.setValue(convertCodeableConcept(t));

View File

@ -1,5 +1,6 @@
package org.hl7.fhir.convertors;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.conv10_40.*;
import org.hl7.fhir.dstu2.model.CodeableConcept;
import org.hl7.fhir.dstu2.model.Parameters;
@ -13,7 +14,6 @@ import org.hl7.fhir.r4.model.CanonicalType;
import org.hl7.fhir.r4.model.CodeSystem;
import org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent;
import org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent;
import org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent;
import org.hl7.fhir.r4.model.Dosage.DosageDoseAndRateComponent;
import org.hl7.fhir.r4.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent;
import org.hl7.fhir.r4.model.Immunization.ImmunizationPerformerComponent;
@ -2451,19 +2451,6 @@ public class VersionConvertor_10_40 extends VersionConvertor_Base {
return tgt;
}
static public class SourceElementComponentWrapper {
public SourceElementComponentWrapper(SourceElementComponent comp, String source, String target) {
super();
this.source = source;
this.target = target;
this.comp = comp;
}
public String source;
public String target;
public org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent comp;
}
public static org.hl7.fhir.r4.model.UsageContext convertCodeableConceptToUsageContext(org.hl7.fhir.dstu2.model.CodeableConcept t) throws FHIRException {
org.hl7.fhir.r4.model.UsageContext result = new org.hl7.fhir.r4.model.UsageContext();
result.setValue(convertCodeableConcept(t));

View File

@ -1,5 +1,6 @@
package org.hl7.fhir.convertors;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.conv10_50.*;
import org.hl7.fhir.dstu2.model.CodeableConcept;
import org.hl7.fhir.dstu2.model.Parameters;
@ -13,7 +14,6 @@ import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent;
import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent;
import org.hl7.fhir.r5.model.CodeableReference;
import org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent;
import org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent;
import org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent;
import org.hl7.fhir.r5.model.Immunization.ImmunizationPerformerComponent;
@ -2474,19 +2474,6 @@ public class VersionConvertor_10_50 extends VersionConvertor_Base {
return tgt;
}
static public class SourceElementComponentWrapper {
public SourceElementComponentWrapper(SourceElementComponent comp, String source, String target) {
super();
this.source = source;
this.target = target;
this.comp = comp;
}
public String source;
public String target;
public org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent comp;
}
public static org.hl7.fhir.r5.model.UsageContext convertCodeableConceptToUsageContext(org.hl7.fhir.dstu2.model.CodeableConcept t) throws FHIRException {
org.hl7.fhir.r5.model.UsageContext result = new org.hl7.fhir.r5.model.UsageContext();
result.setValue(convertCodeableConcept(t));

View File

@ -2398,19 +2398,6 @@ public class VersionConvertor_14_30 extends VersionConvertor_Base {
return result;
}
static public class SourceElementComponentWrapper {
public SourceElementComponentWrapper(SourceElementComponent comp, String source, String target) {
super();
this.source = source;
this.target = target;
this.comp = comp;
}
public String source;
public String target;
public org.hl7.fhir.dstu3.model.ConceptMap.SourceElementComponent comp;
}
static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.SearchParamType> convertSearchParamType(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType> src) throws FHIRException {
if (src == null || src.isEmpty()) return null;
org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.SearchParamType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.SearchParamTypeEnumFactory());

View File

@ -2513,19 +2513,6 @@ public class VersionConvertor_14_40 extends VersionConvertor_Base {
return result;
}
static public class SourceElementComponentWrapper {
public SourceElementComponentWrapper(SourceElementComponent comp, String source, String target) {
super();
this.source = source;
this.target = target;
this.comp = comp;
}
public String source;
public String target;
public org.hl7.fhir.r4.model.ConceptMap.SourceElementComponent comp;
}
static public CanonicalType convertReferenceToCanonical(Reference src) throws FHIRException {
CanonicalType dst = new CanonicalType(src.getReference());
copyElement(src, dst);

View File

@ -2536,19 +2536,6 @@ public class VersionConvertor_14_50 extends VersionConvertor_Base {
return result;
}
static public class SourceElementComponentWrapper {
public SourceElementComponentWrapper(SourceElementComponent comp, String source, String target) {
super();
this.source = source;
this.target = target;
this.comp = comp;
}
public String source;
public String target;
public org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent comp;
}
static public CanonicalType convertReferenceToCanonical(Reference src) throws FHIRException {
CanonicalType dst = new CanonicalType(src.getReference());
copyElement(src, dst);

View File

@ -1,36 +1,33 @@
package org.hl7.fhir.convertors;
/*
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.
*/
package org.hl7.fhir.convertors.advisors;
/*
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.exceptions.FHIRException;
/**

View File

@ -1,36 +1,33 @@
package org.hl7.fhir.convertors;
/*
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.
*/
package org.hl7.fhir.convertors.advisors;
/*
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.exceptions.FHIRException;

View File

@ -1,5 +1,5 @@
package org.hl7.fhir.convertors;
package org.hl7.fhir.convertors.advisors;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
@ -28,47 +28,44 @@ package org.hl7.fhir.convertors;
POSSIBILITY OF SUCH DAMAGE.
*/
import org.hl7.fhir.exceptions.FHIRException;
public interface VersionConvertorAdvisor50 {
/**
* when processing a bundle, and converting from R5 to R2 whether to ignore an entry in the bundle.
* typically, return true when it's a resource that isn't handled, and you don't care.
*
* by default, always return false unless you know why not do this
*
* todo: why only R2? generalise this to all targets
*
* @param src
* @return
*/
boolean ignoreEntry(org.hl7.fhir.r5.model.Bundle.BundleEntryComponent src);
/**
* In R2, code systems are internal to value sets, but in subsequent versions, they
* exist as separate resources. The convertor will create the code system, and then
* call this routine for the host to decide what to do with it
*
* It can make it a contained resource, or it can put it somewhere else
*
* @param tgtcs
* @param source
* @throws FHIRException
*/
void handleCodeSystem(org.hl7.fhir.r5.model.CodeSystem tgtcs, org.hl7.fhir.r5.model.ValueSet source) throws FHIRException;
/**
* when converting from R5 to R2, and converting a value set, the convertor will need
* to find the code system a value set is referring to, so it can include it inline.
*
* This routine should find the actual resource
*
* @param src
* @return
* @throws FHIRException
*/
org.hl7.fhir.r5.model.CodeSystem getCodeSystem(org.hl7.fhir.r5.model.ValueSet src) throws FHIRException;
import org.hl7.fhir.exceptions.FHIRException;
public interface VersionConvertorAdvisor50 {
/**
* when processing a bundle, and converting from R5 to R2 whether to ignore an entry in the bundle.
* typically, return true when it's a resource that isn't handled, and you don't care.
*
* by default, always return false unless you know why not do this
*
* todo: why only R2? generalise this to all targets
*
* @param src
* @return
*/
boolean ignoreEntry(org.hl7.fhir.r5.model.Bundle.BundleEntryComponent src);
/**
* In R2, code systems are internal to value sets, but in subsequent versions, they
* exist as separate resources. The convertor will create the code system, and then
* call this routine for the host to decide what to do with it
*
* It can make it a contained resource, or it can put it somewhere else
*
* @param tgtcs
* @param source
* @throws FHIRException
*/
void handleCodeSystem(org.hl7.fhir.r5.model.CodeSystem tgtcs, org.hl7.fhir.r5.model.ValueSet source) throws FHIRException;
/**
* when converting from R5 to R2, and converting a value set, the convertor will need
* to find the code system a value set is referring to, so it can include it inline.
*
* This routine should find the actual resource
*
* @param src
* @return
* @throws FHIRException
*/
org.hl7.fhir.r5.model.CodeSystem getCodeSystem(org.hl7.fhir.r5.model.ValueSet src) throws FHIRException;
}

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_30;
import org.hl7.fhir.convertors.VersionConvertorAdvisor30;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor30;
import org.hl7.fhir.convertors.VersionConvertor_10_30;
import org.hl7.fhir.exceptions.FHIRException;

View File

@ -2,6 +2,8 @@ package org.hl7.fhir.convertors.conv10_30;
import java.util.ArrayList;
import java.util.List;
import org.hl7.fhir.convertors.SourceElementComponentWrapper;
import org.hl7.fhir.convertors.VersionConvertor_10_30;
import org.hl7.fhir.dstu3.model.ConceptMap;
import org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent;
@ -85,8 +87,8 @@ public class ConceptMap10_30 {
if (src.hasTarget())
tgt.setTarget(VersionConvertor_10_30.convertType(src.getTarget()));
for (org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent t : src.getElement()) {
List<VersionConvertor_10_30.SourceElementComponentWrapper> ws = convertSourceElementComponent(t);
for (VersionConvertor_10_30.SourceElementComponentWrapper w : ws) getGroup(tgt, w.source, w.target).addElement(w.comp);
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> ws = convertSourceElementComponent(t);
for (SourceElementComponentWrapper<ConceptMap.SourceElementComponent> w : ws) getGroup(tgt, w.getSource(), w.getTarget()).addElement(w.getComp());
}
return tgt;
}
@ -221,8 +223,8 @@ public class ConceptMap10_30 {
return tgt;
}
public static List<VersionConvertor_10_30.SourceElementComponentWrapper> convertSourceElementComponent(org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent src) throws FHIRException {
List<VersionConvertor_10_30.SourceElementComponentWrapper> res = new ArrayList<VersionConvertor_10_30.SourceElementComponentWrapper>();
public static List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> convertSourceElementComponent(org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent src) throws FHIRException {
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> res = new ArrayList<>();
if (src == null || src.isEmpty())
return res;
for (org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent t : src.getTarget()) {
@ -230,7 +232,7 @@ public class ConceptMap10_30 {
VersionConvertor_10_30.copyElement(src, tgt);
tgt.setCode(src.getCode());
tgt.addTarget(convertTargetElementComponent(t));
res.add(new VersionConvertor_10_30.SourceElementComponentWrapper(tgt, src.getCodeSystem(), t.getCodeSystem()));
res.add(new SourceElementComponentWrapper<>(tgt, src.getCodeSystem(), t.getCodeSystem()));
}
return res;
}

View File

@ -1,7 +1,7 @@
package org.hl7.fhir.convertors.conv10_30;
import java.util.List;
import org.hl7.fhir.convertors.VersionConvertorAdvisor30;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor30;
import org.hl7.fhir.convertors.VersionConvertor_10_30;
import org.hl7.fhir.dstu2.model.ValueSet;
import org.hl7.fhir.dstu3.model.CodeSystem;
@ -225,6 +225,7 @@ public class ValueSet10_30 {
tgt.setCompose(convertValueSetComposeComponent(src.getCompose()));
tgt.getCompose().setLockedDate(src.getLockedDate());
}
//TODO
if (src.hasCodeSystem() && advisor != null) {
org.hl7.fhir.dstu3.model.CodeSystem tgtcs = new org.hl7.fhir.dstu3.model.CodeSystem();
VersionConvertor_10_30.copyDomainResource(src, tgtcs);

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_40;
import org.hl7.fhir.convertors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.VersionConvertor_10_40;
import org.hl7.fhir.exceptions.FHIRException;

View File

@ -2,6 +2,8 @@ package org.hl7.fhir.convertors.conv10_40;
import java.util.ArrayList;
import java.util.List;
import org.hl7.fhir.convertors.SourceElementComponentWrapper;
import org.hl7.fhir.convertors.VersionConvertor_10_40;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.CanonicalType;
@ -47,8 +49,8 @@ public class ConceptMap10_40 {
r = VersionConvertor_10_40.convertType(src.getTarget());
tgt.setTarget(r instanceof org.hl7.fhir.r4.model.Reference ? new CanonicalType(((org.hl7.fhir.r4.model.Reference) r).getReference()) : r);
for (org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent t : src.getElement()) {
List<VersionConvertor_10_40.SourceElementComponentWrapper> ws = convertSourceElementComponent(t);
for (VersionConvertor_10_40.SourceElementComponentWrapper w : ws) getGroup(tgt, w.source, w.target).addElement(w.comp);
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> ws = convertSourceElementComponent(t);
for (SourceElementComponentWrapper<ConceptMap.SourceElementComponent> w : ws) getGroup(tgt, w.getSource(), w.getTarget()).addElement(w.getComp());
}
return tgt;
}
@ -222,8 +224,8 @@ public class ConceptMap10_40 {
return tgt;
}
public static List<VersionConvertor_10_40.SourceElementComponentWrapper> convertSourceElementComponent(org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent src) throws FHIRException {
List<VersionConvertor_10_40.SourceElementComponentWrapper> res = new ArrayList<VersionConvertor_10_40.SourceElementComponentWrapper>();
public static List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> convertSourceElementComponent(org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent src) throws FHIRException {
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> res = new ArrayList<>();
if (src == null || src.isEmpty())
return res;
for (org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent t : src.getTarget()) {
@ -231,7 +233,7 @@ public class ConceptMap10_40 {
VersionConvertor_10_40.copyElement(src, tgt);
tgt.setCode(src.getCode());
tgt.addTarget(convertTargetElementComponent(t));
res.add(new VersionConvertor_10_40.SourceElementComponentWrapper(tgt, src.getCodeSystem(), t.getCodeSystem()));
res.add(new SourceElementComponentWrapper<>(tgt, src.getCodeSystem(), t.getCodeSystem()));
}
return res;
}

View File

@ -1,7 +1,7 @@
package org.hl7.fhir.convertors.conv10_40;
import java.util.List;
import org.hl7.fhir.convertors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.VersionConvertor_10_40;
import org.hl7.fhir.dstu2.model.ValueSet;
import org.hl7.fhir.exceptions.FHIRException;

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_50;
import org.hl7.fhir.convertors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.VersionConvertor_10_50;
import org.hl7.fhir.exceptions.FHIRException;

View File

@ -2,6 +2,8 @@ package org.hl7.fhir.convertors.conv10_50;
import java.util.ArrayList;
import java.util.List;
import org.hl7.fhir.convertors.SourceElementComponentWrapper;
import org.hl7.fhir.convertors.VersionConvertorConstants;
import org.hl7.fhir.convertors.VersionConvertor_10_50;
import org.hl7.fhir.dstu2.model.Enumerations.ConceptMapEquivalence;
@ -53,8 +55,8 @@ public class ConceptMap10_50 {
r = VersionConvertor_10_50.convertType(src.getTarget());
tgt.setTarget(r instanceof org.hl7.fhir.r5.model.Reference ? new CanonicalType(((org.hl7.fhir.r5.model.Reference) r).getReference()) : r);
for (org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent t : src.getElement()) {
List<VersionConvertor_10_50.SourceElementComponentWrapper> ws = convertSourceElementComponent(t);
for (VersionConvertor_10_50.SourceElementComponentWrapper w : ws) getGroup(tgt, w.source, w.target).addElement(w.comp);
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> ws = convertSourceElementComponent(t);
for (SourceElementComponentWrapper<ConceptMap.SourceElementComponent> w : ws) getGroup(tgt, w.getSource(), w.getTarget()).addElement(w.getComp());
}
return tgt;
}
@ -236,8 +238,8 @@ public class ConceptMap10_50 {
return tgt;
}
public static List<VersionConvertor_10_50.SourceElementComponentWrapper> convertSourceElementComponent(org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent src) throws FHIRException {
List<VersionConvertor_10_50.SourceElementComponentWrapper> res = new ArrayList<VersionConvertor_10_50.SourceElementComponentWrapper>();
public static List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> convertSourceElementComponent(org.hl7.fhir.dstu2.model.ConceptMap.SourceElementComponent src) throws FHIRException {
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> res = new ArrayList<>();
if (src == null || src.isEmpty())
return res;
for (org.hl7.fhir.dstu2.model.ConceptMap.TargetElementComponent t : src.getTarget()) {
@ -249,7 +251,7 @@ public class ConceptMap10_50 {
} else {
tgt.addTarget(convertTargetElementComponent(t));
}
res.add(new VersionConvertor_10_50.SourceElementComponentWrapper(tgt, src.getCodeSystem(), t.getCodeSystem()));
res.add(new SourceElementComponentWrapper<>(tgt, src.getCodeSystem(), t.getCodeSystem()));
}
return res;
}

View File

@ -1,7 +1,7 @@
package org.hl7.fhir.convertors.conv10_50;
import java.util.List;
import org.hl7.fhir.convertors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.VersionConvertor_10_50;
import org.hl7.fhir.dstu2.model.ValueSet;
import org.hl7.fhir.exceptions.FHIRException;

View File

@ -2,6 +2,8 @@ package org.hl7.fhir.convertors.conv14_30;
import java.util.ArrayList;
import java.util.List;
import org.hl7.fhir.convertors.SourceElementComponentWrapper;
import org.hl7.fhir.convertors.VersionConvertor_14_30;
import org.hl7.fhir.dstu3.model.ConceptMap;
import org.hl7.fhir.dstu3.model.ConceptMap.ConceptMapGroupComponent;
@ -85,8 +87,8 @@ public class ConceptMap14_30 {
if (src.hasTarget())
tgt.setTarget(VersionConvertor_14_30.convertType(src.getTarget()));
for (org.hl7.fhir.dstu2016may.model.ConceptMap.SourceElementComponent t : src.getElement()) {
List<VersionConvertor_14_30.SourceElementComponentWrapper> ws = convertSourceElementComponent(t);
for (VersionConvertor_14_30.SourceElementComponentWrapper w : ws) getGroup(tgt, w.source, w.target).addElement(w.comp);
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> ws = convertSourceElementComponent(t);
for (SourceElementComponentWrapper<ConceptMap.SourceElementComponent> w : ws) getGroup(tgt, w.getSource(), w.getTarget()).addElement(w.getComp());
}
return tgt;
}
@ -234,8 +236,8 @@ public class ConceptMap14_30 {
return tgt;
}
public static List<VersionConvertor_14_30.SourceElementComponentWrapper> convertSourceElementComponent(org.hl7.fhir.dstu2016may.model.ConceptMap.SourceElementComponent src) throws FHIRException {
List<VersionConvertor_14_30.SourceElementComponentWrapper> res = new ArrayList<VersionConvertor_14_30.SourceElementComponentWrapper>();
public static List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> convertSourceElementComponent(org.hl7.fhir.dstu2016may.model.ConceptMap.SourceElementComponent src) throws FHIRException {
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> res = new ArrayList<>();
if (src == null || src.isEmpty())
return res;
for (org.hl7.fhir.dstu2016may.model.ConceptMap.TargetElementComponent t : src.getTarget()) {
@ -244,7 +246,7 @@ public class ConceptMap14_30 {
if (src.hasCode())
tgt.setCode(src.getCode());
tgt.addTarget(convertTargetElementComponent(t));
res.add(new VersionConvertor_14_30.SourceElementComponentWrapper(tgt, src.getSystem(), t.getSystem()));
res.add(new SourceElementComponentWrapper<>(tgt, src.getSystem(), t.getSystem()));
}
return res;
}

View File

@ -2,6 +2,8 @@ package org.hl7.fhir.convertors.conv14_40;
import java.util.ArrayList;
import java.util.List;
import org.hl7.fhir.convertors.SourceElementComponentWrapper;
import org.hl7.fhir.convertors.VersionConvertor_14_40;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.CanonicalType;
@ -47,8 +49,8 @@ public class ConceptMap14_40 {
tt = VersionConvertor_14_40.convertType(src.getTarget());
tgt.setTarget(tt instanceof org.hl7.fhir.r4.model.Reference ? new CanonicalType(((org.hl7.fhir.r4.model.Reference) tt).getReference()) : tt);
for (org.hl7.fhir.dstu2016may.model.ConceptMap.SourceElementComponent t : src.getElement()) {
List<VersionConvertor_14_40.SourceElementComponentWrapper> ws = convertSourceElementComponent(t);
for (VersionConvertor_14_40.SourceElementComponentWrapper w : ws) getGroup(tgt, w.source, w.target).addElement(w.comp);
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> ws = convertSourceElementComponent(t);
for (SourceElementComponentWrapper<ConceptMap.SourceElementComponent> w : ws) getGroup(tgt, w.getSource(), w.getTarget()).addElement(w.getComp());
}
return tgt;
}
@ -230,8 +232,8 @@ public class ConceptMap14_40 {
return tgt;
}
public static List<VersionConvertor_14_40.SourceElementComponentWrapper> convertSourceElementComponent(org.hl7.fhir.dstu2016may.model.ConceptMap.SourceElementComponent src) throws FHIRException {
List<VersionConvertor_14_40.SourceElementComponentWrapper> res = new ArrayList<VersionConvertor_14_40.SourceElementComponentWrapper>();
public static List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> convertSourceElementComponent(org.hl7.fhir.dstu2016may.model.ConceptMap.SourceElementComponent src) throws FHIRException {
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> res = new ArrayList<>();
if (src == null || src.isEmpty())
return res;
for (org.hl7.fhir.dstu2016may.model.ConceptMap.TargetElementComponent t : src.getTarget()) {
@ -240,7 +242,7 @@ public class ConceptMap14_40 {
if (src.hasCode())
tgt.setCode(src.getCode());
tgt.addTarget(convertTargetElementComponent(t));
res.add(new VersionConvertor_14_40.SourceElementComponentWrapper(tgt, src.getSystem(), t.getSystem()));
res.add(new SourceElementComponentWrapper<>(tgt, src.getSystem(), t.getSystem()));
}
return res;
}

View File

@ -2,6 +2,8 @@ package org.hl7.fhir.convertors.conv14_50;
import java.util.ArrayList;
import java.util.List;
import org.hl7.fhir.convertors.SourceElementComponentWrapper;
import org.hl7.fhir.convertors.VersionConvertorConstants;
import org.hl7.fhir.convertors.VersionConvertor_14_50;
import org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence;
@ -53,8 +55,8 @@ public class ConceptMap14_50 {
tt = VersionConvertor_14_50.convertType(src.getTarget());
tgt.setTarget(tt instanceof org.hl7.fhir.r5.model.Reference ? new CanonicalType(((org.hl7.fhir.r5.model.Reference) tt).getReference()) : tt);
for (org.hl7.fhir.dstu2016may.model.ConceptMap.SourceElementComponent t : src.getElement()) {
List<VersionConvertor_14_50.SourceElementComponentWrapper> ws = convertSourceElementComponent(t);
for (VersionConvertor_14_50.SourceElementComponentWrapper w : ws) getGroup(tgt, w.source, w.target).addElement(w.comp);
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> ws = convertSourceElementComponent(t);
for (SourceElementComponentWrapper<ConceptMap.SourceElementComponent> w : ws) getGroup(tgt, w.getSource(), w.getTarget()).addElement(w.getComp());
}
return tgt;
}
@ -228,8 +230,8 @@ public class ConceptMap14_50 {
return tgt;
}
public static List<VersionConvertor_14_50.SourceElementComponentWrapper> convertSourceElementComponent(org.hl7.fhir.dstu2016may.model.ConceptMap.SourceElementComponent src) throws FHIRException {
List<VersionConvertor_14_50.SourceElementComponentWrapper> res = new ArrayList<VersionConvertor_14_50.SourceElementComponentWrapper>();
public static List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> convertSourceElementComponent(org.hl7.fhir.dstu2016may.model.ConceptMap.SourceElementComponent src) throws FHIRException {
List<SourceElementComponentWrapper<ConceptMap.SourceElementComponent>> res = new ArrayList<>();
if (src == null || src.isEmpty())
return res;
for (org.hl7.fhir.dstu2016may.model.ConceptMap.TargetElementComponent t : src.getTarget()) {
@ -242,7 +244,7 @@ public class ConceptMap14_50 {
} else {
tgt.addTarget(convertTargetElementComponent(t));
}
res.add(new VersionConvertor_14_50.SourceElementComponentWrapper(tgt, src.getSystem(), t.getSystem()));
res.add(new SourceElementComponentWrapper<>(tgt, src.getSystem(), t.getSystem()));
}
return res;
}

View File

@ -37,7 +37,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.hl7.fhir.convertors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.VersionConvertor_14_40;
import org.hl7.fhir.dstu2016may.formats.JsonParser;
import org.hl7.fhir.dstu2016may.formats.XmlParser;

View File

@ -37,14 +37,13 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.hl7.fhir.convertors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.VersionConvertor_14_50;
import org.hl7.fhir.dstu2016may.formats.JsonParser;
import org.hl7.fhir.dstu2016may.formats.XmlParser;
import org.hl7.fhir.dstu2016may.model.Resource;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.conformance.ProfileUtilities;
import org.hl7.fhir.r5.context.IWorkerContext.IContextResourceLoader;
import org.hl7.fhir.r5.model.Bundle;
import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r5.model.Bundle.BundleType;
@ -55,12 +54,9 @@ import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.ElementDefinition;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.utilities.npm.NpmPackage;
import org.hl7.fhir.r5.model.UriType;
import org.hl7.fhir.r5.model.ValueSet;
import com.google.gson.JsonSyntaxException;
public class R2016MayToR5Loader extends BaseLoaderR5 implements VersionConvertorAdvisor50 {
public R2016MayToR5Loader(String[] types, ILoaderKnowledgeProvider lkp) {

View File

@ -36,13 +36,11 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.hl7.fhir.convertors.VersionConvertorAdvisor30;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor30;
import org.hl7.fhir.convertors.VersionConvertor_10_30;
import org.hl7.fhir.convertors.loaders.BaseLoaderR5.NullLoaderKnowledgeProvider;
import org.hl7.fhir.dstu2.formats.JsonParser;
import org.hl7.fhir.dstu2.formats.XmlParser;
import org.hl7.fhir.dstu2.model.Resource;
import org.hl7.fhir.dstu3.context.SimpleWorkerContext.IContextResourceLoader;
import org.hl7.fhir.dstu3.model.Bundle;
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.dstu3.model.Bundle.BundleType;

View File

@ -37,14 +37,12 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.hl7.fhir.convertors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.VersionConvertor_10_40;
import org.hl7.fhir.convertors.loaders.BaseLoaderR5.NullLoaderKnowledgeProvider;
import org.hl7.fhir.dstu2.formats.JsonParser;
import org.hl7.fhir.dstu2.formats.XmlParser;
import org.hl7.fhir.dstu2.model.Resource;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.context.SimpleWorkerContext.IContextResourceLoader;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r4.model.Bundle.BundleType;

View File

@ -37,10 +37,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.hl7.fhir.convertors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.VersionConvertor_10_50;
import org.hl7.fhir.convertors.loaders.BaseLoaderR5.ILoaderKnowledgeProvider;
import org.hl7.fhir.convertors.loaders.BaseLoaderR5.NullLoaderKnowledgeProvider;
import org.hl7.fhir.dstu2.formats.JsonParser;
import org.hl7.fhir.dstu2.formats.XmlParser;
import org.hl7.fhir.dstu2.model.Resource;
@ -56,12 +54,9 @@ import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.ElementDefinition;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.utilities.npm.NpmPackage;
import org.hl7.fhir.r5.model.UriType;
import org.hl7.fhir.r5.model.ValueSet;
import com.google.gson.JsonSyntaxException;
public class R2ToR5Loader extends BaseLoaderR5 implements IContextResourceLoader, VersionConvertorAdvisor50 {
public R2ToR5Loader(String[] types, ILoaderKnowledgeProvider lkp) {

View File

@ -37,9 +37,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.hl7.fhir.convertors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.VersionConvertor_30_40;
import org.hl7.fhir.convertors.loaders.BaseLoaderR5.NullLoaderKnowledgeProvider;
import org.hl7.fhir.dstu3.formats.JsonParser;
import org.hl7.fhir.dstu3.formats.XmlParser;
import org.hl7.fhir.dstu3.model.Resource;

View File

@ -37,10 +37,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.hl7.fhir.convertors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.VersionConvertor_30_50;
import org.hl7.fhir.convertors.loaders.BaseLoaderR5.ILoaderKnowledgeProvider;
import org.hl7.fhir.convertors.loaders.BaseLoaderR5.NullLoaderKnowledgeProvider;
import org.hl7.fhir.dstu3.formats.JsonParser;
import org.hl7.fhir.dstu3.formats.XmlParser;
import org.hl7.fhir.dstu3.model.Resource;
@ -56,12 +54,9 @@ import org.hl7.fhir.r5.model.ElementDefinition;
import org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.utilities.npm.NpmPackage;
import org.hl7.fhir.r5.model.UriType;
import org.hl7.fhir.r5.model.ValueSet;
import com.google.gson.JsonSyntaxException;
public class R3ToR5Loader extends BaseLoaderR5 implements IContextResourceLoader, VersionConvertorAdvisor50 {
public R3ToR5Loader(String[] types, ILoaderKnowledgeProvider lkp) {

View File

@ -37,10 +37,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.hl7.fhir.convertors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.VersionConvertor_40_50;
import org.hl7.fhir.convertors.loaders.BaseLoaderR5.ILoaderKnowledgeProvider;
import org.hl7.fhir.convertors.loaders.BaseLoaderR5.NullLoaderKnowledgeProvider;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.formats.JsonParser;
import org.hl7.fhir.r4.formats.XmlParser;
@ -56,12 +54,9 @@ import org.hl7.fhir.r5.model.ElementDefinition;
import org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.utilities.npm.NpmPackage;
import org.hl7.fhir.r5.model.UriType;
import org.hl7.fhir.r5.model.ValueSet;
import com.google.gson.JsonSyntaxException;
public class R4ToR5Loader extends BaseLoaderR5 implements IContextResourceLoader, VersionConvertorAdvisor50 {
public R4ToR5Loader(String[] types, ILoaderKnowledgeProvider lkp) {

View File

@ -37,14 +37,11 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.hl7.fhir.convertors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.loaders.BaseLoaderR5.ILoaderKnowledgeProvider;
import org.hl7.fhir.convertors.loaders.BaseLoaderR5.NullLoaderKnowledgeProvider;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.formats.JsonParser;
import org.hl7.fhir.r5.formats.XmlParser;
import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.context.IWorkerContext.IContextResourceLoader;
import org.hl7.fhir.r5.model.Bundle;
import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r5.model.Bundle.BundleType;
@ -55,12 +52,9 @@ import org.hl7.fhir.r5.model.ElementDefinition;
import org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.utilities.npm.NpmPackage;
import org.hl7.fhir.r5.model.UriType;
import org.hl7.fhir.r5.model.ValueSet;
import com.google.gson.JsonSyntaxException;
public class R5ToR5Loader extends BaseLoaderR5 implements VersionConvertorAdvisor50 {
public R5ToR5Loader(String[] types, ILoaderKnowledgeProvider lkp) {

View File

@ -1,33 +1,33 @@
package org.hl7.fhir.convertors.misc;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
@ -38,7 +38,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Date;
import org.hl7.fhir.convertors.VersionConvertorAdvisor30;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor30;
import org.hl7.fhir.convertors.VersionConvertor_10_30;
import org.hl7.fhir.dstu2.model.Resource;
import org.hl7.fhir.dstu3.formats.IParser.OutputStyle;

View File

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

View File

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

View File

@ -1,5 +1,20 @@
package org.hl7.fhir.convertors.misc;
import com.google.common.base.Charsets;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream;
import org.hl7.fhir.convertors.*;
import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.json.JSONUtil;
import org.hl7.fhir.utilities.json.JsonTrackingParser;
import org.hl7.fhir.utilities.npm.NpmPackageIndexBuilder;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
@ -11,57 +26,8 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream;
import org.hl7.fhir.convertors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.VersionConvertor_10_30;
import org.hl7.fhir.convertors.VersionConvertor_10_40;
import org.hl7.fhir.convertors.VersionConvertor_10_50;
import org.hl7.fhir.convertors.VersionConvertor_14_30;
import org.hl7.fhir.convertors.VersionConvertor_14_40;
import org.hl7.fhir.convertors.VersionConvertor_14_50;
import org.hl7.fhir.convertors.VersionConvertor_30_40;
import org.hl7.fhir.convertors.VersionConvertor_30_50;
import org.hl7.fhir.convertors.VersionConvertor_40_50;
import org.hl7.fhir.dstu2.model.Resource;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent;
import org.hl7.fhir.r4.model.CodeSystem;
import org.hl7.fhir.r4.model.ValueSet;
import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.json.JSONUtil;
import org.hl7.fhir.utilities.json.JsonTrackingParser;
import org.hl7.fhir.utilities.npm.NpmPackageIndexBuilder;
import com.google.common.base.Charsets;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
public class NpmPackageVersionConverter {
private class PR2Handler implements VersionConvertorAdvisor40 {
@Override
public boolean ignoreEntry(BundleEntryComponent src) {
return false;
}
@Override
public void handleCodeSystem(CodeSystem tgtcs, ValueSet source) throws FHIRException {
throw new Error("Not done yet");
}
@Override
public CodeSystem getCodeSystem(ValueSet src) throws FHIRException {
throw new Error("Not done yet");
}
}
private static final int BUFFER_SIZE = 1024;
private String source;
@ -70,7 +36,7 @@ public class NpmPackageVersionConverter {
private String currentVersion;
private String vCode;
private List<String> errors = new ArrayList<>();
public static void main(String[] args) throws IOException {
NpmPackageVersionConverter self = new NpmPackageVersionConverter(args[0], args[1], args[2]);
self.execute();
@ -87,9 +53,8 @@ public class NpmPackageVersionConverter {
this.vCode = version;
this.version = VersionUtilities.versionFromCode(version);
}
public List<String> getErrors() {
return errors;
}
@ -99,10 +64,10 @@ public class NpmPackageVersionConverter {
try {
gzipIn = new GzipCompressorInputStream(new FileInputStream(source));
} catch (Exception e) {
throw new IOException("Error reading "+source+": "+e.getMessage(), e);
throw new IOException("Error reading " + source + ": " + e.getMessage(), e);
}
Map<String, byte[]> content = new HashMap<>();
try (TarArchiveInputStream tarIn = new TarArchiveInputStream(gzipIn)) {
TarArchiveEntry entry;
@ -122,7 +87,7 @@ public class NpmPackageVersionConverter {
}
}
}
Map<String, byte[]> output = new HashMap<>();
output.put("package/package.json", convertPackage(content.get("package/package.json")));
@ -141,7 +106,7 @@ public class NpmPackageVersionConverter {
}
}
}
TarArchiveOutputStream tar;
ByteArrayOutputStream OutputStream;
BufferedOutputStream bufferedOutputStream;
@ -156,13 +121,13 @@ public class NpmPackageVersionConverter {
Map<String, NpmPackageIndexBuilder> indexers = new HashMap<>();
for (Entry<String, byte[]> e : output.entrySet()) {
String n = e.getKey().substring(0, e.getKey().lastIndexOf("/"));
String s = e.getKey().substring(n.length()+1);
String s = e.getKey().substring(n.length() + 1);
byte[] b = e.getValue();
NpmPackageIndexBuilder indexer = indexers.get(n);
if (indexer == null) {
indexer = new NpmPackageIndexBuilder();
indexer.start();
indexers.put(n, indexer);
indexers.put(n, indexer);
}
indexer.seeFile(s, b);
if (!s.equals(".index.json") && !s.equals("package.json")) {
@ -175,13 +140,13 @@ public class NpmPackageVersionConverter {
}
for (Entry<String, NpmPackageIndexBuilder> e : indexers.entrySet()) {
byte[] cnt = e.getValue().build().getBytes(Charset.forName("UTF-8"));
TarArchiveEntry entry = new TarArchiveEntry(e.getKey()+"/.index.json");
TarArchiveEntry entry = new TarArchiveEntry(e.getKey() + "/.index.json");
entry.setSize(cnt.length);
tar.putArchiveEntry(entry);
tar.write(cnt);
tar.closeArchiveEntry();
}
byte[] cnt = output.get("package/package.json");
TarArchiveEntry entry = new TarArchiveEntry("package/package.json");
entry.setSize(cnt.length);
@ -203,7 +168,7 @@ public class NpmPackageVersionConverter {
currentVersion = json.getAsJsonArray("fhirVersions").get(0).getAsString();
String name = JSONUtil.str(json, "name");
json.remove("name");
json.addProperty("name", name+"."+vCode);
json.addProperty("name", name + "." + vCode);
json.remove("fhirVersions");
json.remove("dependencies");
JsonArray fv = new JsonArray();
@ -213,7 +178,7 @@ public class NpmPackageVersionConverter {
json.add("dependencies", dep);
dep.addProperty(VersionUtilities.packageForVersion(version), version);
return JsonTrackingParser.write(json).getBytes(Charsets.UTF_8);
}
}
private byte[] convertResource(String n, byte[] cnt) {
try {
@ -226,9 +191,9 @@ public class NpmPackageVersionConverter {
} else if (VersionUtilities.isR3Ver(version)) {
return new org.hl7.fhir.dstu3.formats.JsonParser().composeBytes(VersionConvertor_10_30.convertResource(res));
} else if (VersionUtilities.isR4Ver(version)) {
return new org.hl7.fhir.r4.formats.JsonParser().composeBytes(VersionConvertor_10_40.convertResource(res));
return new org.hl7.fhir.r4.formats.JsonParser().composeBytes(VersionConvertor_10_40.convertResource(res));
} else if (VersionUtilities.isR5Ver(version)) {
return new org.hl7.fhir.r5.formats.JsonParser().composeBytes(VersionConvertor_10_50.convertResource(res));
return new org.hl7.fhir.r5.formats.JsonParser().composeBytes(VersionConvertor_10_50.convertResource(res));
}
} else if (VersionUtilities.isR2BVer(currentVersion)) {
org.hl7.fhir.dstu2016may.model.Resource res = new org.hl7.fhir.dstu2016may.formats.JsonParser().parse(cnt);
@ -241,7 +206,7 @@ public class NpmPackageVersionConverter {
} else if (VersionUtilities.isR4Ver(version)) {
return new org.hl7.fhir.r4.formats.JsonParser().composeBytes(VersionConvertor_14_40.convertResource(res));
} else if (VersionUtilities.isR5Ver(version)) {
return new org.hl7.fhir.r5.formats.JsonParser().composeBytes(VersionConvertor_14_50.convertResource(res));
return new org.hl7.fhir.r5.formats.JsonParser().composeBytes(VersionConvertor_14_50.convertResource(res));
}
} else if (VersionUtilities.isR3Ver(currentVersion)) {
org.hl7.fhir.dstu3.model.Resource res = new org.hl7.fhir.dstu3.formats.JsonParser().parse(cnt);
@ -265,7 +230,7 @@ public class NpmPackageVersionConverter {
} else if (VersionUtilities.isR3Ver(version)) {
return new org.hl7.fhir.dstu3.formats.JsonParser().composeBytes(VersionConvertor_30_40.convertResource(res, true));
} else if (VersionUtilities.isR4Ver(version)) {
return new org.hl7.fhir.r4.formats.JsonParser().composeBytes(res);
return new org.hl7.fhir.r4.formats.JsonParser().composeBytes(res);
} else if (VersionUtilities.isR5Ver(version)) {
return new org.hl7.fhir.r5.formats.JsonParser().composeBytes(VersionConvertor_40_50.convertResource(res));
}
@ -280,13 +245,13 @@ public class NpmPackageVersionConverter {
} else if (VersionUtilities.isR4Ver(version)) {
return new org.hl7.fhir.r4.formats.JsonParser().composeBytes(VersionConvertor_40_50.convertResource(res));
} else if (VersionUtilities.isR5Ver(version)) {
return new org.hl7.fhir.r5.formats.JsonParser().composeBytes(res);
return new org.hl7.fhir.r5.formats.JsonParser().composeBytes(res);
}
}
throw new Error("Unknown version "+currentVersion+" -> "+version);
}
throw new Error("Unknown version " + currentVersion + " -> " + version);
} catch (Exception ex) {
ex.printStackTrace();
errors.add("Error converting "+n+": "+ex.getMessage());
errors.add("Error converting " + n + ": " + ex.getMessage());
return null;
}
}

View File

@ -0,0 +1,26 @@
package org.hl7.fhir.convertors.misc;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor40;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.CodeSystem;
import org.hl7.fhir.r4.model.ValueSet;
class PR2Handler implements VersionConvertorAdvisor40 {
@Override
public boolean ignoreEntry(Bundle.BundleEntryComponent src) {
return false;
}
@Override
public void handleCodeSystem(CodeSystem tgtcs, ValueSet source) throws FHIRException {
throw new Error("Not done yet");
}
@Override
public CodeSystem getCodeSystem(ValueSet src) throws FHIRException {
throw new Error("Not done yet");
}
}

View File

@ -0,0 +1,7 @@
package org.hl7.fhir.convertors
data class SourceElementComponentWrapper<A>(
var comp: A,
var source: String,
var target: String
)

View File

@ -0,0 +1,14 @@
package org.hl7.fhir.convertors
import org.hl7.fhir.r5.model.StructureDefinition
import org.hl7.fhir.r5.model.ValueSet
import java.util.HashMap
data class SpecPackage (
var valuesets: Map<String, ValueSet> = HashMap(),
var expansions: Map<String, ValueSet> = HashMap(),
var types: Map<String, StructureDefinition> = HashMap(),
var resources: Map<String, StructureDefinition> = HashMap(),
var extensions: Map<String, StructureDefinition> = HashMap(),
var profiles: Map<String, StructureDefinition> = HashMap()
)

View File

@ -0,0 +1,3 @@
package org.hl7.fhir.convertors
data class StringReplacement(var source: String, var replacement: String)

View File

@ -0,0 +1,6 @@
package org.hl7.fhir.convertors
import org.hl7.fhir.dstu3.context.SimpleWorkerContext
data class TransformContextR2R3(val context: SimpleWorkerContext, val id: String)

View File

@ -0,0 +1,5 @@
package org.hl7.fhir.convertors
interface TypeLinkProvider {
fun getLink(typeName: String?): String?
}

View File

@ -1,18 +1,13 @@
package org.hl7.fhir.convertors.conv10_30;
import org.hl7.fhir.convertors.VersionConvertorAdvisor30;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor30;
import org.hl7.fhir.convertors.VersionConvertor_10_30;
import org.hl7.fhir.convertors.loaders.R2ToR3Loader;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import java.io.IOException;
import java.io.InputStream;
import java.util.stream.Stream;
public class AdministrativeGender10_30Test {

View File

@ -1,11 +1,10 @@
package org.hl7.fhir.convertors.conv10_30;
import org.hl7.fhir.convertors.VersionConvertorAdvisor30;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor30;
import org.hl7.fhir.convertors.VersionConvertor_10_30;
import org.hl7.fhir.convertors.loaders.R2ToR3Loader;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

View File

@ -1,11 +1,10 @@
package org.hl7.fhir.convertors.conv10_40;
import org.hl7.fhir.convertors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.VersionConvertor_10_40;
import org.hl7.fhir.convertors.misc.IGR2ConvertorAdvisor;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_40;
import org.hl7.fhir.convertors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.VersionConvertor_10_40;
import org.hl7.fhir.convertors.misc.IGR2ConvertorAdvisor;
import org.junit.jupiter.api.Assertions;

View File

@ -1,11 +1,10 @@
package org.hl7.fhir.convertors.conv10_40;
import org.hl7.fhir.convertors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.VersionConvertor_10_40;
import org.hl7.fhir.convertors.misc.IGR2ConvertorAdvisor;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_40;
import org.hl7.fhir.convertors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.VersionConvertor_10_40;
import org.hl7.fhir.convertors.misc.IGR2ConvertorAdvisor;
import org.junit.jupiter.api.Assertions;

View File

@ -1,6 +1,6 @@
package org.hl7.fhir.convertors.conv10_40;
import org.hl7.fhir.convertors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor40;
import org.hl7.fhir.convertors.VersionConvertor_10_40;
import org.hl7.fhir.convertors.misc.IGR2ConvertorAdvisor;
import org.junit.jupiter.api.Assertions;

View File

@ -3,6 +3,7 @@ package org.hl7.fhir.validation;
import com.google.gson.JsonObject;
import lombok.Getter;
import org.hl7.fhir.convertors.*;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.context.SimpleWorkerContext;
import org.hl7.fhir.r5.elementmodel.Manager;

View File

@ -34,7 +34,7 @@ package org.hl7.fhir.validation;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import org.hl7.fhir.convertors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.VersionConvertor_10_50;
import org.hl7.fhir.convertors.VersionConvertor_14_50;
import org.hl7.fhir.convertors.VersionConvertor_30_50;

View File

@ -1,10 +1,10 @@
package org.hl7.fhir.validation;
import com.google.gson.JsonObject;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hl7.fhir.convertors.*;
import org.hl7.fhir.convertors.advisors.VersionConvertorAdvisor50;
import org.hl7.fhir.convertors.txClient.TerminologyClientFactory;
import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.exceptions.FHIRException;
@ -30,20 +30,16 @@ import org.hl7.fhir.r5.utils.ToolingExtensions;
import org.hl7.fhir.r5.utils.structuremap.StructureMapUtilities;
import org.hl7.fhir.utilities.TimeTracker;
import org.hl7.fhir.utilities.*;
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.ToolsVersion;
import org.hl7.fhir.utilities.validation.ValidationMessage;
import org.hl7.fhir.utilities.xhtml.XhtmlComposer;
import org.hl7.fhir.utilities.xml.XMLUtil;
import org.hl7.fhir.validation.BaseValidator.ValidationControl;
import org.hl7.fhir.validation.cli.services.IPackageInstaller;
import org.hl7.fhir.validation.cli.utils.*;
import org.hl7.fhir.validation.instance.InstanceValidator;
import org.hl7.fhir.validation.instance.utils.ValidatorHostContext;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
import java.io.*;

89
pom.xml
View File

@ -25,6 +25,7 @@
<maven_surefire_version>3.0.0-M4</maven_surefire_version>
<jacoco_version>0.8.5</jacoco_version>
<info_cqframework_version>1.5.1</info_cqframework_version>
<kotlin.version>1.5.0</kotlin.version>
</properties>
<name>HL7 Core Artifacts</name>
@ -81,6 +82,17 @@
<version>1.2.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
@ -156,6 +168,35 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>1.5.0</version>
<executions>
<execution>
<id>compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
<sourceDir>${project.basedir}/src/main/java</sourceDir>
</sourceDirs>
</configuration>
</execution>
<execution>
<id>test-compile</id>
<goals> <goal>test-compile</goal> </goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
<sourceDir>${project.basedir}/src/test/java</sourceDir>
</sourceDirs>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@ -172,8 +213,28 @@
<maxmem>4000m</maxmem>
<debug>true</debug>
</configuration>
<dependencies>
</dependencies>
<executions>
<!-- Replacing default-compile as it is treated specially by maven -->
<execution>
<id>default-compile</id>
<phase>none</phase>
</execution>
<!-- Replacing default-testCompile as it is treated specially by maven -->
<execution>
<id>default-testCompile</id>
<phase>none</phase>
</execution>
<execution>
<id>java-compile</id>
<phase>compile</phase>
<goals> <goal>compile</goal> </goals>
</execution>
<execution>
<id>java-test-compile</id>
<phase>test-compile</phase>
<goals> <goal>testCompile</goal> </goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
@ -344,6 +405,30 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<jvmTarget>1.8</jvmTarget>
</configuration>
</plugin>
</plugins>
</build>