use of org.hl7.fhir.r4.model.Slot in project elexis-server by elexis.
the class AppointmentTest method testDirectLoadAppointmentInContactAssignedArea.
@Test
public void testDirectLoadAppointmentInContactAssignedArea() {
Appointment appointment = client.read().resource(Appointment.class).withId("Af322a333db4daf37093177").execute();
assertNotNull(appointment);
assertEquals(1484116200000l, appointment.getStart().getTime());
assertEquals(1484121600000l, appointment.getEnd().getTime());
assertEquals(90, appointment.getMinutesDuration());
List<AppointmentParticipantComponent> participants = appointment.getParticipant();
assertEquals(1, participants.size());
assertEquals(ParticipantRequired.REQUIRED, participants.get(0).getRequired());
Practitioner practitioner = client.read().resource(Practitioner.class).withId(participants.get(0).getActor().getReferenceElement()).execute();
assertNotNull(practitioner);
assertEquals("Nachname", practitioner.getName().get(0).getFamily());
List<Reference> slotReference = appointment.getSlot();
assertNotNull(slotReference);
Slot slot = client.read().resource(Slot.class).withId(slotReference.get(0).getReferenceElement()).execute();
assertNotNull(slot);
assertEquals(SlotStatus.BUSY, slot.getStatus());
Schedule schedule = client.read().resource(Schedule.class).withId(slot.getSchedule().getReferenceElement()).execute();
assertNotNull(schedule);
// practitioner = client.read().resource(Practitioner.class)
// .withId(schedule.getActor().get(0).getReferenceElement()).execute();
// assertEquals("Nachname", practitioner.getName().get(0).getFamily());
}
use of org.hl7.fhir.r4.model.Slot in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeAppointment.
protected void composeAppointment(Complex parent, String parentType, String name, Appointment element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "Appointment", name, element, index);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Appointment", "identifier", element.getIdentifier().get(i), i);
if (element.hasStatusElement())
composeEnum(t, "Appointment", "status", element.getStatusElement(), -1);
if (element.hasServiceCategory())
composeCodeableConcept(t, "Appointment", "serviceCategory", element.getServiceCategory(), -1);
for (int i = 0; i < element.getServiceType().size(); i++) composeCodeableConcept(t, "Appointment", "serviceType", element.getServiceType().get(i), i);
for (int i = 0; i < element.getSpecialty().size(); i++) composeCodeableConcept(t, "Appointment", "specialty", element.getSpecialty().get(i), i);
if (element.hasAppointmentType())
composeCodeableConcept(t, "Appointment", "appointmentType", element.getAppointmentType(), -1);
if (element.hasReason())
composeCodeableConcept(t, "Appointment", "reason", element.getReason(), -1);
if (element.hasPriorityElement())
composeUnsignedInt(t, "Appointment", "priority", element.getPriorityElement(), -1);
if (element.hasDescriptionElement())
composeString(t, "Appointment", "description", element.getDescriptionElement(), -1);
if (element.hasStartElement())
composeInstant(t, "Appointment", "start", element.getStartElement(), -1);
if (element.hasEndElement())
composeInstant(t, "Appointment", "end", element.getEndElement(), -1);
if (element.hasMinutesDurationElement())
composePositiveInt(t, "Appointment", "minutesDuration", element.getMinutesDurationElement(), -1);
for (int i = 0; i < element.getSlot().size(); i++) composeReference(t, "Appointment", "slot", element.getSlot().get(i), i);
if (element.hasCreatedElement())
composeDateTime(t, "Appointment", "created", element.getCreatedElement(), -1);
if (element.hasCommentElement())
composeString(t, "Appointment", "comment", element.getCommentElement(), -1);
for (int i = 0; i < element.getParticipant().size(); i++) composeAppointmentAppointmentParticipantComponent(t, "Appointment", "participant", element.getParticipant().get(i), i);
}
use of org.hl7.fhir.r4.model.Slot in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeSlot.
protected void composeSlot(Complex parent, String parentType, String name, Slot element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "Slot", name, element, index);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Slot", "identifier", element.getIdentifier().get(i), i);
for (int i = 0; i < element.getServiceCategory().size(); i++) composeCodeableConcept(t, "Slot", "serviceCategory", element.getServiceCategory().get(i), i);
for (int i = 0; i < element.getServiceType().size(); i++) composeCodeableConcept(t, "Slot", "serviceType", element.getServiceType().get(i), i);
for (int i = 0; i < element.getSpecialty().size(); i++) composeCodeableConcept(t, "Slot", "specialty", element.getSpecialty().get(i), i);
if (element.hasAppointmentType())
composeCodeableConcept(t, "Slot", "appointmentType", element.getAppointmentType(), -1);
if (element.hasSchedule())
composeReference(t, "Slot", "schedule", element.getSchedule(), -1);
if (element.hasStatusElement())
composeEnum(t, "Slot", "status", element.getStatusElement(), -1);
if (element.hasStartElement())
composeInstant(t, "Slot", "start", element.getStartElement(), -1);
if (element.hasEndElement())
composeInstant(t, "Slot", "end", element.getEndElement(), -1);
if (element.hasOverbookedElement())
composeBoolean(t, "Slot", "overbooked", element.getOverbookedElement(), -1);
if (element.hasCommentElement())
composeString(t, "Slot", "comment", element.getCommentElement(), -1);
}
use of org.hl7.fhir.r4.model.Slot in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeAppointment.
protected void composeAppointment(Complex parent, String parentType, String name, Appointment element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "Appointment", name, element, index);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "Appointment", "identifier", element.getIdentifier().get(i), i);
if (element.hasStatusElement())
composeEnum(t, "Appointment", "status", element.getStatusElement(), -1);
if (element.hasCancelationReason())
composeCodeableConcept(t, "Appointment", "cancelationReason", element.getCancelationReason(), -1);
for (int i = 0; i < element.getServiceCategory().size(); i++) composeCodeableConcept(t, "Appointment", "serviceCategory", element.getServiceCategory().get(i), i);
for (int i = 0; i < element.getServiceType().size(); i++) composeCodeableConcept(t, "Appointment", "serviceType", element.getServiceType().get(i), i);
for (int i = 0; i < element.getSpecialty().size(); i++) composeCodeableConcept(t, "Appointment", "specialty", element.getSpecialty().get(i), i);
if (element.hasAppointmentType())
composeCodeableConcept(t, "Appointment", "appointmentType", element.getAppointmentType(), -1);
for (int i = 0; i < element.getReasonCode().size(); i++) composeCodeableConcept(t, "Appointment", "reasonCode", element.getReasonCode().get(i), i);
for (int i = 0; i < element.getReasonReference().size(); i++) composeReference(t, "Appointment", "reasonReference", element.getReasonReference().get(i), i);
if (element.hasPriorityElement())
composeUnsignedInt(t, "Appointment", "priority", element.getPriorityElement(), -1);
if (element.hasDescriptionElement())
composeString(t, "Appointment", "description", element.getDescriptionElement(), -1);
for (int i = 0; i < element.getSupportingInformation().size(); i++) composeReference(t, "Appointment", "supportingInformation", element.getSupportingInformation().get(i), i);
if (element.hasStartElement())
composeInstant(t, "Appointment", "start", element.getStartElement(), -1);
if (element.hasEndElement())
composeInstant(t, "Appointment", "end", element.getEndElement(), -1);
if (element.hasMinutesDurationElement())
composePositiveInt(t, "Appointment", "minutesDuration", element.getMinutesDurationElement(), -1);
for (int i = 0; i < element.getSlot().size(); i++) composeReference(t, "Appointment", "slot", element.getSlot().get(i), i);
if (element.hasCreatedElement())
composeDateTime(t, "Appointment", "created", element.getCreatedElement(), -1);
if (element.hasCommentElement())
composeString(t, "Appointment", "comment", element.getCommentElement(), -1);
if (element.hasPatientInstructionElement())
composeString(t, "Appointment", "patientInstruction", element.getPatientInstructionElement(), -1);
for (int i = 0; i < element.getBasedOn().size(); i++) composeReference(t, "Appointment", "basedOn", element.getBasedOn().get(i), i);
for (int i = 0; i < element.getParticipant().size(); i++) composeAppointmentAppointmentParticipantComponent(t, "Appointment", "participant", element.getParticipant().get(i), i);
for (int i = 0; i < element.getRequestedPeriod().size(); i++) composePeriod(t, "Appointment", "requestedPeriod", element.getRequestedPeriod().get(i), i);
}
use of org.hl7.fhir.r4.model.Slot in project org.hl7.fhir.core by hapifhir.
the class TurtleTests method test_slot_example_busy.
@Test
public void test_slot_example_busy() throws FileNotFoundException, IOException, Exception {
System.out.println("slot-example-busy.ttl");
new Turtle().parse(TextFile.fileToString("C:\\work\\org.hl7.fhir\\build\\publish\\slot-example-busy.ttl"));
}
Aggregations