HcpAdminImpl.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:openMAXIMS 作者:
public MedicWithLocationsVoCollection listReferringMedicsForLocation(LocationRefVo location)
{
    DomainFactory factory = getDomainFactory();
    java.util.List medics = null;
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    String hql =  "select distinct mos, hcpLoc.accreditationStatus " + 
    " from MemberOfStaff as mos left join mos.hcp as hcp left join mos.locations as hcpLoc ";
    hql += " where (hcpLoc.location.id = :idLocation and mos.isActive = :isActive and hcp.hcpType = :medical ";
    hql += " and ( hcpLoc.accreditationStatus in (:id1, :id2, :id3) ) )";

    medics = factory.find(hql, new String[]{"idLocation","isActive", "medical", "id1", "id2", "id3"}, new Object[]{location.getID_Location(), Boolean.TRUE, getDomLookup(HcpDisType.MEDICAL), getDomLookup(AccreditationLocationStatus.ACCREDITED), getDomLookup(AccreditationLocationStatus.REFERRINGCONSULTANT), getDomLookup(AccreditationLocationStatus.RESTRICT_ACCRED_REFERRING)});

    MedicWithLocationsVoCollection voCollMedic = new MedicWithLocationsVoCollection();
    Iterator it = medics.iterator();
    while(it.hasNext())
    {
        MedicWithLocationsVo voMedicWithLoc = new MedicWithLocationsVo();
        Object[] lstItem = (Object[]) it.next();

        MemberOfStaff doMos = (MemberOfStaff) lstItem[0];

        MemberOfStaffVo voMos = new MemberOfStaffVo();
        MedicVo voMedic = new MedicVo();
        voMos.setID_MemberOfStaff(doMos.getId());
        voMedic.setID_Hcp(doMos.getHcp().getId());

        ims.core.vo.PersonName pn = new ims.core.vo.PersonName();
        pn.setForename(doMos.getName().getForename());
        pn.setSurname(doMos.getName().getSurname());
        pn.setMiddleName(doMos.getName().getMiddleName());
        if (doMos.getName().getTitle() != null)
            pn.setTitle(LookupHelper.getPersonTitleInstance(getLookupService(),doMos.getName().getTitle().getId()));
        voMos.setName(pn);
        voMedic.setMos(voMos);
        voMedicWithLoc.setMedicVo(voMedic);
        voMedicWithLoc.setAccreditationStatus(createAccreditationLookupInstance((LookupInstance)lstItem[1]));

        voCollMedic.add(voMedicWithLoc);
    }
    return voCollMedic.sort();  
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号