use of org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent in project camel-quarkus by apache.
the class FhirDstu2_1Resource method operationOnType.
@Path("/operation/onType")
@GET
@Produces(MediaType.TEXT_PLAIN)
public String operationOnType() {
Map<String, Object> headers = new HashMap<>();
headers.put("CamelFhir.resourceType", Patient.class);
headers.put("CamelFhir.name", "everything");
headers.put("CamelFhir.parameters", null);
headers.put("CamelFhir.outputParameterType", Parameters.class);
headers.put("CamelFhir.useHttpGet", Boolean.FALSE);
headers.put("CamelFhir.returnType", null);
headers.put("CamelFhir.extraParameters", null);
Parameters result = producerTemplate.requestBodyAndHeaders("direct:operationOnType-dstu2-1", null, headers, Parameters.class);
Parameters.ParametersParameterComponent parametersParameterComponent = result.getParameter().get(0);
Bundle bundle = (Bundle) parametersParameterComponent.getResource();
Bundle.BundleEntryComponent bundleEntryComponent = bundle.getEntry().get(0);
return bundleEntryComponent.getResource().getIdElement().toUnqualifiedVersionless().getValue();
}
use of org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent in project camel-quarkus by apache.
the class FhirDstu2Hl7OrgResource method operationOnInstance.
// ///////////////////
// Operation
// ///////////////////
@Path("/operation/onInstance")
@GET
@Produces(MediaType.TEXT_PLAIN)
public String operationOnInstance(@QueryParam("id") String id) {
IdType iIdType = new IdType(id);
Map<String, Object> headers = new HashMap<>();
headers.put("CamelFhir.id", iIdType);
headers.put("CamelFhir.name", "everything");
headers.put("CamelFhir.parameters", null);
headers.put("CamelFhir.outputParameterType", Parameters.class);
headers.put("CamelFhir.useHttpGet", Boolean.FALSE);
headers.put("CamelFhir.returnType", null);
headers.put("CamelFhir.extraParameters", null);
Parameters result = producerTemplate.requestBodyAndHeaders("direct:operationOnInstance-dstu2-hl7org", null, headers, Parameters.class);
Parameters.ParametersParameterComponent parametersParameterComponent = result.getParameter().get(0);
Bundle bundle = (Bundle) parametersParameterComponent.getResource();
Bundle.BundleEntryComponent bundleEntryComponent = bundle.getEntry().get(0);
return bundleEntryComponent.getResource().getIdElement().toUnqualifiedVersionless().getValue();
}
use of org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent in project camel-quarkus by apache.
the class FhirDstu2Hl7OrgResource method operationOnInstanceVersion.
@Path("/operation/onInstanceVersion")
@GET
@Produces(MediaType.TEXT_PLAIN)
public String operationOnInstanceVersion(@QueryParam("id") String id) {
IdType iIdType = new IdType(id);
Map<String, Object> headers = new HashMap<>();
headers.put("CamelFhir.id", iIdType);
headers.put("CamelFhir.name", "everything");
headers.put("CamelFhir.parameters", null);
headers.put("CamelFhir.outputParameterType", Parameters.class);
headers.put("CamelFhir.useHttpGet", Boolean.FALSE);
headers.put("CamelFhir.returnType", null);
headers.put("CamelFhir.extraParameters", null);
Parameters result = producerTemplate.requestBodyAndHeaders("direct:operationOnInstanceVersion-dstu2-hl7org", null, headers, Parameters.class);
Parameters.ParametersParameterComponent parametersParameterComponent = result.getParameter().get(0);
Bundle bundle = (Bundle) parametersParameterComponent.getResource();
Bundle.BundleEntryComponent bundleEntryComponent = bundle.getEntry().get(0);
return bundleEntryComponent.getResource().getIdElement().toUnqualifiedVersionless().getValue();
}
use of org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent in project cqf-ruler by DBCG.
the class CollectDataProviderIT method testCollectData.
@Test
public void testCollectData() {
// Create test Measure
String cql = CqlBuilder.newCqlLibrary("3.0.0").addExpression("Initial Population", "exists([Observation])").build();
Library lib = Libraries.library(cql);
Measure m = MeasureBuilder.newCohortMeasure(lib).build();
this.update(lib);
this.update(m);
// Create test data
Patient john = Patients.john_doe();
this.create(john);
Observation obs = newResource(Observation.class).setSubject(new Reference(john));
this.create(obs);
Encounter enc = newResource(Encounter.class).setSubject(new Reference(john));
this.create(enc);
// Submit it
Parameters results = collectDataProvider.collectData(new SystemRequestDetails(), m.getIdElement(), "2019-01-01", "2019-12-31", Ids.simple(john), null, null);
List<ParametersParameterComponent> resources = org.opencds.cqf.ruler.utility.dstu3.Parameters.getPartsByName(results, "resource");
assertEquals(1, resources.size());
assertEquals("Observation", resources.get(0).getResource().fhirType());
List<ParametersParameterComponent> reports = org.opencds.cqf.ruler.utility.dstu3.Parameters.getPartsByName(results, "measureReport");
assertEquals(1, reports.size());
assertEquals("MeasureReport", reports.get(0).getResource().fhirType());
}
use of org.hl7.fhir.r5.model.Parameters.ParametersParameterComponent in project summary-care-record-api by NHSDigital.
the class AcsRequestValidator method isValid.
@Override
public boolean isValid(String requestBody, ConstraintValidatorContext context) {
try {
Parameters parameters = fhirParser.parseResource(requestBody, Parameters.class);
ParametersParameterComponent parameter = getSetPermissionParameter(parameters);
checkNhsNumber(parameter);
checkPermission(parameter);
} catch (FhirValidationException exc) {
setErrorMessage(context, exc.getMessage());
return false;
}
return true;
}
Aggregations