Exemplo n.º 1
0
    /// <summary>
    /// method
    /// US:902
    /// runs the logic for all the checklists for the patient specified
    /// </summary>
    /// <param name="strPatientID"></param>
    /// <param name="lItemID"></param>
    /// <returns></returns>
    public CStatus RunLogic(string strPatientID)
    {
        CPatChecklistData pcl = new CPatChecklistData(this);
        DataSet           dsPatientChecklists = null;
        CStatus           status = pcl.GetPatChecklistDS(strPatientID, out dsPatientChecklists);

        if (!status.Status)
        {
            return(status);
        }

        CPatChecklistItemData pcli = new CPatChecklistItemData(this);

        foreach (DataRow drChecklist in dsPatientChecklists.Tables[0].Rows)
        {
            try
            {
                status = RunLogic(Convert.ToInt64(drChecklist["PAT_CL_ID"]));
            }
            catch
            {
                return(new CStatus(false, k_STATUS_CODE.Failed, LogicModuleMessages.ERROR_RUN_LOGIC));
            }

            if (!status.Status)
            {
                return(status);
            }
        }

        return(new CStatus());
    }
Exemplo n.º 2
0
    /// <summary>
    /// US:864 US:876 loads a dropdown list with patient checklists, will screen out
    /// check lists that the user does not have view permissions for.
    /// </summary>
    /// <param name="BaseMastr"></param>
    /// <param name="strPatientID"></param>
    /// <param name="ddl"></param>
    /// <returns></returns>
    public CStatus LoadPatientChecklists(CBaseMaster BaseMstr, string strPatientID, DropDownList ddl)
    {
        CPatientChecklistLogic pcl = new CPatientChecklistLogic(BaseMstr.BaseData);
        CStatus status             = pcl.RunLogic(strPatientID);

        if (!status.Status)
        {
            return(status);
        }

        CPatChecklistData pc = new CPatChecklistData(BaseMstr.BaseData);
        DataSet           ds = null;

        status = pc.GetPatChecklistDS(strPatientID, out ds);
        if (!status.Status)
        {
            return(status);
        }

        //remove records from the ds that the user is not allowed to view
        foreach (DataTable table in ds.Tables)
        {
            foreach (DataRow dr in table.Rows)
            {
                long lChecklistID = CDataUtils.GetDSLongValue(dr, "CHECKLIST_ID");

                CChecklistPermissionsDataItem pdi = null;
                CChecklistData clData             = new CChecklistData(BaseMstr.BaseData);
                clData.GetCheckListPermissionsDI(lChecklistID, out pdi);

                //is the user allowed to view this checklist
                if (!pdi.HasPermission(BaseMstr.AppUser, k_CHECKLIST_PERMISSION.Viewable))
                {
                    dr.Delete();
                }
            }
        }
        ds.AcceptChanges();

        //render the dataset
        status = CDropDownList.RenderDataSet(
            ds,
            ddl,
            "CHECKLIST_LABEL",
            "PAT_CL_ID");
        if (!status.Status)
        {
            return(status);
        }

        return(new CStatus());
    }