use of org.hl7.fhir.dstu2.model.HumanName in project camel-quarkus by apache.
the class FhirR4Resource method transactionWithResources.
@Path("/transaction/withResources")
@GET
@Produces(MediaType.TEXT_PLAIN)
@SuppressWarnings("unchecked")
public int transactionWithResources(@QueryParam("summaryEnum") boolean summaryEnum) {
Patient oscar = new Patient().addName(new HumanName().addGiven("Oscar").setFamily("Peterson"));
Patient bobbyHebb = new Patient().addName(new HumanName().addGiven("Bobby").setFamily("Hebb"));
List<IBaseResource> patients = new ArrayList<>(2);
patients.add(oscar);
patients.add(bobbyHebb);
Map<String, Object> headers = new HashMap<>();
if (summaryEnum) {
headers.put(ExtraParameters.SUMMARY_ENUM.getHeaderName(), SummaryEnum.DATA);
}
List<IBaseResource> result = producerTemplate.requestBodyAndHeaders("direct:transactionWithResources-r4", patients, headers, List.class);
return result.size();
}
use of org.hl7.fhir.dstu2.model.HumanName in project camel-quarkus by apache.
the class FhirR5Resource method createTransactionBundle.
private Bundle createTransactionBundle() {
Bundle input = new Bundle();
input.setType(Bundle.BundleType.TRANSACTION);
input.addEntry().setResource(new Patient().addName(new HumanName().addGiven("Art").setFamily("Tatum"))).getRequest().setMethod(Bundle.HTTPVerb.POST);
return input;
}
use of org.hl7.fhir.dstu2.model.HumanName in project camel-quarkus by apache.
the class FhirDstu3Resource method createTransactionBundle.
private Bundle createTransactionBundle() {
Bundle input = new Bundle();
input.setType(Bundle.BundleType.TRANSACTION);
input.addEntry().setResource(new Patient().addName(new HumanName().addGiven("Art").setFamily("Tatum"))).getRequest().setMethod(Bundle.HTTPVerb.POST);
return input;
}
use of org.hl7.fhir.dstu2.model.HumanName in project camel-quarkus by apache.
the class FhirDstu2_1Resource method validateResourceAsString.
@Path("/validate/resourceAsString")
@GET
@Produces(MediaType.TEXT_PLAIN)
public String validateResourceAsString() {
Patient patient = new Patient().addName(new HumanName().addGiven(PATIENT_FIRST_NAME).addFamily(PATIENT_LAST_NAME));
patient.getText().setStatus(Narrative.NarrativeStatus.GENERATED);
patient.getText().setDivAsString("<div>This is the narrative text</div>");
String body = this.fhirContextInstance.get().newXmlParser().encodeResourceToString(patient);
MethodOutcome result = producerTemplate.requestBody("direct:validateResourceAsString-dstu2-1", body, MethodOutcome.class);
OperationOutcome operationOutcome = (OperationOutcome) result.getOperationOutcome();
return operationOutcome.getIssue().get(0).getDiagnostics();
}
use of org.hl7.fhir.dstu2.model.HumanName in project camel-quarkus by apache.
the class FhirDstu3Resource method transactionWithResources.
@Path("/transaction/withResources")
@GET
@Produces(MediaType.TEXT_PLAIN)
@SuppressWarnings("unchecked")
public int transactionWithResources(@QueryParam("summaryEnum") boolean summaryEnum) {
Patient oscar = new Patient().addName(new HumanName().addGiven("Oscar").setFamily("Peterson"));
Patient bobbyHebb = new Patient().addName(new HumanName().addGiven("Bobby").setFamily("Hebb"));
List<IBaseResource> patients = new ArrayList<>(2);
patients.add(oscar);
patients.add(bobbyHebb);
Map<String, Object> headers = new HashMap<>();
if (summaryEnum) {
headers.put(ExtraParameters.SUMMARY_ENUM.getHeaderName(), SummaryEnum.DATA);
}
List<IBaseResource> result = producerTemplate.requestBodyAndHeaders("direct:transactionWithResources-dstu3", patients, headers, List.class);
return result.size();
}
Aggregations