Java 类ims.core.vo.WardDataViewVo 实例源码

项目:openMAXIMS    文件:Logic.java   
@Override
public int compare(WardDataViewVo wardData1, WardDataViewVo wardData2)
{
    if (wardData1.getBay() != null && wardData2.getBay() == null)
        return order;

    if (wardData1.getBay() == null && wardData2.getBay() != null)
        return -1 * order;


    if (wardData1.getBay().equals(wardData2.getBay()))
    {
        if ((wardData1.getBed() == null || wardData1.getBed().getBedNumber() == null) && (wardData2.getBed() == null || wardData2.getBed().getBedNumber() == null))
        {
            if (wardData1.getBay() == null && wardData2.getBay() == null)
                return 0;

            return order * wardData1.getBay().getName().toLowerCase().compareTo(wardData2.getBay().getName().toLowerCase());
        }

        if ((wardData1.getBed() != null && wardData1.getBed().getBedNumber() != null) && (wardData2.getBed() == null || wardData2.getBed().getBedNumber() == null))
            return order;

        if ((wardData1.getBed() == null || wardData1.getBed().getBedNumber() == null) && (wardData2.getBed() != null && wardData2.getBed().getBedNumber() != null))
            return -1 * order;

        // Do we need to trim the Bed Number string
        String bedNumber1 = wardData1.getBed().getBedNumber().trim().replace("-" , "").replace(" ", "");
        String bedNumber2 = wardData2.getBed().getBedNumber().trim().replace("-" , "").replace(" ", "");

        return order * compareNumberAwareString(bedNumber1, bedNumber2);
    }

    return order * wardData1.getBay().getName().toLowerCase().compareTo(wardData2.getBay().getName().toLowerCase());
}
项目:openMAXIMS    文件:Logic.java   
private boolean isPatientOnTrackingMovement(WardDataViewVo bedSpace)
{
    if (bedSpace == null || bedSpace.getInpatEpisode() == null || bedSpace.getInpatEpisode().getCurrentTrackingMovement() == null)
        return false;

    if (Boolean.TRUE.equals(bedSpace.getInpatEpisode().getCurrentTrackingMovement().getPatientReturned()))
        return false;

    return true;
}
项目:openMAXIMS    文件:Logic.java   
private boolean isPatientOnHomeLeave(WardDataViewVo bedSpace)
{
    if (bedSpace == null || bedSpace.getInpatEpisode() == null)
        return false;

    if (Boolean.TRUE.equals(bedSpace.getInpatEpisode().getIsOnHomeLeave()))
        return true;

    return false;
}
项目:openMAXIMS    文件:Logic.java   
private void viewPatientDetailsInBed()
{
    if (!(form.dyngrdInpatients().getValue() instanceof WardDataViewVo) || ((WardDataViewVo)form.dyngrdInpatients().getValue()).getPatient() == null)
        return;
    boolean hasPendingTransfer = ((WardDataViewVo)form.dyngrdInpatients().getValue()).getPendingTransfer() != null;
    form.getGlobalContext().Core.setADTPendingTransfer(hasPendingTransfer  ? domain.getPendingTransfer(((WardDataViewVo)form.dyngrdInpatients().getValue()).getPendingTransfer()) : null);
    form.getGlobalContext().Core.setSelectedBedSpaceState(domain.getBedSpaceState(((WardDataViewVo)form.dyngrdInpatients().getValue()).getBedSpaceState()));
    engine.open(form.getForms().Core.BedInfoDialog, new Object[]{new Boolean(form.isReadOnly())});
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onDyngrdInpatientsRowSelectionChanged(DynamicGridRow row) throws PresentationLogicException
{
    WardBayConfigForWardViewVo wardBayConfig = form.getLocalContext().getWardBayConfig();

    if (wardBayConfig != null && WardBayStatus.CLOSED.equals(wardBayConfig.getWardAvailabilityStatus()))
        return;

    if (wardBayConfig != null && row.getValue() instanceof WardDataViewVo)
    {
        WardDataViewVo wardDataView = (WardDataViewVo) row.getValue();

        BayConfigForWardViewVo bayConfig = wardBayConfig.getBayConfig(wardDataView.getBay());

        if (bayConfig != null && WardBayStatus.CLOSED.equals(bayConfig.getBayAvailabilityStatus()))
            return;

        if (wardDataView.getPatient() == null)
        {
            if (WardBayStatus.BLOCKED.equals(wardBayConfig.getWardAvailabilityStatus()))
                return;

            if (bayConfig != null && WardBayStatus.BLOCKED.equals(bayConfig.getBayAvailabilityStatus()))
                return;
        }
    }

    inpatientsGridSelectionChanged();
}
项目:openMAXIMS    文件:Logic.java   
private WardDataViewVoCollection getValuesFromGrid()
{
    WardDataViewVoCollection coll = new WardDataViewVoCollection();

    for (int i=0; i<form.dyngrdInpatients().getRows().size();i++)
    {
        if (form.dyngrdInpatients().getRows().get(i) != null && form.dyngrdInpatients().getRows().get(i).getValue() instanceof WardDataViewVo)
        {
            coll.add((WardDataViewVo) form.dyngrdInpatients().getRows().get(i).getValue());
        }
    }
    return coll;
}
项目:AvoinApotti    文件:Logic.java   
private void fillFromInpatRecords() 
{
    WardDataViewVoCollection voCollWdv = domain.listInpatientsInBedsByWard(form.cmbWard().getValue());
    if(voCollWdv != null)
    {
        for (WardDataViewVo voWdv : voCollWdv)
        {
            grdInpatientsRow row = form.grdInpatients().getRows().newRow();
            PatientShort voPatient = voWdv.getPatient();
            if(voPatient != null)
            {
                if(voPatient.getNameIsNotNull())
                {
                    row.setColForename(voPatient.getName().getForename());
                    row.setColSurname(voPatient.getName().getSurname());
                }

                PatientId patId = voPatient.getDisplayId();
                row.setColDisplayId(patId != null ? patId.getValue() : null);               
                Integer age = voPatient.calculateAge();
                if(age != null)
                    row.setColAge(String.valueOf(age));

                if(voPatient.getHasActiveAlertsIsNotNull() && voPatient.getHasActiveAlerts())   //wdev-11083
                    row.setColAlert(form.getImages().Core.Alert16); //WDEV-18011 
                row.setColInfant(calculateInfants(voPatient));
            }

            if(voWdv.getBayIsNotNull())
                row.setColBay(voWdv.getBay().getName());
            if(voWdv.getBedIsNotNull())
                row.setColBedNumber(voWdv.getBed().getBedNumber());     

            row.setColPasEventHidden(voWdv.getPasEvent());

            //wdev-14784
            if( voWdv.getInpatEpisodeIsNotNull() && voWdv.getInpatEpisode().getVTEAssessmentStatusIsNotNull()  && ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue() == true) //wdev-15062
            {
                row.setColVTEStatus(VTEAsessmentStatus.REQUIRED.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? form.getImages().OCRR.Requested : (VTEAsessmentStatus.INPROGRESS.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? form.getImages().OCRR.InProgress : null));

            }
            else
            {
                row.setColVTEStatus(null);
            }
            //----------

            row.setTooltip(buildRowTooltip(voWdv));
            row.setValue(voPatient);
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private String buildRowTooltip(WardDataViewVo voWdv)
{
    if (voWdv == null)
        throw new CodingRuntimeException("voWdv cannot be null in method buildRowTooltip");

    String consultant = voWdv.getPasEventIsNotNull() && voWdv.getPasEvent().getConsultantIsNotNull() ? voWdv.getPasEvent().getConsultant().getIMosName() : "";
    String nhsNo =  voWdv.getPatientIsNotNull() && voWdv.getPatient().getNhsn() != null ?  voWdv.getPatient().getNhsn().getValue() : "";

    //wdev-14784
    String vteStatus = "";
    //wdev-14784
    if( voWdv.getInpatEpisodeIsNotNull() && voWdv.getInpatEpisode().getVTEAssessmentStatusIsNotNull()  && ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue() == true) //wdev-15062
    {
        vteStatus = VTEAsessmentStatus.REQUIRED.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? voWdv.getInpatEpisode().getVTEAssessmentStatus().getIItemText()  : (VTEAsessmentStatus.INPROGRESS.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? voWdv.getInpatEpisode().getVTEAssessmentStatus().getIItemText() :(VTEAsessmentStatus.COMPLETED.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? voWdv.getInpatEpisode().getVTEAssessmentStatus().getIItemText() :"")); //wdev-14858
    }

    //---------

    StringBuffer strTooltip = new StringBuffer();

    if( ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue() == true)   //wdev-15062
    {
        strTooltip.append("<html><head></head><body><p><font color='#FF0000'><strong>Other Detail</strong></font>" +
            "<table width='210' border='0'><tr><td width='70'><font color='#0033FF'>NHS Number :</font></td><td>" +
            nhsNo +
            "</td></tr><tr><td><font color='#0033FF'>Consultant :</font></td><td>" +
            consultant +
            "</td></tr><tr><td><font color='#0033FF'>VTE Assessment Status :</font></td><td>" +
            vteStatus +
            "</td></tr></table></p>" +
            "</body></html>");
    }
    else
    {
        strTooltip.append("<html><head></head><body><p><font color='#FF0000'><strong>Other Detail</strong></font>" +
                "<table width='210' border='0'><tr><td width='70'><font color='#0033FF'>NHS Number :</font></td><td>" +
                nhsNo +
                "</td></tr><tr><td><font color='#0033FF'>Consultant :</font></td><td>" +
                consultant +
                "</td></tr></table></p>" +
                "</body></html>");
    }

    return strTooltip.toString();
}
项目:AvoinApotti    文件:WardDataViewImpl.java   
/**
 * A list of all the occupied beds and associated inpatients across a ward
 */
public WardDataViewVoCollection listInpatientsInBedsByWard(LocationRefVo ward)
{
    if (ward == null || ward.getID_Location() == null)
        throw new CodingRuntimeException("ward is null or id not provided in method listInpatientsInBedsByWard");

    WardDataViewVoCollection voCollWdv = new WardDataViewVoCollection();

    String hql = "select bed, pat, bay, pe,inpatEpis from BedSpaceState as bedSpaceState left join bedSpaceState.bedSpace as bed left join bedSpaceState.currentBedStatus as currentStatus left join bedSpaceState.inpatientEpisode as inpatEpis left join inpatEpis.pasEvent as pe left join pe.patient as pat left join bedSpaceState.bay as bay " +
            "where (bedSpaceState.ward.id = :wardId and bedSpaceState.inpatientEpisode is not null  and currentStatus.bedStatus = :occupied)";

    List wdvList = getDomainFactory().find(hql, new String[]{"wardId","occupied"}, new Object[]{ward.getID_Location(), getDomLookup(BedStatus.OCCUPIED)});
    if(wdvList != null && wdvList.size() > 0)
    {
        Iterator it = wdvList.iterator();
        while(it.hasNext())
        {
            Object[] item = (Object[])it.next();
            BedSpace doBed = (BedSpace) item[0];
            Patient doPat = (Patient) item[1];
            Location doBay = (Location) item[2];
            PASEvent doPe = (PASEvent) item[3];
            InpatientEpisode doInpat = (InpatientEpisode) item[4]; //wdev-14784

            WardDataViewVo voWardDv = new WardDataViewVo(); 
            voWardDv.setBed(BedSpaceVoAssembler.create(doBed));
            voWardDv.setBay(LocationLiteVoAssembler.create(doBay));
            voWardDv.setPatient(PatientShortAssembler.create(doPat));
            voWardDv.getPatient().setHasAlerts(doPat.getPatientAlerts() != null && doPat.getPatientAlerts().size() > 0 ? true : false);
            voWardDv.setInpatEpisode(InpatientEpisodeForVTERiskAsessmentVoAssembler.create(doInpat)); //wdev-14784
            //wdev-11083

            Iterator<ims.core.clinical.domain.objects.PatientAlert> patAlert = doPat.getPatientAlerts().iterator();

            boolean flagHasAlerts = false;
            while(patAlert != null && patAlert.hasNext())
            {                   
                if(Boolean.TRUE.equals(patAlert.next().isIsCurrentlyActiveAlert()))
                {
                    flagHasAlerts = true;
                    break;

                }
            }
            voWardDv.getPatient().setHasActiveAlerts(flagHasAlerts);
            //end wdev-11083
            voWardDv.setPasEvent(PasEventADTVoAssembler.create(doPe));

            voCollWdv.add(voWardDv);
        }
    }

    voCollWdv.sort();
    return voCollWdv;
}
项目:openMAXIMS    文件:Logic.java   
private Color getRowColour(WardDataViewVo bedSpace)
{
    ColorBean darkOrangeBean = new ColorBean();
    darkOrangeBean.setName("Dark Orange");
    darkOrangeBean.setValue(INTENSE_ORANGE_COLOR_HEXA_CODE);
    Color darkOrange = new Color(darkOrangeBean);

    if (bedSpace.getBedSpaceState() != null && bedSpace.getBedSpaceState().getCurrentBedStatus() != null)
    {
        if( BedStatus.FOR_CLEANING.equals(bedSpace.getBedSpaceState().getCurrentBedStatus().getBedStatus()))
            return Color.Magenta;

        else if(BedStatus.CLOSED.equals(bedSpace.getBedSpaceState().getCurrentBedStatus().getBedStatus()))
            return Color.Gray;

        else if(BedStatus.AVAILABLE.equals(bedSpace.getBedSpaceState().getCurrentBedStatus().getBedStatus()))
            return Color.LimeGreen;
    }

    //WDEV-22309 

    if (bedSpace.getPatientIsNotNull() && bedSpace.getPatient().getDodIsNotNull())
        return Color.Yellow;

    if (isPatientOnTrackingMovement(bedSpace))
        return Color.RoyalBlue;     

    if (bedSpace.getInpatEpisodeIsNotNull())
    {           
        if (isPatientOnHomeLeave(bedSpace))
            return Color.LightGray;

        if (bedSpace.getPendingTransfer() != null)
            return Color.LightSkyBlue;

        /**     Each row in the list will be assigned a background colour according to the bed status: 
        //          White. Occupied. Estimated date/time of discharge >24hrs from current date/time 
        //          Amber. Occupied. Estimated date/time of discharge <24hrs from current date/time 
        //          Red. Occupied. Confirmed discharge  */

        if (bedSpace.getInpatEpisode().isDischargeDueWithin24Hrs())
            return Boolean.TRUE.equals(bedSpace.getInpatEpisode().getIsConfirmedDischarge()) ? Color.Red : darkOrange;  


    }       
    return null;
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onImbRefreshClick() throws PresentationLogicException
{
    boolean patSelectionCleared = form.dyngrdInpatients().getValue() == null || (form.dyngrdInpatients().getValue() instanceof WardDataViewVo && ((WardDataViewVo)form.dyngrdInpatients().getValue()).getPatient() == null);
    wardValueChanged(patSelectionCleared);
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onDyngrdInpatientsCellButtonClicked(DynamicGridCell cell)
{
    form.dyngrdInpatients().setValue(cell.getRow().getValue());

    if  (form.dyngrdInpatients().getValue() == null)
        return;

    inpatientsGridSelectionChanged();

    InpatientEpisodeRefVo inpatientEpisode = null;
    VTEAssessmentStatusReason vteStatusReason = null;
    VTEAsessmentStatus vteStatus = null;

    if (form.dyngrdInpatients().getValue() instanceof  WardDataViewPatientVo) 
    {
        inpatientEpisode = ((WardDataViewPatientVo)form.dyngrdInpatients().getValue()).getInpatientEpisodeRef();
        vteStatusReason = ((WardDataViewPatientVo)form.dyngrdInpatients().getValue()).getVTEAssessmentStatusReason();
        vteStatus = ((WardDataViewPatientVo)form.dyngrdInpatients().getValue()).getVteAssessmentStatus();
    }
    else if (form.dyngrdInpatients().getValue() instanceof  WardDataViewVo)
    {
        inpatientEpisode = ((WardDataViewVo)form.dyngrdInpatients().getValue()).getInpatEpisode();

        if (inpatientEpisode != null)
        {
            vteStatusReason = ((WardDataViewVo)form.dyngrdInpatients().getValue()).getInpatEpisode().getVTEAssessmentStatusReason();
            vteStatus = ((WardDataViewVo)form.dyngrdInpatients().getValue()).getInpatEpisode().getVTEAssessmentStatus();
        }
    }

    if  (VTEAssessmentStatusReason.EXCLUDED.equals(vteStatusReason))
        return;

    form.getGlobalContext().Core.setInpatientEpisodeForVTERiskAssessmentWorklistVo(domain.getInpatientEpisodeForVTE(inpatientEpisode));

    if (VTEAsessmentStatus.REQUIRED.equals(vteStatus))
    {
        engine.open(form.getForms().Clinical.VTERiskAssessmentDialog, new Object[] {FormMode.EDIT});
    }
    else 
        engine.open(form.getForms().Clinical.VTERiskAssessmentDialog, new Object[] {FormMode.VIEW});

}
项目:openMAXIMS    文件:Logic.java   
private void updateControlsState()
{
    form.dyngrdDisplay().setVisible(RHS_TYPE_WARD_SUMMARY.equals(ConfigFlag.UI.WARD_VIEW_RHS_TYPE.getValue()));
    form.ccWardSummary().setVisible(RHS_TYPE_PATIENTS_SUMMARY.equals(ConfigFlag.UI.WARD_VIEW_RHS_TYPE.getValue()));


    WardBayConfigForWardViewVo wardConfig = form.getLocalContext().getWardBayConfig();

    boolean bAtLeastABayOutOfHours = isAtLeastABayOutOfHours(wardConfig);
    boolean bCanBlockAtLeastABay = canBlockAtLeastABay(wardConfig);
    boolean bCanCloseAtLeastABay = canCloseAtLeastABay(wardConfig);
    boolean bCanReopen = isAtLeastABayCloseOrBlocked(wardConfig);
    boolean bCanCloseWard = canCloseWard(wardConfig);
    boolean bCanBlockWard = canBlockWard(wardConfig);

    form.btnBlockBay().setVisible(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") &&  form.cmbWard().getValue() != null && engine.hasRight(AppRight.BED_MANAGEMENT_CAN_BLOCK_WARD_BAYS));
    form.btnBlockWard().setVisible(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") && form.cmbWard().getValue() != null && engine.hasRight(AppRight.BED_MANAGEMENT_CAN_BLOCK_WARD_BAYS));
    form.btnCloseBay().setVisible(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") &&  form.cmbWard().getValue() != null && engine.hasRight(AppRight.BED_MANAGEMENT_CAN_CLOSE_WARD_BAYS));
    form.btnCloseWard().setVisible(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") && form.cmbWard().getValue() != null && engine.hasRight(AppRight.BED_MANAGEMENT_CAN_CLOSE_WARD_BAYS));
    form.btnReopenBay().setVisible(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") && form.cmbWard().getValue() != null && (engine.hasRight(AppRight.BED_MANAGEMENT_CAN_CLOSE_WARD_BAYS) || engine.hasRight(AppRight.BED_MANAGEMENT_CAN_BLOCK_WARD_BAYS) || engine.hasRight(AppRight.BED_MANAGEMENT_CAN_REOPEN_WARD_BAYS_OOH)));
    form.btnReopenWard().setVisible(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") && form.cmbWard().getValue() != null && (((wardConfig != null && (engine.hasRight(AppRight.BED_MANAGEMENT_CAN_CLOSE_WARD_BAYS) || engine.hasRight(AppRight.BED_MANAGEMENT_CAN_BLOCK_WARD_BAYS))))));

    form.htmWardStatus().setVisible(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") && form.cmbWard().getValue() != null && wardConfig != null);

    form.btnBlockBay().setEnabled(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") &&  form.cmbWard().getValue() != null && wardConfig != null && wardConfig.getBaysIsNotNull() && ((engine.hasRight(AppRight.BED_MANAGEMENT_CAN_BLOCK_WARD_BAYS) && bCanBlockAtLeastABay)));
    form.btnBlockWard().setEnabled(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") && form.cmbWard().getValue() != null && ((engine.hasRight(AppRight.BED_MANAGEMENT_CAN_BLOCK_WARD_BAYS) && bCanBlockWard)));
    form.btnCloseBay().setEnabled(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") &&  form.cmbWard().getValue() != null && wardConfig != null && wardConfig.getBaysIsNotNull() && ((engine.hasRight(AppRight.BED_MANAGEMENT_CAN_CLOSE_WARD_BAYS) && bCanCloseAtLeastABay)));
    form.btnCloseWard().setEnabled(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") && form.cmbWard().getValue() != null && ((engine.hasRight(AppRight.BED_MANAGEMENT_CAN_CLOSE_WARD_BAYS) && bCanCloseWard)));
    form.btnReopenBay().setEnabled(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") && form.cmbWard().getValue() != null && wardConfig != null && wardConfig.getBaysIsNotNull() && ((engine.hasRight(AppRight.BED_MANAGEMENT_CAN_CLOSE_WARD_BAYS) || engine.hasRight(AppRight.BED_MANAGEMENT_CAN_BLOCK_WARD_BAYS)) && bCanReopen) || (engine.hasRight(AppRight.BED_MANAGEMENT_CAN_REOPEN_WARD_BAYS_OOH) && bAtLeastABayOutOfHours));
    form.btnReopenWard().setEnabled(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") && form.cmbWard().getValue() != null && ((engine.hasRight(AppRight.BED_MANAGEMENT_CAN_CLOSE_WARD_BAYS) && wardConfig != null && WardBayStatus.CLOSED.equals(wardConfig.getWardAvailabilityStatus()))) || (engine.hasRight(AppRight.BED_MANAGEMENT_CAN_BLOCK_WARD_BAYS) && wardConfig != null && WardBayStatus.BLOCKED.equals(wardConfig.getWardAvailabilityStatus())));

    form.btnAdmitWard().setEnabled(true);
    form.imbInfo().setVisible(form.cmbWard().getValue() != null && form.getLocalContext().getCountOfBaysOutOfOpeningHoursIsNotNull() && form.getLocalContext().getCountOfBaysOutOfOpeningHours()> 0);
    form.btnAdmitWard().setVisible(form.cmbWard().getValue() != null && isWardAndBaysOpen(form.getLocalContext().getWardBayConfig()));
    form.ccWardSummary().setWardClosedBlocked(!isWardAndBaysOpen(form.getLocalContext().getWardBayConfig()));

    form.getContextMenus().Core.hideAllWardDataViewMenuItems();
    form.getContextMenus().Core.getWardDataViewVIEW_DETAILSItem().setVisible(form.dyngrdInpatients().getValue() instanceof WardDataViewVo && ((WardDataViewVo)form.dyngrdInpatients().getValue()).getPatient() != null);

    form.btnBedManagementDashboard().setEnabled(Boolean.TRUE.equals(form.cmbHospital().getValue() != null));

    if (Boolean.FALSE.equals(form.cmbHospital().getValue() != null))
    {
        form.btnBedManagementDashboard().setTooltip("Hospital must be selected");
    } 
    else
    {
        form.btnBedManagementDashboard().setTooltip("");
    }
}
项目:openMAXIMS    文件:WardDataViewImpl.java   
/**
 * A list of all the occupied beds and associated inpatients across a ward
 */
public WardDataViewVoCollection listInpatientsInBedsByWard(LocationRefVo ward)
{
    if (ward == null || ward.getID_Location() == null)
        throw new CodingRuntimeException("ward is null or id not provided in method listInpatientsInBedsByWard");

    WardDataViewVoCollection voCollWdv = new WardDataViewVoCollection();

    String hql = "select bed, pat, bay, pe,inpatEpis from BedSpaceState as bedSpaceState left join bedSpaceState.bedSpace as bed left join bedSpaceState.currentBedStatus as currentStatus left join bedSpaceState.inpatientEpisode as inpatEpis left join inpatEpis.pasEvent as pe left join pe.patient as pat left join bedSpaceState.bay as bay " +
    "where (bedSpaceState.ward.id = :wardId and bedSpaceState.inpatientEpisode is not null  and currentStatus.bedStatus = :occupied)";

    List wdvList = getDomainFactory().find(hql, new String[]{"wardId","occupied"}, new Object[]{ward.getID_Location(), getDomLookup(BedStatus.OCCUPIED)});
    if(wdvList != null && wdvList.size() > 0)
    {
        Iterator it = wdvList.iterator();
        while(it.hasNext())
        {
            Object[] item = (Object[])it.next();
            BedSpace doBed = (BedSpace) item[0];
            Patient doPat = (Patient) item[1];
            Location doBay = (Location) item[2];
            PASEvent doPe = (PASEvent) item[3];
            InpatientEpisode doInpat = (InpatientEpisode) item[4]; //wdev-14784

            WardDataViewVo voWardDv = new WardDataViewVo(); 
            voWardDv.setBed(BedSpaceVoAssembler.create(doBed));
            voWardDv.setBay(LocationLiteVoAssembler.create(doBay));
            voWardDv.setPatient(PatientLite_IdentifiersVoAssembler.create(doPat));
            voWardDv.getPatient().setHasAlerts(doPat.getPatientAlerts() != null && doPat.getPatientAlerts().size() > 0 ? true : false);
            voWardDv.setInpatEpisode(InpatientEpisodeForVTERiskAsessmentVoAssembler.create(doInpat)); //wdev-14784
            //wdev-11083

            Iterator<ims.core.clinical.domain.objects.PatientAlert> patAlert = doPat.getPatientAlerts().iterator();

            boolean flagHasAlerts = false;
            while(patAlert != null && patAlert.hasNext())
            {                   
                if(Boolean.TRUE.equals(patAlert.next().isIsCurrentlyActiveAlert()))
                {
                    flagHasAlerts = true;
                    break;

                }
            }
            voWardDv.getPatient().setHasAlerts(flagHasAlerts);
            //end wdev-11083
            voWardDv.setPasEvent(PasEventADTVoAssembler.create(doPe));

            voCollWdv.add(voWardDv);
        }
    }

    voCollWdv.sort();
    return voCollWdv;
}
项目:openMAXIMS    文件:Logic.java   
private void fillFromInpatRecords() 
{
    WardDataViewVoCollection voCollWdv = domain.listInpatientsInBedsByWard(form.cmbWard().getValue());
    if(voCollWdv != null)
    {
        for (WardDataViewVo voWdv : voCollWdv)
        {
            grdInpatientsRow row = form.grdInpatients().getRows().newRow();
            PatientShort voPatient = voWdv.getPatient();
            if(voPatient != null)
            {
                if(voPatient.getNameIsNotNull())
                {
                    row.setColForename(voPatient.getName().getForename());
                    row.setColSurname(voPatient.getName().getSurname());
                }

                PatientId patId = voPatient.getDisplayId();
                row.setColDisplayId(patId != null ? patId.getValue() : null);               
                Integer age = voPatient.calculateAge();
                if(age != null)
                    row.setColAge(String.valueOf(age));

                if(voPatient.getHasActiveAlertsIsNotNull() && voPatient.getHasActiveAlerts())   //wdev-11083
                    row.setColAlert(form.getImages().Core.Alert16); //WDEV-18011 
                row.setColInfant(calculateInfants(voPatient));
            }

            if(voWdv.getBayIsNotNull())
                row.setColBay(voWdv.getBay().getName());
            if(voWdv.getBedIsNotNull())
                row.setColBedNumber(voWdv.getBed().getBedNumber());     

            row.setColPasEventHidden(voWdv.getPasEvent());

            //wdev-14784
            if( voWdv.getInpatEpisodeIsNotNull() && voWdv.getInpatEpisode().getVTEAssessmentStatusIsNotNull()  && ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue() == true) //wdev-15062
            {
                row.setColVTEStatus(VTEAsessmentStatus.REQUIRED.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? form.getImages().OCRR.Requested : (VTEAsessmentStatus.INPROGRESS.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? form.getImages().OCRR.InProgress : null));

            }
            else
            {
                row.setColVTEStatus(null);
            }
            //----------

            row.setTooltip(buildRowTooltip(voWdv));
            row.setValue(voPatient);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
private String buildRowTooltip(WardDataViewVo voWdv)
{
    if (voWdv == null)
        throw new CodingRuntimeException("voWdv cannot be null in method buildRowTooltip");

    String consultant = voWdv.getPasEventIsNotNull() && voWdv.getPasEvent().getConsultantIsNotNull() ? voWdv.getPasEvent().getConsultant().getIMosName() : "";
    String nhsNo =  voWdv.getPatientIsNotNull() && voWdv.getPatient().getNhsn() != null ?  voWdv.getPatient().getNhsn().getValue() : "";

    //wdev-14784
    String vteStatus = "";
    //wdev-14784
    if( voWdv.getInpatEpisodeIsNotNull() && voWdv.getInpatEpisode().getVTEAssessmentStatusIsNotNull()  && ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue() == true) //wdev-15062
    {
        vteStatus = VTEAsessmentStatus.REQUIRED.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? voWdv.getInpatEpisode().getVTEAssessmentStatus().getIItemText()  : (VTEAsessmentStatus.INPROGRESS.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? voWdv.getInpatEpisode().getVTEAssessmentStatus().getIItemText() :(VTEAsessmentStatus.COMPLETED.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? voWdv.getInpatEpisode().getVTEAssessmentStatus().getIItemText() :"")); //wdev-14858
    }

    //---------

    StringBuffer strTooltip = new StringBuffer();

    if( ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue() == true)   //wdev-15062
    {
        strTooltip.append("<html><head></head><body><p><font color='#FF0000'><strong>Other Detail</strong></font>" +
            "<table width='210' border='0'><tr><td width='70'><font color='#0033FF'>NHS Number :</font></td><td>" +
            nhsNo +
            "</td></tr><tr><td><font color='#0033FF'>Consultant :</font></td><td>" +
            consultant +
            "</td></tr><tr><td><font color='#0033FF'>VTE Assessment Status :</font></td><td>" +
            vteStatus +
            "</td></tr></table></p>" +
            "</body></html>");
    }
    else
    {
        strTooltip.append("<html><head></head><body><p><font color='#FF0000'><strong>Other Detail</strong></font>" +
                "<table width='210' border='0'><tr><td width='70'><font color='#0033FF'>NHS Number :</font></td><td>" +
                nhsNo +
                "</td></tr><tr><td><font color='#0033FF'>Consultant :</font></td><td>" +
                consultant +
                "</td></tr></table></p>" +
                "</body></html>");
    }

    return strTooltip.toString();
}
项目:openMAXIMS    文件:WardDataViewImpl.java   
/**
 * A list of all the occupied beds and associated inpatients across a ward
 */
public WardDataViewVoCollection listInpatientsInBedsByWard(LocationRefVo ward)
{
    if (ward == null || ward.getID_Location() == null)
        throw new CodingRuntimeException("ward is null or id not provided in method listInpatientsInBedsByWard");

    WardDataViewVoCollection voCollWdv = new WardDataViewVoCollection();

    String hql = "select bed, pat, bay, pe,inpatEpis from BedSpaceState as bedSpaceState left join bedSpaceState.bedSpace as bed left join bedSpaceState.currentBedStatus as currentStatus left join bedSpaceState.inpatientEpisode as inpatEpis left join inpatEpis.pasEvent as pe left join pe.patient as pat left join bedSpaceState.bay as bay " +
            "where (bedSpaceState.ward.id = :wardId and bedSpaceState.inpatientEpisode is not null  and currentStatus.bedStatus = :occupied)";

    List wdvList = getDomainFactory().find(hql, new String[]{"wardId","occupied"}, new Object[]{ward.getID_Location(), getDomLookup(BedStatus.OCCUPIED)});
    if(wdvList != null && wdvList.size() > 0)
    {
        Iterator it = wdvList.iterator();
        while(it.hasNext())
        {
            Object[] item = (Object[])it.next();
            BedSpace doBed = (BedSpace) item[0];
            Patient doPat = (Patient) item[1];
            Location doBay = (Location) item[2];
            PASEvent doPe = (PASEvent) item[3];
            InpatientEpisode doInpat = (InpatientEpisode) item[4]; //wdev-14784

            WardDataViewVo voWardDv = new WardDataViewVo(); 
            voWardDv.setBed(BedSpaceVoAssembler.create(doBed));
            voWardDv.setBay(LocationLiteVoAssembler.create(doBay));
            voWardDv.setPatient(PatientShortAssembler.create(doPat));
            voWardDv.getPatient().setHasAlerts(doPat.getPatientAlerts() != null && doPat.getPatientAlerts().size() > 0 ? true : false);
            voWardDv.setInpatEpisode(InpatientEpisodeForVTERiskAsessmentVoAssembler.create(doInpat)); //wdev-14784
            //wdev-11083

            Iterator<ims.core.clinical.domain.objects.PatientAlert> patAlert = doPat.getPatientAlerts().iterator();

            boolean flagHasAlerts = false;
            while(patAlert != null && patAlert.hasNext())
            {                   
                if(Boolean.TRUE.equals(patAlert.next().isIsCurrentlyActiveAlert()))
                {
                    flagHasAlerts = true;
                    break;

                }
            }
            voWardDv.getPatient().setHasActiveAlerts(flagHasAlerts);
            //end wdev-11083
            voWardDv.setPasEvent(PasEventADTVoAssembler.create(doPe));

            voCollWdv.add(voWardDv);
        }
    }

    voCollWdv.sort();
    return voCollWdv;
}
项目:openmaxims-linux    文件:Logic.java   
private void fillFromInpatRecords() 
{
    WardDataViewVoCollection voCollWdv = domain.listInpatientsInBedsByWard(form.cmbWard().getValue());
    if(voCollWdv != null)
    {
        for (WardDataViewVo voWdv : voCollWdv)
        {
            grdInpatientsRow row = form.grdInpatients().getRows().newRow();
            PatientShort voPatient = voWdv.getPatient();
            if(voPatient != null)
            {
                if(voPatient.getNameIsNotNull())
                {
                    row.setColForename(voPatient.getName().getForename());
                    row.setColSurname(voPatient.getName().getSurname());
                }

                PatientId patId = voPatient.getDisplayId();
                row.setColDisplayId(patId != null ? patId.getValue() : null);               
                Integer age = voPatient.calculateAge();
                if(age != null)
                    row.setColAge(String.valueOf(age));

                if(voPatient.getHasActiveAlertsIsNotNull() && voPatient.getHasActiveAlerts())   //wdev-11083
                    row.setColAlert(form.getImages().Core.Alert16); //WDEV-18011 
                row.setColInfant(calculateInfants(voPatient));
            }

            if(voWdv.getBayIsNotNull())
                row.setColBay(voWdv.getBay().getName());
            if(voWdv.getBedIsNotNull())
                row.setColBedNumber(voWdv.getBed().getBedNumber());     

            row.setColPasEventHidden(voWdv.getPasEvent());

            //wdev-14784
            if( voWdv.getInpatEpisodeIsNotNull() && voWdv.getInpatEpisode().getVTEAssessmentStatusIsNotNull()  && ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue() == true) //wdev-15062
            {
                row.setColVTEStatus(VTEAsessmentStatus.REQUIRED.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? form.getImages().OCRR.Requested : (VTEAsessmentStatus.INPROGRESS.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? form.getImages().OCRR.InProgress : null));

            }
            else
            {
                row.setColVTEStatus(null);
            }
            //----------

            row.setTooltip(buildRowTooltip(voWdv));
            row.setValue(voPatient);
        }
    }
}
项目:openmaxims-linux    文件:Logic.java   
private String buildRowTooltip(WardDataViewVo voWdv)
{
    if (voWdv == null)
        throw new CodingRuntimeException("voWdv cannot be null in method buildRowTooltip");

    String consultant = voWdv.getPasEventIsNotNull() && voWdv.getPasEvent().getConsultantIsNotNull() ? voWdv.getPasEvent().getConsultant().getIMosName() : "";
    String nhsNo =  voWdv.getPatientIsNotNull() && voWdv.getPatient().getNhsn() != null ?  voWdv.getPatient().getNhsn().getValue() : "";

    //wdev-14784
    String vteStatus = "";
    //wdev-14784
    if( voWdv.getInpatEpisodeIsNotNull() && voWdv.getInpatEpisode().getVTEAssessmentStatusIsNotNull()  && ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue() == true) //wdev-15062
    {
        vteStatus = VTEAsessmentStatus.REQUIRED.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? voWdv.getInpatEpisode().getVTEAssessmentStatus().getIItemText()  : (VTEAsessmentStatus.INPROGRESS.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? voWdv.getInpatEpisode().getVTEAssessmentStatus().getIItemText() :(VTEAsessmentStatus.COMPLETED.equals(voWdv.getInpatEpisode().getVTEAssessmentStatus()) ? voWdv.getInpatEpisode().getVTEAssessmentStatus().getIItemText() :"")); //wdev-14858
    }

    //---------

    StringBuffer strTooltip = new StringBuffer();

    if( ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue() == true)   //wdev-15062
    {
        strTooltip.append("<html><head></head><body><p><font color='#FF0000'><strong>Other Detail</strong></font>" +
            "<table width='210' border='0'><tr><td width='70'><font color='#0033FF'>NHS Number :</font></td><td>" +
            nhsNo +
            "</td></tr><tr><td><font color='#0033FF'>Consultant :</font></td><td>" +
            consultant +
            "</td></tr><tr><td><font color='#0033FF'>VTE Assessment Status :</font></td><td>" +
            vteStatus +
            "</td></tr></table></p>" +
            "</body></html>");
    }
    else
    {
        strTooltip.append("<html><head></head><body><p><font color='#FF0000'><strong>Other Detail</strong></font>" +
                "<table width='210' border='0'><tr><td width='70'><font color='#0033FF'>NHS Number :</font></td><td>" +
                nhsNo +
                "</td></tr><tr><td><font color='#0033FF'>Consultant :</font></td><td>" +
                consultant +
                "</td></tr></table></p>" +
                "</body></html>");
    }

    return strTooltip.toString();
}
项目:openmaxims-linux    文件:WardDataViewImpl.java   
/**
 * A list of all the occupied beds and associated inpatients across a ward
 */
public WardDataViewVoCollection listInpatientsInBedsByWard(LocationRefVo ward)
{
    if (ward == null || ward.getID_Location() == null)
        throw new CodingRuntimeException("ward is null or id not provided in method listInpatientsInBedsByWard");

    WardDataViewVoCollection voCollWdv = new WardDataViewVoCollection();

    String hql = "select bed, pat, bay, pe,inpatEpis from BedSpaceState as bedSpaceState left join bedSpaceState.bedSpace as bed left join bedSpaceState.currentBedStatus as currentStatus left join bedSpaceState.inpatientEpisode as inpatEpis left join inpatEpis.pasEvent as pe left join pe.patient as pat left join bedSpaceState.bay as bay " +
            "where (bedSpaceState.ward.id = :wardId and bedSpaceState.inpatientEpisode is not null  and currentStatus.bedStatus = :occupied)";

    List wdvList = getDomainFactory().find(hql, new String[]{"wardId","occupied"}, new Object[]{ward.getID_Location(), getDomLookup(BedStatus.OCCUPIED)});
    if(wdvList != null && wdvList.size() > 0)
    {
        Iterator it = wdvList.iterator();
        while(it.hasNext())
        {
            Object[] item = (Object[])it.next();
            BedSpace doBed = (BedSpace) item[0];
            Patient doPat = (Patient) item[1];
            Location doBay = (Location) item[2];
            PASEvent doPe = (PASEvent) item[3];
            InpatientEpisode doInpat = (InpatientEpisode) item[4]; //wdev-14784

            WardDataViewVo voWardDv = new WardDataViewVo(); 
            voWardDv.setBed(BedSpaceVoAssembler.create(doBed));
            voWardDv.setBay(LocationLiteVoAssembler.create(doBay));
            voWardDv.setPatient(PatientShortAssembler.create(doPat));
            voWardDv.getPatient().setHasAlerts(doPat.getPatientAlerts() != null && doPat.getPatientAlerts().size() > 0 ? true : false);
            voWardDv.setInpatEpisode(InpatientEpisodeForVTERiskAsessmentVoAssembler.create(doInpat)); //wdev-14784
            //wdev-11083

            Iterator<ims.core.clinical.domain.objects.PatientAlert> patAlert = doPat.getPatientAlerts().iterator();

            boolean flagHasAlerts = false;
            while(patAlert != null && patAlert.hasNext())
            {                   
                if(Boolean.TRUE.equals(patAlert.next().isIsCurrentlyActiveAlert()))
                {
                    flagHasAlerts = true;
                    break;

                }
            }
            voWardDv.getPatient().setHasActiveAlerts(flagHasAlerts);
            //end wdev-11083
            voWardDv.setPasEvent(PasEventADTVoAssembler.create(doPe));

            voCollWdv.add(voWardDv);
        }
    }

    voCollWdv.sort();
    return voCollWdv;
}