public IQueryable <T> CheckExistingPatient <T>(string email, string mrn, int patientId, TokenModel token) where T : class, new()
 {
     SqlParameter[] parameters = { new SqlParameter("@Email",          email),
                                   new SqlParameter("@MRN",            mrn),
                                   new SqlParameter("@PatientId",      patientId),
                                   new SqlParameter("@OrganizationId", token.OrganizationID) };
     return(context.ExecStoredProcedureListWithOutput <T>(SQLObjects.PAT_CheckExistingPatient, parameters.Length, parameters).AsQueryable()); //throw new NotImplementedException();
 }
 public IQueryable <T> DeleteAppointment <T>(int appointmentId, bool isAdmin, bool deleteSeries, TokenModel token) where T : class, new()
 {
     SqlParameter[] parameters = { new SqlParameter("@AppointmentId", appointmentId),
                                   new SqlParameter("@IsAdmin",       isAdmin),
                                   new SqlParameter("@DeleteSeries",  deleteSeries),
                                   new SqlParameter("@UserId",        token.UserID) };
     return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.APT_DeleteAppointment.ToString(), parameters.Length, parameters).AsQueryable());
 }
 public IQueryable <T> SaveEligibilityEnquiryRequestData <T>(int patientId, int patientInsuranceId, string serviceTypeCodeIds, string serviceCodeIds, TokenModel token) where T : class, new()
 {
     SqlParameter[] parameters =
     {
         new SqlParameter("@PatientId",          patientId),
         new SqlParameter("@PatientInsuranceId", patientInsuranceId),
         new SqlParameter("@ServiceTypeCodeIds", serviceTypeCodeIds),
         new SqlParameter("@ServiceCodeIds",     serviceCodeIds),
         new SqlParameter("@UserId",             token.UserID),
         new SqlParameter("@OrganizationId",     token.OrganizationID)
     };
     return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.PAT_SaveEligibilityEnquiryRequestData, parameters.Length, parameters).AsQueryable());
 }
 public IQueryable <T> GetAuditLogList <T>(string createdBy, string patientName, string action, string fromDate, string toDate, int organizationID, int locationID, int pageNumber, int pageSize, string sortColumn, string sortOrder) where T : class, new()
 {
     SqlParameter[] parameters = { new SqlParameter("@CreatedBy",      createdBy),
                                   new SqlParameter("@PatientName",    patientName),
                                   new SqlParameter("@Action",         action),
                                   new SqlParameter("@FromDate",       fromDate),
                                   new SqlParameter("@ToDate",         toDate),
                                   new SqlParameter("@OrganizationId", organizationID),
                                   new SqlParameter("@LocationId",     locationID),
                                   new SqlParameter("@PageNumber",     pageNumber),
                                   new SqlParameter("@PageSize",       pageSize),
                                   new SqlParameter("@SortColumn",     sortColumn),
                                   new SqlParameter("@SortOrder",      sortOrder) };
     return(_context.ExecStoredProcedureListWithOutput <T>("ADT_GetAuditLogs", parameters.Length, parameters).AsQueryable());
 }
 public IQueryable <T> GetStaffLeaveList <T>(TokenModel token) where T : class, new()
 {
     SqlParameter[] parameters =
     {
         new SqlParameter("@OrganizationID", token.OrganizationID),
     };
     return(context.ExecStoredProcedureListWithOutput <T>(SQLObjects.STF_GetStaffLeaveList.ToString(), parameters.Length, parameters).AsQueryable());
 }
Exemplo n.º 6
0
 public IQueryable <T> GetMasterInsuranceList <T>(string name, int pageNumber, int pageSize, int organizationId) where T : class, new()
 {
     SqlParameter[] parameters = { new SqlParameter("@InsuranceName",  name),
                                   new SqlParameter("@PageNumber",     pageNumber),
                                   new SqlParameter("@PageSize",       pageSize),
                                   new SqlParameter("@OrganizationId", organizationId) };
     return(_context.ExecStoredProcedureListWithOutput <T>("GetMasterInsuranceList", parameters.Length, parameters).AsQueryable());
 }
 public IQueryable <T> GetVitals <T>(PatientFilterModel patientFilterModel, TokenModel tokenModel) where T : class, new()
 {
     SqlParameter[] parameters = { new SqlParameter("@PatientId",  patientFilterModel.PatientId),
                                   new SqlParameter("@PageNumber", patientFilterModel.pageNumber),
                                   new SqlParameter("@PageSize",   patientFilterModel.pageSize),
                                   new SqlParameter("@SortColumn", patientFilterModel.sortColumn),
                                   new SqlParameter("@SortOrder ", patientFilterModel.sortOrder) };
     return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.PAT_GetVitals.ToString(), parameters.Length, parameters).AsQueryable());
 }
Exemplo n.º 8
0
 public IQueryable <T> GetPatientEncounterTemplateData <T>(int patientEncounterId, int masterTemplateId, TokenModel tokenModel) where T : class, new()
 {
     SqlParameter[] sqlParameters =
     {
         new SqlParameter("@OrganizationID",     tokenModel.OrganizationID),
         new SqlParameter("@PatientEncounterId", patientEncounterId),
         new SqlParameter("@MasterTemplateId",   masterTemplateId),
     };
     return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.ENC_GetPatientEncounterTemplateData.ToString(), sqlParameters.Length, sqlParameters).AsQueryable());
 }
Exemplo n.º 9
0
 public IQueryable <T> GetMasterTagList <T>(SearchFilterModel searchFilterModel, TokenModel tokenModel) where T : class, new()
 {
     SqlParameter[] parameters = { new SqlParameter("@SearchText",     searchFilterModel.SearchText),
                                   new SqlParameter("@OrganizationId", tokenModel.OrganizationID),
                                   new SqlParameter("@PageNumber",     searchFilterModel.pageNumber),
                                   new SqlParameter("@PageSize",       searchFilterModel.pageSize),
                                   new SqlParameter("@SortColumn",     searchFilterModel.sortColumn),
                                   new SqlParameter("@SortOrder",      searchFilterModel.sortOrder) };
     return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.MTR_GetMasterTags, parameters.Length, parameters).AsQueryable());
 }
Exemplo n.º 10
0
 public IQueryable <T> GetChatHistory <T>(ChatParmModel chatParmModel, TokenModel tokenModel) where T : class, new()
 {
     SqlParameter[] parameters = { new SqlParameter("@FromUserID",     chatParmModel.FromUserId),
                                   new SqlParameter("@ToUserId",       chatParmModel.ToUserId),
                                   new SqlParameter("@OrganizationId", tokenModel.OrganizationID),
                                   new SqlParameter("@PageNumber",     chatParmModel.pageNumber),
                                   new SqlParameter("@PageSize",       chatParmModel.pageSize),
                                   new SqlParameter("@SortColumn",     chatParmModel.sortColumn),
                                   new SqlParameter("@SortOrder",      chatParmModel.sortOrder) };
     return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.CHT_GetChatHistory.ToString(), parameters.Length, parameters).AsQueryable());
 }
Exemplo n.º 11
0
 public IQueryable <T> SavePatientAddressAndPhoneNumbers <T>(int patientId, string patientAddresses, string phoneNumbers, TokenModel token) where T : class, new()
 {
     SqlParameter[] parameters =
     {
         new SqlParameter("@PatientId",        patientId),
         new SqlParameter("@PatientAddresses", patientAddresses),
         new SqlParameter("@PhoneNumbers",     phoneNumbers),
         new SqlParameter("@UserId",           token.UserID)
     };
     return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.PAT_SavePatientAddressAndPhoneNumber, parameters.Length, parameters).AsQueryable());
 }
 public IQueryable <T> GetAutoComplateSearchingValues <T>(string tableName, string columnName, string searchText, TokenModel token) where T : class, new()
 {
     SqlParameter[] parameters =
     {
         new SqlParameter("@TableName",      tableName),
         new SqlParameter("@ColumnName",     columnName),
         new SqlParameter("@SearchText",     searchText),
         new SqlParameter("@OrganizationID", token.OrganizationID),
     };
     return(_organizationContext.ExecStoredProcedureListWithOutput <T>(SQLObjects.MTR_AutoCompleteSearching, parameters.Length, parameters).AsQueryable());
 }
Exemplo n.º 13
0
 public IQueryable <T> GetInboxData <T>(bool forStaff, TokenModel token, string fromDate = "", string toDate = "", int pageNumber = 1, int pageSize = 10, string sortColumn = "", string sortOrder = "") where T : class, new()
 {
     SqlParameter[] parameters = { new SqlParameter("@Id",             token.UserID),
                                   new SqlParameter("@ForStaff",       forStaff),
                                   new SqlParameter("@FromDate",       fromDate),
                                   new SqlParameter("@ToDate",         toDate),
                                   new SqlParameter("@PageNumber",     pageNumber),
                                   new SqlParameter("@PageSize",       pageSize),
                                   new SqlParameter("@SortColumn",     sortColumn),
                                   new SqlParameter("@SortOrder",      sortOrder),
                                   new SqlParameter("@OrganizationId", token.OrganizationID) };
     return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.MSG_GetInboxData.ToString(), parameters.Length, parameters).AsQueryable());
 }
Exemplo n.º 14
0
        public IQueryable <T> GetAllCheckListCategories <T>(CheckListFilterModel searchFilterModel, TokenModel token) where T : class, new()
        {
            SqlParameter[] parameters = { new SqlParameter("@SearchText",     searchFilterModel.SearchText),
                                          new SqlParameter("@OrganizationId", token.OrganizationID),
                                          new SqlParameter("@PageNumber",     searchFilterModel.pageNumber),
                                          new SqlParameter("@PageSize",       searchFilterModel.pageSize),
                                          new SqlParameter("@SortColumn",     searchFilterModel.sortColumn),
                                          new SqlParameter("@SortOrder",      searchFilterModel.sortOrder),
                                          new SqlParameter("@CategoryName",   searchFilterModel.CategoryName) };

            return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.CHK_CheckListCategoryList, parameters.Length, parameters).AsQueryable());
        }
Exemplo n.º 15
0
 public IQueryable <T> GetImmunization <T>(int patientId, TokenModel tokenModel) where T : class, new()
 {
     try
     {
         SqlParameter[] parameters = { new SqlParameter("@PatientId", patientId) };
         return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.PAT_GetImmunization.ToString(), parameters.Length, parameters).AsQueryable());
     }
     catch (Exception)
     {
         throw;
     }
 }
 public IQueryable <T> SaveEDI999Acknowledgement <T>(EDI999FileModel edi999FileModel, TokenModel token) where T : class, new()
 {
     SqlParameter[] parameters =
     {
         new SqlParameter("@AcknowledgementType", edi999FileModel.AcknowledgementType),
         new SqlParameter("@ControlNumber",       edi999FileModel.ControlNumber),
         new SqlParameter("@Status",              edi999FileModel.Status),
         new SqlParameter("@EDIFileText",         edi999FileModel.EDIFileText),
         new SqlParameter("@UserId",              token.UserID),
         new SqlParameter("@OrganizationId",      token.OrganizationID),
     };
     return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.EDI_SaveEDI999ResponseDetails, parameters.Length, parameters).AsQueryable());
 }
Exemplo n.º 17
0
 public IQueryable <T> GetMasterServiceCodes <T>(string searchText, TokenModel token, int pageNumber = 1, int pageSize = 10, string sortColumn = "", string sortOrder = "") where T : class, new()
 {
     SqlParameter[] parameters =
     {
         new SqlParameter("@OrganizationID", token.OrganizationID),
         new SqlParameter("@PageNumber",     pageNumber),
         new SqlParameter("@PageSize",       pageSize),
         new SqlParameter("@SortColumn",     sortColumn),
         new SqlParameter("@SortOrder ",     sortOrder),
         new SqlParameter("@SearchText",     searchText)
     };
     return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.MTR_GetMasterServiceCodes.ToString(), parameters.Length, parameters).AsQueryable());
 }
Exemplo n.º 18
0
 public List <RoundingRuleModelList> GetRoundingRules(string RuleName, int OrganizationID, int PageNumber, int PageSize, string SortColumn, string SortOrder)
 {
     return(_context.ExecStoredProcedureListWithOutput <RoundingRuleModelList>("GetRoundingRules",
                                                                               typeof(RoundingRuleModelList).GetProperties().Count(),
                                                                               new SqlParameter()
     {
         ParameterName = "@RuleName",
         SqlDbType = SqlDbType.VarChar,
         Direction = ParameterDirection.Input,
         Value = RuleName,
     },
                                                                               new SqlParameter()
     {
         ParameterName = "@OrganizationID",
         SqlDbType = SqlDbType.Int,
         Direction = ParameterDirection.Input,
         Value = OrganizationID,
     },
                                                                               new SqlParameter()
     {
         ParameterName = "@PageNumber",
         SqlDbType = SqlDbType.Int,
         Direction = ParameterDirection.Input,
         Value = PageNumber,
     },
                                                                               new SqlParameter()
     {
         ParameterName = "@PageSize",
         SqlDbType = SqlDbType.Int,
         Direction = ParameterDirection.Input,
         Value = PageSize,
     },
                                                                               new SqlParameter()
     {
         ParameterName = "@SortColumn",
         SqlDbType = SqlDbType.VarChar,
         Direction = ParameterDirection.Input,
         Value = SortColumn,
     },
                                                                               new SqlParameter()
     {
         ParameterName = "@SortOrder",
         SqlDbType = SqlDbType.VarChar,
         Direction = ParameterDirection.Input,
         Value = SortOrder,
     }).ToList());
 }
Exemplo n.º 19
0
 public IQueryable <T> GetPatientGuardian <T>(PatientGuartdianFilterModel patientGuartdianFilterModel, TokenModel tokenModel) where T : class, new()
 {
     try
     {
         SqlParameter[] parameters = { new SqlParameter("@PatientId",      patientGuartdianFilterModel.PatientId),
                                       new SqlParameter("@SearchKey",      patientGuartdianFilterModel.SearchKey),
                                       new SqlParameter("@OrganizationID", tokenModel.OrganizationID),
                                       new SqlParameter("@SortColumn",     patientGuartdianFilterModel.sortColumn),
                                       new SqlParameter("@SortOrder",      patientGuartdianFilterModel.sortOrder),
                                       new SqlParameter("@PageNumber",     patientGuartdianFilterModel.pageNumber),
                                       new SqlParameter("@PageSize",       patientGuartdianFilterModel.pageSize) };
         return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.PAT_GetPatientGuardian.ToString(), parameters.Length, parameters).AsQueryable());
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 20
0
 public IQueryable <T> GetAllCheckList <T>(CheckListFilterModel searchFilterModel, TokenModel tokenModel) where T : class, new()
 {
     try
     {
         SqlParameter[] parameters = { new SqlParameter("@SearchText",     searchFilterModel.SearchText),
                                       new SqlParameter("@Type",           searchFilterModel.Type),
                                       new SqlParameter("@OrganizationId", tokenModel.OrganizationID),
                                       new SqlParameter("@PageNumber",     searchFilterModel.pageNumber),
                                       new SqlParameter("@PageSize",       searchFilterModel.pageSize),
                                       new SqlParameter("@SortColumn",     searchFilterModel.sortColumn),
                                       new SqlParameter("@SortOrder",      searchFilterModel.sortOrder) };
         return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.CHK_GetAllCheckLists, parameters.Length, parameters).AsQueryable());
     }
     catch (Exception ex)
     {
         throw;
     }
 }
 public IQueryable <T> GetFilteredPatients <T>(string searchKey, string operation, string startWith, string tags, string locationIDs, string isActive, int pageSize, TokenModel tokenModel) where T : class, new()
 {
     try
     {
         SqlParameter[] parameters = { new SqlParameter("@SeachKey",       searchKey),
                                       new SqlParameter("@StartWith",      startWith),
                                       new SqlParameter("@Tags",           tags),
                                       new SqlParameter("@LocationIDs",    locationIDs),
                                       new SqlParameter("@IsActive",       isActive),
                                       new SqlParameter("@OrganizationID", tokenModel.OrganizationID),
                                       new SqlParameter("@SortColumn",     string.Empty),
                                       new SqlParameter("@SortOrder",      string.Empty),
                                       new SqlParameter("@PageNumber",                             1),
                                       new SqlParameter("@PageSize",       pageSize), };
         return(_context.ExecStoredProcedureListWithOutput <T>("GetFilteredPatients", parameters.Length, parameters).AsQueryable());
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 22
0
 public OrganizationDetailModel GetOrganizationDetailsById(TokenModel token)
 {
     SqlParameter[] parameters = { new SqlParameter("@OrganizatonID", token.OrganizationID), };
     return(_context.ExecStoredProcedureListWithOutput <OrganizationDetailModel>(SQLObjects.ORG_GetOrganizationData, parameters.Length, parameters).FirstOrDefault());
 }
 public IQueryable <T> GetTotalRevenue <T>(TokenModel token) where T : class, new()
 {
     SqlParameter[] parameters = { new SqlParameter("@OrganizationId", token.OrganizationID) };
     return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.ADM_GetTotalRevenue.ToString(), parameters.Length, parameters).AsQueryable());
 }
Exemplo n.º 24
0
 public IQueryable <T> CreateClaim <T>(int patientEncounterId, bool isAdmin, int userId, int organizationId) where T : class, new()
 {
     SqlParameter[] parameters = { new SqlParameter("@PatientEncounterId", patientEncounterId),
                                   new SqlParameter("@UserId",             userId),
                                   new SqlParameter("@OrganizationId",     organizationId),
                                   new SqlParameter("@CreatedDate",        DateTime.UtcNow),
                                   new SqlParameter("@IsAdmin",            isAdmin) };
     return(_context.ExecStoredProcedureListWithOutput <T>(SQLObjects.CLM_CreateClaim.ToString(), parameters.Length, parameters).AsQueryable());
 }
        public List <PatientAppointmentsModel> UpdatePatientAppointment(PatientAppointmentFilter patientAppointmentFilter)
        {
            try
            {
                string Staffs = "";
                if (patientAppointmentFilter.PatientAppointment != null && patientAppointmentFilter.PatientAppointment.Count != 0)
                {
                    if (patientAppointmentFilter.PatientAppointment.FirstOrDefault().StaffIDs != null &&
                        patientAppointmentFilter.PatientAppointment.FirstOrDefault().StaffIDs.Count() != 0)
                    {
                        patientAppointmentFilter.PatientAppointment.FirstOrDefault().StaffIDs.ToList().ForEach(l =>
                        {
                            Staffs = Staffs + "," + l;
                        });
                        Staffs = Staffs.Trim(',');
                        patientAppointmentFilter.PatientAppointment.FirstOrDefault().StaffIDs = null;
                    }

                    List <PatientAppointmentsModel> patientAppointmentsModel = new List <PatientAppointmentsModel>();

                    patientAppointmentsModel = patientAppointmentFilter.PatientAppointment.Select(j => new PatientAppointmentsModel
                    {
                        AppointmentTypeID       = j.AppointmentTypeID,
                        CreatedBy               = j.CreatedBy,
                        CreatedDate             = j.CreatedDate,
                        DeletedBy               = j.DeletedBy,
                        DeletedDate             = j.DeletedDate,
                        EndDateTime             = j.EndDateTime,
                        IsActive                = j.IsActive,
                        IsClientRequired        = j.IsClientRequired,
                        IsDeleted               = j.IsDeleted,
                        Notes                   = j.Notes,
                        ParentAppointmentID     = j.ParentAppointmentID,
                        PatientAppointmentId    = j.PatientAppointmentId,
                        PatientID               = j.PatientID,
                        PatientLocationID       = j.PatientLocationID,
                        RecurrenceRule          = j.RecurrenceRule,
                        ServiceAddressID        = j.ServiceAddressID,
                        ServiceID               = j.ServiceID,
                        ServiceLocationID       = j.ServiceLocationID,
                        StaffID                 = j.StaffID,
                        StartDateTime           = j.StartDateTime,
                        UpdatedBy               = j.UpdatedBy,
                        UpdatedDate             = j.UpdatedDate,
                        IsTelehealthAppointment = j.IsTelehealthAppointment
                    }).ToList();

                    return(_context.ExecStoredProcedureListWithOutput <PatientAppointmentsModel>("UpdatePatientAppointment",
                                                                                                 typeof(PatientAppointmentsModel).GetProperties().Count(),
                                                                                                 new SqlParameter()
                    {
                        ParameterName = "@PatientAppointmentList",
                        SqlDbType = SqlDbType.Structured,
                        Direction = ParameterDirection.Input,
                        Value = GetSqlDataTableFromList(patientAppointmentsModel)
                    },
                                                                                                 new SqlParameter()
                    {
                        ParameterName = "@IsUpdate",
                        SqlDbType = SqlDbType.Bit,
                        Direction = ParameterDirection.Input,
                        Value = patientAppointmentFilter.IsUpdate
                    },
                                                                                                 new SqlParameter()
                    {
                        ParameterName = "@IsDelete",
                        SqlDbType = SqlDbType.Bit,
                        Direction = ParameterDirection.Input,
                        Value = patientAppointmentFilter.IsDelete
                    },
                                                                                                 new SqlParameter()
                    {
                        ParameterName = "@IsInsert",
                        SqlDbType = SqlDbType.Bit,
                        Direction = ParameterDirection.Input,
                        Value = patientAppointmentFilter.IsInsert
                    },
                                                                                                 new SqlParameter()
                    {
                        ParameterName = "@Staffs",
                        SqlDbType = SqlDbType.NVarChar,
                        Direction = ParameterDirection.Input,
                        Value = Staffs
                    }).ToList());
                }
                else
                {
                    return(null);
                }
            }

            catch (Exception)
            {
                throw;
            }
        }
 public IQueryable <T> GetServiceCodeForEncounterByAppointmentType <T>(int appointmentId) where T : class, new()
 {
     SqlParameter[] parameters = { new SqlParameter("@AppointmentId", appointmentId) };
     return(_context.ExecStoredProcedureListWithOutput <T>("ENC_GetServiceCodeForEncounterByAppointmentType", parameters.Length, parameters).AsQueryable());
 }