Merge pull request #1230 from hapifhir/MapValidationStuff
Fix IG Loader problems where map conversion no longer works with a 'n…
This commit is contained in:
commit
1f76c6e944
|
@ -140,6 +140,11 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static SimpleWorkerContext fromNothing() throws FileNotFoundException, IOException, FHIRException {
|
||||||
|
SimpleWorkerContext res = new SimpleWorkerContext();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
public static SimpleWorkerContext fromPackage(NpmPackage pi, boolean allowDuplicates) throws FileNotFoundException, IOException, FHIRException {
|
public static SimpleWorkerContext fromPackage(NpmPackage pi, boolean allowDuplicates) throws FileNotFoundException, IOException, FHIRException {
|
||||||
SimpleWorkerContext res = new SimpleWorkerContext();
|
SimpleWorkerContext res = new SimpleWorkerContext();
|
||||||
res.setAllowLoadingDuplicates(allowDuplicates);
|
res.setAllowLoadingDuplicates(allowDuplicates);
|
||||||
|
|
|
@ -147,6 +147,11 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static SimpleWorkerContext fromNothing() throws FileNotFoundException, IOException, FHIRException {
|
||||||
|
SimpleWorkerContext res = new SimpleWorkerContext();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
public static SimpleWorkerContext fromPackage(NpmPackage pi, boolean allowDuplicates) throws FileNotFoundException, IOException, FHIRException {
|
public static SimpleWorkerContext fromPackage(NpmPackage pi, boolean allowDuplicates) throws FileNotFoundException, IOException, FHIRException {
|
||||||
SimpleWorkerContext res = new SimpleWorkerContext();
|
SimpleWorkerContext res = new SimpleWorkerContext();
|
||||||
res.setAllowLoadingDuplicates(allowDuplicates);
|
res.setAllowLoadingDuplicates(allowDuplicates);
|
||||||
|
|
|
@ -785,7 +785,7 @@ public class IgLoader {
|
||||||
else if (fn.endsWith(".json") && !fn.endsWith("template.json"))
|
else if (fn.endsWith(".json") && !fn.endsWith("template.json"))
|
||||||
res = new org.hl7.fhir.dstu3.formats.JsonParser().parse(new ByteArrayInputStream(content));
|
res = new org.hl7.fhir.dstu3.formats.JsonParser().parse(new ByteArrayInputStream(content));
|
||||||
else if (fn.endsWith(".txt") || fn.endsWith(".map") || fn.endsWith(".fml"))
|
else if (fn.endsWith(".txt") || fn.endsWith(".map") || fn.endsWith(".fml"))
|
||||||
res = new org.hl7.fhir.dstu3.utils.StructureMapUtilities(null).parse(new String(content));
|
res = new org.hl7.fhir.dstu3.utils.StructureMapUtilities(org.hl7.fhir.dstu3.context.SimpleWorkerContext.fromNothing()).parse(new String(content));
|
||||||
else
|
else
|
||||||
throw new FHIRException("Unsupported format for " + fn);
|
throw new FHIRException("Unsupported format for " + fn);
|
||||||
r = VersionConvertorFactory_30_50.convertResource(res);
|
r = VersionConvertorFactory_30_50.convertResource(res);
|
||||||
|
@ -796,7 +796,7 @@ public class IgLoader {
|
||||||
else if (fn.endsWith(".json") && !fn.endsWith("template.json"))
|
else if (fn.endsWith(".json") && !fn.endsWith("template.json"))
|
||||||
res = new org.hl7.fhir.r4.formats.JsonParser().parse(new ByteArrayInputStream(content));
|
res = new org.hl7.fhir.r4.formats.JsonParser().parse(new ByteArrayInputStream(content));
|
||||||
else if (fn.endsWith(".txt") || fn.endsWith(".map") || fn.endsWith(".fml"))
|
else if (fn.endsWith(".txt") || fn.endsWith(".map") || fn.endsWith(".fml"))
|
||||||
res = new org.hl7.fhir.r4.utils.StructureMapUtilities(null).parse(new String(content), fn);
|
res = new org.hl7.fhir.r4.utils.StructureMapUtilities(org.hl7.fhir.r4.context.SimpleWorkerContext.fromNothing()).parse(new String(content), fn);
|
||||||
else
|
else
|
||||||
throw new FHIRException("Unsupported format for " + fn);
|
throw new FHIRException("Unsupported format for " + fn);
|
||||||
r = VersionConvertorFactory_40_50.convertResource(res);
|
r = VersionConvertorFactory_40_50.convertResource(res);
|
||||||
|
@ -807,7 +807,7 @@ public class IgLoader {
|
||||||
else if (fn.endsWith(".json") && !fn.endsWith("template.json"))
|
else if (fn.endsWith(".json") && !fn.endsWith("template.json"))
|
||||||
res = new org.hl7.fhir.r4b.formats.JsonParser().parse(new ByteArrayInputStream(content));
|
res = new org.hl7.fhir.r4b.formats.JsonParser().parse(new ByteArrayInputStream(content));
|
||||||
else if (fn.endsWith(".txt") || fn.endsWith(".map") || fn.endsWith(".fml"))
|
else if (fn.endsWith(".txt") || fn.endsWith(".map") || fn.endsWith(".fml"))
|
||||||
res = new org.hl7.fhir.r4b.utils.structuremap.StructureMapUtilities(null).parse(new String(content), fn);
|
res = new org.hl7.fhir.r4b.utils.structuremap.StructureMapUtilities(org.hl7.fhir.r4b.context.SimpleWorkerContext.fromNothing()).parse(new String(content), fn);
|
||||||
else
|
else
|
||||||
throw new FHIRException("Unsupported format for " + fn);
|
throw new FHIRException("Unsupported format for " + fn);
|
||||||
r = VersionConvertorFactory_43_50.convertResource(res);
|
r = VersionConvertorFactory_43_50.convertResource(res);
|
||||||
|
|
Loading…
Reference in New Issue