/// <summary>
 /// Get the details of the current facility in the view model by ID
 /// </summary>
 /// <param name="facilityId"></param>
 /// <returns></returns>
 ///
 //[AcceptVerbs(HttpVerbs.Get)]
 public ActionResult GetFacility(int facilityId)
 {
     using (var facilityBal = new FacilityBal())
     {
         //Call the AddFacility Method to Add / Update current facility
         var currentFacility = facilityBal.GetFacilityById(facilityId);
         var jsonResult      = new
         {
             currentFacility.FacilityId,
             currentFacility.FacilityNumber,
             currentFacility.FacilityName,
             currentFacility.FacilityStreetAddress,
             currentFacility.FacilityStreetAddress2,
             currentFacility.FacilityCity,
             currentFacility.FacilityZipCode,
             currentFacility.FacilityLicenseNumber,
             FacilityLicenseNumberExpire = currentFacility.FacilityLicenseNumberExpire.GetShortDateString1(),
             currentFacility.FacilityTypeLicense,
             currentFacility.FacilityRelated,
             currentFacility.FacilityTotalStaffedBed,
             currentFacility.FacilityTotalLicenseBed,
             currentFacility.FacilityPOBox,
             currentFacility.CountryID,
             currentFacility.FacilityState,
             currentFacility.IsActive,
             currentFacility.CorporateID,
             currentFacility.FacilityTimeZone,
             currentFacility.RegionId,
             currentFacility.IsDeleted,
             currentFacility.SenderID,
         };
         return(Json(jsonResult, JsonRequestBehavior.AllowGet));
     }
 }
 public static void CreateDefaultFacilityItems(int fId, string fName, int userId)
 {
     using (var bal = new FacilityBal())
     {
         bal.CreateDefaultFacilityItems(fId, fName, userId);
     }
 }
        /// <summary>
        /// The get random facility id.
        /// </summary>
        /// <param name="cId">
        /// The c id.
        /// </param>
        /// <returns>
        /// The <see cref="int"/>.
        /// </returns>
        public int GetRandomFacilityId(int cId)
        {
            var facilitybal            = new FacilityBal();
            var randomselectedFacility = facilitybal.GetFacilitiesByCorpoarteId(cId).PickRandom();

            return(randomselectedFacility.FacilityId);
        }
Example #4
0
        /// <summary>
        /// Add New or Update the Parameters based on if we pass the Parameters ID in the ParametersViewModel object.
        /// </summary>
        /// <param name="parametersModel">pass the details of Parameters in the view model</param>
        /// <returns>
        /// returns the newly added or updated ID of Parameters row
        /// </returns>
        public ActionResult SaveParameters(Model.Parameters parametersModel)
        {
            //Initialize the newId variable
            var newId          = -1;
            var userId         = Helpers.GetLoggedInUserId();
            var corporateId    = Helpers.GetSysAdminCorporateID();
            var facilityId     = Helpers.GetDefaultFacilityId();
            var facilityBal    = new FacilityBal();
            var facilityNumber = facilityBal.GetFacilityNumberById(facilityId);

            //Check if ParametersViewModel
            if (parametersModel != null)
            {
                using (var parametersBal = new ParametersBal())
                {
                    if (parametersModel.ParametersID > 0)
                    {
                        parametersModel.ModifiedBy   = userId;
                        parametersModel.ModifiedDate = Helpers.GetInvariantCultureDateTime();
                    }
                    parametersModel.CorporateID    = corporateId;
                    parametersModel.FacilityID     = facilityId;
                    parametersModel.FacilityNumber = facilityNumber;
                    parametersModel.CreatedBy      = userId;
                    parametersModel.CreatedDate    = Helpers.GetInvariantCultureDateTime();
                    //Call the AddParameters Method to Add / Update current Parameters
                    newId = parametersBal.AddUptdateParameters(parametersModel);
                }
            }
            return(Json(newId));
        }
        /// <summary>
        /// Gets the facility list by corporate identifier.
        /// </summary>
        /// <param name="corpId">The corp identifier.</param>
        /// <returns></returns>
        public ActionResult GetFacilityListByCorporateId(string corpId)
        {
            using (var bal = new FacilityBal())
            {
                var facilities = bal.GetFacilitiesByCorporateId(Convert.ToInt32(corpId));
                if (facilities.Count > 0)
                {
                    var facilityId = Helpers.GetLoggedInUserIsAdmin() ? 0 : Helpers.GetDefaultFacilityId();
                    var list       = new List <SelectListItem>();

                    if (facilityId > 0 && Convert.ToInt32(corpId) > 0)
                    {
                        facilities = facilities.Where(f => f.FacilityId == facilityId).ToList();
                    }

                    list.AddRange(facilities.Select(item => new SelectListItem
                    {
                        Text  = item.FacilityName,
                        Value = item.FacilityId.ToString()
                    }));
                    return(Json(list));
                }
                return(Json(null));
            }
        }
 //function to Get Facilities by corporate without Countries .
 /// <summary>
 /// Gets the corporate facilities.
 /// </summary>
 /// <param name="Id">The identifier.</param>
 /// <returns></returns>
 public ActionResult GetCorporateFacilities(int Id)
 {
     using (var facilityBal = new FacilityBal())
     {
         var result = facilityBal.GetFacilitiesByCorporateIdWithoutCountries(Id).ToList().OrderBy(x => x.FacilityName).ToList();
         return(Json(result));
     }
 }
        /// <summary>
        /// Get the details of the current facility in the view model by ID
        /// </summary>
        /// <param name="facilityId"></param>
        /// <returns></returns>
        ///


        /// <summary>
        /// Delete the current facility based on the Facility ID passed in the SharedViewModel
        /// </summary>
        /// <param name="facilityId"></param>
        /// <returns></returns>
        public ActionResult DeleteFacility(int facilityId)
        {
            var list = new List <FacilityCustomModel>();

            var facilityBal = new FacilityBal();
            var cId         = Helpers.GetDefaultCorporateId();

            facilityBal.DeleteFacilityData(Convert.ToString(facilityId));
            list = facilityBal.GetFacilityList(cId);

            return(PartialView(PartialViews.FacilityList, list));
        }
Example #8
0
        //Function To reset the User Form
        /// <summary>
        /// Resets the type of the global code category form order.
        /// </summary>
        /// <returns></returns>
        public ActionResult ResetGlobalCodeCategoryFormOrderType()
        {
            //Initialize the GlobalCode Bal
            var facilityBal = new FacilityBal();
            var cId         = Helpers.GetDefaultCorporateId();
            var objGlobalCodeCategoryMasterView = new GlobalCodeCategoryMasterView
            {
                GCC = new GlobalCodeCategory(),
                //LstFacility = facilityBal.GetFacilities(cId)
            };

            return(PartialView(PartialViews.AddUpdateOrderCategoryType, objGlobalCodeCategoryMasterView));
        }
 /// <summary>
 /// Bind all the Facility list
 /// </summary>
 /// <returns>
 /// action result with the partial view containing the facility list object
 /// </returns>
 public ActionResult BindFaciltyList()
 {
     //Initialize the Facility Communicator object
     using (var facilityBal = new FacilityBal())
     {
         //Get the facilities list
         var cId = Helpers.GetDefaultCorporateId();
         //var facilityList = facilityBal.GetFacilities(cId);
         var facilityList = facilityBal.GetFacilityList(cId);
         //Pass the ActionResult with List of FacilityViewModel object to Partial View FacilityList
         return(PartialView(PartialViews.FacilityList, facilityList));
     }
 }
Example #10
0
        //Function to get  GlobalCode for editing
        /// <summary>
        /// Edits the global category code.
        /// </summary>
        /// <param name="GlobalCodeCategoryId">The global code category identifier.</param>
        /// <returns></returns>
        public ActionResult EditGlobalCategoryCode(int GlobalCodeCategoryId)
        {
            //Initialize the GlobalCode Bal
            var globalCodeCategoryMasterBal = new GlobalCodeCategoryMasterBal();
            // var currentGCCMaster = globalCodeCategoryMasterBal.GetGlobalCategoriesByGlobalCodeCategoryId(GlobalCodeCategoryId);
            var facilityBal = new FacilityBal();
            var cId         = Helpers.GetDefaultCorporateId();
            var viewData    = new GlobalCodeCategoryMasterView
            {
                GCC = globalCodeCategoryMasterBal.GetGlobalCategoriesByGlobalCodeCategoryId(GlobalCodeCategoryId),
                //LstFacility = facilityBal.GetFacilities(cId)
            };

            return(PartialView(PartialViews.AddUpdateGlobalCodeCategoryMaster, viewData));
        }
        /// <summary>
        /// Add New or Update the facility based on if we pass the Facility ID in the FacilityViewModel object.
        /// </summary>
        /// <param name="model">pass the details of facility in the view model</param>
        /// <returns>
        /// returns the newly added or updated ID of facility row
        /// </returns>
        public ActionResult SaveFacility(Facility model)
        {
            var          list  = new List <FacilityCustomModel>();
            var          input = model.FacilityTimeZone;
            TimeZoneInfo cst   = TimeZoneInfo.FindSystemTimeZoneById(input);

            var    test = cst.DisplayName;
            string sub  = test.Substring(4, 6);

            model.TimeZ = sub;
            //Check if FacilityViewModel
            if (model != null)
            {
                var fId = model.FacilityId;

                using (var bal = new FacilityBal())
                {
                    var status = bal.CheckDuplicateFacilityNoAndLicenseNo(model.FacilityNumber, model.FacilityLicenseNumber,
                                                                          model.FacilityId, model.CorporateID.Value);

                    if (status > 0)
                    {
                        return(Json(status, JsonRequestBehavior.AllowGet));
                    }

                    if (model.FacilityId > 0)
                    {
                        model.ModifiedBy   = Helpers.GetLoggedInUserId();
                        model.ModifiedDate = Helpers.GetInvariantCultureDateTime();
                    }
                    else
                    {
                        model.CreatedBy   = Helpers.GetLoggedInUserId();
                        model.CreatedDate = Helpers.GetInvariantCultureDateTime();
                    }


                    //Call the AddFacility Method to Add / Update current facility
                    list = bal.AddUpdateFacility(model, out fId);

                    if (fId > 0)
                    {
                        BackgroundJob.Enqueue(() => CreateDefaultFacilityItems(fId, model.FacilityName, Helpers.GetLoggedInUserId()));
                    }
                }
            }
            return(PartialView(PartialViews.FacilityList, list));
        }
        /// <summary>
        /// Get List Of Facilities and convert to json string.
        /// </summary>
        /// <returns>
        /// json result with faclitiy lists.
        /// </returns>
        public JsonResult GetFListJson()
        {
            var facilityBal = new FacilityBal();
            //Get the facilities list
            var cId = Helpers.GetDefaultCorporateId();
            //var facilityList = facilityBal.GetFacilities(cId);
            var facilityList = facilityBal.GetFacilityList(cId);
            var jsonResult   = new
            {
                aaData = facilityList.Select(f => new[] {
                    f.FacilityName, f.CorporateName, f.FacilityNumber, f.FacilityStreetAddress,
                    Convert.ToString(f.FacilityZipCode.GetValueOrDefault()), f.FacilityLicenseNumber,
                    Convert.ToString(f.FacilityLicenseNumberExpire.GetValueOrDefault()),
                    f.FacilityId.ToString()
                })
            };

            return(Json(jsonResult, JsonRequestBehavior.AllowGet));
        }
        public JsonResult GetCorporateData(int cId)
        {
            List <DropdownListData> fList;
            var fId = Helpers.GetDefaultFacilityId();

            if (Helpers.GetLoggedInUserIsAdmin())
            {
                fId = 0;
            }

            using (var bal = new FacilityBal())
                fList = bal.GetFacilityDropdownData(cId, fId);

            var jsonData = new
            {
                fList,
                tList = GetTargetsListInString(cId, fId)
            };

            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// Gets the user roles.
        /// </summary>
        /// <param name="userid">The userid.</param>
        /// <returns></returns>
        private List <RoleSelectionCustomModel> GetUserRoles(int userid)
        {
            var userroleList = new List <RoleSelectionCustomModel>();
            var userroleBal  = new UserRoleBal();
            var roleBal      = new RoleBal();
            var facilityRole = new FacilityRoleBal();
            var facility     = new FacilityBal();
            var roles        = userroleBal.GetUserRolesByUserId(userid);

            foreach (var role in roles)
            {
                var roleFacilityIds = facilityRole.GetFacilityRolesByRoleId(role.RoleID);
                userroleList.AddRange(roleFacilityIds.Select(rolefacility => new RoleSelectionCustomModel
                {
                    RoleId       = role.RoleID,
                    RoleName     = roleBal.GetRoleNameById(role.RoleID),
                    FacilityName = facility.GetFacilityNameById(rolefacility.FacilityId),
                    FacilityId   = rolefacility.FacilityId,
                    CorporateId  = rolefacility.CorporateId
                }));
            }
            return(userroleList);
        }
        /// <summary>
        /// Get the details of the Facility View in the Model Facility such as FacilityList, list of countries etc.
        /// </summary>
        /// <returns>
        /// returns the actionresult in the form of current object of the Model Facility to be passed to View Facility
        /// </returns>
        public ActionResult Index()
        {
            //Initialize the Facility Communicator object
            var facilityBal = new FacilityBal();

            //Get the facilities list
            var cId = Helpers.GetDefaultCorporateId();
            //var facilityList = facilityBal.GetFacilities(cId);
            var facilityList = facilityBal.GetFacilityList(cId);

            //Intialize the View Model i.e. FacilityView which is binded to Main View Index.cshtml under Facility
            var facilityView = new FacilityView
            {
                FacilityList    = facilityList,
                CurrentFacility = new Facility()
                {
                    CorporateID = Helpers.GetSysAdminCorporateID()
                }
            };

            //Pass the View Model in ActionResult to View Facility
            return(View(facilityView));
        }
        /// <summary>
        /// Indexes this instance.
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            // var globalCodeCommunicator = new GlobalCodeCommunicator();
            var             objGlobalCodeCategoryBal = new GlobalCodeCategoryBal();
            var             globalCodeCategories     = objGlobalCodeCategoryBal.GetGlobalCodeCategoriesWithFacilityName();
            List <Facility> facilities;

            using (var facilityBal = new FacilityBal())
            {
                var cId = Helpers.GetDefaultCorporateId();
                facilities = facilityBal.GetFacilities(cId);
            }
            var gModel = new GlobalCodeCategoryView
            {
                GlobalCodeCategoryList                  = globalCodeCategories,
                FacilityList                            = facilities,
                SelectedGlobalCodeCategoryOptions       = new List <GlobalCodeCategory>(),
                FacilityNumber                          = "0",
                SelectedSourceGlobalCodeCategoryOptions = new List <GlobalCodeCategory>()
            };

            return(View(gModel));
        }
        //public PartialViewResult GetAllTargetsData(int corporateId, int facilityId)
        //{
        //    using (var bal = new DashboardTargetsBal())
        //    {
        //        //Get the Entity list
        //        var list = bal.GetDashboardTargetsList(corporateId, facilityId);
        //        return PartialView(PartialViews.DashboardTargetsList, list);
        //    }
        //}

        public JsonResult BindAllTargetsData()
        {
            var cArray = new List <string> {
                "1012", "1013"
            };
            var gcList = GetGlobaCodesByCategories(cArray);
            var cList  = GetCorporateList();
            List <DropdownListData> fList;
            List <DropdownListData> rList;

            var cId = Helpers.GetSysAdminCorporateID();

            var fId = Helpers.GetDefaultFacilityId();

            if (Helpers.GetLoggedInUserIsAdmin())
            {
                fId = 0;
            }
            using (var bal = new FacilityBal())
                fList = bal.GetFacilityDropdownData(cId, fId);

            using (var bal = new RoleBal())
                rList = bal.GetRolesByFacility(Helpers.GetDefaultFacilityId());

            var jsonData = new
            {
                uomList = gcList.Where(g => g.ExternalValue1.Equals("1012")).ToList(),
                tList   = gcList.Where(g => g.ExternalValue1.Equals("1013")).ToList(),
                cList,
                fList,
                rList,
                fId = Convert.ToString(Helpers.GetDefaultFacilityId()),
                cId = Convert.ToString(Helpers.GetSysAdminCorporateID())
            };

            return(Json(jsonData, JsonRequestBehavior.AllowGet));
        }
Example #18
0
        public ActionResult GetFacilitiesDropdownDataWithFacilityNumber()
        {
            var cId            = Helpers.GetDefaultCorporateId();
            var facilityNumber = Helpers.GetDefaultFacilityNumber();

            using (var facBal = new FacilityBal())
            {
                var facilities = facBal.GetFacilities(cId);
                if (facilities.Count > 0)
                {
                    var list   = new List <SelectListItem>();
                    var roleId = Helpers.GetDefaultRoleId();
                    if (Convert.ToInt32(roleId) != 40)
                    {
                        var item = facilities.FirstOrDefault(f => f.FacilityNumber.Equals(facilityNumber));
                        if (item != null)
                        {
                            list.Add(new SelectListItem
                            {
                                Text  = item.FacilityName,
                                Value = item.FacilityNumber,
                            });
                        }
                    }
                    else
                    {
                        list.AddRange(facilities.Select(item => new SelectListItem
                        {
                            Text  = item.FacilityName,
                            Value = item.FacilityNumber,
                        }));
                    }
                    return(Json(list, JsonRequestBehavior.AllowGet));
                }
            }
            return(Json(null));
        }
        /// <summary>
        /// Sets the user role.
        /// </summary>
        /// <param name="roleId">The role identifier.</param>
        /// <param name="facilityId">The facility identifier.</param>
        /// <param name="corporateId">The corporate identifier.</param>
        /// <returns></returns>
        public ActionResult SetUserRole(int roleId, int facilityId, int corporateId)
        {
            SessionClass objSession = null;

            if (Session[SessionNames.SessionClass.ToString()] != null)
            {
                objSession             = Session[SessionNames.SessionClass.ToString()] as SessionClass;
                objSession.FacilityId  = facilityId;
                objSession.RoleId      = roleId;
                objSession.CorporateId = corporateId;
                //using (var mBal = new ModuleAccessBal())
                //{
                //    var mList = mBal.GetModulesAccessList(corporateId, facilityId);
                //    Session[SessionNames.SessoionModuleAccess.ToString()] = mList;
                //}

                // Changed by Shashank ON : 5th May 2015 : To add the Module access level Security when user log in via Facility and Corporate
                using (var userbal = new UsersBal())
                    objSession.MenuSessionList = userbal.GetTabsByUserIdRoleId(objSession.UserId, objSession.RoleId, objSession.FacilityId, objSession.CorporateId, isDeleted: false, isActive: true);

                using (var rtBal = new RoleTabsBal())
                {
                    objSession.IsPatientSearchAccessible = rtBal.CheckIfTabNameAccessibleToGivenRole("Patient Lookup",
                                                                                                     ControllerAccess.PatientSearch.ToString(), ActionNameAccess.PatientSearch.ToString(),
                                                                                                     Convert.ToInt32(roleId));
                    objSession.IsAuthorizationAccessible =
                        rtBal.CheckIfTabNameAccessibleToGivenRole("Obtain Insurance Authorization",
                                                                  ControllerAccess.Authorization.ToString(),
                                                                  ActionNameAccess.AuthorizationMain.ToString(), Convert.ToInt32(roleId));
                    objSession.IsActiveEncountersAccessible =
                        rtBal.CheckIfTabNameAccessibleToGivenRole("Active Encounters",
                                                                  ControllerAccess.ActiveEncounter.ToString(),
                                                                  ActionNameAccess.ActiveEncounter.ToString(),
                                                                  Convert.ToInt32(roleId));
                    objSession.IsBillHeaderViewAccessible =
                        rtBal.CheckIfTabNameAccessibleToGivenRole("Generate Preliminary Bill",
                                                                  ControllerAccess.BillHeader.ToString(),
                                                                  ActionNameAccess.Index.ToString(), Convert.ToInt32(roleId));
                    objSession.IsEhrAccessible =
                        rtBal.CheckIfTabNameAccessibleToGivenRole("EHR",
                                                                  ControllerAccess.Summary.ToString(),
                                                                  ActionNameAccess.PatientSummary.ToString(), Convert.ToInt32(roleId));

                    objSession.SchedularAccessible =
                        rtBal.CheckIfTabNameAccessibleToGivenRole("Scheduling", string.Empty, string.Empty,
                                                                  Convert.ToInt32(roleId));
                }
            }
            else
            {
                objSession = new SessionClass
                {
                    FacilityId  = facilityId,
                    RoleId      = roleId,
                    CorporateId = corporateId
                };
            }

            var userBal     = new UsersBal();
            var userDetails = userBal.GetUserDetails(roleId, facilityId, objSession.UserId);

            objSession.RoleName        = userDetails.RoleName;
            objSession.FacilityName    = userDetails.DefaultFacility;
            objSession.UserName        = userDetails.UserName;
            objSession.FacilityNumber  = userDetails.FacilityNumber;
            objSession.UserIsAdmin     = userDetails.UserIsAdmin;
            objSession.SelectedCulture = CultureInfo.CurrentCulture.Name;
            objSession.RoleKey         = userDetails.RoleKey;

            if (objSession.MenuSessionList != null || !objSession.MenuSessionList.Any())
            {
                // Changed by Shashank ON : 5th May 2015 : To add the Module access level Security when user log in via Facility and Corporate
                using (var userbal = new UsersBal())
                    objSession.MenuSessionList = userbal.GetTabsByUserIdRoleId(objSession.UserId, objSession.RoleId, objSession.FacilityId, objSession.CorporateId, isDeleted: false, isActive: true);
            }
            using (var facilitybal = new FacilityBal())
            {
                var facilityObj   = facilitybal.GetFacilityByFacilityId(facilityId);
                var timezoneValue = facilityObj.FacilityTimeZone;
                if (!string.IsNullOrEmpty(timezoneValue))
                {
                    var timezoneobj = TimeZoneInfo.FindSystemTimeZoneById(timezoneValue);
                    objSession.TimeZone = timezoneobj.BaseUtcOffset.TotalHours.ToString();
                }
                else
                {
                    objSession.TimeZone = "0.0";
                }
            }


            /*
             * By: Amit Jain
             * On: 24082015
             * Purpose: Setting up the table numbers for the Billing Codes
             */
            //----Billing Codes' Table Number additions start here---------------
            if (objSession.CorporateId > 0 && !string.IsNullOrEmpty(objSession.FacilityNumber))
            {
                using (var bBal = new SuppliesDotComParametersBal())
                {
                    var currentParameter = bBal.GetDetailsByCorporateAndFacility(
                        objSession.CorporateId, objSession.FacilityNumber);
                    var cDetails = new Corporate();
                    using (var cBal = new CorporateBal())
                        cDetails = cBal.GetCorporateById(objSession.CorporateId);

                    if (objSession.UserId != 1)
                    {
                        objSession.CptTableNumber =
                            currentParameter != null && !string.IsNullOrEmpty(currentParameter.CPTTableNumber)
                                ? currentParameter.CPTTableNumber
                                : cDetails.DefaultCPTTableNumber;

                        objSession.ServiceCodeTableNumber =
                            currentParameter != null && !string.IsNullOrEmpty(currentParameter.ServiceCodeTableNumber)
                                ? currentParameter.ServiceCodeTableNumber
                                : cDetails.DefaultServiceCodeTableNumber;

                        objSession.DrugTableNumber =
                            currentParameter != null && !string.IsNullOrEmpty(currentParameter.DrugTableNumber)
                                ? currentParameter.DrugTableNumber
                                : cDetails.DefaultDRUGTableNumber;

                        objSession.DrgTableNumber =
                            currentParameter != null && !string.IsNullOrEmpty(currentParameter.DRGTableNumber)
                                ? currentParameter.DRGTableNumber
                                : cDetails.DefaultDRGTableNumber;

                        objSession.HcPcsTableNumber =
                            currentParameter != null && !string.IsNullOrEmpty(currentParameter.HCPCSTableNumber)
                                ? currentParameter.HCPCSTableNumber
                                : cDetails.DefaultHCPCSTableNumber;

                        objSession.DiagnosisCodeTableNumber =
                            currentParameter != null && !string.IsNullOrEmpty(currentParameter.DiagnosisTableNumber)
                                ? currentParameter.DiagnosisTableNumber
                                : cDetails.DefaultDiagnosisTableNumber;

                        objSession.BillEditRuleTableNumber =
                            currentParameter != null && !string.IsNullOrEmpty(currentParameter.BillEditRuleTableNumber)
                                                    ? currentParameter.BillEditRuleTableNumber
                                                    : cDetails.BillEditRuleTableNumber;

                        objSession.DefaultCountryId = currentParameter.DefaultCountry > 0
                            ? currentParameter.DefaultCountry : 45;
                    }
                    else
                    {
                        objSession.CptTableNumber           = "0";
                        objSession.ServiceCodeTableNumber   = "0";
                        objSession.DrugTableNumber          = "0";
                        objSession.DrgTableNumber           = "0";
                        objSession.HcPcsTableNumber         = "0";
                        objSession.DiagnosisCodeTableNumber = "0";
                        objSession.BillEditRuleTableNumber  = "0";
                    }
                }
            }
            //----Billing Codes' Table Number additions end here---------------

            Session[SessionNames.SessionClass.ToString()] = objSession;
            return(Json(0));
            //return RedirectToAction("PatientSearch", "PatientSearch");
        }
Example #20
0
 protected List <DropdownListData> GetDefaultFacilityList(int corporateId)
 {
     using (var bal = new FacilityBal())
         return(bal.GetFacilityDropdownData(corporateId, 0));
 }
        public void CreateCorporate()
        {
            using (var corporateBal = new CorporateBal())
            {
                this.model.CorporateName           = this.GetRandomString(10);
                this.model.CorporateNumber         = this.GetRandomStringNumber(4);
                this.model.CountryID               = "45";
                this.model.StateID                 = "3";
                this.model.CityID                  = "3";
                this.model.CreatedBy               = 9999;
                this.model.CreatedDate             = DateTime.Now;
                this.model.DefaultCPTTableNumber   = "4010";
                this.model.BillEditRuleTableNumber = "100";

                corporateBal.AddUptdateCorporate(this.model); // ... Create new corporate
                int corporateId = this.model.CorporateID;

                IEnumerable <Facility> facilitylistObj = new FacilityBal().GetFacilitiesByCorpoarteId(corporateId);

                // .... Get the facilities for the newly created Corporate
                Assert.IsNotNull(facilitylistObj);    // .... check if the cororate facility created on not
                Assert.IsTrue(facilitylistObj.Any()); // .... check if there is any oject in the list
                if (facilitylistObj.Any())
                {
                    Facility facilityobj = facilitylistObj.FirstOrDefault();

                    // .... Assertion below
                    Assert.AreEqual(facilityobj.CorporateID, this.model.CorporateID);
                    Assert.IsTrue(facilityobj.FacilityName.Contains(this.model.CorporateName.Substring(0, 3)));

                    SuppliesDotComParametersBal balBSP = new SuppliesDotComParametersBal();
                    var facilityparmaters = balBSP.GetDetailsByCorporateAndFacility(
                        corporateId,
                        facilityobj.FacilityNumber);
                    Assert.IsTrue(facilityparmaters != null);
                    Assert.IsTrue(facilityparmaters.CPTTableNumber == this.model.DefaultCPTTableNumber);
                    Assert.IsTrue(facilityparmaters.BillEditRuleTableNumber == this.model.BillEditRuleTableNumber);

                    // ... Facilitystructure Checks
                    List <FacilityStructureCustomModel> facilityStructureList =
                        new FacilityStructureBal().GetFacilityStructure(facilityobj.FacilityId.ToString());
                    Assert.IsTrue(facilityStructureList.Any());

                    // ... UBed Master Checks
                    IEnumerable <BedMasterCustomModel> ubedMasterobjList =
                        new BedMasterBal().GetBedMasterListByRole(facilityobj.FacilityId, this.model.CorporateID);
                    Assert.IsTrue(ubedMasterobjList.Any());

                    // ... Role Creation Checks
                    List <Role> rolesList = new RoleBal().GetRolesByCorporateIdFacilityId(
                        this.model.CorporateID,
                        facilityobj.FacilityId);
                    Assert.IsTrue(rolesList.Any());

                    // ... Facility Roles Creation Checks
                    List <FacilityRoleCustomModel> facilityRoleList =
                        new FacilityRoleBal().GetFacilityRoleListByFacility(
                            this.model.CorporateID,
                            facilityobj.FacilityId,
                            0);
                    Assert.IsTrue(facilityRoleList.Any());

                    // ... users Creation Checks
                    List <UsersCustomModel> usersList =
                        new UsersBal().GetUsersByCorporateIdFacilityId(this.model.CorporateID, facilityobj.FacilityId);
                    Assert.IsTrue(usersList.Any());

                    // ... UserRole Creation Checks
                    // var userRoleList = new UserRoleBal().GetUserRolesByCorporateFacilityAndUserId(
                    // model.CorporateID,
                    // facilityobj.FacilityId);
                    // Assert.IsTrue(usersList.Any());

                    // ... ModuleAccess Creation Checks
                    List <ModuleAccess> moduleAccessList =
                        new ModuleAccessBal().GetModulesAccessList(this.model.CorporateID, facilityobj.FacilityId);
                    Assert.IsTrue(moduleAccessList.Any());

                    // ... DashboardIndicator Creation Checks
                    // var dashBoardIndicatorsList = new DashboardIndicatorDataBal().GetDashboardIndicatorDataList(
                    // model.CorporateID,
                    // facilityobj.FacilityId);
                    // Assert.IsTrue(dashBoardIndicatorsList.Any());
                }

                corporateBal.DeleteCorporateData(this.model.CorporateID.ToString()); // ...clean Data after Test
                Corporate corporateAftertest = corporateBal.GetCorporateById(this.model.CorporateID);
                Assert.IsNull(corporateAftertest);
            }
        }