Java 类ims.nursing.vo.CarePlanInterventions 实例源码

项目:AvoinApotti    文件:Logic.java   
private void updateContextMenuActionsState()
{
    boolean editMode = FormMode.EDIT.equals(form.getMode());

    boolean isCcoSpecific =  ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO");
    boolean isRowSelected = form.dyngrdActions().getSelectedRow() != null;
    boolean isCurrentActionActive = false;
    if (isRowSelected)
        isCurrentActionActive = ((CarePlanInterventions)form.dyngrdActions().getValue()).getActive();

    boolean currentActionRemoved = false;
    if (isRowSelected)
        currentActionRemoved = Boolean.TRUE.equals(((CarePlanInterventions)form.dyngrdActions().getValue()).getIsRemoved());

    form.getContextMenus().Nursing.getCarePlanEvaluateActionADDItem().setVisible(editMode);
    form.getContextMenus().Nursing.getCarePlanEvaluateActionMARKACTIONCOMPLETEItem().setVisible(editMode && isRowSelected && isCcoSpecific && isCurrentActionActive && !currentActionRemoved);
    form.getContextMenus().Nursing.getCarePlanEvaluateActionREACTIVATEACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && !isCurrentActionActive && engine.hasRight(AppRight.NURSING_ADMIN_ROLE) && !currentActionRemoved);

    form.getContextMenus().Nursing.getCarePlanEvaluateActionREMOVE_ACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && !currentActionRemoved);
    form.getContextMenus().Nursing.getCarePlanEvaluateActionREINSTATE_ACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && currentActionRemoved);
}
项目:AvoinApotti    文件:Logic.java   
private CarePlanInterventions getInteventionFromTemplate(CarePlanTemplateIntervention template)
{
    CarePlanInterventions result = new CarePlanInterventions();
    Object Object = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteVo = Object!=null?(HcpLiteVo)Object:null;
    result.setDescription(template.getIntervention());
    result.setActive(new Boolean(true));


    result.setStartBy(hcpLiteVo);

    result.setInterventionType(template.getInterventionType());
    result.setOrder(form.getLocalContext().getCarePlan().getInterventions() == null ? 0:form.getLocalContext().getCarePlan().getInterventions().size());
    result.setStartDate(new Date());
    return result;
}
项目:openMAXIMS    文件:Logic.java   
private void updateContextMenuActionsState()
{
    boolean editMode = FormMode.EDIT.equals(form.getMode());

    boolean isCcoSpecific =  ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO");
    boolean isRowSelected = form.dyngrdActions().getSelectedRow() != null;
    boolean isCurrentActionActive = false;
    if (isRowSelected)
        isCurrentActionActive = ((CarePlanInterventions)form.dyngrdActions().getValue()).getActive();

    boolean currentActionRemoved = false;
    if (isRowSelected)
        currentActionRemoved = Boolean.TRUE.equals(((CarePlanInterventions)form.dyngrdActions().getValue()).getIsRemoved());

    form.getContextMenus().Nursing.getCarePlanEvaluateActionADDItem().setVisible(editMode);
    form.getContextMenus().Nursing.getCarePlanEvaluateActionMARKACTIONCOMPLETEItem().setVisible(editMode && isRowSelected && isCcoSpecific && isCurrentActionActive && !currentActionRemoved);
    form.getContextMenus().Nursing.getCarePlanEvaluateActionREACTIVATEACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && !isCurrentActionActive && engine.hasRight(AppRight.NURSING_ADMIN_ROLE) && !currentActionRemoved);

    form.getContextMenus().Nursing.getCarePlanEvaluateActionREMOVE_ACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && !currentActionRemoved);
    form.getContextMenus().Nursing.getCarePlanEvaluateActionREINSTATE_ACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && currentActionRemoved);
}
项目:openMAXIMS    文件:Logic.java   
private CarePlanInterventions getInteventionFromTemplate(CarePlanTemplateIntervention template)
{
    CarePlanInterventions result = new CarePlanInterventions();
    Object Object = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteVo = Object!=null?(HcpLiteVo)Object:null;
    result.setDescription(template.getIntervention());
    result.setActive(new Boolean(true));


    result.setStartBy(hcpLiteVo);

    result.setInterventionType(template.getInterventionType());
    result.setOrder(form.getLocalContext().getCarePlan().getInterventions() == null ? 0:form.getLocalContext().getCarePlan().getInterventions().size());
    result.setStartDate(new Date());
    return result;
}
项目:openMAXIMS    文件:Logic.java   
private void updateContextMenuActionsState()
{
    boolean editMode = FormMode.EDIT.equals(form.getMode());

    boolean isCcoSpecific =  ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO");
    boolean isRowSelected = form.dyngrdActions().getSelectedRow() != null;
    boolean isCurrentActionActive = false;
    if (isRowSelected)
        isCurrentActionActive = ((CarePlanInterventions)form.dyngrdActions().getValue()).getActive();

    boolean currentActionRemoved = false;
    if (isRowSelected)
        currentActionRemoved = Boolean.TRUE.equals(((CarePlanInterventions)form.dyngrdActions().getValue()).getIsRemoved());

    form.getContextMenus().Nursing.getCarePlanEvaluateActionADDItem().setVisible(editMode);
    form.getContextMenus().Nursing.getCarePlanEvaluateActionMARKACTIONCOMPLETEItem().setVisible(editMode && isRowSelected && isCcoSpecific && isCurrentActionActive && !currentActionRemoved);
    form.getContextMenus().Nursing.getCarePlanEvaluateActionREACTIVATEACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && !isCurrentActionActive && engine.hasRight(AppRight.NURSING_ADMIN_ROLE) && !currentActionRemoved);

    form.getContextMenus().Nursing.getCarePlanEvaluateActionREMOVE_ACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && !currentActionRemoved);
    form.getContextMenus().Nursing.getCarePlanEvaluateActionREINSTATE_ACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && currentActionRemoved);
}
项目:openMAXIMS    文件:Logic.java   
private CarePlanInterventions getInteventionFromTemplate(CarePlanTemplateIntervention template)
{
    CarePlanInterventions result = new CarePlanInterventions();
    Object Object = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteVo = Object!=null?(HcpLiteVo)Object:null;
    result.setDescription(template.getIntervention());
    result.setActive(new Boolean(true));


    result.setStartBy(hcpLiteVo);

    result.setInterventionType(template.getInterventionType());
    result.setOrder(form.getLocalContext().getCarePlan().getInterventions() == null ? 0:form.getLocalContext().getCarePlan().getInterventions().size());
    result.setStartDate(new Date());
    return result;
}
项目:openmaxims-linux    文件:Logic.java   
private void updateContextMenuActionsState()
{
    boolean editMode = FormMode.EDIT.equals(form.getMode());

    boolean isCcoSpecific =  ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO");
    boolean isRowSelected = form.dyngrdActions().getSelectedRow() != null;
    boolean isCurrentActionActive = false;
    if (isRowSelected)
        isCurrentActionActive = ((CarePlanInterventions)form.dyngrdActions().getValue()).getActive();

    boolean currentActionRemoved = false;
    if (isRowSelected)
        currentActionRemoved = Boolean.TRUE.equals(((CarePlanInterventions)form.dyngrdActions().getValue()).getIsRemoved());

    form.getContextMenus().Nursing.getCarePlanEvaluateActionADDItem().setVisible(editMode);
    form.getContextMenus().Nursing.getCarePlanEvaluateActionMARKACTIONCOMPLETEItem().setVisible(editMode && isRowSelected && isCcoSpecific && isCurrentActionActive && !currentActionRemoved);
    form.getContextMenus().Nursing.getCarePlanEvaluateActionREACTIVATEACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && !isCurrentActionActive && engine.hasRight(AppRight.NURSING_ADMIN_ROLE) && !currentActionRemoved);

    form.getContextMenus().Nursing.getCarePlanEvaluateActionREMOVE_ACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && !currentActionRemoved);
    form.getContextMenus().Nursing.getCarePlanEvaluateActionREINSTATE_ACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && currentActionRemoved);
}
项目:openmaxims-linux    文件:Logic.java   
private CarePlanInterventions getInteventionFromTemplate(CarePlanTemplateIntervention template)
{
    CarePlanInterventions result = new CarePlanInterventions();
    Object Object = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteVo = Object!=null?(HcpLiteVo)Object:null;
    result.setDescription(template.getIntervention());
    result.setActive(new Boolean(true));


    result.setStartBy(hcpLiteVo);

    result.setInterventionType(template.getInterventionType());
    result.setOrder(form.getLocalContext().getCarePlan().getInterventions() == null ? 0:form.getLocalContext().getCarePlan().getInterventions().size());
    result.setStartDate(new Date());
    return result;
}
项目:AvoinApotti    文件:Logic.java   
private void removeAction(boolean remove)
{
    loadCarePlanFromScreen();

    CarePlanInterventions value = (CarePlanInterventions)form.dyngrdActions().getSelectedRow().getValue();

    value.setIsRemoved(remove);
    value.setRemovedDate(remove ? new Date() : null);

    populateDynGrid(form.getLocalContext().getCarePlan().getInterventions());
}
项目:AvoinApotti    文件:Logic.java   
private boolean shouldAdd(CarePlanInterventions carePlanInterventions)
{
    if (carePlanInterventions == null )
        return false;
    if (form.cbFilter().getValue().equals("0") && !(carePlanInterventions.getActiveIsNotNull() && carePlanInterventions.getActive() && !Boolean.TRUE.equals(carePlanInterventions.getIsRemoved())))
        return false;
    return true;
}
项目:openMAXIMS    文件:Logic.java   
private String buildRemovedReinstatedActionTooltip(CarePlanInterventions action)
{
    if (action == null)
        return null;
    StringBuilder tooltip = new StringBuilder();
    if (action.getRemovalAuthoringInformationIsNotNull() && Boolean.TRUE.equals(action.getIsRemoved()))
    {
        if (action.getRemovalAuthoringInformation().getAuthoringHcp() != null)
        {   
            tooltip.append("Removed By: <b>" + action.getRemovalAuthoringInformation().getAuthoringHcp().getIMosName() + "</b>");
        }
        if (action.getRemovalAuthoringInformation().getAuthoringDateTime() != null)
        {
            tooltip.append("<br/> Removal Date/Time: <b>" +action.getRemovalAuthoringInformation().getAuthoringDateTime() + "</b>");
        }
    }
    else if (action.getReinstatingAuthoringInformationIsNotNull() && Boolean.FALSE.equals(action.getIsRemoved()))
    {
        if (action.getReinstatingAuthoringInformation().getAuthoringHcp() != null)
        {   
            tooltip.append("Reinstated By: <b>" + action.getReinstatingAuthoringInformation().getAuthoringHcp().getIMosName()+ "</b>");
        }
        if (action.getReinstatingAuthoringInformation().getAuthoringDateTime() != null)
        {
            tooltip.append("<br/> Reinstated Date/Time: <b>" + action.getReinstatingAuthoringInformation().getAuthoringDateTime()+ "</b>");
        }
    }

    return  tooltip.toString();

}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onDyngrdInterventionsCellValueChanged(DynamicGridCell cell) 
{
    form.btnSave().setEnabled(true);
    //WDEV-16795 --- start
    String prevText = ""; 
    DynamicGridRow row = cell.getRow();

    // Get completing information cell
    DynamicGridCell completingInformationCell = row.getCells().get(getColumn(COLWHENWHO));
    if (DynamicCellType.BOOL.equals(cell.getType()) &&  Boolean.TRUE.equals(completingInformationCell.getIdentifier())) 
        prevText = buildRemovedReinstatedActionTooltip((CarePlanInterventions) row.getIdentifier());
    //WDEV-16795----- end
    // WDEV-12237 Complete data for cell if it is marked as true
    if (cell.getType() == DynamicCellType.BOOL && Boolean.TRUE.equals(cell.getValue()))
    {
        // Set completing info
        StringBuilder displayText = new StringBuilder();

        displayText.append((new Date()).toString());
        displayText.append(" ");
        if (domain.getHcpLiteUser() != null)
            displayText.append(((HcpLiteVo)domain.getHcpLiteUser()).toString());

        completingInformationCell.setValue(displayText.toString());
        completingInformationCell.setTooltip(Boolean.TRUE.equals(completingInformationCell.getIdentifier()) ? displayText.toString() + (prevText.length() > 0 ? "<br/>" + prevText : prevText) :  displayText.toString()); //WDEV-16795

    }
    else
    {           
        completingInformationCell.setValue(null);
        completingInformationCell.setTooltip(Boolean.TRUE.equals(completingInformationCell.getIdentifier()) ? prevText : null); //WDEV-16795
    }

}
项目:openMAXIMS    文件:Logic.java   
private void removeAction(boolean remove)
{
    loadCarePlanFromScreen();

    CarePlanInterventions value = (CarePlanInterventions)form.dyngrdActions().getSelectedRow().getValue();

    value.setIsRemoved(remove);
    //WDEV-16795 ------------------ start
    AuthoringInformationVo authoringInfo = populateAuthoringInfo();
    value.setRemovalAuthoringInformation(remove ? authoringInfo : null);
    value.setReinstatingAuthoringInformation(remove ? null : authoringInfo); 
    //WDEV-16795 ------------------- end        
    populateDynGrid(form.getLocalContext().getCarePlan().getInterventions());
}
项目:openMAXIMS    文件:Logic.java   
private boolean shouldAdd(CarePlanInterventions carePlanInterventions)
{
    if (carePlanInterventions == null )
        return false;
    if (form.cbFilter().getValue().equals("0") && !(carePlanInterventions.getActiveIsNotNull() && carePlanInterventions.getActive() && !Boolean.TRUE.equals(carePlanInterventions.getIsRemoved())))
        return false;
    return true;
}
项目:openMAXIMS    文件:Logic.java   
private String buildRemovedReinstatedActionTooltip(CarePlanInterventions action)
{
    if (action == null)
        return null;
    StringBuilder tooltip = new StringBuilder();
    if (action.getRemovalAuthoringInformationIsNotNull() && Boolean.TRUE.equals(action.getIsRemoved()))
    {
        if (action.getRemovalAuthoringInformation().getAuthoringHcp() != null)
        {   
            tooltip.append("Removed By: <b>" + action.getRemovalAuthoringInformation().getAuthoringHcp().getIMosName() + "</b>");
        }
        if (action.getRemovalAuthoringInformation().getAuthoringDateTime() != null)
        {
            tooltip.append("<br/> Removal Date/Time: <b>" + action.getRemovalAuthoringInformation().getAuthoringDateTime() + "</b>");
        }
    }
    else if (action.getReinstatingAuthoringInformationIsNotNull() && Boolean.FALSE.equals(action.getIsRemoved()))
    {
        if (action.getReinstatingAuthoringInformation().getAuthoringHcp() != null)
        {   
            tooltip.append("Reinstated By: <b>" + action.getReinstatingAuthoringInformation().getAuthoringHcp().getIMosName() + "</b>");
        }
        if (action.getReinstatingAuthoringInformation().getAuthoringDateTime() != null)
        {
            tooltip.append("<br/> Reinstated Date/Time: <b>" + action.getReinstatingAuthoringInformation().getAuthoringDateTime() + "</b>");
        }
    }

    return  tooltip.toString();

}
项目:openMAXIMS    文件:Logic.java   
private void removeAction(boolean remove)
{
    loadCarePlanFromScreen();

    CarePlanInterventions value = (CarePlanInterventions)form.dyngrdActions().getSelectedRow().getValue();

    value.setIsRemoved(remove);
    value.setRemovedDate(remove ? new Date() : null);

    populateDynGrid(form.getLocalContext().getCarePlan().getInterventions());
}
项目:openMAXIMS    文件:Logic.java   
private boolean shouldAdd(CarePlanInterventions carePlanInterventions)
{
    if (carePlanInterventions == null )
        return false;
    if (form.cbFilter().getValue().equals("0") && !(carePlanInterventions.getActiveIsNotNull() && carePlanInterventions.getActive() && !Boolean.TRUE.equals(carePlanInterventions.getIsRemoved())))
        return false;
    return true;
}
项目:openmaxims-linux    文件:Logic.java   
private void removeAction(boolean remove)
{
    loadCarePlanFromScreen();

    CarePlanInterventions value = (CarePlanInterventions)form.dyngrdActions().getSelectedRow().getValue();

    value.setIsRemoved(remove);
    value.setRemovedDate(remove ? new Date() : null);

    populateDynGrid(form.getLocalContext().getCarePlan().getInterventions());
}
项目:openmaxims-linux    文件:Logic.java   
private boolean shouldAdd(CarePlanInterventions carePlanInterventions)
{
    if (carePlanInterventions == null )
        return false;
    if (form.cbFilter().getValue().equals("0") && !(carePlanInterventions.getActiveIsNotNull() && carePlanInterventions.getActive() && !Boolean.TRUE.equals(carePlanInterventions.getIsRemoved())))
        return false;
    return true;
}
项目:AvoinApotti    文件:Logic.java   
private CarePlanInterventionsCollection createNewCarePlanInterventionsCollection(CarePlanInterventionsCollection collInterventionsToBeCopied)
{
    if (collInterventionsToBeCopied == null || collInterventionsToBeCopied.size() == 0)
        return null;

    CarePlanInterventionsCollection collInterventions = new CarePlanInterventionsCollection();

    collInterventionsToBeCopied.sort(SortOrder.ASCENDING);

    int counter = 0;

    for (int i = 0; i < collInterventionsToBeCopied.size(); i++)
    {
        CarePlanInterventions interventionToSave = collInterventionsToBeCopied.get(i);

        if (interventionToSave.getActive() && (interventionToSave.getIsRemoved() == null || (interventionToSave.getIsRemoved() != null && !interventionToSave.getIsRemoved())))
        {
            interventionToSave.setID_CarePlanIntervention(null);

            interventionToSave.setStartDate(new Date());

            Object hcpUser = domain.getHcpLiteUser();
            if (hcpUser != null)
            {
                interventionToSave.setStartBy((HcpLiteVo) hcpUser);
            }

            interventionToSave.setOrder(counter);
            counter++;

            // fields that shouldn't be copied
            interventionToSave.setStopDate(null);
            interventionToSave.setStopBy(null);
            interventionToSave.setRemovedDate(null);

            collInterventions.add(interventionToSave);
        }

    }

    return collInterventions;
}
项目:AvoinApotti    文件:Logic.java   
private void populateGrid(CarePlanTitleCollection voCPs)
{
    form.dyngrdInterventions().getRows().clear();

    CarePlanCollection voCarePlans = null;

    if (voCPs != null && voCPs.size() > 0)
        voCarePlans = domain.listCarePlans(voCPs);

    for (int i = 0 ; voCarePlans != null && i < voCarePlans.size() ; i++)
    {
        voCarePlans.get(i).getInterventions().sort();

        for (int j = 0 ; voCarePlans.get(i).getInterventionsIsNotNull() && j < voCarePlans.get(i).getInterventions().size() ; j++)
        {
            CarePlanInterventions voInt = voCarePlans.get(i).getInterventions().get(j);

            DynamicGridRow row = form.dyngrdInterventions().getRows().newRow();
            //WDEV-16795 
            String removalInfo = "";
            if (voInt != null && Boolean.TRUE.equals(voInt.getIsRemoved()))
            {
                row.setReadOnly(true);
                row.setBackColor(Color.Gray);
                removalInfo = "<b>Care Plan Action Removed since: </b>" + voInt.getRemovedDate().toString(DateFormat.STANDARD);
            }

            DynamicGridCell cellOrdNum = row.getCells().newCell(getColumn(COLORDERNUMBER), DynamicCellType.STRING);
            cellOrdNum.setValue(voInt.getOrder().toString());
            //WDEV-16795
            cellOrdNum.setTooltip(voInt.getOrder().toString()+ (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""));
            cellOrdNum.setReadOnly(Boolean.TRUE);

            DynamicGridCell cellDesc = row.getCells().newCell(getColumn(COLDESC), DynamicCellType.STRING);
            cellDesc.setValue(voInt.getDescription().toString());
            //WDEV-16795
            cellDesc.setTooltip(voInt.getDescriptionIsNotNull() ? voInt.getDescription().toString() + (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""): "" + (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""));
            cellDesc.setReadOnly(Boolean.TRUE);

            DynamicGridCell cellInfo = row.getCells().newCell(getColumn(COLADDINFO), DynamicCellType.STRING);
            cellInfo.setValue(voInt.getAdditionalInfo());
            //WDEV-16795 
            cellInfo.setTooltip(voInt.getAdditionalInfoIsNotNull() ? voInt.getAdditionalInfo() : "" + (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""));
            cellInfo.setReadOnly(Boolean.TRUE);

            DynamicGridCell cellComp = row.getCells().newCell(getColumn(COLCOMPLETED), DynamicCellType.BOOL, DynamicGridCellOptions.EDITABLE_DATA_CELL);
            cellComp.setValue(voInt.getStopDateIsNotNull() ? Boolean.TRUE : Boolean.FALSE);
            cellComp.setReadOnly(voInt.getStopDateIsNotNull() && !voInt.getIsRemoved());//WDEV-16795
            cellComp.setAutoPostBack(Boolean.TRUE);

            DynamicGridCell cellCompInfo = row.getCells().newCell(getColumn(COLWHENWHO), DynamicCellType.STRING);
            cellCompInfo.setValue(voInt.getStopDateIsNotNull() || voInt.getStopByIsNotNull() ? 
                    (voInt.getStopDateIsNotNull() ? voInt.getStopDate().toString() : "" ) + " " + (voInt.getStopByIsNotNull() ? voInt.getStopBy().getName().toString() : "" ) : "");
            //WDEV-16795 
            cellCompInfo.setTooltip(voInt.getStopDateIsNotNull() || voInt.getStopByIsNotNull() ? 
                    (voInt.getStopDateIsNotNull() ? voInt.getStopDate().toString() + (removalInfo.length() > 0 ? "\n" + removalInfo : "") : "") + " " + (voInt.getStopByIsNotNull() ? voInt.getStopBy().getName().toString() + (removalInfo.length() > 0 ? "\n" + removalInfo : "") : "") : "" + (removalInfo.length() > 0 ? "\n" + removalInfo : ""));
            cellCompInfo.setReadOnly(Boolean.TRUE);

            row.setValue(voCarePlans.get(i));
            row.setIdentifier(voInt);
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void addThisRowsCarePlanInterventionAndOtherInterventionstoo(DynamicGridRow row) 
{
    // Check to see if the CarePlan is already in collection
    for (int i = 0 ; i < form.getLocalContext().getCarePlansToSave().size() ; i++)
    {
        if (form.getLocalContext().getCarePlansToSave().get(i).getID_CarePlan().equals(((CarePlan)row.getValue()).getID_CarePlan()))
            return;
    }

    CarePlan voRowCarePlan = ((CarePlan)row.getValue());

    //Look thru grid find rows for suppplied CarePlan - voRowCarePlan
    for (int iRow = 0 ; iRow < form.dyngrdInterventions().getRows().size() ; iRow++)
    {
        if (((CarePlan)form.dyngrdInterventions().getRows().get(iRow).getValue()).getID_CarePlan().equals(voRowCarePlan.getID_CarePlan()))
        {
            CarePlanInterventions voRowIntervention = (CarePlanInterventions)form.dyngrdInterventions().getRows().get(iRow).getIdentifier();

            // see if associated Intervention - Row is ticked
            DynamicGridCell cellComp = form.dyngrdInterventions().getRows().get(iRow).getCells().get(getColumn(COLCOMPLETED));
            if (cellComp != null 
                && cellComp.getType() == DynamicCellType.BOOL
                && (! cellComp.isReadOnly())
                && ((Boolean) cellComp.getValue()) )
            {
                //look for matching intervention in CarePlan - and set Stpooed INfo
                for( int iInter = 0 ; iInter < voRowCarePlan.getInterventions().size() ; iInter++)
                {
                    if (voRowCarePlan.getInterventions().get(iInter).getID_CarePlanIntervention().equals(voRowIntervention.getID_CarePlanIntervention()))
                    {
                        voRowCarePlan.getInterventions().get(iInter).setStopBy((HcpLiteVo)domain.getHcpLiteUser());
                        voRowCarePlan.getInterventions().get(iInter).setStopDate(new Date());
                        //WDEV-12155 
                        voRowCarePlan.getInterventions().get(iInter).setActive(false);
                    }
                }
            }
        }
    }
    form.getLocalContext().getCarePlansToSave().add(voRowCarePlan);
}
项目:AvoinApotti    文件:Logic.java   
private void populateDynGridRowFromData(DynamicGridRow newRow, CarePlanInterventions inter)
{
    boolean isCcoSpecific = ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO");
    boolean activeOnly = form.cbFilter().getValue().equals("0");
    DynamicGridColumn column = null;
    DynamicGridCell newCell = null;
    if (!isCcoSpecific)
    {
        column = form.dyngrdActions().getColumns().getByIdentifier(SELECTED_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.BOOL);
        newCell.setValue(inter.getActive());
        newCell.setReadOnly(CarePlanInterventionManOpt.MANDATORY.equals(inter.getInterventionType()));
    }
    column = form.dyngrdActions().getColumns().getByIdentifier(ACTION_COLUMN_INDENTIFIER);
    newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
    newCell.setValue(inter.getDescription());
    newCell.setTooltip(inter.getDescription());
    newCell.setReadOnly(true);

    column = form.dyngrdActions().getColumns().getByIdentifier(STARTD_COLUMN_INDENTIFIER);
    newCell = newRow.getCells().newCell(column, DynamicCellType.DATE);
    newCell.setValue(inter.getStartDate());
    newCell.setReadOnly(true);

    column = form.dyngrdActions().getColumns().getByIdentifier(STARTB_COLUMN_INDENTIFIER);
    newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
    newCell.setValue(inter.getStartByIsNotNull()?inter.getStartBy().toString():null);
    newCell.setTooltip(inter.getStartByIsNotNull()?inter.getStartBy().toString():null); //wdev-13285
    newCell.setReadOnly(true);

    if (!activeOnly)
    {
        column = form.dyngrdActions().getColumns().getByIdentifier(STOPD_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.DATE);
        newCell.setValue(inter.getStopDate());
        newCell.setReadOnly(true);

        column = form.dyngrdActions().getColumns().getByIdentifier(STOPB_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
        newCell.setValue(inter.getStopByIsNotNull()?inter.getStopBy().toString():null);
        newCell.setTooltip(inter.getStopByIsNotNull()?inter.getStopBy().toString():null); //wdev-13285
        newCell.setReadOnly(true);
    }

    if (isCcoSpecific)
    {
        column = form.dyngrdActions().getColumns().getByIdentifier(NOTES_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
        newCell.setStringMaxLength(100);
        newCell.setValue(inter.getAdditionalInfo());
        newCell.setTooltip(inter.getAdditionalInfo());  //wdev-13285
        newCell.setReadOnly(false);
    }

    if (isCcoSpecific && Boolean.TRUE.equals(inter.getIsRemoved()))
    {
        newRow.setTextColor(Color.Gray);
    }

    newRow.setValue(inter);
}
项目:AvoinApotti    文件:Logic.java   
private CarePlan createDuplicateCarePlan() {
    CarePlan cpDuplicate = new CarePlan();
    CarePlan cp = form.getLocalContext().getCarePlan();

    cpDuplicate.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
    cpDuplicate.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
    cpDuplicate.setTitle(cp.getTitle());
    cpDuplicate.setObjective(cp.getObjective());
    cpDuplicate.setNextEvaluationDate(new Date());
    CarePlanInterventionsCollection collCarePlanInterventions = new CarePlanInterventionsCollection();
    if(cp.getInterventions()!=null)
    for(int i=0; i<cp.getInterventions().size(); i++){
        CarePlanInterventions action = cp.getInterventions().get(i);
        CarePlanInterventions carePlanIntervention = new CarePlanInterventions();
        carePlanIntervention.setDescription(action.getDescription());
        carePlanIntervention.setActive(true);
        carePlanIntervention.setStartDate(action.getStartDate());
        carePlanIntervention.setStartBy(action.getStartBy());

        carePlanIntervention.setOrder(action.getOrder());
        carePlanIntervention.setInterventionType(action.getInterventionType());
        carePlanIntervention.setFrequency(action.getFrequency());

        collCarePlanInterventions.add(carePlanIntervention);
    }
    cpDuplicate.setInterventions(collCarePlanInterventions);

    //Care Plan Status
    CarePlanStatus status = new CarePlanStatus();
    status.setDateTime(new DateTime());

    Object Object = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteVo = Object != null ? (HcpLiteVo) Object : null;

    status.setHCP(hcpLiteVo);

    status.setStatus(ims.nursing.vo.lookups.CarePlanStatus.ACTIVE);

    cpDuplicate.setCurrentCarePlanStatus(status);

    CarePlanStatusCollection voColl = new CarePlanStatusCollection();
    voColl.add(status);
    cpDuplicate.setCarePlanStatus(voColl);

    return cpDuplicate;
}
项目:openMAXIMS    文件:Logic.java   
private CarePlanInterventionsCollection createNewCarePlanInterventionsCollection(CarePlanInterventionsCollection collInterventionsToBeCopied)
{
    if (collInterventionsToBeCopied == null || collInterventionsToBeCopied.size() == 0)
        return null;

    CarePlanInterventionsCollection collInterventions = new CarePlanInterventionsCollection();

    collInterventionsToBeCopied.sort(SortOrder.ASCENDING);

    int counter = 0;

    for (int i = 0; i < collInterventionsToBeCopied.size(); i++)
    {
        CarePlanInterventions interventionToSave = collInterventionsToBeCopied.get(i);

        if (interventionToSave.getActive() && (interventionToSave.getIsRemoved() == null || (interventionToSave.getIsRemoved() != null && !interventionToSave.getIsRemoved())))
        {
            interventionToSave.setID_CarePlanIntervention(null);

            interventionToSave.setStartDate(new Date());

            Object hcpUser = domain.getHcpLiteUser();
            if (hcpUser != null)
            {
                interventionToSave.setStartBy((HcpLiteVo) hcpUser);
            }

            interventionToSave.setOrder(counter);
            counter++;

            // fields that shouldn't be copied
            interventionToSave.setStopDate(null);
            interventionToSave.setStopBy(null);
            interventionToSave.setIsRemoved(null); //WDEV-16795
            interventionToSave.setRemovalAuthoringInformation(null); //WDEV-16795

            collInterventions.add(interventionToSave);
        }
    }
    return collInterventions;
}
项目:openMAXIMS    文件:Logic.java   
private void populateGrid(CarePlanTitleCollection voCPs)
{
    form.dyngrdInterventions().getRows().clear();

    CarePlanCollection voCarePlans = null;

    if (voCPs != null && voCPs.size() > 0)
        voCarePlans = domain.listCarePlans(voCPs);

    for (int i = 0 ; voCarePlans != null && i < voCarePlans.size() ; i++)
    {
        voCarePlans.get(i).getInterventions().sort();

        for (int j = 0 ; voCarePlans.get(i).getInterventionsIsNotNull() && j < voCarePlans.get(i).getInterventions().size() ; j++)
        {
            CarePlanInterventions voInt = voCarePlans.get(i).getInterventions().get(j);

            DynamicGridRow row = form.dyngrdInterventions().getRows().newRow();
            //WDEV-16795 
            String removalInfo = "";
            String lineDelimiter = "<br/>"; 
            boolean isCcoSpecific = ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO");
            boolean isRemovedOrReinstatedAction = voInt != null && isCcoSpecific && (Boolean.TRUE.equals(voInt.getIsRemoved()) || Boolean.FALSE.equals(voInt.getIsRemoved())); //WDEV-16795
            if (voInt != null && Boolean.TRUE.equals(voInt.getIsRemoved()))
            {
                row.setReadOnly(true);
                row.setBackColor(Color.LightGray);                                      
            }
            if (isRemovedOrReinstatedAction)
            {
                removalInfo = buildRemovedReinstatedActionTooltip(voInt);
            }
            //---- end WDEV-16795
            DynamicGridCell cellOrdNum = row.getCells().newCell(getColumn(COLORDERNUMBER), DynamicCellType.STRING);
            cellOrdNum.setValue(voInt.getOrder().toString());
            //WDEV-16795
            cellOrdNum.setTooltip(voInt.getOrderIsNotNull() ? voInt.getOrder().toString() + lineDelimiter + removalInfo : removalInfo);
            cellOrdNum.setReadOnly(Boolean.TRUE);

            DynamicGridCell cellDesc = row.getCells().newCell(getColumn(COLDESC), DynamicCellType.STRING);
            cellDesc.setValue(voInt.getDescription().toString());
            //WDEV-16795
            cellDesc.setTooltip(voInt.getDescriptionIsNotNull() ? voInt.getDescription().toString() + lineDelimiter + removalInfo: removalInfo);
            cellDesc.setReadOnly(Boolean.TRUE);

            DynamicGridCell cellInfo = row.getCells().newCell(getColumn(COLADDINFO), DynamicCellType.STRING);
            cellInfo.setValue(voInt.getAdditionalInfo());
            //WDEV-16795 
            cellInfo.setTooltip(voInt.getAdditionalInfoIsNotNull() ? voInt.getAdditionalInfo() + lineDelimiter + removalInfo: removalInfo);
            cellInfo.setReadOnly(Boolean.TRUE);

            DynamicGridCell cellComp = row.getCells().newCell(getColumn(COLCOMPLETED), DynamicCellType.BOOL, DynamicGridCellOptions.EDITABLE_DATA_CELL);
            cellComp.setValue(voInt.getStopDateIsNotNull() ? Boolean.TRUE : Boolean.FALSE);
            cellComp.setReadOnly(voInt.getStopDateIsNotNull());
            cellComp.setTooltip(Boolean.TRUE.equals(row.isReadOnly()) || voInt.getStopDateIsNotNull() ?  removalInfo : ""); //WDEV-16795
            cellComp.setAutoPostBack(Boolean.TRUE);

            DynamicGridCell cellCompInfo = row.getCells().newCell(getColumn(COLWHENWHO), DynamicCellType.STRING);
            cellCompInfo.setValue(voInt.getStopDateIsNotNull() || voInt.getStopByIsNotNull() ? 
                    (voInt.getStopDateIsNotNull() ? voInt.getStopDate() : "" ) + " " + (voInt.getStopByIsNotNull() ? voInt.getStopBy().getIMosName() : "" ) : "");
            //WDEV-16795 
            cellCompInfo.setTooltip(voInt.getStopDateIsNotNull() || voInt.getStopByIsNotNull() ? 
                    (voInt.getStopDateIsNotNull() ? voInt.getStopDate() : "" ) + " " + (voInt.getStopByIsNotNull() ? voInt.getStopBy().getIMosName() : "" ) + lineDelimiter + removalInfo: removalInfo);
            cellCompInfo.setReadOnly(Boolean.TRUE);
            if (isRemovedOrReinstatedAction)
                cellCompInfo.setIdentifier(isRemovedOrReinstatedAction); //WDEV-16795 

            row.setValue(voCarePlans.get(i));
            row.setIdentifier(voInt);

        }
    }
}
项目:openMAXIMS    文件:Logic.java   
private void addThisRowsCarePlanInterventionAndOtherInterventionstoo(DynamicGridRow row) 
{
    // Check to see if the CarePlan is already in collection
    for (int i = 0 ; i < form.getLocalContext().getCarePlansToSave().size() ; i++)
    {
        if (form.getLocalContext().getCarePlansToSave().get(i).getID_CarePlan().equals(((CarePlan)row.getValue()).getID_CarePlan()))
            return;
    }

    CarePlan voRowCarePlan = ((CarePlan)row.getValue());

    //Look thru grid find rows for suppplied CarePlan - voRowCarePlan
    for (int iRow = 0 ; iRow < form.dyngrdInterventions().getRows().size() ; iRow++)
    {
        if (((CarePlan)form.dyngrdInterventions().getRows().get(iRow).getValue()).getID_CarePlan().equals(voRowCarePlan.getID_CarePlan()))
        {
            CarePlanInterventions voRowIntervention = (CarePlanInterventions)form.dyngrdInterventions().getRows().get(iRow).getIdentifier();

            // see if associated Intervention - Row is ticked
            DynamicGridCell cellComp = form.dyngrdInterventions().getRows().get(iRow).getCells().get(getColumn(COLCOMPLETED));
            if (cellComp != null 
                && cellComp.getType() == DynamicCellType.BOOL
                && (! cellComp.isReadOnly())
                && ((Boolean) cellComp.getValue()) )
            {
                //look for matching intervention in CarePlan - and set Stpooed INfo
                for( int iInter = 0 ; iInter < voRowCarePlan.getInterventions().size() ; iInter++)
                {
                    if (voRowCarePlan.getInterventions().get(iInter).getID_CarePlanIntervention().equals(voRowIntervention.getID_CarePlanIntervention()))
                    {
                        voRowCarePlan.getInterventions().get(iInter).setStopBy((HcpLiteVo)domain.getHcpLiteUser());
                        voRowCarePlan.getInterventions().get(iInter).setStopDate(new Date());
                        //WDEV-12155 
                        voRowCarePlan.getInterventions().get(iInter).setActive(false);
                    }
                }
            }
        }
    }
    form.getLocalContext().getCarePlansToSave().add(voRowCarePlan);
}
项目:openMAXIMS    文件:Logic.java   
private void populateDynGridRowFromData(DynamicGridRow newRow, CarePlanInterventions inter)
{
    boolean isCcoSpecific = ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO");
    boolean activeOnly = form.cbFilter().getValue().equals("0");
    boolean isRemovedOrReinstatedAction = isCcoSpecific && (Boolean.TRUE.equals(inter.getIsRemoved()) || Boolean.FALSE.equals(inter.getIsRemoved())); //WDEV-16795 


    DynamicGridColumn column = null;
    DynamicGridCell newCell = null;
    String addInfo = ""; //WDEV-16795
    String lineDelimiter = "<br/>"; 

    if (isRemovedOrReinstatedAction) //WDEV-16795 
    {
        addInfo = buildRemovedReinstatedActionTooltip (inter);
    }
    if (!isCcoSpecific)
    {
        column = form.dyngrdActions().getColumns().getByIdentifier(SELECTED_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.BOOL);
        newCell.setValue(inter.getActive());
        newCell.setReadOnly(CarePlanInterventionManOpt.MANDATORY.equals(inter.getInterventionType()));
    }
    column = form.dyngrdActions().getColumns().getByIdentifier(ACTION_COLUMN_INDENTIFIER);
    newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
    newCell.setValue(inter.getDescription());
    newCell.setTooltip(inter.getDescription() != null ? inter.getDescription() + lineDelimiter + addInfo : addInfo);
    newCell.setReadOnly(true);

    column = form.dyngrdActions().getColumns().getByIdentifier(STARTD_COLUMN_INDENTIFIER);
    newCell = newRow.getCells().newCell(column, DynamicCellType.DATE);
    newCell.setValue(inter.getStartDate());
    newCell.setTooltip(inter.getStartDate() != null ? inter.getStartDate() + lineDelimiter +  addInfo : addInfo);
    newCell.setReadOnly(true);

    column = form.dyngrdActions().getColumns().getByIdentifier(STARTB_COLUMN_INDENTIFIER);
    newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
    newCell.setValue(inter.getStartByIsNotNull() ? inter.getStartBy().toString():null);
    newCell.setTooltip(inter.getStartByIsNotNull() ? inter.getStartBy().toString() + lineDelimiter + addInfo : addInfo ); //wdev-13285 //WDEV-16795 
    newCell.setReadOnly(true);

    if (!activeOnly)
    {
        column = form.dyngrdActions().getColumns().getByIdentifier(STOPD_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.DATE);
        newCell.setValue(inter.getStopDate());
        newCell.setTooltip(inter.getStopDateIsNotNull() ? inter.getStopDate() + lineDelimiter + addInfo : addInfo);
        newCell.setReadOnly(true);

        column = form.dyngrdActions().getColumns().getByIdentifier(STOPB_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
        newCell.setValue(inter.getStopByIsNotNull()?inter.getStopBy().toString():null);
        newCell.setTooltip(inter.getStopByIsNotNull()  ?inter.getStopBy().toString() + lineDelimiter + addInfo :addInfo) ; //wdev-13285 //WDEV-16795 
        newCell.setReadOnly(true);
    }

    if (isCcoSpecific)
    {
        column = form.dyngrdActions().getColumns().getByIdentifier(NOTES_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
        newCell.setStringMaxLength(100);
        newCell.setValue(inter.getAdditionalInfo());
        newCell.setTooltip(inter.getAdditionalInfoIsNotNull() ? inter.getAdditionalInfo() + lineDelimiter  + addInfo : addInfo);    //wdev-13285 //WDEV-16795 
        newCell.setReadOnly(false);
    }

    if (isCcoSpecific && Boolean.TRUE.equals(inter.getIsRemoved()))
    {
        newRow.setTextColor(Color.Gray);
    }

    newRow.setValue(inter);
}
项目:openMAXIMS    文件:Logic.java   
private CarePlan createDuplicateCarePlan() {
    CarePlan cpDuplicate = new CarePlan();
    CarePlan cp = form.getLocalContext().getCarePlan();

    cpDuplicate.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
    cpDuplicate.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
    cpDuplicate.setTitle(cp.getTitle());
    cpDuplicate.setObjective(cp.getObjective());
    cpDuplicate.setNextEvaluationDate(new Date());
    CarePlanInterventionsCollection collCarePlanInterventions = new CarePlanInterventionsCollection();
    if(cp.getInterventions()!=null)
    for(int i=0; i<cp.getInterventions().size(); i++){
        CarePlanInterventions action = cp.getInterventions().get(i);
        CarePlanInterventions carePlanIntervention = new CarePlanInterventions();
        carePlanIntervention.setDescription(action.getDescription());
        carePlanIntervention.setActive(true);
        carePlanIntervention.setStartDate(action.getStartDate());
        carePlanIntervention.setStartBy(action.getStartBy());

        carePlanIntervention.setOrder(action.getOrder());
        carePlanIntervention.setInterventionType(action.getInterventionType());
        carePlanIntervention.setFrequency(action.getFrequency());

        collCarePlanInterventions.add(carePlanIntervention);
    }
    cpDuplicate.setInterventions(collCarePlanInterventions);

    //Care Plan Status
    CarePlanStatus status = new CarePlanStatus();
    status.setDateTime(new DateTime());

    Object Object = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteVo = Object != null ? (HcpLiteVo) Object : null;

    status.setHCP(hcpLiteVo);

    status.setStatus(ims.nursing.vo.lookups.CarePlanStatus.ACTIVE);

    cpDuplicate.setCurrentCarePlanStatus(status);

    CarePlanStatusCollection voColl = new CarePlanStatusCollection();
    voColl.add(status);
    cpDuplicate.setCarePlanStatus(voColl);

    return cpDuplicate;
}
项目:openMAXIMS    文件:Logic.java   
private CarePlanInterventionsCollection createNewCarePlanInterventionsCollection(CarePlanInterventionsCollection collInterventionsToBeCopied)
{
    if (collInterventionsToBeCopied == null || collInterventionsToBeCopied.size() == 0)
        return null;

    CarePlanInterventionsCollection collInterventions = new CarePlanInterventionsCollection();

    collInterventionsToBeCopied.sort(SortOrder.ASCENDING);

    int counter = 0;

    for (int i = 0; i < collInterventionsToBeCopied.size(); i++)
    {
        CarePlanInterventions interventionToSave = collInterventionsToBeCopied.get(i);

        if (interventionToSave.getActive() && (interventionToSave.getIsRemoved() == null || (interventionToSave.getIsRemoved() != null && !interventionToSave.getIsRemoved())))
        {
            interventionToSave.setID_CarePlanIntervention(null);

            interventionToSave.setStartDate(new Date());

            Object hcpUser = domain.getHcpLiteUser();
            if (hcpUser != null)
            {
                interventionToSave.setStartBy((HcpLiteVo) hcpUser);
            }

            interventionToSave.setOrder(counter);
            counter++;

            // fields that shouldn't be copied
            interventionToSave.setStopDate(null);
            interventionToSave.setStopBy(null);
            interventionToSave.setRemovedDate(null);

            collInterventions.add(interventionToSave);
        }

    }

    return collInterventions;
}
项目:openMAXIMS    文件:Logic.java   
private void populateGrid(CarePlanTitleCollection voCPs)
{
    form.dyngrdInterventions().getRows().clear();

    CarePlanCollection voCarePlans = null;

    if (voCPs != null && voCPs.size() > 0)
        voCarePlans = domain.listCarePlans(voCPs);

    for (int i = 0 ; voCarePlans != null && i < voCarePlans.size() ; i++)
    {
        voCarePlans.get(i).getInterventions().sort();

        for (int j = 0 ; voCarePlans.get(i).getInterventionsIsNotNull() && j < voCarePlans.get(i).getInterventions().size() ; j++)
        {
            CarePlanInterventions voInt = voCarePlans.get(i).getInterventions().get(j);

            DynamicGridRow row = form.dyngrdInterventions().getRows().newRow();
            //WDEV-16795 
            String removalInfo = "";
            if (voInt != null && Boolean.TRUE.equals(voInt.getIsRemoved()))
            {
                row.setReadOnly(true);
                row.setBackColor(Color.Gray);
                removalInfo = "<b>Care Plan Action Removed since: </b>" + voInt.getRemovedDate().toString(DateFormat.STANDARD);
            }

            DynamicGridCell cellOrdNum = row.getCells().newCell(getColumn(COLORDERNUMBER), DynamicCellType.STRING);
            cellOrdNum.setValue(voInt.getOrder().toString());
            //WDEV-16795
            cellOrdNum.setTooltip(voInt.getOrder().toString()+ (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""));
            cellOrdNum.setReadOnly(Boolean.TRUE);

            DynamicGridCell cellDesc = row.getCells().newCell(getColumn(COLDESC), DynamicCellType.STRING);
            cellDesc.setValue(voInt.getDescription().toString());
            //WDEV-16795
            cellDesc.setTooltip(voInt.getDescriptionIsNotNull() ? voInt.getDescription().toString() + (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""): "" + (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""));
            cellDesc.setReadOnly(Boolean.TRUE);

            DynamicGridCell cellInfo = row.getCells().newCell(getColumn(COLADDINFO), DynamicCellType.STRING);
            cellInfo.setValue(voInt.getAdditionalInfo());
            //WDEV-16795 
            cellInfo.setTooltip(voInt.getAdditionalInfoIsNotNull() ? voInt.getAdditionalInfo() : "" + (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""));
            cellInfo.setReadOnly(Boolean.TRUE);

            DynamicGridCell cellComp = row.getCells().newCell(getColumn(COLCOMPLETED), DynamicCellType.BOOL, DynamicGridCellOptions.EDITABLE_DATA_CELL);
            cellComp.setValue(voInt.getStopDateIsNotNull() ? Boolean.TRUE : Boolean.FALSE);
            cellComp.setReadOnly(voInt.getStopDateIsNotNull() && !voInt.getIsRemoved());//WDEV-16795
            cellComp.setAutoPostBack(Boolean.TRUE);

            DynamicGridCell cellCompInfo = row.getCells().newCell(getColumn(COLWHENWHO), DynamicCellType.STRING);
            cellCompInfo.setValue(voInt.getStopDateIsNotNull() || voInt.getStopByIsNotNull() ? 
                    (voInt.getStopDateIsNotNull() ? voInt.getStopDate().toString() : "" ) + " " + (voInt.getStopByIsNotNull() ? voInt.getStopBy().getName().toString() : "" ) : "");
            //WDEV-16795 
            cellCompInfo.setTooltip(voInt.getStopDateIsNotNull() || voInt.getStopByIsNotNull() ? 
                    (voInt.getStopDateIsNotNull() ? voInt.getStopDate().toString() + (removalInfo.length() > 0 ? "\n" + removalInfo : "") : "") + " " + (voInt.getStopByIsNotNull() ? voInt.getStopBy().getName().toString() + (removalInfo.length() > 0 ? "\n" + removalInfo : "") : "") : "" + (removalInfo.length() > 0 ? "\n" + removalInfo : ""));
            cellCompInfo.setReadOnly(Boolean.TRUE);

            row.setValue(voCarePlans.get(i));
            row.setIdentifier(voInt);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
private void addThisRowsCarePlanInterventionAndOtherInterventionstoo(DynamicGridRow row) 
{
    // Check to see if the CarePlan is already in collection
    for (int i = 0 ; i < form.getLocalContext().getCarePlansToSave().size() ; i++)
    {
        if (form.getLocalContext().getCarePlansToSave().get(i).getID_CarePlan().equals(((CarePlan)row.getValue()).getID_CarePlan()))
            return;
    }

    CarePlan voRowCarePlan = ((CarePlan)row.getValue());

    //Look thru grid find rows for suppplied CarePlan - voRowCarePlan
    for (int iRow = 0 ; iRow < form.dyngrdInterventions().getRows().size() ; iRow++)
    {
        if (((CarePlan)form.dyngrdInterventions().getRows().get(iRow).getValue()).getID_CarePlan().equals(voRowCarePlan.getID_CarePlan()))
        {
            CarePlanInterventions voRowIntervention = (CarePlanInterventions)form.dyngrdInterventions().getRows().get(iRow).getIdentifier();

            // see if associated Intervention - Row is ticked
            DynamicGridCell cellComp = form.dyngrdInterventions().getRows().get(iRow).getCells().get(getColumn(COLCOMPLETED));
            if (cellComp != null 
                && cellComp.getType() == DynamicCellType.BOOL
                && (! cellComp.isReadOnly())
                && ((Boolean) cellComp.getValue()) )
            {
                //look for matching intervention in CarePlan - and set Stpooed INfo
                for( int iInter = 0 ; iInter < voRowCarePlan.getInterventions().size() ; iInter++)
                {
                    if (voRowCarePlan.getInterventions().get(iInter).getID_CarePlanIntervention().equals(voRowIntervention.getID_CarePlanIntervention()))
                    {
                        voRowCarePlan.getInterventions().get(iInter).setStopBy((HcpLiteVo)domain.getHcpLiteUser());
                        voRowCarePlan.getInterventions().get(iInter).setStopDate(new Date());
                        //WDEV-12155 
                        voRowCarePlan.getInterventions().get(iInter).setActive(false);
                    }
                }
            }
        }
    }
    form.getLocalContext().getCarePlansToSave().add(voRowCarePlan);
}
项目:openMAXIMS    文件:Logic.java   
private void populateDynGridRowFromData(DynamicGridRow newRow, CarePlanInterventions inter)
{
    boolean isCcoSpecific = ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO");
    boolean activeOnly = form.cbFilter().getValue().equals("0");
    DynamicGridColumn column = null;
    DynamicGridCell newCell = null;
    if (!isCcoSpecific)
    {
        column = form.dyngrdActions().getColumns().getByIdentifier(SELECTED_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.BOOL);
        newCell.setValue(inter.getActive());
        newCell.setReadOnly(CarePlanInterventionManOpt.MANDATORY.equals(inter.getInterventionType()));
    }
    column = form.dyngrdActions().getColumns().getByIdentifier(ACTION_COLUMN_INDENTIFIER);
    newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
    newCell.setValue(inter.getDescription());
    newCell.setTooltip(inter.getDescription());
    newCell.setReadOnly(true);

    column = form.dyngrdActions().getColumns().getByIdentifier(STARTD_COLUMN_INDENTIFIER);
    newCell = newRow.getCells().newCell(column, DynamicCellType.DATE);
    newCell.setValue(inter.getStartDate());
    newCell.setReadOnly(true);

    column = form.dyngrdActions().getColumns().getByIdentifier(STARTB_COLUMN_INDENTIFIER);
    newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
    newCell.setValue(inter.getStartByIsNotNull()?inter.getStartBy().toString():null);
    newCell.setTooltip(inter.getStartByIsNotNull()?inter.getStartBy().toString():null); //wdev-13285
    newCell.setReadOnly(true);

    if (!activeOnly)
    {
        column = form.dyngrdActions().getColumns().getByIdentifier(STOPD_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.DATE);
        newCell.setValue(inter.getStopDate());
        newCell.setReadOnly(true);

        column = form.dyngrdActions().getColumns().getByIdentifier(STOPB_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
        newCell.setValue(inter.getStopByIsNotNull()?inter.getStopBy().toString():null);
        newCell.setTooltip(inter.getStopByIsNotNull()?inter.getStopBy().toString():null); //wdev-13285
        newCell.setReadOnly(true);
    }

    if (isCcoSpecific)
    {
        column = form.dyngrdActions().getColumns().getByIdentifier(NOTES_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
        newCell.setStringMaxLength(100);
        newCell.setValue(inter.getAdditionalInfo());
        newCell.setTooltip(inter.getAdditionalInfo());  //wdev-13285
        newCell.setReadOnly(false);
    }

    if (isCcoSpecific && Boolean.TRUE.equals(inter.getIsRemoved()))
    {
        newRow.setTextColor(Color.Gray);
    }

    newRow.setValue(inter);
}
项目:openMAXIMS    文件:Logic.java   
private CarePlan createDuplicateCarePlan() {
    CarePlan cpDuplicate = new CarePlan();
    CarePlan cp = form.getLocalContext().getCarePlan();

    cpDuplicate.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
    cpDuplicate.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
    cpDuplicate.setTitle(cp.getTitle());
    cpDuplicate.setObjective(cp.getObjective());
    cpDuplicate.setNextEvaluationDate(new Date());
    CarePlanInterventionsCollection collCarePlanInterventions = new CarePlanInterventionsCollection();
    if(cp.getInterventions()!=null)
    for(int i=0; i<cp.getInterventions().size(); i++){
        CarePlanInterventions action = cp.getInterventions().get(i);
        CarePlanInterventions carePlanIntervention = new CarePlanInterventions();
        carePlanIntervention.setDescription(action.getDescription());
        carePlanIntervention.setActive(true);
        carePlanIntervention.setStartDate(action.getStartDate());
        carePlanIntervention.setStartBy(action.getStartBy());

        carePlanIntervention.setOrder(action.getOrder());
        carePlanIntervention.setInterventionType(action.getInterventionType());
        carePlanIntervention.setFrequency(action.getFrequency());

        collCarePlanInterventions.add(carePlanIntervention);
    }
    cpDuplicate.setInterventions(collCarePlanInterventions);

    //Care Plan Status
    CarePlanStatus status = new CarePlanStatus();
    status.setDateTime(new DateTime());

    Object Object = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteVo = Object != null ? (HcpLiteVo) Object : null;

    status.setHCP(hcpLiteVo);

    status.setStatus(ims.nursing.vo.lookups.CarePlanStatus.ACTIVE);

    cpDuplicate.setCurrentCarePlanStatus(status);

    CarePlanStatusCollection voColl = new CarePlanStatusCollection();
    voColl.add(status);
    cpDuplicate.setCarePlanStatus(voColl);

    return cpDuplicate;
}
项目:openmaxims-linux    文件:Logic.java   
private CarePlanInterventionsCollection createNewCarePlanInterventionsCollection(CarePlanInterventionsCollection collInterventionsToBeCopied)
{
    if (collInterventionsToBeCopied == null || collInterventionsToBeCopied.size() == 0)
        return null;

    CarePlanInterventionsCollection collInterventions = new CarePlanInterventionsCollection();

    collInterventionsToBeCopied.sort(SortOrder.ASCENDING);

    int counter = 0;

    for (int i = 0; i < collInterventionsToBeCopied.size(); i++)
    {
        CarePlanInterventions interventionToSave = collInterventionsToBeCopied.get(i);

        if (interventionToSave.getActive() && (interventionToSave.getIsRemoved() == null || (interventionToSave.getIsRemoved() != null && !interventionToSave.getIsRemoved())))
        {
            interventionToSave.setID_CarePlanIntervention(null);

            interventionToSave.setStartDate(new Date());

            Object hcpUser = domain.getHcpLiteUser();
            if (hcpUser != null)
            {
                interventionToSave.setStartBy((HcpLiteVo) hcpUser);
            }

            interventionToSave.setOrder(counter);
            counter++;

            // fields that shouldn't be copied
            interventionToSave.setStopDate(null);
            interventionToSave.setStopBy(null);
            interventionToSave.setRemovedDate(null);

            collInterventions.add(interventionToSave);
        }

    }

    return collInterventions;
}
项目:openmaxims-linux    文件:Logic.java   
private void populateGrid(CarePlanTitleCollection voCPs)
{
    form.dyngrdInterventions().getRows().clear();

    CarePlanCollection voCarePlans = null;

    if (voCPs != null && voCPs.size() > 0)
        voCarePlans = domain.listCarePlans(voCPs);

    for (int i = 0 ; voCarePlans != null && i < voCarePlans.size() ; i++)
    {
        voCarePlans.get(i).getInterventions().sort();

        for (int j = 0 ; voCarePlans.get(i).getInterventionsIsNotNull() && j < voCarePlans.get(i).getInterventions().size() ; j++)
        {
            CarePlanInterventions voInt = voCarePlans.get(i).getInterventions().get(j);

            DynamicGridRow row = form.dyngrdInterventions().getRows().newRow();
            //WDEV-16795 
            String removalInfo = "";
            if (voInt != null && Boolean.TRUE.equals(voInt.getIsRemoved()))
            {
                row.setReadOnly(true);
                row.setBackColor(Color.Gray);
                removalInfo = "<b>Care Plan Action Removed since: </b>" + voInt.getRemovedDate().toString(DateFormat.STANDARD);
            }

            DynamicGridCell cellOrdNum = row.getCells().newCell(getColumn(COLORDERNUMBER), DynamicCellType.STRING);
            cellOrdNum.setValue(voInt.getOrder().toString());
            //WDEV-16795
            cellOrdNum.setTooltip(voInt.getOrder().toString()+ (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""));
            cellOrdNum.setReadOnly(Boolean.TRUE);

            DynamicGridCell cellDesc = row.getCells().newCell(getColumn(COLDESC), DynamicCellType.STRING);
            cellDesc.setValue(voInt.getDescription().toString());
            //WDEV-16795
            cellDesc.setTooltip(voInt.getDescriptionIsNotNull() ? voInt.getDescription().toString() + (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""): "" + (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""));
            cellDesc.setReadOnly(Boolean.TRUE);

            DynamicGridCell cellInfo = row.getCells().newCell(getColumn(COLADDINFO), DynamicCellType.STRING);
            cellInfo.setValue(voInt.getAdditionalInfo());
            //WDEV-16795 
            cellInfo.setTooltip(voInt.getAdditionalInfoIsNotNull() ? voInt.getAdditionalInfo() : "" + (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""));
            cellInfo.setReadOnly(Boolean.TRUE);

            DynamicGridCell cellComp = row.getCells().newCell(getColumn(COLCOMPLETED), DynamicCellType.BOOL, DynamicGridCellOptions.EDITABLE_DATA_CELL);
            cellComp.setValue(voInt.getStopDateIsNotNull() ? Boolean.TRUE : Boolean.FALSE);
            cellComp.setReadOnly(voInt.getStopDateIsNotNull() && !voInt.getIsRemoved());//WDEV-16795
            cellComp.setAutoPostBack(Boolean.TRUE);

            DynamicGridCell cellCompInfo = row.getCells().newCell(getColumn(COLWHENWHO), DynamicCellType.STRING);
            cellCompInfo.setValue(voInt.getStopDateIsNotNull() || voInt.getStopByIsNotNull() ? 
                    (voInt.getStopDateIsNotNull() ? voInt.getStopDate().toString() : "" ) + " " + (voInt.getStopByIsNotNull() ? voInt.getStopBy().getName().toString() : "" ) : "");
            //WDEV-16795 
            cellCompInfo.setTooltip(voInt.getStopDateIsNotNull() || voInt.getStopByIsNotNull() ? 
                    (voInt.getStopDateIsNotNull() ? voInt.getStopDate().toString() + (removalInfo.length() > 0 ? "\n" + removalInfo : "") : "") + " " + (voInt.getStopByIsNotNull() ? voInt.getStopBy().getName().toString() + (removalInfo.length() > 0 ? "\n" + removalInfo : "") : "") : "" + (removalInfo.length() > 0 ? "\n" + removalInfo : ""));
            cellCompInfo.setReadOnly(Boolean.TRUE);

            row.setValue(voCarePlans.get(i));
            row.setIdentifier(voInt);
        }
    }
}
项目:openmaxims-linux    文件:Logic.java   
private void addThisRowsCarePlanInterventionAndOtherInterventionstoo(DynamicGridRow row) 
{
    // Check to see if the CarePlan is already in collection
    for (int i = 0 ; i < form.getLocalContext().getCarePlansToSave().size() ; i++)
    {
        if (form.getLocalContext().getCarePlansToSave().get(i).getID_CarePlan().equals(((CarePlan)row.getValue()).getID_CarePlan()))
            return;
    }

    CarePlan voRowCarePlan = ((CarePlan)row.getValue());

    //Look thru grid find rows for suppplied CarePlan - voRowCarePlan
    for (int iRow = 0 ; iRow < form.dyngrdInterventions().getRows().size() ; iRow++)
    {
        if (((CarePlan)form.dyngrdInterventions().getRows().get(iRow).getValue()).getID_CarePlan().equals(voRowCarePlan.getID_CarePlan()))
        {
            CarePlanInterventions voRowIntervention = (CarePlanInterventions)form.dyngrdInterventions().getRows().get(iRow).getIdentifier();

            // see if associated Intervention - Row is ticked
            DynamicGridCell cellComp = form.dyngrdInterventions().getRows().get(iRow).getCells().get(getColumn(COLCOMPLETED));
            if (cellComp != null 
                && cellComp.getType() == DynamicCellType.BOOL
                && (! cellComp.isReadOnly())
                && ((Boolean) cellComp.getValue()) )
            {
                //look for matching intervention in CarePlan - and set Stpooed INfo
                for( int iInter = 0 ; iInter < voRowCarePlan.getInterventions().size() ; iInter++)
                {
                    if (voRowCarePlan.getInterventions().get(iInter).getID_CarePlanIntervention().equals(voRowIntervention.getID_CarePlanIntervention()))
                    {
                        voRowCarePlan.getInterventions().get(iInter).setStopBy((HcpLiteVo)domain.getHcpLiteUser());
                        voRowCarePlan.getInterventions().get(iInter).setStopDate(new Date());
                        //WDEV-12155 
                        voRowCarePlan.getInterventions().get(iInter).setActive(false);
                    }
                }
            }
        }
    }
    form.getLocalContext().getCarePlansToSave().add(voRowCarePlan);
}
项目:openmaxims-linux    文件:Logic.java   
private void populateDynGridRowFromData(DynamicGridRow newRow, CarePlanInterventions inter)
{
    boolean isCcoSpecific = ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO");
    boolean activeOnly = form.cbFilter().getValue().equals("0");
    DynamicGridColumn column = null;
    DynamicGridCell newCell = null;
    if (!isCcoSpecific)
    {
        column = form.dyngrdActions().getColumns().getByIdentifier(SELECTED_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.BOOL);
        newCell.setValue(inter.getActive());
        newCell.setReadOnly(CarePlanInterventionManOpt.MANDATORY.equals(inter.getInterventionType()));
    }
    column = form.dyngrdActions().getColumns().getByIdentifier(ACTION_COLUMN_INDENTIFIER);
    newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
    newCell.setValue(inter.getDescription());
    newCell.setTooltip(inter.getDescription());
    newCell.setReadOnly(true);

    column = form.dyngrdActions().getColumns().getByIdentifier(STARTD_COLUMN_INDENTIFIER);
    newCell = newRow.getCells().newCell(column, DynamicCellType.DATE);
    newCell.setValue(inter.getStartDate());
    newCell.setReadOnly(true);

    column = form.dyngrdActions().getColumns().getByIdentifier(STARTB_COLUMN_INDENTIFIER);
    newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
    newCell.setValue(inter.getStartByIsNotNull()?inter.getStartBy().toString():null);
    newCell.setTooltip(inter.getStartByIsNotNull()?inter.getStartBy().toString():null); //wdev-13285
    newCell.setReadOnly(true);

    if (!activeOnly)
    {
        column = form.dyngrdActions().getColumns().getByIdentifier(STOPD_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.DATE);
        newCell.setValue(inter.getStopDate());
        newCell.setReadOnly(true);

        column = form.dyngrdActions().getColumns().getByIdentifier(STOPB_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
        newCell.setValue(inter.getStopByIsNotNull()?inter.getStopBy().toString():null);
        newCell.setTooltip(inter.getStopByIsNotNull()?inter.getStopBy().toString():null); //wdev-13285
        newCell.setReadOnly(true);
    }

    if (isCcoSpecific)
    {
        column = form.dyngrdActions().getColumns().getByIdentifier(NOTES_COLUMN_INDENTIFIER);
        newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
        newCell.setStringMaxLength(100);
        newCell.setValue(inter.getAdditionalInfo());
        newCell.setTooltip(inter.getAdditionalInfo());  //wdev-13285
        newCell.setReadOnly(false);
    }

    if (isCcoSpecific && Boolean.TRUE.equals(inter.getIsRemoved()))
    {
        newRow.setTextColor(Color.Gray);
    }

    newRow.setValue(inter);
}
项目:openmaxims-linux    文件:Logic.java   
private CarePlan createDuplicateCarePlan() {
    CarePlan cpDuplicate = new CarePlan();
    CarePlan cp = form.getLocalContext().getCarePlan();

    cpDuplicate.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
    cpDuplicate.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
    cpDuplicate.setTitle(cp.getTitle());
    cpDuplicate.setObjective(cp.getObjective());
    cpDuplicate.setNextEvaluationDate(new Date());
    CarePlanInterventionsCollection collCarePlanInterventions = new CarePlanInterventionsCollection();
    if(cp.getInterventions()!=null)
    for(int i=0; i<cp.getInterventions().size(); i++){
        CarePlanInterventions action = cp.getInterventions().get(i);
        CarePlanInterventions carePlanIntervention = new CarePlanInterventions();
        carePlanIntervention.setDescription(action.getDescription());
        carePlanIntervention.setActive(true);
        carePlanIntervention.setStartDate(action.getStartDate());
        carePlanIntervention.setStartBy(action.getStartBy());

        carePlanIntervention.setOrder(action.getOrder());
        carePlanIntervention.setInterventionType(action.getInterventionType());
        carePlanIntervention.setFrequency(action.getFrequency());

        collCarePlanInterventions.add(carePlanIntervention);
    }
    cpDuplicate.setInterventions(collCarePlanInterventions);

    //Care Plan Status
    CarePlanStatus status = new CarePlanStatus();
    status.setDateTime(new DateTime());

    Object Object = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteVo = Object != null ? (HcpLiteVo) Object : null;

    status.setHCP(hcpLiteVo);

    status.setStatus(ims.nursing.vo.lookups.CarePlanStatus.ACTIVE);

    cpDuplicate.setCurrentCarePlanStatus(status);

    CarePlanStatusCollection voColl = new CarePlanStatusCollection();
    voColl.add(status);
    cpDuplicate.setCarePlanStatus(voColl);

    return cpDuplicate;
}