Search in sources :

Example 76 with Parameters

use of org.hl7.fhir.r5.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;
}
Also used : Parameters(org.hl7.fhir.dstu2.model.Parameters)

Example 77 with Parameters

use of org.hl7.fhir.r5.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);
    }
}
Also used : FHIRException(org.hl7.fhir.exceptions.FHIRException) File(java.io.File) IParser(org.hl7.fhir.dstu2.formats.IParser) JsonParser(org.hl7.fhir.dstu2.formats.JsonParser)

Example 78 with Parameters

use of org.hl7.fhir.r5.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);
}
Also used : Complex(org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)

Example 79 with Parameters

use of org.hl7.fhir.r5.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;
}
Also used : IBaseParameters(org.hl7.fhir.instance.model.api.IBaseParameters)

Example 80 with Parameters

use of org.hl7.fhir.r5.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;
}
Also used : Parameters(org.hl7.fhir.dstu3.model.Parameters)

Aggregations

Parameters (org.hl7.fhir.r4.model.Parameters)105 Test (org.junit.jupiter.api.Test)96 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)71 StringType (org.hl7.fhir.r4.model.StringType)68 RestIntegrationTest (org.opencds.cqf.ruler.test.RestIntegrationTest)61 HashMap (java.util.HashMap)58 ArrayList (java.util.ArrayList)53 FHIRException (org.hl7.fhir.exceptions.FHIRException)48 IOException (java.io.IOException)44 Parameters (org.hl7.fhir.dstu3.model.Parameters)41 Bundle (org.hl7.fhir.r4.model.Bundle)34 Measure (org.hl7.fhir.r4.model.Measure)31 Path (javax.ws.rs.Path)25 Produces (javax.ws.rs.Produces)25 Patient (org.hl7.fhir.r4.model.Patient)25 FileNotFoundException (java.io.FileNotFoundException)24 List (java.util.List)24 JsonObject (javax.json.JsonObject)23 GET (javax.ws.rs.GET)23 ExtraParameters (org.apache.camel.component.fhir.api.ExtraParameters)23