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

项目:AvoinApotti    文件:Logic.java   
@Override
protected void onGrdLayoutsGridCheckBoxClicked(int column, grdLayoutsRow row, boolean isChecked) throws PresentationLogicException
{
    if (Boolean.FALSE.equals(isChecked) && row.getValue().getFloorBedSpaceLayout() != null && row.getValue().getID_BayConfig() != null)
    {
        if (row.getValue().getID_BayConfig() != null)
        {
            BedSpaceVoCollection getBedSpaces = domain.getBedSpacesForLayout(row.getValue().getFloorBedSpaceLayout());

            if (areOccupiedBeds(getBedSpaces))
            {
                row.setActive(Boolean.TRUE);
                engine.showMessage("Bay cannot be Inactivated as there are occupied beds on the Ward.", "Warning", MessageButtons.OK, MessageIcon.WARNING);
            }
        }
    }

}
项目:openMAXIMS    文件:Logic.java   
private void populateBedSpaceGrid(BedSpaceVoCollection bedSpaces)
{
    form.grdBedSpace().getRows().clear();

    if(bedSpaces == null)
        return;

    for(BedSpaceVo bed : bedSpaces)
    {
        grdBedSpaceRow row = form.grdBedSpace().getRows().newRow();
        row.setColBedSpaceType(bed.getBedSpaceType() != null ? bed.getBedSpaceType().getText() : null);
        row.setColWardType(bed.getWardType() != null ? bed.getWardType().getText() : null);
        row.setColBedNumber(bed.getBedNumber());
        row.setColTextPosition(bed.getTextPosition());
        row.setColImagePosition(bed.getImagePosition());

        row.setValue(bed);
    }
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onGrdLayoutsGridCheckBoxClicked(int column, grdLayoutsRow row, boolean isChecked) throws PresentationLogicException
{
    if (Boolean.FALSE.equals(isChecked) && row.getValue().getFloorBedSpaceLayout() != null && row.getValue().getID_BayConfig() != null)
    {
        if (row.getValue().getID_BayConfig() != null)
        {
            BedSpaceVoCollection getBedSpaces = domain.getBedSpacesForLayout(row.getValue().getFloorBedSpaceLayout());

            if (areOccupiedBeds(getBedSpaces))
            {
                row.setActive(Boolean.TRUE);
                engine.showMessage("Bay cannot be Inactivated as there are occupied beds on the Ward.", "Warning", MessageButtons.OK, MessageIcon.WARNING);
            }
        }
    }

}
项目:openmaxims-linux    文件:Logic.java   
@Override
protected void onGrdLayoutsGridCheckBoxClicked(int column, grdLayoutsRow row, boolean isChecked) throws PresentationLogicException
{
    if (Boolean.FALSE.equals(isChecked) && row.getValue().getFloorBedSpaceLayout() != null && row.getValue().getID_BayConfig() != null)
    {
        if (row.getValue().getID_BayConfig() != null)
        {
            BedSpaceVoCollection getBedSpaces = domain.getBedSpacesForLayout(row.getValue().getFloorBedSpaceLayout());

            if (areOccupiedBeds(getBedSpaces))
            {
                row.setActive(Boolean.TRUE);
                engine.showMessage("Bay cannot be Inactivated as there are occupied beds on the Ward.", "Warning", MessageButtons.OK, MessageIcon.WARNING);
            }
        }
    }

}
项目:AvoinApotti    文件:Logic.java   
private Boolean areOccupiedBeds(BedSpaceVoCollection getBedSpaces)
{
    if (getBedSpaces == null)
        return false;

    for (int i=0; i < getBedSpaces.size(); i++)
    {
        BedSpaceStateStatusLiteVo bedSpaceState = domain.getBedSpaceStateStatus(getBedSpaces.get(i));

        if (BedStatus.OCCUPIED.equals(bedSpaceState.getBedStatus()))
            return true;
    }

    return false;
}
项目:AvoinApotti    文件:WardBayConfigDialogImpl.java   
public BedSpaceVoCollection getBedSpacesForLayout(FloorBedSpaceLayoutRefVo floorBedSpaceLayoutRef)
{
    if (floorBedSpaceLayoutRef == null || floorBedSpaceLayoutRef.getID_FloorBedSpaceLayout() == null)
        throw new CodingRuntimeException("Cannot get BedSpaces on null FloorBedSpaceLayoutRef");

    String hql = "select bs.bedSpaces from FloorBedSpaceLayout as bs where bs.id = " + floorBedSpaceLayoutRef.getID_FloorBedSpaceLayout();
    List bedSpaces = getDomainFactory().find(hql);

    BedSpaceVoCollection voColl = BedSpaceVoAssembler.createBedSpaceVoCollectionFromBedSpace(bedSpaces);

    return voColl;
}
项目:openMAXIMS    文件:Logic.java   
@Override
    protected void onGrdLayoutsGridCheckBoxClicked(int column, grdLayoutsRow row, boolean isChecked) throws PresentationLogicException
    {
        //http://jira/browse/WDEV-20449
//      if (Boolean.FALSE.equals(isChecked) && row.getValue().getFloorBedSpaceLayout() != null && row.getValue().getID_BayConfig() != null)
//      {
//          if (row.getValue().getID_BayConfig() != null)
//          {
//              BedSpaceVoCollection getBedSpaces = domain.getBedSpacesForLayout(row.getValue().getFloorBedSpaceLayout());
//              
//              if (areOccupiedBeds(getBedSpaces))
//              {
//                  row.setActive(Boolean.TRUE);
//                  //engine.showMessage("Bay cannot be Inactivated as there are occupied beds on the Ward.", "Warning", MessageButtons.OK, MessageIcon.WARNING);
//              }
//          }
//      }
//      
//      if (column == 3)
//          calculateNrOfBeds();

        // Only perform following if user has ticked/unticked column 3 (Active) in grdLayouts
        if (column == COL_BAY_ACTIVE)
        {
            if (row.getValue().getID_BayConfig() != null)
            {
                BedSpaceVoCollection getBedSpaces = domain.getBedSpacesForLayout(row.getValue().getFloorBedSpaceLayout());

                if (areOccupiedBeds(getBedSpaces))
                {
                    row.setActive(Boolean.TRUE);
                    engine.showMessage("The bay cannot be inactivated as there are patients occupying a bed admitted on it.", "Warning", MessageButtons.OK, MessageIcon.WARNING);
                }
            }

            calculateNrOfBeds();

        } //WDEV-20449

    }
项目:openMAXIMS    文件:Logic.java   
private Boolean areOccupiedBeds(BedSpaceVoCollection getBedSpaces)
{
    if (getBedSpaces == null)
        return false;

    for (int i=0; i < getBedSpaces.size(); i++)
    {
        BedSpaceStateStatusLiteVo bedSpaceState = domain.getBedSpaceStateStatus(getBedSpaces.get(i));

        if (BedStatus.OCCUPIED.equals(bedSpaceState.getBedStatus()))
            return true;
    }

    return false;
}
项目:openMAXIMS    文件:WardBayConfigDialogImpl.java   
public BedSpaceVoCollection getBedSpacesForLayout(FloorBedSpaceLayoutRefVo floorBedSpaceLayoutRef)
{
    if (floorBedSpaceLayoutRef == null || floorBedSpaceLayoutRef.getID_FloorBedSpaceLayout() == null)
        throw new CodingRuntimeException("Cannot get BedSpaces on null FloorBedSpaceLayoutRef");

    String hql = "select bs.bedSpaces from FloorBedSpaceLayout as bs where bs.id = " + floorBedSpaceLayoutRef.getID_FloorBedSpaceLayout();
    List<?> bedSpaces = getDomainFactory().find(hql);

    BedSpaceVoCollection voColl = BedSpaceVoAssembler.createBedSpaceVoCollectionFromBedSpace(bedSpaces);

    return voColl;
}
项目:openMAXIMS    文件:Logic.java   
private Boolean areOccupiedBeds(BedSpaceVoCollection getBedSpaces)
{
    if (getBedSpaces == null)
        return false;

    for (int i=0; i < getBedSpaces.size(); i++)
    {
        BedSpaceStateStatusLiteVo bedSpaceState = domain.getBedSpaceStateStatus(getBedSpaces.get(i));

        if (BedStatus.OCCUPIED.equals(bedSpaceState.getBedStatus()))
            return true;
    }

    return false;
}
项目:openMAXIMS    文件:WardBayConfigDialogImpl.java   
public BedSpaceVoCollection getBedSpacesForLayout(FloorBedSpaceLayoutRefVo floorBedSpaceLayoutRef)
{
    if (floorBedSpaceLayoutRef == null || floorBedSpaceLayoutRef.getID_FloorBedSpaceLayout() == null)
        throw new CodingRuntimeException("Cannot get BedSpaces on null FloorBedSpaceLayoutRef");

    String hql = "select bs.bedSpaces from FloorBedSpaceLayout as bs where bs.id = " + floorBedSpaceLayoutRef.getID_FloorBedSpaceLayout();
    List bedSpaces = getDomainFactory().find(hql);

    BedSpaceVoCollection voColl = BedSpaceVoAssembler.createBedSpaceVoCollectionFromBedSpace(bedSpaces);

    return voColl;
}
项目:openmaxims-linux    文件:Logic.java   
private Boolean areOccupiedBeds(BedSpaceVoCollection getBedSpaces)
{
    if (getBedSpaces == null)
        return false;

    for (int i=0; i < getBedSpaces.size(); i++)
    {
        BedSpaceStateStatusLiteVo bedSpaceState = domain.getBedSpaceStateStatus(getBedSpaces.get(i));

        if (BedStatus.OCCUPIED.equals(bedSpaceState.getBedStatus()))
            return true;
    }

    return false;
}
项目:openmaxims-linux    文件:WardBayConfigDialogImpl.java   
public BedSpaceVoCollection getBedSpacesForLayout(FloorBedSpaceLayoutRefVo floorBedSpaceLayoutRef)
{
    if (floorBedSpaceLayoutRef == null || floorBedSpaceLayoutRef.getID_FloorBedSpaceLayout() == null)
        throw new CodingRuntimeException("Cannot get BedSpaces on null FloorBedSpaceLayoutRef");

    String hql = "select bs.bedSpaces from FloorBedSpaceLayout as bs where bs.id = " + floorBedSpaceLayoutRef.getID_FloorBedSpaceLayout();
    List bedSpaces = getDomainFactory().find(hql);

    BedSpaceVoCollection voColl = BedSpaceVoAssembler.createBedSpaceVoCollectionFromBedSpace(bedSpaces);

    return voColl;
}