From 60085522f788b0faec3ac893d724fe867ae07725 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Sat, 11 Jan 2020 06:18:23 +1100 Subject: [PATCH] clean up old code --- .../generator/loader/DefinitionsLoader.java | 60 ------------------- 1 file changed, 60 deletions(-) delete mode 100644 org.hl7.fhir.core.generator/src/org/hl7/fhir/core/generator/loader/DefinitionsLoader.java diff --git a/org.hl7.fhir.core.generator/src/org/hl7/fhir/core/generator/loader/DefinitionsLoader.java b/org.hl7.fhir.core.generator/src/org/hl7/fhir/core/generator/loader/DefinitionsLoader.java deleted file mode 100644 index a9f4b15d8..000000000 --- a/org.hl7.fhir.core.generator/src/org/hl7/fhir/core/generator/loader/DefinitionsLoader.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.hl7.fhir.core.generator.loader; - -import java.io.IOException; - -import org.hl7.fhir.core.generator.engine.Definitions; -import org.hl7.fhir.exceptions.FHIRFormatError; -import org.hl7.fhir.r5.formats.JsonParser; -import org.hl7.fhir.r5.model.CapabilityStatement; -import org.hl7.fhir.r5.model.CodeSystem; -import org.hl7.fhir.r5.model.CompartmentDefinition; -import org.hl7.fhir.r5.model.ConceptMap; -import org.hl7.fhir.r5.model.OperationDefinition; -import org.hl7.fhir.r5.model.Resource; -import org.hl7.fhir.r5.model.SearchParameter; -import org.hl7.fhir.r5.model.StructureDefinition; -import org.hl7.fhir.r5.model.ValueSet; -import org.hl7.fhir.utilities.cache.NpmPackage; -import org.hl7.fhir.utilities.cache.PackageCacheManager; -import org.hl7.fhir.utilities.cache.ToolsVersion; - -public class DefinitionsLoader { - - public static Definitions load(NpmPackage npm) throws IOException { - Definitions res = new Definitions(); - - for (String t : npm.listResources("CodeSystem")) { - res.getCodeSystems().see((CodeSystem) load(npm, t)); - } - for (String t : npm.listResources("ValueSet")) { - res.getValuesets().see((ValueSet) load(npm, t)); - } - for (String t : npm.listResources("ConceptMap")) { - res.getConceptMaps().see((ConceptMap) load(npm, t)); - } - for (String t : npm.listResources("CapabilityStatement")) { - res.getStatements().see((CapabilityStatement) load(npm, t)); - } - for (String t : npm.listResources("StructureDefinition")) { - res.getStructures().see((StructureDefinition) load(npm, t)); - } - for (String t : npm.listResources("OperationDefinition")) { - res.getOperations().see((OperationDefinition) load(npm, t)); - } - for (String t : npm.listResources("SearchParameter")) { - res.getSearchParams().see((SearchParameter) load(npm, t)); - } - for (String t : npm.listResources("CompartmentDefinition")) { - res.getCompartments().see((CompartmentDefinition) load(npm, t)); - } - return res; - } - - public static Resource load(NpmPackage npm, String t) { - try { - return new JsonParser().parse(npm.loadResource(t)); - } catch (Exception e) { - throw new Error("Error reading "+t+": "+e.getMessage(), e); - } - } -}