Java 类ims.clinical.vo.domain.PatientTheatreBookingVoAssembler 实例源码

项目:AvoinApotti    文件:PatientTheatreAppointmentManagementImpl.java   
public PatientTheatreBookingVoCollection listTheatreAppointmentsByPatientAndDate(PatientRefVo patientID, Date apptDate)
{
    ArrayList<String> markers = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();
    String andStr = "";
    StringBuffer sb = new StringBuffer();

    String hql = "from Booking_Appointment as appt "; //WDEV-9091

    if (patientID != null)
    {
        sb.append(andStr + " appt.patient.id = :pat");
        markers.add("pat");
        values.add(patientID.getID_Patient());
        andStr = " and ";
    }

    if (apptDate != null)
    {
        sb.append(andStr + " appt.appointmentDate = :apptDate");
        markers.add("apptDate");
        values.add(apptDate.getDate());
        andStr = " and ";
    }
    sb.append(andStr + " appt.theatreBooking != null");
    andStr = " and ";
    sb.append(andStr + " appt.apptStatus = :apptBooked");
    markers.add("apptBooked");
    values.add(getDomLookup(Status_Reason.BOOKED));

    hql += " where ";
    hql += sb.toString();

    java.util.List<?> list = getDomainFactory().find(hql.toString(), markers, values);

    return PatientTheatreBookingVoAssembler.createPatientTheatreBookingVoCollectionFromBooking_Appointment(list); //WDEV-9091

    //WDEV - 9091
    /*
    Iterator it = list.iterator();
    PatientTheatreBookingVoCollection voColl = new PatientTheatreBookingVoCollection();
    while(it.hasNext())
    {

        Object[] lstItem = (Object[]) it.next();
        Booking_Appointment doOP = (Booking_Appointment)lstItem[0];
        Booking_AppointmentVo voOP = Booking_AppointmentVoAssembler.create(doOP);
        PatientTheatreBookingVo voTheatre = new PatientTheatreBookingVo(voOP.getID_Booking_Appointment(), voOP.getVersion_Booking_Appointment());

        voTheatre.setID_Booking_Appointment(doOP.getId());

        voTheatre.setAppointmentDate(voOP.getAppointmentDate());
        voTheatre.setApptStartTime(voOP.getApptStartTime());
        voTheatre.setApptStatus(voOP.getApptStatus());
        voTheatre.setApptStatusHistory(voOP.getApptStatusHistory());
        voTheatre.setArrivalTime(null);
        voTheatre.setSeenTime(null);
        voTheatre.setOutcome(voOP.getOutcome());
        voTheatre.setTheatreBooking(TheatreBookingLiteVoAssembler.create((TheatreBooking)lstItem[1]));
        voTheatre.setSession(voOP.getSession());
        voTheatre.setApptStatusReas(voOP.getApptStatusReas());
        voTheatre.setRequiresRebook(voOP.getRequiresRebook());
        voTheatre.setCurrentStatusRecord(voOP.getCurrentStatusRecord());

        voColl.add(voTheatre);
    }
    return voColl;
    */
    //WDEV-9091
}
项目:openMAXIMS    文件:PatientTheatreAppointmentManagementImpl.java   
public PatientTheatreBookingVoCollection listTheatreAppointmentsByPatientAndDate(PatientRefVo patientID, Date apptDate)
{
    ArrayList<String> markers = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();
    String andStr = "";
    StringBuffer sb = new StringBuffer();

    String hql = "from Booking_Appointment as appt "; //WDEV-9091

    if (patientID != null)
    {
        sb.append(andStr + " appt.patient.id = :pat");
        markers.add("pat");
        values.add(patientID.getID_Patient());
        andStr = " and ";
    }

    if (apptDate != null)
    {
        sb.append(andStr + " appt.appointmentDate = :apptDate");
        markers.add("apptDate");
        values.add(apptDate.getDate());
        andStr = " and ";
    }
    sb.append(andStr + " appt.theatreBooking != null");
    andStr = " and ";
    sb.append(andStr + " appt.apptStatus = :apptBooked");
    markers.add("apptBooked");
    values.add(getDomLookup(Status_Reason.BOOKED));

    hql += " where ";
    hql += sb.toString();

    java.util.List<?> list = getDomainFactory().find(hql.toString(), markers, values);

    return PatientTheatreBookingVoAssembler.createPatientTheatreBookingVoCollectionFromBooking_Appointment(list); //WDEV-9091

    //WDEV - 9091
    /*
    Iterator it = list.iterator();
    PatientTheatreBookingVoCollection voColl = new PatientTheatreBookingVoCollection();
    while(it.hasNext())
    {

        Object[] lstItem = (Object[]) it.next();
        Booking_Appointment doOP = (Booking_Appointment)lstItem[0];
        Booking_AppointmentVo voOP = Booking_AppointmentVoAssembler.create(doOP);
        PatientTheatreBookingVo voTheatre = new PatientTheatreBookingVo(voOP.getID_Booking_Appointment(), voOP.getVersion_Booking_Appointment());

        voTheatre.setID_Booking_Appointment(doOP.getId());

        voTheatre.setAppointmentDate(voOP.getAppointmentDate());
        voTheatre.setApptStartTime(voOP.getApptStartTime());
        voTheatre.setApptStatus(voOP.getApptStatus());
        voTheatre.setApptStatusHistory(voOP.getApptStatusHistory());
        voTheatre.setArrivalTime(null);
        voTheatre.setSeenTime(null);
        voTheatre.setOutcome(voOP.getOutcome());
        voTheatre.setTheatreBooking(TheatreBookingLiteVoAssembler.create((TheatreBooking)lstItem[1]));
        voTheatre.setSession(voOP.getSession());
        voTheatre.setApptStatusReas(voOP.getApptStatusReas());
        voTheatre.setRequiresRebook(voOP.getRequiresRebook());
        voTheatre.setCurrentStatusRecord(voOP.getCurrentStatusRecord());

        voColl.add(voTheatre);
    }
    return voColl;
    */
    //WDEV-9091
}
项目:openmaxims-linux    文件:PatientTheatreAppointmentManagementImpl.java   
public PatientTheatreBookingVoCollection listTheatreAppointmentsByPatientAndDate(PatientRefVo patientID, Date apptDate)
{
    ArrayList<String> markers = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();
    String andStr = "";
    StringBuffer sb = new StringBuffer();

    String hql = "from Booking_Appointment as appt "; //WDEV-9091

    if (patientID != null)
    {
        sb.append(andStr + " appt.patient.id = :pat");
        markers.add("pat");
        values.add(patientID.getID_Patient());
        andStr = " and ";
    }

    if (apptDate != null)
    {
        sb.append(andStr + " appt.appointmentDate = :apptDate");
        markers.add("apptDate");
        values.add(apptDate.getDate());
        andStr = " and ";
    }
    sb.append(andStr + " appt.theatreBooking != null");
    andStr = " and ";
    sb.append(andStr + " appt.apptStatus = :apptBooked");
    markers.add("apptBooked");
    values.add(getDomLookup(Status_Reason.BOOKED));

    hql += " where ";
    hql += sb.toString();

    java.util.List<?> list = getDomainFactory().find(hql.toString(), markers, values);

    return PatientTheatreBookingVoAssembler.createPatientTheatreBookingVoCollectionFromBooking_Appointment(list); //WDEV-9091

    //WDEV - 9091
    /*
    Iterator it = list.iterator();
    PatientTheatreBookingVoCollection voColl = new PatientTheatreBookingVoCollection();
    while(it.hasNext())
    {

        Object[] lstItem = (Object[]) it.next();
        Booking_Appointment doOP = (Booking_Appointment)lstItem[0];
        Booking_AppointmentVo voOP = Booking_AppointmentVoAssembler.create(doOP);
        PatientTheatreBookingVo voTheatre = new PatientTheatreBookingVo(voOP.getID_Booking_Appointment(), voOP.getVersion_Booking_Appointment());

        voTheatre.setID_Booking_Appointment(doOP.getId());

        voTheatre.setAppointmentDate(voOP.getAppointmentDate());
        voTheatre.setApptStartTime(voOP.getApptStartTime());
        voTheatre.setApptStatus(voOP.getApptStatus());
        voTheatre.setApptStatusHistory(voOP.getApptStatusHistory());
        voTheatre.setArrivalTime(null);
        voTheatre.setSeenTime(null);
        voTheatre.setOutcome(voOP.getOutcome());
        voTheatre.setTheatreBooking(TheatreBookingLiteVoAssembler.create((TheatreBooking)lstItem[1]));
        voTheatre.setSession(voOP.getSession());
        voTheatre.setApptStatusReas(voOP.getApptStatusReas());
        voTheatre.setRequiresRebook(voOP.getRequiresRebook());
        voTheatre.setCurrentStatusRecord(voOP.getCurrentStatusRecord());

        voColl.add(voTheatre);
    }
    return voColl;
    */
    //WDEV-9091
}