Java 类ims.core.vo.domain.LocShortMappingsVoAssembler 实例源码

项目:AvoinApotti    文件:SessionManagementImpl.java   
private LocationLiteVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:AvoinApotti    文件:MoveToWardSpecimenCollectionImpl.java   
private LocShortMappingsVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:AvoinApotti    文件:WardSpecimenCollectionImpl.java   
private LocShortMappingsVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:AvoinApotti    文件:TheatreAdmissionImpl.java   
public LocShortMappingsVo getBookingApptSessionLocation(Integer apptId) 
{
    if (apptId == null)
        return null;
    DomainFactory factory = getDomainFactory();     

    ArrayList<String> marques = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();
    marques.add("id");
    values.add(apptId); 
    marques.add("locTypeWardID");
    values.add(LocationType.WARD.getID());

    String query = " select sessionLocation from Booking_Appointment as apptDetails left join apptDetails.session as sessionDetails left join sessionDetails.schLocation as sessionLocation left join sessionLocation.type as locationType where ( apptDetails.id = :id and sessionLocation.isActive = 1 and locationType.id = :locTypeWardID ) ";
    List<?> sessionLoc = factory.find(query, marques, values);

    if(sessionLoc != null && sessionLoc.size() > 0 && sessionLoc.get(0) instanceof Location)
        return LocShortMappingsVoAssembler.create((Location) sessionLoc.get(0));

    return null;
}
项目:openMAXIMS    文件:InpatientListImpl.java   
private LocShortMappingsVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:openMAXIMS    文件:MoveSessionDialogImpl.java   
private LocationLiteVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:openMAXIMS    文件:MoveSessionToLocationDialogImpl.java   
private LocationLiteVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:openMAXIMS    文件:SessionManagementImpl.java   
private LocationLiteVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:openMAXIMS    文件:TheatreSessionManagementImpl.java   
private LocationLiteVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:openMAXIMS    文件:MoveToWardSpecimenCollectionImpl.java   
private LocShortMappingsVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:openMAXIMS    文件:WardSpecimenCollectionImpl.java   
private LocShortMappingsVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:openMAXIMS    文件:TheatreAdmissionImpl.java   
public LocShortMappingsVo getBookingApptSessionLocation(Integer apptId) 
{
    if (apptId == null)
        return null;
    DomainFactory factory = getDomainFactory();     

    ArrayList<String> marques = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();
    marques.add("id");
    values.add(apptId); 
    marques.add("locTypeWardID");
    values.add(LocationType.WARD.getID());

    String query = " select sessionLocation from Booking_Appointment as apptDetails left join apptDetails.session as sessionDetails left join sessionDetails.schLocation as sessionLocation left join sessionLocation.type as locationType where ( apptDetails.id = :id and sessionLocation.isActive = 1 and locationType.id = :locTypeWardID ) ";
    List<?> sessionLoc = factory.find(query, marques, values);

    if(sessionLoc != null && sessionLoc.size() > 0 && sessionLoc.get(0) instanceof Location)
        return LocShortMappingsVoAssembler.create((Location) sessionLoc.get(0));

    return null;
}
项目:openMAXIMS    文件:AcuteTheatreListImpl.java   
public ims.core.vo.LocShortMappingsVoCollection listTheatresForHospital(ims.core.resource.place.vo.LocationRefVo hospital)
{
    if (hospital == null || hospital.getID_Location() == null)
        throw new CodingRuntimeException("hospital is null or id not provided in method listTheatresForHospital");

    OrganisationAndLocation impl = (OrganisationAndLocation) getDomainImpl(OrganisationAndLocationImpl.class);
    String locationIds = impl.getChildLocationsIdsForLocation(hospital.getID_Location(), new int[]{LocationType.THEATRE.getID()}, true);

    List theatres = null;
    if(!locationIds.isEmpty())
    {
        String hql="from Location loc where loc.id in "; 
        hql += " ( "+ locationIds + " )";
        theatres = getDomainFactory().find(hql);
    }

    return LocShortMappingsVoAssembler.createLocShortMappingsVoCollectionFromLocation(theatres);
}
项目:openMAXIMS    文件:SessionManagementImpl.java   
private LocationLiteVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:openMAXIMS    文件:MoveToWardSpecimenCollectionImpl.java   
private LocShortMappingsVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:openMAXIMS    文件:WardSpecimenCollectionImpl.java   
private LocShortMappingsVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:openMAXIMS    文件:TheatreAdmissionImpl.java   
public LocShortMappingsVo getBookingApptSessionLocation(Integer apptId) 
{
    if (apptId == null)
        return null;
    DomainFactory factory = getDomainFactory();     

    ArrayList<String> marques = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();
    marques.add("id");
    values.add(apptId); 
    marques.add("locTypeWardID");
    values.add(LocationType.WARD.getID());

    String query = " select sessionLocation from Booking_Appointment as apptDetails left join apptDetails.session as sessionDetails left join sessionDetails.schLocation as sessionLocation left join sessionLocation.type as locationType where ( apptDetails.id = :id and sessionLocation.isActive = 1 and locationType.id = :locTypeWardID ) ";
    List<?> sessionLoc = factory.find(query, marques, values);

    if(sessionLoc != null && sessionLoc.size() > 0 && sessionLoc.get(0) instanceof Location)
        return LocShortMappingsVoAssembler.create((Location) sessionLoc.get(0));

    return null;
}
项目:openmaxims-linux    文件:SessionManagementImpl.java   
private LocationLiteVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:openmaxims-linux    文件:MoveToWardSpecimenCollectionImpl.java   
private LocShortMappingsVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:openmaxims-linux    文件:WardSpecimenCollectionImpl.java   
private LocShortMappingsVo getHospital(Location doLocation)
{
    if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
    {
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    while (doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();

        if (doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        {
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
        }
    }

    return null;
}
项目:AvoinApotti    文件:PhelbotomyWorkListImpl.java   
private LocShortMappingsVo getHospital(Location doLocation)
{
    if(doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);

    while(doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();
        if(doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    return null;
}
项目:AvoinApotti    文件:TheatreListImpl.java   
/**
* List active locations where the location type is hospital for currently logged MOS user
* Will return null if logged in user is not MOS
*/
// WDEV-11645
public LocShortMappingsVoCollection listActiveHospitals(MemberOfStaffRefVo memberOfStaff)
{
    if (memberOfStaff == null || !memberOfStaff.getID_MemberOfStaffIsNotNull())
        return null;

    StringBuilder query = new StringBuilder();
    query.append("select location from MemberOfStaff as mos left join mos.locations as hcpLocation left join hcpLocation.location as location ");
    query.append(" where location.type = :LocType and location.isActive = :isActive and location.isVirtual = :isVirtual and mos.id = :mosID");

    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();

    paramNames.add("LocType");
    paramValues.add(getDomLookup(LocationType.HOSP));

    paramNames.add("isActive");
    paramValues.add(Boolean.TRUE);

    paramNames.add("isVirtual");
    paramValues.add(Boolean.FALSE);

    paramNames.add("mosID");
    paramValues.add(memberOfStaff.getID_MemberOfStaff());

    return LocShortMappingsVoAssembler.createLocShortMappingsVoCollectionFromLocation(getDomainFactory().find(query.toString(), paramNames, paramValues));
}
项目:AvoinApotti    文件:TheatreListImpl.java   
public ims.core.vo.LocShortMappingsVoCollection listTheatresForHospital(ims.core.resource.place.vo.LocationRefVo hospital)
{
    if (hospital == null || hospital.getID_Location() == null)
        throw new CodingRuntimeException("hospital is null or id not provided in method listTheatresForHospital");

    List theatres = getDomainFactory().find("from Location loc where loc.parentLocation.id = :idParent and loc.type.id = :idLocType and loc.isActive = :isActive", new String[]{"idParent","idLocType", "isActive"}, new Object[]{hospital.getID_Location(), LocationType.THEATRE.getId(), Boolean.TRUE});
    return LocShortMappingsVoAssembler.createLocShortMappingsVoCollectionFromLocation(theatres);
}
项目:AvoinApotti    文件:ExternalEventsImpl.java   
public IfPatientLocationVo getPatientLocFromAppointment(
        Booking_AppointmentRefVo appointment) throws StaleObjectException, DomainInterfaceException {
    if (null==appointment)
    {
        throw new DomainInterfaceException("Appointment should not be null");
    }
    IfPatientLocationVo patLoc = new IfPatientLocationVo();
    DomainFactory factory = getDomainFactory();
    Booking_Appointment domBookAppt = (Booking_Appointment)factory.getDomainObject(appointment);

    PatientRefVo pat = new PatientRefVo();
    pat.setID_Patient(domBookAppt.getPatient().getId());
    patLoc.setPatient(pat);
    patLoc.setAppointmentID(domBookAppt.getId().toString());

    Location domLoc=domBookAppt.getSession().getSchLocation();
    Location domLocParent=domLoc.getParentLocation();

    LocShortMappingsVo locShortvo =LocShortMappingsVoAssembler.create(domLoc);
    patLoc.setLocMapping(locShortvo);

    LocShortMappingsVo parentLocShortVo = LocShortMappingsVoAssembler.create(domLocParent);
    patLoc.setParentLocMapping(parentLocShortVo);

    String hql = "select cr from CatsReferral as cr join cr.appointments as ba  "
        + "where (ba.id = :apptId)";

    List<?> referralList = factory.find(hql, new String[] { "apptId" },
            new Object[] { domBookAppt.getId() });

    if (referralList.size() == 0)
        patLoc.setReferralID("");
    else
    {
        CatsReferral domObjReferral = (CatsReferral) referralList.get(0);
        patLoc.setReferralID(domObjReferral.getId().toString());
    }

    return patLoc;
}
项目:openMAXIMS    文件:ADTImpl.java   
public ifWardMessageQueueVo getWardMessageQueueDetails(WardMessageQueueVo queueItem)
    {
        if(queueItem==null)
            return null;

        ifWardMessageQueueVo returnVal = null;  
        DomainFactory factory = getDomainFactory();
        Location wardLocation = null;
        Location parentLocation = null; //WDEV-20096
        wardLocation = (Location)factory.getDomainObject(Location.class, queueItem.getWard().getBoId());        
        if(wardLocation!=null)
        {
            returnVal = ifWardMessageQueueVoAssembler.create(wardLocation);

            //WDEV-20096
            if(wardLocation.getParentLocation() != null)
            {
                parentLocation = wardLocation.getParentLocation();
//              LocShortMappingsVo parentLocVo = LocShortMappingsVoAssembler.create(parentLocation.getParentLocation());
                LocShortMappingsVo parentLocVo = LocShortMappingsVoAssembler.create(parentLocation);
                returnVal.setParentLocation(parentLocVo);
                while (parentLocation.getParentLocation() != null)
                {
                    LocShortMappingsVo pLocVo = LocShortMappingsVoAssembler.create(parentLocation.getParentLocation());
                    returnVal.setParentLocation(pLocVo);
                    parentLocation = parentLocation.getParentLocation();
                }
            } //WDEV-20096

        }
        return returnVal;           
    }
项目:openMAXIMS    文件:PhelbotomyWorkListImpl.java   
private LocShortMappingsVo getHospital(Location doLocation)
{
    if(doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);

    while(doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();
        if(doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    return null;
}
项目:openMAXIMS    文件:TheatreListImpl.java   
/**
* List active locations where the location type is hospital for currently logged MOS user
* Will return null if logged in user is not MOS
*/
// WDEV-11645
public LocShortMappingsVoCollection listActiveHospitals(MemberOfStaffRefVo memberOfStaff)
{
    if (memberOfStaff == null || !memberOfStaff.getID_MemberOfStaffIsNotNull())
        return null;

    StringBuilder query = new StringBuilder();
    query.append("select location from MemberOfStaff as mos left join mos.locations as hcpLocation left join hcpLocation.location as location ");
    query.append(" where location.type = :LocType and location.isActive = :isActive and location.isVirtual = :isVirtual and mos.id = :mosID");

    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();

    paramNames.add("LocType");
    paramValues.add(getDomLookup(LocationType.HOSP));

    paramNames.add("isActive");
    paramValues.add(Boolean.TRUE);

    paramNames.add("isVirtual");
    paramValues.add(Boolean.FALSE);

    paramNames.add("mosID");
    paramValues.add(memberOfStaff.getID_MemberOfStaff());

    return LocShortMappingsVoAssembler.createLocShortMappingsVoCollectionFromLocation(getDomainFactory().find(query.toString(), paramNames, paramValues));
}
项目:openMAXIMS    文件:TheatreListImpl.java   
public ims.core.vo.LocShortMappingsVoCollection listTheatresForHospital(ims.core.resource.place.vo.LocationRefVo hospital)
{
    if (hospital == null || hospital.getID_Location() == null)
        throw new CodingRuntimeException("hospital is null or id not provided in method listTheatresForHospital");

    List theatres = getDomainFactory().find("from Location loc where loc.parentLocation.id = :idParent and loc.type.id = :idLocType and loc.isActive = :isActive", new String[]{"idParent","idLocType", "isActive"}, new Object[]{hospital.getID_Location(), LocationType.THEATRE.getId(), Boolean.TRUE});
    return LocShortMappingsVoAssembler.createLocShortMappingsVoCollectionFromLocation(theatres);
}
项目:openMAXIMS    文件:ExternalEventsImpl.java   
public IfPatientLocationVo getPatientLocFromAppointment(
        Booking_AppointmentRefVo appointment) throws StaleObjectException, DomainInterfaceException {
    if (null==appointment)
    {
        throw new DomainInterfaceException("Appointment should not be null");
    }
    IfPatientLocationVo patLoc = new IfPatientLocationVo();
    DomainFactory factory = getDomainFactory();
    Booking_Appointment domBookAppt = (Booking_Appointment)factory.getDomainObject(appointment);

    PatientRefVo pat = new PatientRefVo();
    pat.setID_Patient(domBookAppt.getPatient().getId());
    patLoc.setPatient(pat);
    patLoc.setAppointmentID(domBookAppt.getId().toString());

    Location domLoc=domBookAppt.getSession().getSchLocation();
    Location domLocParent=domLoc.getParentLocation();

    LocShortMappingsVo locShortvo =LocShortMappingsVoAssembler.create(domLoc);
    patLoc.setLocMapping(locShortvo);

    LocShortMappingsVo parentLocShortVo = LocShortMappingsVoAssembler.create(domLocParent);
    patLoc.setParentLocMapping(parentLocShortVo);

    String hql = "select cr from CatsReferral as cr join cr.appointments as ba  "
        + "where (ba.id = :apptId)";

    List<?> referralList = factory.find(hql, new String[] { "apptId" },
            new Object[] { domBookAppt.getId() });

    if (referralList.size() == 0)
        patLoc.setReferralID("");
    else
    {
        CatsReferral domObjReferral = (CatsReferral) referralList.get(0);
        patLoc.setReferralID(domObjReferral.getId().toString());
    }

    return patLoc;
}
项目:openMAXIMS    文件:AcuteTheatreListImpl.java   
/**
 * List active locations where the location type is hospital
 */
public ims.core.vo.LocShortMappingsVoCollection listActiveHospitals(ims.core.resource.people.vo.MemberOfStaffRefVo memberOfStaff)
{
    if (memberOfStaff == null || !memberOfStaff.getID_MemberOfStaffIsNotNull())
        return null;

    StringBuilder query = new StringBuilder();
    query.append("select location from MemberOfStaff as mos left join mos.locations as hcpLocation left join hcpLocation.location as location ");
    query.append(" where location.type = :LocType and location.isActive = :isActive and location.isVirtual = :isVirtual and mos.id = :mosID");
    query.append(" ORDER BY location.upperName ASC"); //WDEV-23131

    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();

    paramNames.add("LocType");
    paramValues.add(getDomLookup(LocationType.HOSP));

    paramNames.add("isActive");
    paramValues.add(Boolean.TRUE);

    paramNames.add("isVirtual");
    paramValues.add(Boolean.FALSE);

    paramNames.add("mosID");
    paramValues.add(memberOfStaff.getID_MemberOfStaff());

    return LocShortMappingsVoAssembler.createLocShortMappingsVoCollectionFromLocation(getDomainFactory().find(query.toString(), paramNames, paramValues));
}
项目:openMAXIMS    文件:PhelbotomyWorkListImpl.java   
private LocShortMappingsVo getHospital(Location doLocation)
{
    if(doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);

    while(doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();
        if(doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    return null;
}
项目:openMAXIMS    文件:TheatreListImpl.java   
/**
* List active locations where the location type is hospital for currently logged MOS user
* Will return null if logged in user is not MOS
*/
// WDEV-11645
public LocShortMappingsVoCollection listActiveHospitals(MemberOfStaffRefVo memberOfStaff)
{
    if (memberOfStaff == null || !memberOfStaff.getID_MemberOfStaffIsNotNull())
        return null;

    StringBuilder query = new StringBuilder();
    query.append("select location from MemberOfStaff as mos left join mos.locations as hcpLocation left join hcpLocation.location as location ");
    query.append(" where location.type = :LocType and location.isActive = :isActive and location.isVirtual = :isVirtual and mos.id = :mosID");

    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();

    paramNames.add("LocType");
    paramValues.add(getDomLookup(LocationType.HOSP));

    paramNames.add("isActive");
    paramValues.add(Boolean.TRUE);

    paramNames.add("isVirtual");
    paramValues.add(Boolean.FALSE);

    paramNames.add("mosID");
    paramValues.add(memberOfStaff.getID_MemberOfStaff());

    return LocShortMappingsVoAssembler.createLocShortMappingsVoCollectionFromLocation(getDomainFactory().find(query.toString(), paramNames, paramValues));
}
项目:openMAXIMS    文件:TheatreListImpl.java   
public ims.core.vo.LocShortMappingsVoCollection listTheatresForHospital(ims.core.resource.place.vo.LocationRefVo hospital)
{
    if (hospital == null || hospital.getID_Location() == null)
        throw new CodingRuntimeException("hospital is null or id not provided in method listTheatresForHospital");

    List theatres = getDomainFactory().find("from Location loc where loc.parentLocation.id = :idParent and loc.type.id = :idLocType and loc.isActive = :isActive", new String[]{"idParent","idLocType", "isActive"}, new Object[]{hospital.getID_Location(), LocationType.THEATRE.getId(), Boolean.TRUE});
    return LocShortMappingsVoAssembler.createLocShortMappingsVoCollectionFromLocation(theatres);
}
项目:openMAXIMS    文件:ExternalEventsImpl.java   
public IfPatientLocationVo getPatientLocFromAppointment(
        Booking_AppointmentRefVo appointment) throws StaleObjectException, DomainInterfaceException {
    if (null==appointment)
    {
        throw new DomainInterfaceException("Appointment should not be null");
    }
    IfPatientLocationVo patLoc = new IfPatientLocationVo();
    DomainFactory factory = getDomainFactory();
    Booking_Appointment domBookAppt = (Booking_Appointment)factory.getDomainObject(appointment);

    PatientRefVo pat = new PatientRefVo();
    pat.setID_Patient(domBookAppt.getPatient().getId());
    patLoc.setPatient(pat);
    patLoc.setAppointmentID(domBookAppt.getId().toString());

    Location domLoc=domBookAppt.getSession().getSchLocation();
    Location domLocParent=domLoc.getParentLocation();

    LocShortMappingsVo locShortvo =LocShortMappingsVoAssembler.create(domLoc);
    patLoc.setLocMapping(locShortvo);

    LocShortMappingsVo parentLocShortVo = LocShortMappingsVoAssembler.create(domLocParent);
    patLoc.setParentLocMapping(parentLocShortVo);

    String hql = "select cr from CatsReferral as cr join cr.appointments as ba  "
        + "where (ba.id = :apptId)";

    List<?> referralList = factory.find(hql, new String[] { "apptId" },
            new Object[] { domBookAppt.getId() });

    if (referralList.size() == 0)
        patLoc.setReferralID("");
    else
    {
        CatsReferral domObjReferral = (CatsReferral) referralList.get(0);
        patLoc.setReferralID(domObjReferral.getId().toString());
    }

    return patLoc;
}
项目:openmaxims-linux    文件:PhelbotomyWorkListImpl.java   
private LocShortMappingsVo getHospital(Location doLocation)
{
    if(doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
        return LocShortMappingsVoAssembler.create((LocSite) doLocation);

    while(doLocation.getParentLocation() != null)
    {
        doLocation = doLocation.getParentLocation();
        if(doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP)))
            return LocShortMappingsVoAssembler.create((LocSite) doLocation);
    }

    return null;
}
项目:AvoinApotti    文件:PropertyChecklistImpl.java   
public LocShortMappingsVoCollection listWards(String name)  
{
    java.util.List locations = listLocations(LocationType.WARD,Boolean.TRUE, name);
    return  LocShortMappingsVoAssembler.createLocShortMappingsVoCollectionFromLocation(locations).sort();
}
项目:AvoinApotti    文件:OrganisationAndLocationImpl.java   
public LocShortMappingsVo getLocationByTaxonomyType(String extId, TaxonomyType taxonomyType) 
{
    return LocShortMappingsVoAssembler.create(getDomLocationByTaxonomyType(extId, taxonomyType));
}
项目:AvoinApotti    文件:OrganisationAndLocationImpl.java   
public LocShortMappingsVoCollection listActiveHospitals()
{
    List locations = listLocations(LocationType.HOSP,Boolean.TRUE,null,null,null);
    return  LocShortMappingsVoAssembler.createLocShortMappingsVoCollectionFromLocation(locations).sort();
}
项目:AvoinApotti    文件:OrganisationAndLocationImpl.java   
public LocShortMappingsVoCollection listActiveWardsForHospital(LocationRefVo hospital)
{
    List locations = listLocationsByParentLocation(LocationType.WARD,hospital,Boolean.TRUE,null,null,null);
    return  LocShortMappingsVoAssembler.createLocShortMappingsVoCollectionFromLocation(locations).sort();
}
项目:AvoinApotti    文件:OrganisationAndLocationImpl.java   
public LocShortMappingsVoCollection listActiveReferringHospitalsWithMappings()
{
    return LocShortMappingsVoAssembler.createLocShortMappingsVoCollectionFromLocation( listLocations(LocationType.HOSP, Boolean.TRUE, Boolean.TRUE, null, null)).sort();
}