use of org.hl7.fhir.r4.model.Parameters in project org.hl7.fhir.core by hapifhir.
the class BaseWorkerContext method verifyCodeExternal.
private ValidationResult verifyCodeExternal(ValueSet vs, Coding coding, boolean tryCache) {
ValidationResult res = handleByCache(vs, coding, tryCache);
if (res != null)
return res;
Parameters pin = new Parameters();
pin.addParameter().setName("coding").setValue(coding);
pin.addParameter().setName("valueSet").setResource(vs);
res = serverValidateCode(pin);
Map<String, ValidationResult> cache = validationCache.get(vs.getUrl());
cache.put(cacheId(coding), res);
return res;
}
use of org.hl7.fhir.r4.model.Parameters in project org.hl7.fhir.core by hapifhir.
the class BatchLoader method main.
public static void main(String[] args) throws IOException, Exception {
if (args.length < 4) {
System.out.println("Batch uploader takes 4 parameters in order: server base url, file/folder to upload, xml/json, and batch size");
} else {
String server = args[0];
String file = args[1];
// args[2].equals("json") ? new JsonParser() : new XmlParser();
IParser p = new JsonParser();
int size = Integer.parseInt(args[3]);
size = 500;
if (file.endsWith(".xml")) {
throw new FHIRException("Unimplemented file type " + file);
} else if (file.endsWith(".json")) {
throw new FHIRException("Unimplemented file type " + file);
} else if (file.endsWith(".zip")) {
LoadZipFile(server, file, p, size, 0, -1);
} else if (new File(file).isDirectory()) {
LoadDirectory(server, file, p, size);
} else
throw new FHIRException("Unknown file type " + file);
}
}
use of org.hl7.fhir.r4.model.Parameters in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeParameters.
protected void composeParameters(Complex parent, String parentType, String name, Parameters element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeResource(t, "Parameters", name, element, index);
for (int i = 0; i < element.getParameter().size(); i++) composeParametersParametersParameterComponent(t, "Parameters", "parameter", element.getParameter().get(i), i);
}
use of org.hl7.fhir.r4.model.Parameters in project org.hl7.fhir.core by hapifhir.
the class Parameters method copy.
public Parameters copy() {
Parameters dst = new Parameters();
copyValues(dst);
if (parameter != null) {
dst.parameter = new ArrayList<ParametersParameterComponent>();
for (ParametersParameterComponent i : parameter) dst.parameter.add(i.copy());
}
;
return dst;
}
use of org.hl7.fhir.r4.model.Parameters in project org.hl7.fhir.core by hapifhir.
the class BaseWorkerContext method verifyCodeExternal.
private ValidationResult verifyCodeExternal(ValueSet vs, CodeableConcept cc, boolean tryCache) throws Exception {
ValidationResult res = handleByCache(vs, cc, tryCache);
if (res != null) {
return res;
}
Parameters pin = new Parameters();
pin.addParameter().setName("codeableConcept").setValue(cc);
pin.addParameter().setName("valueSet").setResource(vs);
res = serverValidateCode(pin, false);
Map<String, ValidationResult> cache = validationCache.get(vs.getUrl());
cache.put(cacheId(cc), res);
return res;
}
Aggregations