diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/PackageMaintainer.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/PackageMaintainer.java index 215fc0dd4..2ff36eac2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/PackageMaintainer.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/PackageMaintainer.java @@ -1,80 +1,101 @@ -package org.hl7.fhir.convertors.misc; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.utilities.TextFile; -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.utilities.json.JsonTrackingParser; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonObject; - -public class PackageMaintainer { - - - private static final String PATH = "C:\\work\\org.hl7.fhir\\packages\\core"; - - public static void main(String[] args) throws IOException { - new PackageMaintainer().check("r4"); - new PackageMaintainer().check("r2"); - new PackageMaintainer().check("r3"); - new PackageMaintainer().check("r2b"); - } - - private void check(String ver) throws IOException { - System.out.println("Check "+ver); - List allIds = listResources(Utilities.path(PATH, "hl7.fhir."+ver+".examples", "package")); - List coreIds = listResources(Utilities.path(PATH, "hl7.fhir."+ver+".core", "package")); - for (String s : coreIds) { - if (!allIds.contains(s)) { - System.out.println("Core contains "+s+" but allIds doesn't"); - } - } - for (String s : allIds) { - if (!coreIds.contains(s)) { - String c = s.substring(0, s.indexOf("-")); - if (Utilities.existsInList(c, "CodeSystem", "ValueSet", "ConceptMap", "StructureDefinition", "StructureMap", "NamingSystem", "SearchParameter", "OperationDefinition", "CapabilityStatement", "Conformance")) - System.out.println("Examples contains "+s+" but core doesn't"); - } - } - strip(new File(Utilities.path(PATH, "hl7.fhir."+ver+".core", "package"))); - strip(new File(Utilities.path(PATH, "hl7.fhir."+ver+".expansions", "package"))); - if (!ver.equals("r2b")) - strip(new File(Utilities.path(PATH, "hl7.fhir."+ver+".elements", "package"))); - } - - - private List listResources(String dir) { - File folder = new File(dir); - List res = new ArrayList<>(); - for (String fn : folder.list()) { - if (fn.endsWith(".json") && fn.contains("-")) { - String s = fn; - s = s.substring(0, s.indexOf(".")); - res.add(s); - } - } - return res; - } - - private void strip(File folder) throws IOException { - for (File f : folder.listFiles()) { - if (f.isDirectory()) - strip(f); - else if (f.getName().endsWith(".json")) { - JsonObject json = JsonTrackingParser.parseJson(f); - if (json.has("resourceType") && json.has("text")) { - json.remove("text"); - Gson gson = new GsonBuilder().create(); - String src = gson.toJson(json); - TextFile.stringToFile(src, f.getAbsolutePath()); - } - } - } - } - -} +package org.hl7.fhir.convertors.misc; + +/*- + * #%L + * org.hl7.fhir.convertors + * %% + * Copyright (C) 2014 - 2019 Health Level 7 + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.hl7.fhir.utilities.TextFile; +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.utilities.json.JsonTrackingParser; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; + +public class PackageMaintainer { + + + private static final String PATH = "C:\\work\\org.hl7.fhir\\packages\\core"; + + public static void main(String[] args) throws IOException { + new PackageMaintainer().check("r4"); + new PackageMaintainer().check("r2"); + new PackageMaintainer().check("r3"); + new PackageMaintainer().check("r2b"); + } + + private void check(String ver) throws IOException { + System.out.println("Check "+ver); + List allIds = listResources(Utilities.path(PATH, "hl7.fhir."+ver+".examples", "package")); + List coreIds = listResources(Utilities.path(PATH, "hl7.fhir."+ver+".core", "package")); + for (String s : coreIds) { + if (!allIds.contains(s)) { + System.out.println("Core contains "+s+" but allIds doesn't"); + } + } + for (String s : allIds) { + if (!coreIds.contains(s)) { + String c = s.substring(0, s.indexOf("-")); + if (Utilities.existsInList(c, "CodeSystem", "ValueSet", "ConceptMap", "StructureDefinition", "StructureMap", "NamingSystem", "SearchParameter", "OperationDefinition", "CapabilityStatement", "Conformance")) + System.out.println("Examples contains "+s+" but core doesn't"); + } + } + strip(new File(Utilities.path(PATH, "hl7.fhir."+ver+".core", "package"))); + strip(new File(Utilities.path(PATH, "hl7.fhir."+ver+".expansions", "package"))); + if (!ver.equals("r2b")) + strip(new File(Utilities.path(PATH, "hl7.fhir."+ver+".elements", "package"))); + } + + + private List listResources(String dir) { + File folder = new File(dir); + List res = new ArrayList<>(); + for (String fn : folder.list()) { + if (fn.endsWith(".json") && fn.contains("-")) { + String s = fn; + s = s.substring(0, s.indexOf(".")); + res.add(s); + } + } + return res; + } + + private void strip(File folder) throws IOException { + for (File f : folder.listFiles()) { + if (f.isDirectory()) + strip(f); + else if (f.getName().endsWith(".json")) { + JsonObject json = JsonTrackingParser.parseJson(f); + if (json.has("resourceType") && json.has("text")) { + json.remove("text"); + Gson gson = new GsonBuilder().create(); + String src = gson.toJson(json); + TextFile.stringToFile(src, f.getAbsolutePath()); + } + } + } + } + +} diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/SearchParameterProcessor.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/SearchParameterProcessor.java index 86b622082..18bbe4bed 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/SearchParameterProcessor.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/misc/SearchParameterProcessor.java @@ -1,297 +1,318 @@ -package org.hl7.fhir.convertors.misc; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.convertors.misc.SearchParameterProcessor.SPRelationship; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.exceptions.FHIRFormatError; -import org.hl7.fhir.r5.formats.IParser.OutputStyle; -import org.hl7.fhir.r5.formats.JsonParser; -import org.hl7.fhir.r5.model.ConceptMap; -import org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent; -import org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent; -import org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence; -import org.hl7.fhir.r5.model.Enumerations.PublicationStatus; -import org.hl7.fhir.utilities.CSVReader; -import org.hl7.fhir.utilities.TextFile; -import org.hl7.fhir.utilities.Utilities; - -public class SearchParameterProcessor { - - public class SPRelationship { - private String r4; - private String r3; - private String r2b; - private String r2; - public SPRelationship(String r4, String r3, String r2b, String r2) { - super(); - this.r4 = r4; - this.r3 = r3; - this.r2b = r2b; - this.r2 = r2; - } - public String getR4() { - return r4; - } - public String getR3() { - return r3; - } - public String getR2b() { - return r2b; - } - public String getR2() { - return r2; - } - public String getByCode(String code) { - if ("R4".equals(code)) - return r4; - if ("R3".equals(code)) - return r3; - if ("R2b".equals(code)) - return r2b; - if ("R2".equals(code)) - return r2; - return null; - } - - } - - private static final String ROOT = "C:\\work\\org.hl7.fhir\\org.fhir.interversion\\package"; - - private List list = new ArrayList<>(); - - private List list4 = new ArrayList<>(); - private List list3 = new ArrayList<>(); - private List list2 = new ArrayList<>(); - private List list2b = new ArrayList<>(); - - private void load() throws FileNotFoundException, IOException, FHIRException { - load4(); - load3(); - load2b(); - load2(); - loadCsv(); - - check4(); - check3(); - check2b(); - check2(); - - generate("R3", "R4", "STU3", "R4"); - generate("R4", "R3", "R4", "STU3"); - generate("R2", "R4", "DSTU2", "R4"); - generate("R4", "R2", "R4", "DSTU2"); - generate("R2", "R3", "DSTU2", "STU3"); - generate("R3", "R2", "STU3", "DSTU2"); - } - - private void generate(String src, String dst, String srcURL, String tgtURL) throws FileNotFoundException, IOException { - ConceptMap map = new ConceptMap(); - map.setId("search-parameters-"+src+"-to-"+dst); - map.setUrl("http://hl7.org/fhir/interversion/ConceptMap/"+map.getId()); - map.setName("SearchParameterMap"+src+dst); - map.setTitle("Search Parameter Map - "+src+" to "+dst); - map.setStatus(PublicationStatus.DRAFT); - map.setDate(new Date()); - map.setExperimental(false); - map.setPublisher("HL7"); - ConceptMapGroupComponent group = map.addGroup(); - group.setSource("http://hl7.org/fhir/"+srcURL); - group.setTarget("http://hl7.org/fhir/"+tgtURL); - for (SPRelationship sp : list) { - String s = sp.getByCode(src); - String d = sp.getByCode(dst); - if (!Utilities.noString(s) && !Utilities.noString(d)) { - SourceElementComponent e = makeElement(s, group); - e.addTarget().setCode(d).setEquivalence(ConceptMapEquivalence.RELATEDTO); - } - } - new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(ROOT, "ConceptMap-"+map.getId()+".json")), map); - } - - private SourceElementComponent makeElement(String code, ConceptMapGroupComponent group) { - for (SourceElementComponent e : group.getElement()) { - if (e.getCode().equals(code)) - return e; - } - return group.addElement().setCode(code); - } - - private void check4() { - for (String s : list4) { - boolean ok = false; - for (SPRelationship t : list) { - if (s.equals(t.r4)) - ok = true; - } - if (!ok) - System.out.println("R4 missing : "+s); - } - for (SPRelationship sp : list) { - if (!Utilities.noString(sp.r4)) { - boolean ok = list4.contains(sp.r4); - if (!ok) - System.out.println("R4 extra : "+sp.r4); - } - } - } - - private void check3() { - for (String s : list3) { - boolean ok = false; - for (SPRelationship t : list) { - if (s.equals(t.r3)) - ok = true; - } - if (!ok) - System.out.println("R3 : "+s); - } - for (SPRelationship sp : list) { - if (!Utilities.noString(sp.r3)) { - boolean ok = list3.contains(sp.r3); - if (!ok) - System.out.println("R3 extra : "+sp.r3); - } - } - } - - private void check2b() { - for (String s : list2b) { - boolean ok = false; - for (SPRelationship t : list) { - if (s.equals(t.r2b)) - ok = true; - } - if (!ok) - System.out.println("R2b : "+s); - } - for (SPRelationship sp : list) { - if (!Utilities.noString(sp.r2b)) { - boolean ok = list2b.contains(sp.r2b); - if (!ok) - System.out.println("R2b extra : "+sp.r2b); - } - } - } - - private void check2() { - for (String s : list2) { - boolean ok = false; - for (SPRelationship t : list) { - if (s.equals(t.r2)) - ok = true; - } - if (!ok) - System.out.println("R2 : "+s); - } - for (SPRelationship sp : list) { - if (!Utilities.noString(sp.r2)) { - boolean ok = list2.contains(sp.r2); - if (!ok) - System.out.println("R2 extra : "+sp.r2); - } - } - } - - private void load4() throws FHIRFormatError, FileNotFoundException, IOException { - org.hl7.fhir.r4.model.Bundle bundle = (org.hl7.fhir.r4.model.Bundle) new org.hl7.fhir.r4.formats.JsonParser().parse(new FileInputStream("c:\\temp\\sp4.json")); - for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent be : bundle.getEntry()) { - org.hl7.fhir.r4.model.SearchParameter sp = (org.hl7.fhir.r4.model.SearchParameter) be.getResource(); - for (org.hl7.fhir.r4.model.CodeType br : sp.getBase()) { - if (!Utilities.existsInList(br.asStringValue(), "DomainResource", "Resource")) - list4.add(br.asStringValue()+"."+sp.getCode());//+", "+sp.getType().toCode()); - } - } - Collections.sort(list4); - System.out.println("R4 loaded - "+list4.size()+" parameters"); - } - - private void load3() throws FHIRFormatError, FileNotFoundException, IOException { - org.hl7.fhir.dstu3.model.Bundle bundle = (org.hl7.fhir.dstu3.model.Bundle) new org.hl7.fhir.dstu3.formats.JsonParser().parse(new FileInputStream("c:\\temp\\sp3.json")); - for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent be : bundle.getEntry()) { - org.hl7.fhir.dstu3.model.SearchParameter sp = (org.hl7.fhir.dstu3.model.SearchParameter) be.getResource(); - for (org.hl7.fhir.dstu3.model.CodeType br : sp.getBase()) { - if (!Utilities.existsInList(br.asStringValue(), "DomainResource", "Resource")) - list3.add(br.asStringValue()+"."+sp.getCode());//+", "+sp.getType().toCode()); - } - } - Collections.sort(list3); - System.out.println("R3 loaded - "+list3.size()+" parameters"); - } - - private void load2() throws FHIRFormatError, FileNotFoundException, IOException { - org.hl7.fhir.dstu2.model.Bundle bundle = (org.hl7.fhir.dstu2.model.Bundle) new org.hl7.fhir.dstu2.formats.JsonParser().parse(new FileInputStream("c:\\temp\\sp2.json")); - for (org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent be : bundle.getEntry()) { - org.hl7.fhir.dstu2.model.SearchParameter sp = (org.hl7.fhir.dstu2.model.SearchParameter) be.getResource(); - String br = sp.getBase(); - if (!Utilities.existsInList(br, "DomainResource", "Resource")) - list2.add(br+"."+sp.getCode());//+", "+sp.getType().toCode()); - } - Collections.sort(list2); - System.out.println("R2 loaded - "+list2.size()+" parameters"); - } - - private void load2b() throws FHIRFormatError, FileNotFoundException, IOException { - org.hl7.fhir.dstu2016may.model.Bundle bundle = (org.hl7.fhir.dstu2016may.model.Bundle) new org.hl7.fhir.dstu2016may.formats.JsonParser().parse(new FileInputStream("c:\\temp\\sp2b.json")); - for (org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent be : bundle.getEntry()) { - org.hl7.fhir.dstu2016may.model.SearchParameter sp = (org.hl7.fhir.dstu2016may.model.SearchParameter) be.getResource(); - String br = sp.getBase(); - if (!Utilities.existsInList(br, "DomainResource", "Resource")) - list2b.add(br+"."+sp.getCode());//+", "+sp.getType().toCode()); - } - Collections.sort(list2b); - System.out.println("R2b loaded - "+list2b.size()+" parameters"); - } - - private void loadCsv() throws IOException, FHIRException { - CSVReader csv = new CSVReader(new FileInputStream("C:\\work\\org.hl7.fhir\\org.fhir.interversion\\work\\search-params.csv")); - csv.readHeaders(); - while (csv.line()) { - String r4 = csv.cell("R4"); - String r3 = csv.cell("R3"); - String r2b = csv.cell("R2b"); - String r2 = csv.cell("R2"); - if (!Utilities.noString(r4) || !Utilities.noString(r3) || !Utilities.noString(r2b) || !Utilities.noString(r2)) { - boolean ok = (!Utilities.noString(r4) && r4.contains(".")) || - (!Utilities.noString(r3) && r3.contains(".")) || - (!Utilities.noString(r2b) && r2b.contains(".")) || - (!Utilities.noString(r2) && r2.contains(".")); - if (ok) { - list.add(new SPRelationship(r4, r3, r2b, r2)); - } - } - } - System.out.println("Map loaded - "+list.size()+" entries"); - } - -// private void generate(String name) throws IOException { -// StringBuilder b = new StringBuilder(); -// -// String rn = ""; -// Collections.sort(list); -// for (String s : list) { -// String rnn = s.substring(0, s.indexOf(".")); -// if (!rnn.equals(rn)) { -// rn = rnn; -// b.append(rn+"\r\n"); -// } -// b.append(s+"\r\n"); -// } -// TextFile.stringToFile(b.toString(), name); -// } -// - public static void main(String[] args) throws FileNotFoundException, IOException, FHIRException { - new SearchParameterProcessor().load(); - } - - -} +package org.hl7.fhir.convertors.misc; + +/*- + * #%L + * org.hl7.fhir.convertors + * %% + * Copyright (C) 2014 - 2019 Health Level 7 + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +import org.hl7.fhir.convertors.misc.SearchParameterProcessor.SPRelationship; +import org.hl7.fhir.exceptions.FHIRException; +import org.hl7.fhir.exceptions.FHIRFormatError; +import org.hl7.fhir.r5.formats.IParser.OutputStyle; +import org.hl7.fhir.r5.formats.JsonParser; +import org.hl7.fhir.r5.model.ConceptMap; +import org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent; +import org.hl7.fhir.r5.model.ConceptMap.SourceElementComponent; +import org.hl7.fhir.r5.model.Enumerations.ConceptMapEquivalence; +import org.hl7.fhir.r5.model.Enumerations.PublicationStatus; +import org.hl7.fhir.utilities.CSVReader; +import org.hl7.fhir.utilities.TextFile; +import org.hl7.fhir.utilities.Utilities; + +public class SearchParameterProcessor { + + public class SPRelationship { + private String r4; + private String r3; + private String r2b; + private String r2; + public SPRelationship(String r4, String r3, String r2b, String r2) { + super(); + this.r4 = r4; + this.r3 = r3; + this.r2b = r2b; + this.r2 = r2; + } + public String getR4() { + return r4; + } + public String getR3() { + return r3; + } + public String getR2b() { + return r2b; + } + public String getR2() { + return r2; + } + public String getByCode(String code) { + if ("R4".equals(code)) + return r4; + if ("R3".equals(code)) + return r3; + if ("R2b".equals(code)) + return r2b; + if ("R2".equals(code)) + return r2; + return null; + } + + } + + private static final String ROOT = "C:\\work\\org.hl7.fhir\\org.fhir.interversion\\package"; + + private List list = new ArrayList<>(); + + private List list4 = new ArrayList<>(); + private List list3 = new ArrayList<>(); + private List list2 = new ArrayList<>(); + private List list2b = new ArrayList<>(); + + private void load() throws FileNotFoundException, IOException, FHIRException { + load4(); + load3(); + load2b(); + load2(); + loadCsv(); + + check4(); + check3(); + check2b(); + check2(); + + generate("R3", "R4", "STU3", "R4"); + generate("R4", "R3", "R4", "STU3"); + generate("R2", "R4", "DSTU2", "R4"); + generate("R4", "R2", "R4", "DSTU2"); + generate("R2", "R3", "DSTU2", "STU3"); + generate("R3", "R2", "STU3", "DSTU2"); + } + + private void generate(String src, String dst, String srcURL, String tgtURL) throws FileNotFoundException, IOException { + ConceptMap map = new ConceptMap(); + map.setId("search-parameters-"+src+"-to-"+dst); + map.setUrl("http://hl7.org/fhir/interversion/ConceptMap/"+map.getId()); + map.setName("SearchParameterMap"+src+dst); + map.setTitle("Search Parameter Map - "+src+" to "+dst); + map.setStatus(PublicationStatus.DRAFT); + map.setDate(new Date()); + map.setExperimental(false); + map.setPublisher("HL7"); + ConceptMapGroupComponent group = map.addGroup(); + group.setSource("http://hl7.org/fhir/"+srcURL); + group.setTarget("http://hl7.org/fhir/"+tgtURL); + for (SPRelationship sp : list) { + String s = sp.getByCode(src); + String d = sp.getByCode(dst); + if (!Utilities.noString(s) && !Utilities.noString(d)) { + SourceElementComponent e = makeElement(s, group); + e.addTarget().setCode(d).setEquivalence(ConceptMapEquivalence.RELATEDTO); + } + } + new JsonParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path(ROOT, "ConceptMap-"+map.getId()+".json")), map); + } + + private SourceElementComponent makeElement(String code, ConceptMapGroupComponent group) { + for (SourceElementComponent e : group.getElement()) { + if (e.getCode().equals(code)) + return e; + } + return group.addElement().setCode(code); + } + + private void check4() { + for (String s : list4) { + boolean ok = false; + for (SPRelationship t : list) { + if (s.equals(t.r4)) + ok = true; + } + if (!ok) + System.out.println("R4 missing : "+s); + } + for (SPRelationship sp : list) { + if (!Utilities.noString(sp.r4)) { + boolean ok = list4.contains(sp.r4); + if (!ok) + System.out.println("R4 extra : "+sp.r4); + } + } + } + + private void check3() { + for (String s : list3) { + boolean ok = false; + for (SPRelationship t : list) { + if (s.equals(t.r3)) + ok = true; + } + if (!ok) + System.out.println("R3 : "+s); + } + for (SPRelationship sp : list) { + if (!Utilities.noString(sp.r3)) { + boolean ok = list3.contains(sp.r3); + if (!ok) + System.out.println("R3 extra : "+sp.r3); + } + } + } + + private void check2b() { + for (String s : list2b) { + boolean ok = false; + for (SPRelationship t : list) { + if (s.equals(t.r2b)) + ok = true; + } + if (!ok) + System.out.println("R2b : "+s); + } + for (SPRelationship sp : list) { + if (!Utilities.noString(sp.r2b)) { + boolean ok = list2b.contains(sp.r2b); + if (!ok) + System.out.println("R2b extra : "+sp.r2b); + } + } + } + + private void check2() { + for (String s : list2) { + boolean ok = false; + for (SPRelationship t : list) { + if (s.equals(t.r2)) + ok = true; + } + if (!ok) + System.out.println("R2 : "+s); + } + for (SPRelationship sp : list) { + if (!Utilities.noString(sp.r2)) { + boolean ok = list2.contains(sp.r2); + if (!ok) + System.out.println("R2 extra : "+sp.r2); + } + } + } + + private void load4() throws FHIRFormatError, FileNotFoundException, IOException { + org.hl7.fhir.r4.model.Bundle bundle = (org.hl7.fhir.r4.model.Bundle) new org.hl7.fhir.r4.formats.JsonParser().parse(new FileInputStream("c:\\temp\\sp4.json")); + for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent be : bundle.getEntry()) { + org.hl7.fhir.r4.model.SearchParameter sp = (org.hl7.fhir.r4.model.SearchParameter) be.getResource(); + for (org.hl7.fhir.r4.model.CodeType br : sp.getBase()) { + if (!Utilities.existsInList(br.asStringValue(), "DomainResource", "Resource")) + list4.add(br.asStringValue()+"."+sp.getCode());//+", "+sp.getType().toCode()); + } + } + Collections.sort(list4); + System.out.println("R4 loaded - "+list4.size()+" parameters"); + } + + private void load3() throws FHIRFormatError, FileNotFoundException, IOException { + org.hl7.fhir.dstu3.model.Bundle bundle = (org.hl7.fhir.dstu3.model.Bundle) new org.hl7.fhir.dstu3.formats.JsonParser().parse(new FileInputStream("c:\\temp\\sp3.json")); + for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent be : bundle.getEntry()) { + org.hl7.fhir.dstu3.model.SearchParameter sp = (org.hl7.fhir.dstu3.model.SearchParameter) be.getResource(); + for (org.hl7.fhir.dstu3.model.CodeType br : sp.getBase()) { + if (!Utilities.existsInList(br.asStringValue(), "DomainResource", "Resource")) + list3.add(br.asStringValue()+"."+sp.getCode());//+", "+sp.getType().toCode()); + } + } + Collections.sort(list3); + System.out.println("R3 loaded - "+list3.size()+" parameters"); + } + + private void load2() throws FHIRFormatError, FileNotFoundException, IOException { + org.hl7.fhir.dstu2.model.Bundle bundle = (org.hl7.fhir.dstu2.model.Bundle) new org.hl7.fhir.dstu2.formats.JsonParser().parse(new FileInputStream("c:\\temp\\sp2.json")); + for (org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent be : bundle.getEntry()) { + org.hl7.fhir.dstu2.model.SearchParameter sp = (org.hl7.fhir.dstu2.model.SearchParameter) be.getResource(); + String br = sp.getBase(); + if (!Utilities.existsInList(br, "DomainResource", "Resource")) + list2.add(br+"."+sp.getCode());//+", "+sp.getType().toCode()); + } + Collections.sort(list2); + System.out.println("R2 loaded - "+list2.size()+" parameters"); + } + + private void load2b() throws FHIRFormatError, FileNotFoundException, IOException { + org.hl7.fhir.dstu2016may.model.Bundle bundle = (org.hl7.fhir.dstu2016may.model.Bundle) new org.hl7.fhir.dstu2016may.formats.JsonParser().parse(new FileInputStream("c:\\temp\\sp2b.json")); + for (org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent be : bundle.getEntry()) { + org.hl7.fhir.dstu2016may.model.SearchParameter sp = (org.hl7.fhir.dstu2016may.model.SearchParameter) be.getResource(); + String br = sp.getBase(); + if (!Utilities.existsInList(br, "DomainResource", "Resource")) + list2b.add(br+"."+sp.getCode());//+", "+sp.getType().toCode()); + } + Collections.sort(list2b); + System.out.println("R2b loaded - "+list2b.size()+" parameters"); + } + + private void loadCsv() throws IOException, FHIRException { + CSVReader csv = new CSVReader(new FileInputStream("C:\\work\\org.hl7.fhir\\org.fhir.interversion\\work\\search-params.csv")); + csv.readHeaders(); + while (csv.line()) { + String r4 = csv.cell("R4"); + String r3 = csv.cell("R3"); + String r2b = csv.cell("R2b"); + String r2 = csv.cell("R2"); + if (!Utilities.noString(r4) || !Utilities.noString(r3) || !Utilities.noString(r2b) || !Utilities.noString(r2)) { + boolean ok = (!Utilities.noString(r4) && r4.contains(".")) || + (!Utilities.noString(r3) && r3.contains(".")) || + (!Utilities.noString(r2b) && r2b.contains(".")) || + (!Utilities.noString(r2) && r2.contains(".")); + if (ok) { + list.add(new SPRelationship(r4, r3, r2b, r2)); + } + } + } + System.out.println("Map loaded - "+list.size()+" entries"); + } + +// private void generate(String name) throws IOException { +// StringBuilder b = new StringBuilder(); +// +// String rn = ""; +// Collections.sort(list); +// for (String s : list) { +// String rnn = s.substring(0, s.indexOf(".")); +// if (!rnn.equals(rn)) { +// rn = rnn; +// b.append(rn+"\r\n"); +// } +// b.append(s+"\r\n"); +// } +// TextFile.stringToFile(b.toString(), name); +// } +// + public static void main(String[] args) throws FileNotFoundException, IOException, FHIRException { + new SearchParameterProcessor().load(); + } + + +} diff --git a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/Unbundler.java b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/Unbundler.java index 5163975b0..26650e529 100644 --- a/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/Unbundler.java +++ b/org.hl7.fhir.dstu2/src/main/java/org/hl7/fhir/dstu2/utils/Unbundler.java @@ -1,45 +1,66 @@ -package org.hl7.fhir.dstu2.utils; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; - -import org.hl7.fhir.exceptions.FHIRFormatError; -import org.apache.commons.lang3.StringUtils; -import org.hl7.fhir.dstu2.formats.JsonParser; -import org.hl7.fhir.dstu2.model.Bundle; -import org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent; -import org.hl7.fhir.dstu2.model.Resource; -import org.hl7.fhir.dstu2.model.ValueSet; -import org.hl7.fhir.utilities.Utilities; - -public class Unbundler { - - public static void main(String[] args) throws Exception { - unbundle(args[0]); - } - - private static void unbundle(String src) throws FHIRFormatError, FileNotFoundException, IOException { - String folder = Utilities.getDirectoryForFile(src); - Bundle bnd = (Bundle) new JsonParser().parse(new FileInputStream(src)); - for (BundleEntryComponent be : bnd.getEntry()) { - Resource r = be.getResource(); - if (r != null) { - if (StringUtils.isBlank(r.getId())) { - if (r instanceof ValueSet) - r.setId(tail((ValueSet) r)); - } - if (!StringUtils.isBlank(r.getId())) { - String tgt = Utilities.path(folder, r.fhirType()+"-"+r.getId()+".json"); - new JsonParser().compose(new FileOutputStream(tgt), r); - } - } - } - } - - private static String tail(ValueSet r) { - return r.getUrl().contains("/") ? r.getUrl().substring(r.getUrl().lastIndexOf("/")+1) : null; - } - -} +package org.hl7.fhir.dstu2.utils; + +/*- + * #%L + * org.hl7.fhir.dstu2 + * %% + * Copyright (C) 2014 - 2019 Health Level 7 + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; + +import org.hl7.fhir.exceptions.FHIRFormatError; +import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.dstu2.formats.JsonParser; +import org.hl7.fhir.dstu2.model.Bundle; +import org.hl7.fhir.dstu2.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.dstu2.model.Resource; +import org.hl7.fhir.dstu2.model.ValueSet; +import org.hl7.fhir.utilities.Utilities; + +public class Unbundler { + + public static void main(String[] args) throws Exception { + unbundle(args[0]); + } + + private static void unbundle(String src) throws FHIRFormatError, FileNotFoundException, IOException { + String folder = Utilities.getDirectoryForFile(src); + Bundle bnd = (Bundle) new JsonParser().parse(new FileInputStream(src)); + for (BundleEntryComponent be : bnd.getEntry()) { + Resource r = be.getResource(); + if (r != null) { + if (StringUtils.isBlank(r.getId())) { + if (r instanceof ValueSet) + r.setId(tail((ValueSet) r)); + } + if (!StringUtils.isBlank(r.getId())) { + String tgt = Utilities.path(folder, r.fhirType()+"-"+r.getId()+".json"); + new JsonParser().compose(new FileOutputStream(tgt), r); + } + } + } + } + + private static String tail(ValueSet r) { + return r.getUrl().contains("/") ? r.getUrl().substring(r.getUrl().lastIndexOf("/")+1) : null; + } + +} diff --git a/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/Unbundler.java b/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/Unbundler.java index 9ef294510..64f58f4c4 100644 --- a/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/Unbundler.java +++ b/org.hl7.fhir.dstu2016may/src/main/java/org/hl7/fhir/dstu2016may/utils/Unbundler.java @@ -1,45 +1,66 @@ -package org.hl7.fhir.dstu2016may.utils; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; - -import org.hl7.fhir.exceptions.FHIRFormatError; -import org.apache.commons.lang3.StringUtils; -import org.hl7.fhir.dstu2016may.model.ValueSet; -import org.hl7.fhir.dstu2016may.formats.JsonParser; -import org.hl7.fhir.dstu2016may.model.Bundle; -import org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent; -import org.hl7.fhir.dstu2016may.model.Resource; -import org.hl7.fhir.utilities.Utilities; - -public class Unbundler { - - public static void main(String[] args) throws Exception { - unbundle(args[0]); - } - - private static void unbundle(String src) throws FHIRFormatError, FileNotFoundException, IOException { - String folder = Utilities.getDirectoryForFile(src); - Bundle bnd = (Bundle) new JsonParser().parse(new FileInputStream(src)); - for (BundleEntryComponent be : bnd.getEntry()) { - Resource r = be.getResource(); - if (r != null) { - if (StringUtils.isBlank(r.getId())) { - if (r instanceof ValueSet) - r.setId(tail((ValueSet) r)); - } - if (!StringUtils.isBlank(r.getId())) { - String tgt = Utilities.path(folder, r.fhirType()+"-"+r.getId()+".json"); - new JsonParser().compose(new FileOutputStream(tgt), r); - } - } - } - } - - private static String tail(ValueSet r) { - return r.getUrl().contains("/") ? r.getUrl().substring(r.getUrl().lastIndexOf("/")+1) : null; - } - -} +package org.hl7.fhir.dstu2016may.utils; + +/*- + * #%L + * org.hl7.fhir.dstu2016may + * %% + * Copyright (C) 2014 - 2019 Health Level 7 + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; + +import org.hl7.fhir.exceptions.FHIRFormatError; +import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.dstu2016may.model.ValueSet; +import org.hl7.fhir.dstu2016may.formats.JsonParser; +import org.hl7.fhir.dstu2016may.model.Bundle; +import org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.dstu2016may.model.Resource; +import org.hl7.fhir.utilities.Utilities; + +public class Unbundler { + + public static void main(String[] args) throws Exception { + unbundle(args[0]); + } + + private static void unbundle(String src) throws FHIRFormatError, FileNotFoundException, IOException { + String folder = Utilities.getDirectoryForFile(src); + Bundle bnd = (Bundle) new JsonParser().parse(new FileInputStream(src)); + for (BundleEntryComponent be : bnd.getEntry()) { + Resource r = be.getResource(); + if (r != null) { + if (StringUtils.isBlank(r.getId())) { + if (r instanceof ValueSet) + r.setId(tail((ValueSet) r)); + } + if (!StringUtils.isBlank(r.getId())) { + String tgt = Utilities.path(folder, r.fhirType()+"-"+r.getId()+".json"); + new JsonParser().compose(new FileOutputStream(tgt), r); + } + } + } + } + + private static String tail(ValueSet r) { + return r.getUrl().contains("/") ? r.getUrl().substring(r.getUrl().lastIndexOf("/")+1) : null; + } + +} diff --git a/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/Unbundler.java b/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/Unbundler.java index 0ca4b1cff..ab47cedd6 100644 --- a/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/Unbundler.java +++ b/org.hl7.fhir.dstu3/src/main/java/org/hl7/fhir/dstu3/utils/Unbundler.java @@ -1,33 +1,54 @@ -package org.hl7.fhir.dstu3.utils; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; - -import org.hl7.fhir.exceptions.FHIRFormatError; -import org.hl7.fhir.dstu3.formats.JsonParser; -import org.hl7.fhir.dstu3.model.Bundle; -import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent; -import org.hl7.fhir.dstu3.model.Resource; -import org.hl7.fhir.utilities.Utilities; - -public class Unbundler { - - public static void main(String[] args) throws Exception { - unbundle(args[0]); - } - - private static void unbundle(String src) throws FHIRFormatError, FileNotFoundException, IOException { - String folder = Utilities.getDirectoryForFile(src); - Bundle bnd = (Bundle) new JsonParser().parse(new FileInputStream(src)); - for (BundleEntryComponent be : bnd.getEntry()) { - Resource r = be.getResource(); - if (r != null) { - String tgt = Utilities.path(folder, r.fhirType()+"-"+r.getId()+".json"); - new JsonParser().compose(new FileOutputStream(tgt), r); - } - } - } - -} +package org.hl7.fhir.dstu3.utils; + +/*- + * #%L + * org.hl7.fhir.dstu3 + * %% + * Copyright (C) 2014 - 2019 Health Level 7 + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; + +import org.hl7.fhir.exceptions.FHIRFormatError; +import org.hl7.fhir.dstu3.formats.JsonParser; +import org.hl7.fhir.dstu3.model.Bundle; +import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.dstu3.model.Resource; +import org.hl7.fhir.utilities.Utilities; + +public class Unbundler { + + public static void main(String[] args) throws Exception { + unbundle(args[0]); + } + + private static void unbundle(String src) throws FHIRFormatError, FileNotFoundException, IOException { + String folder = Utilities.getDirectoryForFile(src); + Bundle bnd = (Bundle) new JsonParser().parse(new FileInputStream(src)); + for (BundleEntryComponent be : bnd.getEntry()) { + Resource r = be.getResource(); + if (r != null) { + String tgt = Utilities.path(folder, r.fhirType()+"-"+r.getId()+".json"); + new JsonParser().compose(new FileOutputStream(tgt), r); + } + } + } + +} diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/Unbundler.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/Unbundler.java index 76fd72bd4..3ad068e89 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/Unbundler.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/Unbundler.java @@ -1,48 +1,69 @@ -package org.hl7.fhir.r4.utils; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; - -import org.apache.commons.lang3.StringUtils; -import org.hl7.fhir.r4.model.ValueSet; -import org.hl7.fhir.exceptions.FHIRFormatError; -import org.hl7.fhir.r4.formats.JsonParser; -import org.hl7.fhir.r4.model.Bundle; -import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; -import org.hl7.fhir.r4.model.MetadataResource; -import org.hl7.fhir.r4.model.Resource; -import org.hl7.fhir.utilities.Utilities; - -public class Unbundler { - - public static void main(String[] args) throws Exception { - unbundle(args[0]); - } - - - private static void unbundle(String src) throws FHIRFormatError, FileNotFoundException, IOException { - String folder = Utilities.getDirectoryForFile(src); - Bundle bnd = (Bundle) new JsonParser().parse(new FileInputStream(src)); - for (BundleEntryComponent be : bnd.getEntry()) { - Resource r = be.getResource(); - if (r != null) { - if (StringUtils.isBlank(r.getId())) { - if (r instanceof MetadataResource) - r.setId(tail((MetadataResource) r)); - } - if (!StringUtils.isBlank(r.getId())) { - String tgt = Utilities.path(folder, r.fhirType()+"-"+r.getId()+".json"); - if (!new File(tgt).exists()) - new JsonParser().compose(new FileOutputStream(tgt), r); - } - } - } - } - - private static String tail(MetadataResource r) { - return r.getUrl().contains("/") ? r.getUrl().substring(r.getUrl().lastIndexOf("/")+1) : null; - } -} +package org.hl7.fhir.r4.utils; + +/*- + * #%L + * org.hl7.fhir.r4 + * %% + * Copyright (C) 2014 - 2019 Health Level 7 + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; + +import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.r4.model.ValueSet; +import org.hl7.fhir.exceptions.FHIRFormatError; +import org.hl7.fhir.r4.formats.JsonParser; +import org.hl7.fhir.r4.model.Bundle; +import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.r4.model.MetadataResource; +import org.hl7.fhir.r4.model.Resource; +import org.hl7.fhir.utilities.Utilities; + +public class Unbundler { + + public static void main(String[] args) throws Exception { + unbundle(args[0]); + } + + + private static void unbundle(String src) throws FHIRFormatError, FileNotFoundException, IOException { + String folder = Utilities.getDirectoryForFile(src); + Bundle bnd = (Bundle) new JsonParser().parse(new FileInputStream(src)); + for (BundleEntryComponent be : bnd.getEntry()) { + Resource r = be.getResource(); + if (r != null) { + if (StringUtils.isBlank(r.getId())) { + if (r instanceof MetadataResource) + r.setId(tail((MetadataResource) r)); + } + if (!StringUtils.isBlank(r.getId())) { + String tgt = Utilities.path(folder, r.fhirType()+"-"+r.getId()+".json"); + if (!new File(tgt).exists()) + new JsonParser().compose(new FileOutputStream(tgt), r); + } + } + } + } + + private static String tail(MetadataResource r) { + return r.getUrl().contains("/") ? r.getUrl().substring(r.getUrl().lastIndexOf("/")+1) : null; + } +} diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/openapi/OpenApiGenerator.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/openapi/OpenApiGenerator.java index 710ec45fd..eaaf26014 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/openapi/OpenApiGenerator.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/openapi/OpenApiGenerator.java @@ -1,5 +1,25 @@ package org.hl7.fhir.r5.openapi; +/*- + * #%L + * org.hl7.fhir.r5 + * %% + * Copyright (C) 2014 - 2019 Health Level 7 + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import java.util.HashSet; import java.util.List; import java.util.Set; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/patterns/ActivityDefinitionDefinitionImpl.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/patterns/ActivityDefinitionDefinitionImpl.java index a2ebd79bf..580bc7270 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/patterns/ActivityDefinitionDefinitionImpl.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/patterns/ActivityDefinitionDefinitionImpl.java @@ -1,880 +1,901 @@ -package org.hl7.fhir.r5.patterns; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Wed, May 8, 2019 10:40+1000 for FHIR v4.1.0 - -import java.util.*; - -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.r5.model.Enumerations.*; -import org.hl7.fhir.r5.model.*; -import org.hl7.fhir.r5.model.Enumeration; -import org.hl7.fhir.exceptions.FHIRException; - -public class ActivityDefinitionDefinitionImpl extends PatternBaseImpl implements Definition { - - private ActivityDefinition wrapped; - - public ActivityDefinitionDefinitionImpl(ActivityDefinition wrapped) { - super(wrapped); - this.wrapped = wrapped; - } - - public int getUrlMin() { - return 0; - } - - public int getUrlMax() { - return 1; - } - - public UriType getUrlElement() throws FHIRException { - return wrapped.getUrlElement(); - } - - - public boolean hasUrlElement() { - return wrapped.hasUrlElement(); - } - - - public boolean hasUrl() { - return wrapped.hasUrl(); - } - - - public Definition setUrlElement(UriType value) throws FHIRException { - wrapped.setUrlElement(value); - return this; - - } - - - public String getUrl() throws FHIRException { - return wrapped.getUrl(); - } - - public Definition setUrl(String value) throws FHIRException { - wrapped.setUrl(value); - return this; - -} - - public int getIdentifierMin() { - return 0; - } - - public int getIdentifierMax() { - return 2147483647; - } - - public Identifier getIdentifier() throws FHIRException { - return wrapped.getIdentifierFirstRep(); - } - - public boolean hasIdentifier() { - return wrapped.hasIdentifier(); - } - - public Definition setIdentifier(Identifier value) throws FHIRException { - wrapped.getIdentifier().clear(); - if (value != null) - wrapped.getIdentifier().add(value); - return this; - - } - - public int getVersionMin() { - return 0; - } - - public int getVersionMax() { - return 1; - } - - public StringType getVersionElement() throws FHIRException { - return wrapped.getVersionElement(); - } - - - public boolean hasVersionElement() { - return wrapped.hasVersionElement(); - } - - - public boolean hasVersion() { - return wrapped.hasVersion(); - } - - - public Definition setVersionElement(StringType value) throws FHIRException { - wrapped.setVersionElement(value); - return this; - - } - - - public String getVersion() throws FHIRException { - return wrapped.getVersion(); - } - - public Definition setVersion(String value) throws FHIRException { - wrapped.setVersion(value); - return this; - -} - - public int getTitleMin() { - return 0; - } - - public int getTitleMax() { - return 1; - } - - public StringType getTitleElement() throws FHIRException { - return wrapped.getTitleElement(); - } - - - public boolean hasTitleElement() { - return wrapped.hasTitleElement(); - } - - - public boolean hasTitle() { - return wrapped.hasTitle(); - } - - - public Definition setTitleElement(StringType value) throws FHIRException { - wrapped.setTitleElement(value); - return this; - - } - - - public String getTitle() throws FHIRException { - return wrapped.getTitle(); - } - - public Definition setTitle(String value) throws FHIRException { - wrapped.setTitle(value); - return this; - -} - - public int getDerivedFromCanonicalMin() { - return 0; - } - - public int getDerivedFromCanonicalMax() { - return 0; - } - - public List getDerivedFromCanonical() throws FHIRException { - throw new FHIRException("The pattern property 'derivedFromCanonical' is not supported in 'ActivityDefinition'"); - } - - public Definition setDerivedFromCanonical(List theDerivedFromCanonical) throws FHIRException { - - throw new FHIRException("The pattern property 'derivedFromCanonical' is not supported in 'ActivityDefinition'"); - } - - public boolean hasDerivedFromCanonical() { - return false; - } - - - public CanonicalType addDerivedFromCanonicalElement() throws FHIRException { - throw new FHIRException("The pattern property 'derivedFromCanonical' is not supported in 'ActivityDefinition'"); - } - - - public Definition addDerivedFromCanonical(String value) throws FHIRException { - throw new FHIRException("The pattern property 'derivedFromCanonical' is not supported in 'ActivityDefinition'"); - } - - - public boolean hasDerivedFromCanonical(String value) { - return false; - } - - - public int getDerivedFromUriMin() { - return 0; - } - - public int getDerivedFromUriMax() { - return 0; - } - - public List getDerivedFromUri() throws FHIRException { - throw new FHIRException("The pattern property 'derivedFromUri' is not supported in 'ActivityDefinition'"); - } - - public Definition setDerivedFromUri(List theDerivedFromUri) throws FHIRException { - - throw new FHIRException("The pattern property 'derivedFromUri' is not supported in 'ActivityDefinition'"); - } - - public boolean hasDerivedFromUri() { - return false; - } - - - public UriType addDerivedFromUriElement() throws FHIRException { - throw new FHIRException("The pattern property 'derivedFromUri' is not supported in 'ActivityDefinition'"); - } - - - public Definition addDerivedFromUri(String value) throws FHIRException { - throw new FHIRException("The pattern property 'derivedFromUri' is not supported in 'ActivityDefinition'"); - } - - - public boolean hasDerivedFromUri(String value) { - return false; - } - - - public int getPartOfMin() { - return 0; - } - - public int getPartOfMax() { - return 0; - } - - public List getPartOf() throws FHIRException { - throw new FHIRException("The pattern property 'partOf' is not supported in 'ActivityDefinition'"); - } - - public Definition setPartOf(List thePartOf) throws FHIRException { - - throw new FHIRException("The pattern property 'partOf' is not supported in 'ActivityDefinition'"); - } - - public boolean hasPartOf() { - return false; - } - - - public CanonicalType addPartOfElement() throws FHIRException { - throw new FHIRException("The pattern property 'partOf' is not supported in 'ActivityDefinition'"); - } - - - public Definition addPartOf(String value) throws FHIRException { - throw new FHIRException("The pattern property 'partOf' is not supported in 'ActivityDefinition'"); - } - - - public boolean hasPartOf(String value) { - return false; - } - - - public int getReplacesMin() { - return 0; - } - - public int getReplacesMax() { - return 0; - } - - public List getReplaces() throws FHIRException { - throw new FHIRException("The pattern property 'replaces' is not supported in 'ActivityDefinition'"); - } - - public Definition setReplaces(List theReplaces) throws FHIRException { - - throw new FHIRException("The pattern property 'replaces' is not supported in 'ActivityDefinition'"); - } - - public boolean hasReplaces() { - return false; - } - - - public CanonicalType addReplacesElement() throws FHIRException { - throw new FHIRException("The pattern property 'replaces' is not supported in 'ActivityDefinition'"); - } - - - public Definition addReplaces(String value) throws FHIRException { - throw new FHIRException("The pattern property 'replaces' is not supported in 'ActivityDefinition'"); - } - - - public boolean hasReplaces(String value) { - return false; - } - - - public int getStatusMin() { - return 0; - } - - public int getStatusMax() { - return 0; - } - - public Enumeration getStatusElement() throws FHIRException { - throw new FHIRException("The pattern property 'status' is not supported in 'ActivityDefinition'"); - } - - - public boolean hasStatusElement() { - return false; - } - - - public boolean hasStatus() { - return false; - } - - - public Definition setStatusElement(Enumeration value) throws FHIRException { - throw new FHIRException("The pattern property 'status' is not supported in 'ActivityDefinition'"); - } - - - public PublicationStatus getStatus() throws FHIRException { - throw new FHIRException("The pattern property 'status' is not supported in 'ActivityDefinition'"); - } - - public Definition setStatus(PublicationStatus value) throws FHIRException { - throw new FHIRException("The pattern property 'status' is not supported in 'ActivityDefinition'"); -} - - public int getExperimentalMin() { - return 0; - } - - public int getExperimentalMax() { - return 1; - } - - public BooleanType getExperimentalElement() throws FHIRException { - return wrapped.getExperimentalElement(); - } - - - public boolean hasExperimentalElement() { - return wrapped.hasExperimentalElement(); - } - - - public boolean hasExperimental() { - return wrapped.hasExperimental(); - } - - - public Definition setExperimentalElement(BooleanType value) throws FHIRException { - wrapped.setExperimentalElement(value); - return this; - - } - - - public boolean getExperimental() throws FHIRException { - return wrapped.getExperimental(); - } - - public Definition setExperimental(boolean value) throws FHIRException { - wrapped.setExperimental(value); - return this; - -} - - public int getSubjectMin() { - return 0; - } - - public int getSubjectMax() { - return 0; - } - - public Type getSubject() throws FHIRException { - throw new FHIRException("The pattern property 'subject[x]' is not supported in 'ActivityDefinition'"); - } - - public CodeableConcept getSubjectCodeableConcept() throws FHIRException { - throw new FHIRException("The pattern property 'subject[x]' is not supported in 'ActivityDefinition'"); - } - - public boolean hasSubjectCodeableConcept() { - return false; - } - - public Reference getSubjectReference() throws FHIRException { - throw new FHIRException("The pattern property 'subject[x]' is not supported in 'ActivityDefinition'"); - } - - public boolean hasSubjectReference() { - return false; - } - - public boolean hasSubject() { - return false; - } - - public Definition setSubject(Type value) throws FHIRException { - throw new FHIRException("The pattern property 'subject[x]' is not supported in 'ActivityDefinition'"); - } - - public int getDateMin() { - return 0; - } - - public int getDateMax() { - return 1; - } - - public DateTimeType getDateElement() throws FHIRException { - return wrapped.getDateElement(); - } - - - public boolean hasDateElement() { - return wrapped.hasDateElement(); - } - - - public boolean hasDate() { - return wrapped.hasDate(); - } - - - public Definition setDateElement(DateTimeType value) throws FHIRException { - wrapped.setDateElement(value); - return this; - - } - - - public Date getDate() throws FHIRException { - return wrapped.getDate(); - } - - public Definition setDate(Date value) throws FHIRException { - wrapped.setDate(value); - return this; - -} - - public int getPublisherMin() { - return 0; - } - - public int getPublisherMax() { - return 0; - } - - public Reference getPublisher() throws FHIRException { - throw new FHIRException("The pattern property 'publisher' is not supported in 'ActivityDefinition'"); - } - - public boolean hasPublisher() { - return false; - } - - public Definition setPublisher(Reference value) throws FHIRException { - throw new FHIRException("The pattern property 'publisher' is not supported in 'ActivityDefinition'"); - } - - public int getContactMin() { - return 0; - } - - public int getContactMax() { - return 2147483647; - } - - public List getContact() throws FHIRException { - return wrapped.getContact(); - } - - public Definition setContact(List theContact) throws FHIRException { - - wrapped.setContact(theContact); - return this; - - } - - public boolean hasContact() { - return wrapped.hasContact(); - } - - - public ContactDetail addContact() throws FHIRException { - throw new FHIRException("The pattern property 'contact' is not supported in 'ActivityDefinition'"); - } - - - public Definition addContact(ContactDetail t) throws FHIRException { - throw new FHIRException("The pattern property 'contact' is not supported in 'ActivityDefinition'"); - } - - - public ContactDetail getContactFirstRep() throws FHIRException { - - return wrapped.getContactFirstRep(); - } - - public int getDescriptionMin() { - return 0; - } - - public int getDescriptionMax() { - return 1; - } - - public MarkdownType getDescriptionElement() throws FHIRException { - return wrapped.getDescriptionElement(); - } - - - public boolean hasDescriptionElement() { - return wrapped.hasDescriptionElement(); - } - - - public boolean hasDescription() { - return wrapped.hasDescription(); - } - - - public Definition setDescriptionElement(MarkdownType value) throws FHIRException { - wrapped.setDescriptionElement(value); - return this; - - } - - - public String getDescription() throws FHIRException { - return wrapped.getDescription(); - } - - public Definition setDescription(String value) throws FHIRException { - wrapped.setDescription(value); - return this; - -} - - public int getUseContextMin() { - return 0; - } - - public int getUseContextMax() { - return 2147483647; - } - - public List getUseContext() throws FHIRException { - return wrapped.getUseContext(); - } - - public Definition setUseContext(List theUseContext) throws FHIRException { - - wrapped.setUseContext(theUseContext); - return this; - - } - - public boolean hasUseContext() { - return wrapped.hasUseContext(); - } - - - public UsageContext addUseContext() throws FHIRException { - throw new FHIRException("The pattern property 'useContext' is not supported in 'ActivityDefinition'"); - } - - - public Definition addUseContext(UsageContext t) throws FHIRException { - throw new FHIRException("The pattern property 'useContext' is not supported in 'ActivityDefinition'"); - } - - - public UsageContext getUseContextFirstRep() throws FHIRException { - - return wrapped.getUseContextFirstRep(); - } - - public int getJurisdictionMin() { - return 0; - } - - public int getJurisdictionMax() { - return 2147483647; - } - - public List getJurisdiction() throws FHIRException { - return wrapped.getJurisdiction(); - } - - public Definition setJurisdiction(List theJurisdiction) throws FHIRException { - - wrapped.setJurisdiction(theJurisdiction); - return this; - - } - - public boolean hasJurisdiction() { - return wrapped.hasJurisdiction(); - } - - - public CodeableConcept addJurisdiction() throws FHIRException { - throw new FHIRException("The pattern property 'jurisdiction' is not supported in 'ActivityDefinition'"); - } - - - public Definition addJurisdiction(CodeableConcept t) throws FHIRException { - throw new FHIRException("The pattern property 'jurisdiction' is not supported in 'ActivityDefinition'"); - } - - - public CodeableConcept getJurisdictionFirstRep() throws FHIRException { - - return wrapped.getJurisdictionFirstRep(); - } - - public int getPurposeMin() { - return 0; - } - - public int getPurposeMax() { - return 1; - } - - public MarkdownType getPurposeElement() throws FHIRException { - return wrapped.getPurposeElement(); - } - - - public boolean hasPurposeElement() { - return wrapped.hasPurposeElement(); - } - - - public boolean hasPurpose() { - return wrapped.hasPurpose(); - } - - - public Definition setPurposeElement(MarkdownType value) throws FHIRException { - wrapped.setPurposeElement(value); - return this; - - } - - - public String getPurpose() throws FHIRException { - return wrapped.getPurpose(); - } - - public Definition setPurpose(String value) throws FHIRException { - wrapped.setPurpose(value); - return this; - -} - - public int getCopyrightMin() { - return 0; - } - - public int getCopyrightMax() { - return 1; - } - - public MarkdownType getCopyrightElement() throws FHIRException { - return wrapped.getCopyrightElement(); - } - - - public boolean hasCopyrightElement() { - return wrapped.hasCopyrightElement(); - } - - - public boolean hasCopyright() { - return wrapped.hasCopyright(); - } - - - public Definition setCopyrightElement(MarkdownType value) throws FHIRException { - wrapped.setCopyrightElement(value); - return this; - - } - - - public String getCopyright() throws FHIRException { - return wrapped.getCopyright(); - } - - public Definition setCopyright(String value) throws FHIRException { - wrapped.setCopyright(value); - return this; - -} - - public int getApprovalDateMin() { - return 0; - } - - public int getApprovalDateMax() { - return 1; - } - - public DateType getApprovalDateElement() throws FHIRException { - return wrapped.getApprovalDateElement(); - } - - - public boolean hasApprovalDateElement() { - return wrapped.hasApprovalDateElement(); - } - - - public boolean hasApprovalDate() { - return wrapped.hasApprovalDate(); - } - - - public Definition setApprovalDateElement(DateType value) throws FHIRException { - wrapped.setApprovalDateElement(value); - return this; - - } - - - public Date getApprovalDate() throws FHIRException { - return wrapped.getApprovalDate(); - } - - public Definition setApprovalDate(Date value) throws FHIRException { - wrapped.setApprovalDate(value); - return this; - -} - - public int getLastReviewDateMin() { - return 0; - } - - public int getLastReviewDateMax() { - return 1; - } - - public DateType getLastReviewDateElement() throws FHIRException { - return wrapped.getLastReviewDateElement(); - } - - - public boolean hasLastReviewDateElement() { - return wrapped.hasLastReviewDateElement(); - } - - - public boolean hasLastReviewDate() { - return wrapped.hasLastReviewDate(); - } - - - public Definition setLastReviewDateElement(DateType value) throws FHIRException { - wrapped.setLastReviewDateElement(value); - return this; - - } - - - public Date getLastReviewDate() throws FHIRException { - return wrapped.getLastReviewDate(); - } - - public Definition setLastReviewDate(Date value) throws FHIRException { - wrapped.setLastReviewDate(value); - return this; - -} - - public int getEffectivePeriodMin() { - return 0; - } - - public int getEffectivePeriodMax() { - return 1; - } - - public Period getEffectivePeriod() throws FHIRException { - return wrapped.getEffectivePeriod(); - } - - public boolean hasEffectivePeriod() { - return wrapped.hasEffectivePeriod(); - } - - public Definition setEffectivePeriod(Period value) throws FHIRException { - wrapped.setEffectivePeriod(value); - return this; - - } - - public int getPerformerTypeMin() { - return 0; - } - - public int getPerformerTypeMax() { - return 0; - } - - public CodeableConcept getPerformerType() throws FHIRException { - throw new FHIRException("The pattern property 'performerType' is not supported in 'ActivityDefinition'"); - } - - public boolean hasPerformerType() { - return false; - } - - public Definition setPerformerType(CodeableConcept value) throws FHIRException { - throw new FHIRException("The pattern property 'performerType' is not supported in 'ActivityDefinition'"); - } - - public String fhirType() { - return "ActivityDefinition"; -} - - -} - +package org.hl7.fhir.r5.patterns; + +/*- + * #%L + * org.hl7.fhir.r5 + * %% + * Copyright (C) 2014 - 2019 Health Level 7 + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + +/* + Copyright (c) 2011+, HL7, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of HL7 nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ + +// Generated on Wed, May 8, 2019 10:40+1000 for FHIR v4.1.0 + +import java.util.*; + +import org.hl7.fhir.utilities.Utilities; +import org.hl7.fhir.r5.model.Enumerations.*; +import org.hl7.fhir.r5.model.*; +import org.hl7.fhir.r5.model.Enumeration; +import org.hl7.fhir.exceptions.FHIRException; + +public class ActivityDefinitionDefinitionImpl extends PatternBaseImpl implements Definition { + + private ActivityDefinition wrapped; + + public ActivityDefinitionDefinitionImpl(ActivityDefinition wrapped) { + super(wrapped); + this.wrapped = wrapped; + } + + public int getUrlMin() { + return 0; + } + + public int getUrlMax() { + return 1; + } + + public UriType getUrlElement() throws FHIRException { + return wrapped.getUrlElement(); + } + + + public boolean hasUrlElement() { + return wrapped.hasUrlElement(); + } + + + public boolean hasUrl() { + return wrapped.hasUrl(); + } + + + public Definition setUrlElement(UriType value) throws FHIRException { + wrapped.setUrlElement(value); + return this; + + } + + + public String getUrl() throws FHIRException { + return wrapped.getUrl(); + } + + public Definition setUrl(String value) throws FHIRException { + wrapped.setUrl(value); + return this; + +} + + public int getIdentifierMin() { + return 0; + } + + public int getIdentifierMax() { + return 2147483647; + } + + public Identifier getIdentifier() throws FHIRException { + return wrapped.getIdentifierFirstRep(); + } + + public boolean hasIdentifier() { + return wrapped.hasIdentifier(); + } + + public Definition setIdentifier(Identifier value) throws FHIRException { + wrapped.getIdentifier().clear(); + if (value != null) + wrapped.getIdentifier().add(value); + return this; + + } + + public int getVersionMin() { + return 0; + } + + public int getVersionMax() { + return 1; + } + + public StringType getVersionElement() throws FHIRException { + return wrapped.getVersionElement(); + } + + + public boolean hasVersionElement() { + return wrapped.hasVersionElement(); + } + + + public boolean hasVersion() { + return wrapped.hasVersion(); + } + + + public Definition setVersionElement(StringType value) throws FHIRException { + wrapped.setVersionElement(value); + return this; + + } + + + public String getVersion() throws FHIRException { + return wrapped.getVersion(); + } + + public Definition setVersion(String value) throws FHIRException { + wrapped.setVersion(value); + return this; + +} + + public int getTitleMin() { + return 0; + } + + public int getTitleMax() { + return 1; + } + + public StringType getTitleElement() throws FHIRException { + return wrapped.getTitleElement(); + } + + + public boolean hasTitleElement() { + return wrapped.hasTitleElement(); + } + + + public boolean hasTitle() { + return wrapped.hasTitle(); + } + + + public Definition setTitleElement(StringType value) throws FHIRException { + wrapped.setTitleElement(value); + return this; + + } + + + public String getTitle() throws FHIRException { + return wrapped.getTitle(); + } + + public Definition setTitle(String value) throws FHIRException { + wrapped.setTitle(value); + return this; + +} + + public int getDerivedFromCanonicalMin() { + return 0; + } + + public int getDerivedFromCanonicalMax() { + return 0; + } + + public List getDerivedFromCanonical() throws FHIRException { + throw new FHIRException("The pattern property 'derivedFromCanonical' is not supported in 'ActivityDefinition'"); + } + + public Definition setDerivedFromCanonical(List theDerivedFromCanonical) throws FHIRException { + + throw new FHIRException("The pattern property 'derivedFromCanonical' is not supported in 'ActivityDefinition'"); + } + + public boolean hasDerivedFromCanonical() { + return false; + } + + + public CanonicalType addDerivedFromCanonicalElement() throws FHIRException { + throw new FHIRException("The pattern property 'derivedFromCanonical' is not supported in 'ActivityDefinition'"); + } + + + public Definition addDerivedFromCanonical(String value) throws FHIRException { + throw new FHIRException("The pattern property 'derivedFromCanonical' is not supported in 'ActivityDefinition'"); + } + + + public boolean hasDerivedFromCanonical(String value) { + return false; + } + + + public int getDerivedFromUriMin() { + return 0; + } + + public int getDerivedFromUriMax() { + return 0; + } + + public List getDerivedFromUri() throws FHIRException { + throw new FHIRException("The pattern property 'derivedFromUri' is not supported in 'ActivityDefinition'"); + } + + public Definition setDerivedFromUri(List theDerivedFromUri) throws FHIRException { + + throw new FHIRException("The pattern property 'derivedFromUri' is not supported in 'ActivityDefinition'"); + } + + public boolean hasDerivedFromUri() { + return false; + } + + + public UriType addDerivedFromUriElement() throws FHIRException { + throw new FHIRException("The pattern property 'derivedFromUri' is not supported in 'ActivityDefinition'"); + } + + + public Definition addDerivedFromUri(String value) throws FHIRException { + throw new FHIRException("The pattern property 'derivedFromUri' is not supported in 'ActivityDefinition'"); + } + + + public boolean hasDerivedFromUri(String value) { + return false; + } + + + public int getPartOfMin() { + return 0; + } + + public int getPartOfMax() { + return 0; + } + + public List getPartOf() throws FHIRException { + throw new FHIRException("The pattern property 'partOf' is not supported in 'ActivityDefinition'"); + } + + public Definition setPartOf(List thePartOf) throws FHIRException { + + throw new FHIRException("The pattern property 'partOf' is not supported in 'ActivityDefinition'"); + } + + public boolean hasPartOf() { + return false; + } + + + public CanonicalType addPartOfElement() throws FHIRException { + throw new FHIRException("The pattern property 'partOf' is not supported in 'ActivityDefinition'"); + } + + + public Definition addPartOf(String value) throws FHIRException { + throw new FHIRException("The pattern property 'partOf' is not supported in 'ActivityDefinition'"); + } + + + public boolean hasPartOf(String value) { + return false; + } + + + public int getReplacesMin() { + return 0; + } + + public int getReplacesMax() { + return 0; + } + + public List getReplaces() throws FHIRException { + throw new FHIRException("The pattern property 'replaces' is not supported in 'ActivityDefinition'"); + } + + public Definition setReplaces(List theReplaces) throws FHIRException { + + throw new FHIRException("The pattern property 'replaces' is not supported in 'ActivityDefinition'"); + } + + public boolean hasReplaces() { + return false; + } + + + public CanonicalType addReplacesElement() throws FHIRException { + throw new FHIRException("The pattern property 'replaces' is not supported in 'ActivityDefinition'"); + } + + + public Definition addReplaces(String value) throws FHIRException { + throw new FHIRException("The pattern property 'replaces' is not supported in 'ActivityDefinition'"); + } + + + public boolean hasReplaces(String value) { + return false; + } + + + public int getStatusMin() { + return 0; + } + + public int getStatusMax() { + return 0; + } + + public Enumeration getStatusElement() throws FHIRException { + throw new FHIRException("The pattern property 'status' is not supported in 'ActivityDefinition'"); + } + + + public boolean hasStatusElement() { + return false; + } + + + public boolean hasStatus() { + return false; + } + + + public Definition setStatusElement(Enumeration value) throws FHIRException { + throw new FHIRException("The pattern property 'status' is not supported in 'ActivityDefinition'"); + } + + + public PublicationStatus getStatus() throws FHIRException { + throw new FHIRException("The pattern property 'status' is not supported in 'ActivityDefinition'"); + } + + public Definition setStatus(PublicationStatus value) throws FHIRException { + throw new FHIRException("The pattern property 'status' is not supported in 'ActivityDefinition'"); +} + + public int getExperimentalMin() { + return 0; + } + + public int getExperimentalMax() { + return 1; + } + + public BooleanType getExperimentalElement() throws FHIRException { + return wrapped.getExperimentalElement(); + } + + + public boolean hasExperimentalElement() { + return wrapped.hasExperimentalElement(); + } + + + public boolean hasExperimental() { + return wrapped.hasExperimental(); + } + + + public Definition setExperimentalElement(BooleanType value) throws FHIRException { + wrapped.setExperimentalElement(value); + return this; + + } + + + public boolean getExperimental() throws FHIRException { + return wrapped.getExperimental(); + } + + public Definition setExperimental(boolean value) throws FHIRException { + wrapped.setExperimental(value); + return this; + +} + + public int getSubjectMin() { + return 0; + } + + public int getSubjectMax() { + return 0; + } + + public Type getSubject() throws FHIRException { + throw new FHIRException("The pattern property 'subject[x]' is not supported in 'ActivityDefinition'"); + } + + public CodeableConcept getSubjectCodeableConcept() throws FHIRException { + throw new FHIRException("The pattern property 'subject[x]' is not supported in 'ActivityDefinition'"); + } + + public boolean hasSubjectCodeableConcept() { + return false; + } + + public Reference getSubjectReference() throws FHIRException { + throw new FHIRException("The pattern property 'subject[x]' is not supported in 'ActivityDefinition'"); + } + + public boolean hasSubjectReference() { + return false; + } + + public boolean hasSubject() { + return false; + } + + public Definition setSubject(Type value) throws FHIRException { + throw new FHIRException("The pattern property 'subject[x]' is not supported in 'ActivityDefinition'"); + } + + public int getDateMin() { + return 0; + } + + public int getDateMax() { + return 1; + } + + public DateTimeType getDateElement() throws FHIRException { + return wrapped.getDateElement(); + } + + + public boolean hasDateElement() { + return wrapped.hasDateElement(); + } + + + public boolean hasDate() { + return wrapped.hasDate(); + } + + + public Definition setDateElement(DateTimeType value) throws FHIRException { + wrapped.setDateElement(value); + return this; + + } + + + public Date getDate() throws FHIRException { + return wrapped.getDate(); + } + + public Definition setDate(Date value) throws FHIRException { + wrapped.setDate(value); + return this; + +} + + public int getPublisherMin() { + return 0; + } + + public int getPublisherMax() { + return 0; + } + + public Reference getPublisher() throws FHIRException { + throw new FHIRException("The pattern property 'publisher' is not supported in 'ActivityDefinition'"); + } + + public boolean hasPublisher() { + return false; + } + + public Definition setPublisher(Reference value) throws FHIRException { + throw new FHIRException("The pattern property 'publisher' is not supported in 'ActivityDefinition'"); + } + + public int getContactMin() { + return 0; + } + + public int getContactMax() { + return 2147483647; + } + + public List getContact() throws FHIRException { + return wrapped.getContact(); + } + + public Definition setContact(List theContact) throws FHIRException { + + wrapped.setContact(theContact); + return this; + + } + + public boolean hasContact() { + return wrapped.hasContact(); + } + + + public ContactDetail addContact() throws FHIRException { + throw new FHIRException("The pattern property 'contact' is not supported in 'ActivityDefinition'"); + } + + + public Definition addContact(ContactDetail t) throws FHIRException { + throw new FHIRException("The pattern property 'contact' is not supported in 'ActivityDefinition'"); + } + + + public ContactDetail getContactFirstRep() throws FHIRException { + + return wrapped.getContactFirstRep(); + } + + public int getDescriptionMin() { + return 0; + } + + public int getDescriptionMax() { + return 1; + } + + public MarkdownType getDescriptionElement() throws FHIRException { + return wrapped.getDescriptionElement(); + } + + + public boolean hasDescriptionElement() { + return wrapped.hasDescriptionElement(); + } + + + public boolean hasDescription() { + return wrapped.hasDescription(); + } + + + public Definition setDescriptionElement(MarkdownType value) throws FHIRException { + wrapped.setDescriptionElement(value); + return this; + + } + + + public String getDescription() throws FHIRException { + return wrapped.getDescription(); + } + + public Definition setDescription(String value) throws FHIRException { + wrapped.setDescription(value); + return this; + +} + + public int getUseContextMin() { + return 0; + } + + public int getUseContextMax() { + return 2147483647; + } + + public List getUseContext() throws FHIRException { + return wrapped.getUseContext(); + } + + public Definition setUseContext(List theUseContext) throws FHIRException { + + wrapped.setUseContext(theUseContext); + return this; + + } + + public boolean hasUseContext() { + return wrapped.hasUseContext(); + } + + + public UsageContext addUseContext() throws FHIRException { + throw new FHIRException("The pattern property 'useContext' is not supported in 'ActivityDefinition'"); + } + + + public Definition addUseContext(UsageContext t) throws FHIRException { + throw new FHIRException("The pattern property 'useContext' is not supported in 'ActivityDefinition'"); + } + + + public UsageContext getUseContextFirstRep() throws FHIRException { + + return wrapped.getUseContextFirstRep(); + } + + public int getJurisdictionMin() { + return 0; + } + + public int getJurisdictionMax() { + return 2147483647; + } + + public List getJurisdiction() throws FHIRException { + return wrapped.getJurisdiction(); + } + + public Definition setJurisdiction(List theJurisdiction) throws FHIRException { + + wrapped.setJurisdiction(theJurisdiction); + return this; + + } + + public boolean hasJurisdiction() { + return wrapped.hasJurisdiction(); + } + + + public CodeableConcept addJurisdiction() throws FHIRException { + throw new FHIRException("The pattern property 'jurisdiction' is not supported in 'ActivityDefinition'"); + } + + + public Definition addJurisdiction(CodeableConcept t) throws FHIRException { + throw new FHIRException("The pattern property 'jurisdiction' is not supported in 'ActivityDefinition'"); + } + + + public CodeableConcept getJurisdictionFirstRep() throws FHIRException { + + return wrapped.getJurisdictionFirstRep(); + } + + public int getPurposeMin() { + return 0; + } + + public int getPurposeMax() { + return 1; + } + + public MarkdownType getPurposeElement() throws FHIRException { + return wrapped.getPurposeElement(); + } + + + public boolean hasPurposeElement() { + return wrapped.hasPurposeElement(); + } + + + public boolean hasPurpose() { + return wrapped.hasPurpose(); + } + + + public Definition setPurposeElement(MarkdownType value) throws FHIRException { + wrapped.setPurposeElement(value); + return this; + + } + + + public String getPurpose() throws FHIRException { + return wrapped.getPurpose(); + } + + public Definition setPurpose(String value) throws FHIRException { + wrapped.setPurpose(value); + return this; + +} + + public int getCopyrightMin() { + return 0; + } + + public int getCopyrightMax() { + return 1; + } + + public MarkdownType getCopyrightElement() throws FHIRException { + return wrapped.getCopyrightElement(); + } + + + public boolean hasCopyrightElement() { + return wrapped.hasCopyrightElement(); + } + + + public boolean hasCopyright() { + return wrapped.hasCopyright(); + } + + + public Definition setCopyrightElement(MarkdownType value) throws FHIRException { + wrapped.setCopyrightElement(value); + return this; + + } + + + public String getCopyright() throws FHIRException { + return wrapped.getCopyright(); + } + + public Definition setCopyright(String value) throws FHIRException { + wrapped.setCopyright(value); + return this; + +} + + public int getApprovalDateMin() { + return 0; + } + + public int getApprovalDateMax() { + return 1; + } + + public DateType getApprovalDateElement() throws FHIRException { + return wrapped.getApprovalDateElement(); + } + + + public boolean hasApprovalDateElement() { + return wrapped.hasApprovalDateElement(); + } + + + public boolean hasApprovalDate() { + return wrapped.hasApprovalDate(); + } + + + public Definition setApprovalDateElement(DateType value) throws FHIRException { + wrapped.setApprovalDateElement(value); + return this; + + } + + + public Date getApprovalDate() throws FHIRException { + return wrapped.getApprovalDate(); + } + + public Definition setApprovalDate(Date value) throws FHIRException { + wrapped.setApprovalDate(value); + return this; + +} + + public int getLastReviewDateMin() { + return 0; + } + + public int getLastReviewDateMax() { + return 1; + } + + public DateType getLastReviewDateElement() throws FHIRException { + return wrapped.getLastReviewDateElement(); + } + + + public boolean hasLastReviewDateElement() { + return wrapped.hasLastReviewDateElement(); + } + + + public boolean hasLastReviewDate() { + return wrapped.hasLastReviewDate(); + } + + + public Definition setLastReviewDateElement(DateType value) throws FHIRException { + wrapped.setLastReviewDateElement(value); + return this; + + } + + + public Date getLastReviewDate() throws FHIRException { + return wrapped.getLastReviewDate(); + } + + public Definition setLastReviewDate(Date value) throws FHIRException { + wrapped.setLastReviewDate(value); + return this; + +} + + public int getEffectivePeriodMin() { + return 0; + } + + public int getEffectivePeriodMax() { + return 1; + } + + public Period getEffectivePeriod() throws FHIRException { + return wrapped.getEffectivePeriod(); + } + + public boolean hasEffectivePeriod() { + return wrapped.hasEffectivePeriod(); + } + + public Definition setEffectivePeriod(Period value) throws FHIRException { + wrapped.setEffectivePeriod(value); + return this; + + } + + public int getPerformerTypeMin() { + return 0; + } + + public int getPerformerTypeMax() { + return 0; + } + + public CodeableConcept getPerformerType() throws FHIRException { + throw new FHIRException("The pattern property 'performerType' is not supported in 'ActivityDefinition'"); + } + + public boolean hasPerformerType() { + return false; + } + + public Definition setPerformerType(CodeableConcept value) throws FHIRException { + throw new FHIRException("The pattern property 'performerType' is not supported in 'ActivityDefinition'"); + } + + public String fhirType() { + return "ActivityDefinition"; +} + + +} + diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/MappingSheetParser.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/MappingSheetParser.java index 6c59e1065..636c46199 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/MappingSheetParser.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/MappingSheetParser.java @@ -1,5 +1,25 @@ package org.hl7.fhir.r5.utils; +/*- + * #%L + * org.hl7.fhir.r5 + * %% + * Copyright (C) 2014 - 2019 Health Level 7 + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/Unbundler.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/Unbundler.java index 82aa1e58a..9931dedbb 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/Unbundler.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/Unbundler.java @@ -1,33 +1,54 @@ -package org.hl7.fhir.r5.utils; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; - -import org.hl7.fhir.exceptions.FHIRFormatError; -import org.hl7.fhir.r5.formats.JsonParser; -import org.hl7.fhir.r5.model.Bundle; -import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent; -import org.hl7.fhir.r5.model.Resource; -import org.hl7.fhir.utilities.Utilities; - -public class Unbundler { - - public static void main(String[] args) throws Exception { - unbundle(args[0]); - } - - private static void unbundle(String src) throws FHIRFormatError, FileNotFoundException, IOException { - String folder = Utilities.getDirectoryForFile(src); - Bundle bnd = (Bundle) new JsonParser().parse(new FileInputStream(src)); - for (BundleEntryComponent be : bnd.getEntry()) { - Resource r = be.getResource(); - if (r != null) { - String tgt = Utilities.path(folder, r.fhirType()+"-"+r.getId()+".json"); - new JsonParser().compose(new FileOutputStream(tgt), r); - } - } - } - -} +package org.hl7.fhir.r5.utils; + +/*- + * #%L + * org.hl7.fhir.r5 + * %% + * Copyright (C) 2014 - 2019 Health Level 7 + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; + +import org.hl7.fhir.exceptions.FHIRFormatError; +import org.hl7.fhir.r5.formats.JsonParser; +import org.hl7.fhir.r5.model.Bundle; +import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.r5.model.Resource; +import org.hl7.fhir.utilities.Utilities; + +public class Unbundler { + + public static void main(String[] args) throws Exception { + unbundle(args[0]); + } + + private static void unbundle(String src) throws FHIRFormatError, FileNotFoundException, IOException { + String folder = Utilities.getDirectoryForFile(src); + Bundle bnd = (Bundle) new JsonParser().parse(new FileInputStream(src)); + for (BundleEntryComponent be : bnd.getEntry()) { + Resource r = be.getResource(); + if (r != null) { + String tgt = Utilities.path(folder, r.fhirType()+"-"+r.getId()+".json"); + new JsonParser().compose(new FileOutputStream(tgt), r); + } + } + } + +} diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/AudioUtilities.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/AudioUtilities.java index 7e712c39e..ba4ca7932 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/AudioUtilities.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/AudioUtilities.java @@ -1,5 +1,25 @@ package org.hl7.fhir.utilities; +/*- + * #%L + * org.hl7.fhir.utilities + * %% + * Copyright (C) 2014 - 2019 Health Level 7 + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.SourceDataLine; diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/XmlUtilities.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/XmlUtilities.java index 3e2760a32..b84ebb643 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/XmlUtilities.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/XmlUtilities.java @@ -1,5 +1,25 @@ package org.hl7.fhir.utilities; +/*- + * #%L + * org.hl7.fhir.utilities + * %% + * Copyright (C) 2014 - 2019 Health Level 7 + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import net.sf.saxon.TransformerFactoryImpl; import javax.xml.transform.Transformer; diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/EnableWhenEvaluator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/EnableWhenEvaluator.java index 56216b686..b4ed77368 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/EnableWhenEvaluator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/EnableWhenEvaluator.java @@ -1,5 +1,25 @@ package org.hl7.fhir.r5.validation; +/*- + * #%L + * org.hl7.fhir.validation + * %% + * Copyright (C) 2014 - 2019 Health Level 7 + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import java.util.*; import java.util.stream.*; diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/XmlValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/XmlValidator.java index 67bf92b30..5b245767a 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/XmlValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/XmlValidator.java @@ -9,9 +9,9 @@ package org.hl7.fhir.r5.validation; * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.