Search in sources :

Example 1 with SlotEntity

use of uk.gov.hscic.appointment.slot.SlotEntity in project gpconnect-demonstrator by nhsconnect.

the class AppointmentEntityToAppointmentDetailTransformer method transform.

@Override
public AppointmentDetail transform(AppointmentEntity item) {
    AppointmentDetail appointmentDetail = new AppointmentDetail();
    appointmentDetail.setId(item.getId());
    appointmentDetail.setCancellationReason(item.getCancellationReason());
    appointmentDetail.setStatus(item.getStatus());
    appointmentDetail.setDescription(item.getDescription());
    appointmentDetail.setStartDateTime(item.getStartDateTime());
    appointmentDetail.setEndDateTime(item.getEndDateTime());
    appointmentDetail.setSlotIds(item.getSlots().stream().map(SlotEntity::getId).collect(Collectors.toList()));
    appointmentDetail.setComment(item.getComment());
    appointmentDetail.setPatientId(item.getPatientId());
    appointmentDetail.setPractitionerId(item.getPractitionerId());
    appointmentDetail.setLocationId(item.getLocationId());
    appointmentDetail.setLastUpdated(item.getLastUpdated());
    appointmentDetail.setMinutesDuration(item.getMinutesDuration());
    appointmentDetail.setPriority(item.getPriority());
    appointmentDetail.setBookingOrganization(bookingOrgTransformer.transform(item.getBookingOrganization()));
    appointmentDetail.setCreated(item.getCreated());
    return appointmentDetail;
}
Also used : AppointmentDetail(uk.gov.hscic.model.appointment.AppointmentDetail) SlotEntity(uk.gov.hscic.appointment.slot.SlotEntity)

Aggregations

SlotEntity (uk.gov.hscic.appointment.slot.SlotEntity)1 AppointmentDetail (uk.gov.hscic.model.appointment.AppointmentDetail)1