Beispiel #1
0
        private BLModel.Paged.Physician getPhysicianRecords(Expression <Func <Physician, bool> > _where, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext   = new MMCDbContext();
            var          _physicanByName = (from phys in _MMCDbContext.physicians.Where(_where)
                                            join spty in _MMCDbContext.specialties
                                            on phys.PhysSpecialtyId equals spty.SpecialtyID
                                            join st in _MMCDbContext.states
                                            on phys.PhysStateId equals st.StateId
                                            select new
            {
                phys.PhysAddress1,
                phys.PhysAddress2,
                phys.PhysCity,
                phys.PhysEMail,
                phys.PhysFax,
                phys.PhysFirstName,
                phys.PhysicianId,
                phys.PhysLastName,
                phys.PhysNotes,
                phys.PhysNPI,
                phys.PhysPhone,
                phys.PhysQualification,
                phys.PhysSpecialtyId,
                phys.PhysZip,
                phys.PhysStateId,
                PhysSpecialtyName = spty.SpecialtyName,
                PhysStateName = st.StateName
            }).OrderByDescending(phys => phys.PhysicianId).ToList();

            return(new BLModel.Paged.Physician
            {
                PhysicianDetails = _physicanByName.Select(phys => new BLModel.Physician().InjectFrom(phys)).Cast <BLModel.Physician>().Skip(_skip).Take(_take).ToList(),
                TotalCount = _physicanByName.Count()
            });
        }
Beispiel #2
0
        public PatientDetailsByReferralID getPatientDetailsByReferralID(int _rfaReferralId)
        {
            int?         _patientClaimID = getReferralByID(_rfaReferralId).PatientClaimID;
            MMCDbContext _mMCDbContext   = new MMCDbContext();

            if (_patientClaimID != null)
            {
                var _PatientDetailsByReferralID = (from pat in _mMCDbContext.patients
                                                   join patclm in _mMCDbContext.patientClaims
                                                   on pat.PatientID equals patclm.PatientID
                                                   where patclm.PatientClaimID == _patientClaimID.Value
                                                   select new { PatientID = pat.PatientID, PatientName = (pat.PatFirstName + " " + pat.PatLastName), PatClaimNumber = patclm.PatClaimNumber, PatDOI = patclm.PatDOI, PatientClaimID = _patientClaimID.Value, RFAReferralID = _rfaReferralId }).AsEnumerable();
                return(_PatientDetailsByReferralID.Select(icr => new BLModel.PatientDetailsByReferralID().InjectFrom(icr)).Cast <BLModel.PatientDetailsByReferralID>().SingleOrDefault());
            }
            else
            {
                PatientDetailsByReferralID _patientDetailsByReferralID = new PatientDetailsByReferralID();
                _patientDetailsByReferralID.PatientID      = 0;
                _patientDetailsByReferralID.PatientClaimID = 0;
                _patientDetailsByReferralID.RFAReferralID  = _rfaReferralId;
                _patientDetailsByReferralID.PatClaimNumber = null;
                _patientDetailsByReferralID.PatientName    = null;
                _patientDetailsByReferralID.PatDOI         = null;
                return(_patientDetailsByReferralID);
            }
        }
Beispiel #3
0
        public int addClientStatement(ClientStatement _clientStatement)
        {
            MMCDbContext _MMCDbContext = new MMCDbContext();
            string       getIncrementStatementNumber = "";
            var          statementDetails            = getStatementNumberByClient(_clientStatement.ClientID);

            if (statementDetails == null)
            {
                var _getStatementNumber = (from _clientPrivateLabel in _MMCDbContext.clientPrivateLabelss
                                           where _clientStatement.ClientID == _clientPrivateLabel.ClientID
                                           select new
                {
                    _clientPrivateLabel.ClientStatementStart
                }).FirstOrDefault();
                getIncrementStatementNumber = _getStatementNumber.ClientStatementStart.ToString();
            }
            else
            {
                getIncrementStatementNumber = IncrementInvoice(statementDetails.ClientStatementNumber);
            }

            _clientStatement.ClientStatementNumber   = getIncrementStatementNumber;
            _clientStatement.ClientStatementFileName = _clientStatement.ClientStatementNumber + "_" + GlobalConst.FileName.InvoiceStatement + GlobalConst.Extension.pdf;
            return(_clientStatementRepo.Add(_clientStatement).ClientStatementID);
        }
Beispiel #4
0
        public string addRFAReferralInvoice(RFAReferralInvoice _rRFAReferralInvoice)
        {
            MMCDbContext _MMCDbContext             = new MMCDbContext();
            string       getIncrementInvoiceNumber = "";
            var          billingDetails            = getInvoiceNumberByClientID(_rRFAReferralInvoice.ClientID.Value);

            if (billingDetails == null)
            {
                var _getInvoiceNumber = (from _clientBill in _MMCDbContext.clientBillings
                                         join _client in _MMCDbContext.clients
                                         on _clientBill.ClientID equals _client.ClientID
                                         join _patClaim in _MMCDbContext.patientClaims
                                         on _client.ClientID equals _patClaim.PatClientID
                                         where _patClaim.PatientClaimID == _rRFAReferralInvoice.PatientClaimID
                                         select new
                {
                    _clientBill.ClientInvoiceNumber
                }).FirstOrDefault();
                getIncrementInvoiceNumber = _getInvoiceNumber.ClientInvoiceNumber.ToString();
            }
            else
            {
                getIncrementInvoiceNumber = IncrementInvoice(billingDetails.InvoiceNumber);
            }

            _rRFAReferralInvoice.InvoiceNumber = getIncrementInvoiceNumber;
            return(_rFAReferralInvoiceRepo.Add(_rRFAReferralInvoice).InvoiceNumber);
        }
Beispiel #5
0
        public BLModel.Physician getPhysicianByIDIntake(Expression <Func <Physician, bool> > _where)
        {
            MMCDbContext _MMCDbContext   = new MMCDbContext();
            var          _physicanByName = (from phys in _MMCDbContext.physicians.Where(_where)
                                            join spty in _MMCDbContext.specialties
                                            on phys.PhysSpecialtyId equals spty.SpecialtyID
                                            join st in _MMCDbContext.states
                                            on phys.PhysStateId equals st.StateId
                                            select new
            {
                phys.PhysAddress1,
                phys.PhysAddress2,
                phys.PhysCity,
                phys.PhysEMail,
                phys.PhysFax,
                phys.PhysFirstName,
                phys.PhysicianId,
                phys.PhysLastName,
                phys.PhysNotes,
                phys.PhysNPI,
                phys.PhysPhone,
                phys.PhysQualification,
                phys.PhysStateId,
                phys.PhysSpecialtyId,
                phys.PhysZip,
                PhysSpecialtyName = spty.SpecialtyName,
                PhysStateName = st.StateName
            }).OrderByDescending(phys => phys.PhysicianId).ToList();

            return(_physicanByName.Select(phys => new BLModel.Physician().InjectFrom(phys)).Cast <BLModel.Physician>().SingleOrDefault());
        }
Beispiel #6
0
        public BLModel.Paged.ManagedCareCompany getManagedCareCompanyRecords(Expression <Func <ManagedCareCompany, bool> > _where, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext = new MMCDbContext();
            var          _compByName   = (from comp in _MMCDbContext.managedCareCompanies.Where(_where)
                                          join st in _MMCDbContext.states
                                          on comp.CompStateId equals st.StateId
                                          select new
            {
                comp.CompanyId
                ,
                comp.CompName
                ,
                comp.CompAddress
                ,
                comp.CompAddress2
                ,
                comp.CompCity
                ,
                comp.CompZip
                ,
                comp.CompStateId
                ,
                CompStateName = st.StateName
            }).OrderByDescending(comp => comp.CompanyId).ToList();

            return(new BLModel.Paged.ManagedCareCompany
            {
                ManagedCareCompanyDetails = _compByName.Select(comp => new BLModel.ManagedCareCompany().InjectFrom(comp)).Cast <BLModel.ManagedCareCompany>().Skip(_skip).Take(_take).ToList(),
                TotalCount = _compByName.Count()
            });
        }
Beispiel #7
0
        public IEnumerable <DLModel.Physician> getPhysicianByReferralID(int _referralID)
        {
            MMCDbContext dbcontext = new MMCDbContext();
            var          refclaim  = (from refr in dbcontext.rfaReferrals where refr.RFAReferralID == _referralID select(refr.PatientClaimID)).SingleOrDefault();
            int          refrclaim = System.Convert.ToInt32(refclaim);
            var          phys      = (from refr in dbcontext.rfaReferrals join phy in dbcontext.physicians on refr.PhysicianID equals phy.PhysicianId where refr.PatientClaimID == refrclaim select(phy)).ToList().Distinct();

            return(phys.Select(emp => new DLModel.Physician().InjectFrom(emp)).Cast <DLModel.Physician>());
        }
Beispiel #8
0
        public IEnumerable <BLModel.PatientClaim> getAllpatientClaimsByPatientID(int _patientID)
        {
            MMCDbContext _MMCDbContext            = new MMCDbContext();
            var          _patientClaimByPatientId = (from patclm in _MMCDbContext.patientClaims
                                                     where patclm.PatientID == _patientID
                                                     select new { patclm.PatientClaimID, patclm.PatClaimNumber, patclm.PatDOI, patclm.PatClaimJurisdictionId, patclm.PatientID }).OrderByDescending(patclm => patclm.PatientClaimID).ToList();

            return(_patientClaimByPatientId.Select(pcmc => new BLModel.PatientClaim().InjectFrom(pcmc)).Cast <BLModel.PatientClaim>().ToList());
        }
Beispiel #9
0
        public BLModel.Paged.User getUsersByName(string SearchText, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext = new MMCDbContext();

            return(new BLModel.Paged.User
            {
                UserDetails = _MMCDbContext.users.Where(usr => usr.UserFirstName.StartsWith(SearchText) || usr.UserLastName.StartsWith(SearchText) || usr.UserName.StartsWith(SearchText) || (usr.UserFirstName + " " + usr.UserLastName).StartsWith(SearchText)).OrderByDescending(usr => usr.UserId).Skip(_skip).Take(_take).ToList(),
                TotalCount = _MMCDbContext.users.Where(usr => usr.UserFirstName.StartsWith(SearchText) || usr.UserLastName.StartsWith(SearchText) || usr.UserName.StartsWith(SearchText) || (usr.UserFirstName + " " + usr.UserLastName).StartsWith(SearchText)).OrderBy(usr => usr.UserId).Count()
            });
        }
Beispiel #10
0
        public IEnumerable <BLModel.AdjusterByClientID> getAdjusterByClientID(int _clientid)
        {
            MMCDbContext _MMCDbContext       = new MMCDbContext();
            var          _adjusterByClientID = (from adj in _MMCDbContext.adjusters
                                                join clnt in _MMCDbContext.clients
                                                on adj.ClientID equals clnt.ClientID
                                                where clnt.ClientID == _clientid
                                                select new { AdjusterName = adj.AdjFirstName + " " + adj.AdjLastName, AdjusterID = adj.AdjusterID }).OrderBy(adj => adj.AdjusterName).AsEnumerable();

            return(_adjusterByClientID.Select(adj => new BLModel.AdjusterByClientID().InjectFrom(adj)).Cast <BLModel.AdjusterByClientID>().ToList());
        }
        public BLModel.Paged.ThirdPartyAdministrator getThirdPartyAdministratorsByName(string SearchText, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext = new MMCDbContext();
            var          _ThirdPartyAdministratorDetails = (_MMCDbContext.thirdPartyAdministrators.Join(_MMCDbContext.states, s => s.TPAStateId, ss => ss.StateId, (s, ss) => new { s.TPAID, s.TPAName, s.TPAAddress, s.TPAAddress2, s.TPACity, s.TPAStateId, s.TPAZip, ss.StateName })
                                                            .Where(s => s.TPAName.StartsWith(SearchText)).OrderByDescending(s => s.TPAID)).Skip(_skip).Take(_take).ToList();

            return(new BLModel.Paged.ThirdPartyAdministrator
            {
                ThirdPartyAdministratorDetails = _ThirdPartyAdministratorDetails.Select(cm => new BLModel.ThirdPartyAdministrator().InjectFrom(cm)).Cast <BLModel.ThirdPartyAdministrator>().ToList(),
                TotalCount = _MMCDbContext.thirdPartyAdministrators.Where(s => s.TPAName.StartsWith(SearchText)).Count()
            });
        }
        public BLModel.Paged.MedicalGroup getMedicalGroupsByName(string SearchText, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext        = new MMCDbContext();
            var          _medicalGroupDetails = (_MMCDbContext.medicalGroups.Join(_MMCDbContext.states, s => s.MGStateID, ss => ss.StateId, (s, ss) => new { s.MedicalGroupID, s.MedicalGroupName, s.MGAddress, s.MGAddress2, s.MGCity, s.MGStateID, s.MGZip, s.MGNote, ss.StateName })
                                                 .Where(s => s.MedicalGroupName.Contains(SearchText)).OrderByDescending(s => s.MedicalGroupID)).Skip(_skip).Take(_take).ToList();

            return(new BLModel.Paged.MedicalGroup
            {
                MedicalGroupDetails = _medicalGroupDetails.Select(cm => new BLModel.MedicalGroup().InjectFrom(cm)).Cast <BLModel.MedicalGroup>().ToList(),
                TotalCount = _MMCDbContext.medicalGroups.Where(s => s.MedicalGroupName.Contains(SearchText)).Count()
            });
        }
Beispiel #13
0
        public string getStatementNumberByStatementID(int StatementID)
        {
            MMCDbContext _MMCDbContext   = new MMCDbContext();
            var          _getStatementID = (from _stmtData in _MMCDbContext.ClientStatements
                                            where _stmtData.ClientStatementID == StatementID
                                            select new
            {
                _stmtData.ClientStatementNumber
            }).Single();

            return((_getStatementID.ClientStatementNumber).ToString());
        }
Beispiel #14
0
        public int getInvoiceIDByInvoiceNumber(string InvoiceNumber)
        {
            MMCDbContext _MMCDbContext = new MMCDbContext();
            var          _getInvoiceID = (from _invData in _MMCDbContext.rFAReferralInvoices
                                          where _invData.InvoiceNumber == InvoiceNumber
                                          select new
            {
                _invData.RFAReferralInvoiceID
            }).Single();

            return(Convert.ToInt32(_getInvoiceID.RFAReferralInvoiceID));
        }
        public BLModel.Paged.ThirdPartyAdministratorBranch getThirdPartyAdministratorBranchesByTPAID(int _thirdPartyAdministratorId, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext = new MMCDbContext();
            var          _ThirdPartyAdministratorBranchDetails = (_MMCDbContext.thirdPartyAdministratorBranches.Join(_MMCDbContext.states, s => s.TPABranchStateId, ss => ss.StateId, (s, ss) => new { s.TPABranchName, s.TPABranchID, s.TPABranchCity, s.TPABranchAddress, s.TPABranchAddress2, s.TPABranchStateId, s.TPABranchZip, s.states.StateName, s.TPAID })
                                                                  .Where(s => s.TPAID == _thirdPartyAdministratorId).OrderByDescending(s => s.TPABranchID)).Skip(_skip).Take(_take).ToList();

            return(new BLModel.Paged.ThirdPartyAdministratorBranch
            {
                ThirdPartyAdministratorBranchDetails = _ThirdPartyAdministratorBranchDetails.Select(cm => new BLModel.ThirdPartyAdministratorBranch().InjectFrom(cm)).Cast <BLModel.ThirdPartyAdministratorBranch>().ToList(),
                TotalCount = _MMCDbContext.thirdPartyAdministratorBranches.Where(s => s.TPAID == _thirdPartyAdministratorId).Count()
            });
        }
Beispiel #16
0
        public IEnumerable <BLModel.ClientEmployer> getAllClientEmployerByClientID(int ClientID)
        {
            MMCDbContext _MMCDbContext  = new MMCDbContext();
            var          _ClientInsurer = (from clntemp in _MMCDbContext.clientemployers
                                           join emp in _MMCDbContext.employers
                                           on clntemp.EmployerID equals emp.EmployerID
                                           join st in _MMCDbContext.states
                                           on emp.EmpStateId equals st.StateId
                                           where clntemp.ClientID == ClientID
                                           select new { clntemp.ClientEmployerID, emp.EmployerID, emp.EmpName, emp.EmpAddress1, emp.EmpCity, emp.EmpZip, EmpState = st.StateName }).ToList().OrderBy(emp => emp.EmpName);

            return(_ClientInsurer.Select(ins => new BLModel.ClientEmployer().InjectFrom(ins)).Cast <BLModel.ClientEmployer>().AsEnumerable());
        }
Beispiel #17
0
        public ClientStatement getStatementNumberByClient(int _clientID)
        {
            MMCDbContext _MMCDbContext       = new MMCDbContext();
            var          _getStatementNumber = (from _stmtData in _MMCDbContext.ClientStatements
                                                where _stmtData.ClientID == _clientID
                                                orderby _stmtData.ClientStatementID descending
                                                select
                                                (
                                                    _stmtData
                                                )).ToList();

            return(_getStatementNumber.Select(inv => new ClientStatement().InjectFrom(inv)).Cast <ClientStatement>().FirstOrDefault());
        }
        public BLModel.Paged.PeerReview getPeerReviewsByName(string SearchText, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext     = new MMCDbContext();
            var          _PeerReviewByName = (from peerReview in _MMCDbContext.peerReviews
                                              where (peerReview.PeerReviewName.StartsWith(SearchText))
                                              select new { peerReview.PeerReviewName, peerReview.PeerReviewEmail, peerReview.PeerReviewFax, peerReview.PeerReviewID, peerReview.PeerReviewPhone }).OrderByDescending(pReview => pReview.PeerReviewID).Skip(_skip).Take(_take).ToList();

            return(new BLModel.Paged.PeerReview
            {
                PeerReviewDetails = _PeerReviewByName.Select(peerReview => new DLModel.PeerReview().InjectFrom(peerReview)).Cast <DLModel.PeerReview>(),
                TotalCount = (_MMCDbContext.peerReviews.Where(pReview => pReview.PeerReviewName.StartsWith(SearchText)).Count())
            });
        }
Beispiel #19
0
        public BLModel.Paged.PatientClaim getpatientClaimsByPatientID(int _patientID, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext            = new MMCDbContext();
            var          _patientClaimByPatientId = (from patclm in _MMCDbContext.patientClaims
                                                     where patclm.PatientID == _patientID
                                                     select new { patclm.PatientClaimID, patclm.PatClaimNumber, patclm.PatDOI, patclm.PatClaimJurisdictionId, patclm.PatientID }).OrderByDescending(patclm => patclm.PatientClaimID).ToList();

            return(new BLModel.Paged.PatientClaim
            {
                PatientClaimDetails = _patientClaimByPatientId.Select(pcmc => new BLModel.PatientClaim().InjectFrom(pcmc)).Cast <BLModel.PatientClaim>().Skip(_skip).Take(_take).ToList(),
                TotalCount = _patientClaimByPatientId.Count()
            });
        }
Beispiel #20
0
        public BLModel.Paged.ADR getADRsByName(string SearchText, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext = new MMCDbContext();
            var          _ADRByName    = (_MMCDbContext.ADRs.Join(_MMCDbContext.states, p => p.ADRStateID, pp => pp.StateId, (p, pp) => new
            {
                p.ADRID, p.ADRName, p.ADRAddress, p.ADRAddress2, p.ADRCity, p.ADRStateID, p.ADRZip, pp.StateName
            }).Where(p => p.ADRName.StartsWith(SearchText)).OrderByDescending(p => p.ADRID)).Skip(_skip).Take(_take).ToList();

            return(new BLModel.Paged.ADR
            {
                ADRDetails = _ADRByName.Select(adr => new BLModel.ADR().InjectFrom(adr)).Cast <BLModel.ADR>(),
                TotalCount = (_MMCDbContext.ADRs.Where(adr => adr.ADRName.StartsWith(SearchText))).Count()
            });
        }
Beispiel #21
0
        public BLModel.Paged.Insurer getInsurersByName(string SearchText, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext  = new MMCDbContext();
            var          _insurerByName = (from ins in _MMCDbContext.insurers
                                           join st in _MMCDbContext.states
                                           on ins.InsStateId equals st.StateId
                                           where (ins.InsName.StartsWith(SearchText))
                                           select new { ins.InsAddress1, ins.InsAddress2, ins.InsCity, ins.InsEMail, ins.InsFax, ins.InsName, ins.InsPhone, ins.InsStateId, ins.InsurerID, ins.InsZip, InsStateName = st.StateName }).OrderByDescending(ins => ins.InsurerID).Skip(_skip).Take(_take).ToList();

            return(new BLModel.Paged.Insurer
            {
                InsurerDetails = _insurerByName.Select(ins => new BLModel.Insurer().InjectFrom(ins)).Cast <BLModel.Insurer>().ToList(),
                TotalCount = _MMCDbContext.insurers.Where(ins => ins.InsName.StartsWith(SearchText)).Count()
            });
        }
Beispiel #22
0
        public BLModel.Paged.Adjuster getadjustersByName(string SearchText, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext   = new MMCDbContext();
            var          _adjusterByName = (from adj in _MMCDbContext.adjusters
                                            join st in _MMCDbContext.states
                                            on adj.AdjStateId equals st.StateId
                                            where (adj.AdjFirstName.StartsWith(SearchText) || adj.AdjLastName.StartsWith(SearchText) || (adj.AdjFirstName + " " + adj.AdjLastName).StartsWith(SearchText))
                                            select new { adj.AdjAddress1, adj.AdjAddress2, adj.AdjCity, adj.AdjEMail, adj.AdjFax, adj.AdjFirstName, adj.AdjLastName, adj.AdjPhone, adj.AdjStateId, adj.AdjusterID, adj.AdjZip, AdjStateName = st.StateName }).OrderByDescending(adj => adj.AdjusterID).Skip(_skip).Take(_take).ToList();

            return(new BLModel.Paged.Adjuster
            {
                AdjusterDetails = _adjusterByName.Select(adj => new BLModel.Adjuster().InjectFrom(adj)).Cast <BLModel.Adjuster>(),
                TotalCount = (_MMCDbContext.adjusters.Where(adj => adj.AdjFirstName.StartsWith(SearchText) || adj.AdjLastName.StartsWith(SearchText) || (adj.AdjFirstName + " " + adj.AdjLastName).StartsWith(SearchText))).Count()
            });
        }
Beispiel #23
0
        public BLModel.Paged.PatientCurrentMedicalCondition getpatientCurrentMedicalConditionByPatientId(int _patientID, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext = new MMCDbContext();
            var          _patientCurrentMedicalConditionByPatientId = (from pcmc in _MMCDbContext.patientCurrentMedicalConditions
                                                                       join cmc in _MMCDbContext.currentMedicalConditions
                                                                       on pcmc.CurrentMedicalConditionId equals cmc.CurrentMedicalConditionId
                                                                       where pcmc.PatientID == _patientID
                                                                       select new { pcmc.PatCurrentMedicalConditionId, pcmc.PatientID, pcmc.CurrentMedicalConditionId, PatCurrentMedicalConditionName = cmc.CurrentMedicalConditionName }).OrderByDescending(pcmc => pcmc.PatCurrentMedicalConditionId).ToList();

            return(new BLModel.Paged.PatientCurrentMedicalCondition
            {
                PatientCurrentMedicalConditionDetails = _patientCurrentMedicalConditionByPatientId.Select(pcmc => new BLModel.PatientCurrentMedicalCondition().InjectFrom(pcmc)).Cast <BLModel.PatientCurrentMedicalCondition>().Skip(_skip).Take(_take).ToList(),
                TotalCount = _patientCurrentMedicalConditionByPatientId.Count()
            });
        }
Beispiel #24
0
        public BLModel.Paged.CaseManager getCaseManagerByName(string searchtext, int skip, int take)
        {
            MMCDbContext _MMCDbContext       = new MMCDbContext();
            var          _CaseManagerDetails = (_MMCDbContext.caseManagers.Join(_MMCDbContext.states, s => s.CMStateId, ss => ss.StateId, (s, ss) => new { s.CaseManagerID, s.CMAddress1, s.CMAddress2, s.CMCity, s.CMEmail, s.CMFax, s.CMFirstName, s.CMLastName,
                                                                                                                                                           s.CMNotes,
                                                                                                                                                           s.CMPhone,
                                                                                                                                                           s.CMStateId,
                                                                                                                                                           s.CMZip,
                                                                                                                                                           ss.StateName }).Where(s => s.CMFirstName.StartsWith(searchtext) || s.CMLastName.StartsWith(searchtext) || (s.CMFirstName.Trim() + " " + s.CMLastName.Trim()).StartsWith(searchtext)).OrderByDescending(s => s.CaseManagerID)).Skip(skip).Take(take).ToList();

            return(new BLModel.Paged.CaseManager
            {
                CaseManagerDetails = _CaseManagerDetails.Select(cm => new BLModel.CaseManager().InjectFrom(cm)).Cast <BLModel.CaseManager>().ToList(),
                TotalCount = (_MMCDbContext.caseManagers.Where(s => s.CMFirstName.StartsWith(searchtext) || s.CMLastName.StartsWith(searchtext) || (s.CMFirstName.Trim() + " " + s.CMLastName.Trim()).StartsWith(searchtext))).Count()
            });
        }
Beispiel #25
0
        public RFAReferralInvoice getInvoiceNumberByClientID(int ClientID)
        {
            MMCDbContext _MMCDbContext     = new MMCDbContext();
            var          _getInvoiceNumber = (from _invData in _MMCDbContext.rFAReferralInvoices
                                              where _invData.ClientID == ClientID
                                              orderby _invData.RFAReferralInvoiceID descending
                                              select new
            {
                _invData.RFAReferralInvoiceID,
                _invData.PatientClaimID,
                _invData.InvoiceNumber,
                _invData.ClientID
            }).ToList();

            return(_getInvoiceNumber.Select(inv => new RFAReferralInvoice().InjectFrom(inv)).Cast <RFAReferralInvoice>().FirstOrDefault());
        }
Beispiel #26
0
        public BLModel.Paged.PatientClaimStatus getPatientClaimStatusByPatientClaimId(int _patientClaimID, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext         = new MMCDbContext();
            var          _patientClaimStatuses = (from patclm in _MMCDbContext.patientClaims
                                                  join pcs in _MMCDbContext.patientClaimStatuses
                                                  on patclm.PatientClaimID equals pcs.PatientClaimID
                                                  join cs in _MMCDbContext.claimStatuses
                                                  on pcs.ClaimStatusID equals cs.ClaimStatusID
                                                  where patclm.PatientClaimID == _patientClaimID
                                                  select new { patclm.PatientClaimID, PatClaimStatusName = cs.ClaimStatusName, pcs.PatientClaimStatusID, pcs.ClaimStatusID }).OrderByDescending(pcs => pcs.PatientClaimStatusID).ToList();

            return(new BLModel.Paged.PatientClaimStatus
            {
                PatientClaimStatustDetails = _patientClaimStatuses.Select(pcd => new BLModel.PatientClaimStatus().InjectFrom(pcd)).Cast <BLModel.PatientClaimStatus>().Skip(_skip).Take(_take).ToList(),
                TotalCount = _patientClaimStatuses.Count()
            });
        }
Beispiel #27
0
        public BLModel.Paged.InsuranceBranch getInsuranceBranchesByInsurerID(int _InsurerID, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext  = new MMCDbContext();
            var          _insurerByName = (from insbrch in _MMCDbContext.insuranceBranches
                                           join ins in _MMCDbContext.insurers
                                           on insbrch.InsurerId equals ins.InsurerID
                                           join st in _MMCDbContext.states
                                           on insbrch.InsBranchStateId equals st.StateId
                                           where (insbrch.InsurerId == _InsurerID)
                                           select new { InsBranchStateName = st.StateName, insbrch.InsBranchAddress, insbrch.InsBranchCity, insbrch.InsBranchName, insbrch.InsBranchStateId, insbrch.InsBranchZip, insbrch.InsuranceBranchID, insbrch.InsurerId }).OrderByDescending(insbrch => insbrch.InsuranceBranchID).ToList();

            return(new BLModel.Paged.InsuranceBranch
            {
                InsuranceBranchDetails = _insurerByName.Select(ins => new BLModel.InsuranceBranch().InjectFrom(ins)).Cast <BLModel.InsuranceBranch>().Skip(_skip).Take(_take).ToList(),
                TotalCount = _insurerByName.Count()
            });
        }
Beispiel #28
0
        public PatientClaimStatus getPatientClaimStatusByRefferalID(int _rfaRefferalID)
        {
            MMCDbContext _MMCDbContext       = new MMCDbContext();
            var          _patientClaimStatus = (from pcs in _MMCDbContext.patientClaimStatuses
                                                join rfarefferals in _MMCDbContext.rfaReferrals
                                                on pcs.PatientClaimID equals rfarefferals.PatientClaimID
                                                where rfarefferals.RFAReferralID == _rfaRefferalID
                                                select new
            {
                PatientClaimID = pcs.PatientClaimID,
                ClaimStatusID = pcs.ClaimStatusID,
                PatientClaimStatusID = pcs.PatientClaimStatusID,
                DeniedRationale = pcs.DeniedRationale
            }).ToList();

            return(_patientClaimStatus.Select(pcd => new DLModel.PatientClaimStatus().InjectFrom(pcd)).Cast <DLModel.PatientClaimStatus>().SingleOrDefault());
        }
Beispiel #29
0
        public BLModel.Paged.ClientEmployer getClientEmployerByClientID(int ClientID, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext  = new MMCDbContext();
            var          _ClientInsurer = (from clntemp in _MMCDbContext.clientemployers
                                           join emp in _MMCDbContext.employers
                                           on clntemp.EmployerID equals emp.EmployerID
                                           join st in _MMCDbContext.states
                                           on emp.EmpStateId equals st.StateId
                                           where clntemp.ClientID == ClientID
                                           select new { clntemp.ClientEmployerID, emp.EmployerID, emp.EmpName, emp.EmpAddress1, emp.EmpCity, emp.EmpZip, EmpState = st.StateName }).ToList().OrderBy(emp => emp.EmpName);

            return(new BLModel.Paged.ClientEmployer
            {
                ClientEmployerDetails = _ClientInsurer.Select(ins => new BLModel.ClientEmployer().InjectFrom(ins)).Cast <BLModel.ClientEmployer>().Skip(_skip).Take(_take).ToList(),
                TotalCount = _ClientInsurer.Count()
            });
        }
Beispiel #30
0
        public BLModel.Paged.ClientManagedCareCompany getClientManagedCareCompanyByClientID(int ClientID, int _skip, int _take)
        {
            MMCDbContext _MMCDbContext  = new MMCDbContext();
            var          _ClientInsurer = (from clntmmc in _MMCDbContext.clientmanagedcarecompanys
                                           join mmc in _MMCDbContext.managedCareCompanies
                                           on clntmmc.CompanyID equals mmc.CompanyId
                                           join st in _MMCDbContext.states
                                           on mmc.CompStateId equals st.StateId
                                           where clntmmc.ClientID == ClientID
                                           select new { clntmmc.ClientCompanyID, mmc.CompanyId, mmc.CompName, mmc.CompCity, mmc.CompZip, mmc.CompAddress, CompState = st.StateName }).ToList().OrderBy(mmc => mmc.CompName);

            return(new BLModel.Paged.ClientManagedCareCompany
            {
                ClientManagedCareCompanyDetails = _ClientInsurer.Select(ins => new BLModel.ClientManagedCareCompany().InjectFrom(ins)).Cast <BLModel.ClientManagedCareCompany>().Skip(_skip).Take(_take).ToList(),
                TotalCount = _ClientInsurer.Count()
            });
        }