use of org.hl7.fhir.r5.model.HumanName in project nia-patient-switching-standard-adaptor by NHSDigital.
the class UnknownPractitionerHandler method createUnknownPractitioner.
private Practitioner createUnknownPractitioner() {
Practitioner unknown = new Practitioner();
unknown.setId(idGeneratorService.generateUuid());
return unknown.addName(new HumanName().setText(UNKNOWN_USER));
}
use of org.hl7.fhir.r5.model.HumanName in project camel-spring-boot by apache.
the class FhirLoadPageTest method populateServer.
@BeforeEach
public void populateServer() {
List<IBaseResource> input = new ArrayList<>();
Patient p1 = new Patient();
p1.addName().setFamily("PATIENT1");
input.add(p1);
Patient p2 = new Patient();
p2.addName().setFamily("PATIENT2");
input.add(p2);
input.add(new Patient().addName(new HumanName().setFamily("PATIENT3")));
List<IBaseResource> response = fhirClient.transaction().withResources(input).encodedJson().execute();
assertEquals(3, response.size());
}
use of org.hl7.fhir.r5.model.HumanName in project camel-spring-boot by apache.
the class FhirTransactionTest method testWithResources.
@Test
public void testWithResources() throws Exception {
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);
// using java.util.List message body for single parameter "resources"
List<IBaseResource> result = requestBody("direct://WITH_RESOURCES", patients);
assertNotNull(result, "withResources result");
LOG.debug("withResources: " + result);
assertEquals(2, result.size());
}
use of org.hl7.fhir.r5.model.HumanName in project camel-spring-boot by apache.
the class FhirValidateTest method testResource.
@Test
public void testResource() throws Exception {
Patient bobbyHebb = new Patient().addName(new HumanName().addGiven("Bobby").setFamily("Hebb"));
// using org.hl7.fhir.instance.model.api.IBaseResource message body for single parameter "resource"
MethodOutcome result = requestBody("direct://RESOURCE", bobbyHebb);
assertNotNull(result, "resource result");
LOG.debug("resource: " + result);
assertNotNull(result.getOperationOutcome());
assertTrue(((OperationOutcome) result.getOperationOutcome()).getText().getDivAsString().contains("No issues detected during validation"));
}
use of org.hl7.fhir.r5.model.HumanName in project camel-spring-boot by apache.
the class FhirValidateTest method testResourceAsString.
@Test
public void testResourceAsString() throws Exception {
Patient bobbyHebb = new Patient().addName(new HumanName().addGiven("Bobby").setFamily("Hebb"));
// using org.hl7.fhir.instance.model.api.IBaseResource message body for single parameter "resource"
MethodOutcome result = requestBody("direct://RESOURCE_AS_STRING", this.fhirContext.newXmlParser().encodeResourceToString(bobbyHebb));
assertNotNull(result, "resource result");
LOG.debug("resource: " + result);
assertNotNull(result.getOperationOutcome());
assertTrue(((OperationOutcome) result.getOperationOutcome()).getText().getDivAsString().contains("No issues detected during validation"));
}
Aggregations