Exemple #1
0
        ///<summary>Refreshed automatically to always be kept current with all phrases, regardless of whether there are any entries in LanguageForeign table.</summary>
        public static void Refresh()
        {
            HList = new Hashtable();
            if (CultureInfo.CurrentCulture.Name == "en-US")
            {
                return;
            }
            string    command = "SELECT * from language";
            DataTable table   = General.GetTable(command);

            List = new Language[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                List[i] = new Language();
                //List[i].EnglishCommentsOld= PIn.PString(table.Rows[i][0].ToString());
                List[i].ClassType  = PIn.PString(table.Rows[i][1].ToString());
                List[i].English    = PIn.PString(table.Rows[i][2].ToString());
                List[i].IsObsolete = PIn.PBool(table.Rows[i][3].ToString());
                if (!HList.ContainsKey(List[i].ClassType + List[i].English))
                {
                    HList.Add(List[i].ClassType + List[i].English, List[i]);
                }
            }
            //MessageBox.Show(List.Length.ToString());
        }
Exemple #2
0
        //there are no methods for deleting or changing log entries because that will never be allowed.



        ///<summary>Used when viewing various audit trails of specific types.</summary>
        public static SecurityLog[] Refresh(int patNum, Permissions[] permTypes)
        {
            string types = "";

            for (int i = 0; i < permTypes.Length; i++)
            {
                if (i > 0)
                {
                    types += " OR";
                }
                types += " PermType=" + POut.PInt((int)permTypes[i]);
            }
            string command = "SELECT * FROM securitylog "
                             + "WHERE PatNum= '" + POut.PInt(patNum) + "' "
                             + "AND (" + types + ")";
            DataTable table = General.GetTable(command);

            SecurityLog[] List = new SecurityLog[table.Rows.Count];
            for (int i = 0; i < List.Length; i++)
            {
                List[i] = new SecurityLog();
                List[i].SecurityLogNum = PIn.PInt(table.Rows[i][0].ToString());
                List[i].PermType       = (Permissions)PIn.PInt(table.Rows[i][1].ToString());
                List[i].UserNum        = PIn.PInt(table.Rows[i][2].ToString());
                List[i].LogDateTime    = PIn.PDateT(table.Rows[i][3].ToString());
                List[i].LogText        = PIn.PString(table.Rows[i][4].ToString());
                List[i].PatNum         = PIn.PInt(table.Rows[i][5].ToString());
            }
            return(List);
        }
Exemple #3
0
        public static Employee[] ListShort;        //does not include hidden employees

        ///<summary></summary>
        public static void Refresh()
        {
            string    command = "SELECT * FROM employee ORDER BY IsHidden,FName,LName";
            DataTable table   = General.GetTable(command);

            ListLong = new Employee[table.Rows.Count];
            ArrayList tempList = new ArrayList();

            //Employee temp;
            for (int i = 0; i < table.Rows.Count; i++)
            {
                ListLong[i]             = new Employee();
                ListLong[i].EmployeeNum = PIn.PInt(table.Rows[i][0].ToString());
                ListLong[i].LName       = PIn.PString(table.Rows[i][1].ToString());
                ListLong[i].FName       = PIn.PString(table.Rows[i][2].ToString());
                ListLong[i].MiddleI     = PIn.PString(table.Rows[i][3].ToString());
                ListLong[i].IsHidden    = PIn.PBool(table.Rows[i][4].ToString());
                ListLong[i].ClockStatus = PIn.PString(table.Rows[i][5].ToString());
                if (!ListLong[i].IsHidden)
                {
                    tempList.Add(ListLong[i]);
                }
            }
            ListShort = new Employee[tempList.Count];
            for (int i = 0; i < tempList.Count; i++)
            {
                ListShort[i] = (Employee)tempList[i];
            }
        }
Exemple #4
0
        ///<summary></summary>
        public static void Refresh()
        {
            string    command = "SELECT * from autocode";
            DataTable table   = General.GetTable(command);

            HList = new Hashtable();
            List  = new AutoCode[table.Rows.Count];
            ArrayList ALshort = new ArrayList();          //int of indexes of short list

            for (int i = 0; i < List.Length; i++)
            {
                List[i]               = new AutoCode();
                List[i].AutoCodeNum   = PIn.PInt(table.Rows[i][0].ToString());
                List[i].Description   = PIn.PString(table.Rows[i][1].ToString());
                List[i].IsHidden      = PIn.PBool(table.Rows[i][2].ToString());
                List[i].LessIntrusive = PIn.PBool(table.Rows[i][3].ToString());
                HList.Add(List[i].AutoCodeNum, List[i]);
                if (!List[i].IsHidden)
                {
                    ALshort.Add(i);
                }
            }
            ListShort = new AutoCode[ALshort.Count];
            for (int i = 0; i < ALshort.Count; i++)
            {
                ListShort[i] = List[(int)ALshort[i]];
            }
        }
Exemple #5
0
        ///<summary></summary>
        public static void Refresh()
        {
            //MessageBox.Show("refreshing");
            HList = new Hashtable();
            Program tempProgram = new Program();
            string  command     =
                "SELECT * from program ORDER BY ProgDesc";
            DataTable table = General.GetTable(command);

            List = new Program[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                tempProgram             = new Program();
                tempProgram.ProgramNum  = PIn.PInt(table.Rows[i][0].ToString());
                tempProgram.ProgName    = PIn.PString(table.Rows[i][1].ToString());
                tempProgram.ProgDesc    = PIn.PString(table.Rows[i][2].ToString());
                tempProgram.Enabled     = PIn.PBool(table.Rows[i][3].ToString());
                tempProgram.Path        = PIn.PString(table.Rows[i][4].ToString());
                tempProgram.CommandLine = PIn.PString(table.Rows[i][5].ToString());
                tempProgram.Note        = PIn.PString(table.Rows[i][6].ToString());
                List[i] = tempProgram;
                if (!HList.ContainsKey(tempProgram.ProgName))
                {
                    HList.Add(tempProgram.ProgName, tempProgram);
                }
            }
            //MessageBox.Show(HList.Count.ToString());
        }
Exemple #6
0
        ///<summary>Carriers are not refreshed as local data, but are refreshed as needed. A full refresh is frequently triggered if a carrierNum cannot be found in the HList.  Important retrieval is done directly from the db.</summary>
        public static void Refresh()
        {
            HList = new Hashtable();
            string    command = "SELECT * FROM carrier ORDER BY CarrierName";
            DataTable table   = General.GetTable(command);

            List = new Carrier[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                List[i]                    = new Carrier();
                List[i].CarrierNum         = PIn.PInt(table.Rows[i][0].ToString());
                List[i].CarrierName        = PIn.PString(table.Rows[i][1].ToString());
                List[i].Address            = PIn.PString(table.Rows[i][2].ToString());
                List[i].Address2           = PIn.PString(table.Rows[i][3].ToString());
                List[i].City               = PIn.PString(table.Rows[i][4].ToString());
                List[i].State              = PIn.PString(table.Rows[i][5].ToString());
                List[i].Zip                = PIn.PString(table.Rows[i][6].ToString());
                List[i].Phone              = PIn.PString(table.Rows[i][7].ToString());
                List[i].ElectID            = PIn.PString(table.Rows[i][8].ToString());
                List[i].NoSendElect        = PIn.PBool(table.Rows[i][9].ToString());
                List[i].IsCDA              = PIn.PBool(table.Rows[i][10].ToString());
                List[i].IsPMP              = PIn.PBool(table.Rows[i][11].ToString());
                List[i].CDAnetVersion      = PIn.PString(table.Rows[i][12].ToString());
                List[i].CanadianNetworkNum = PIn.PInt(table.Rows[i][13].ToString());
                HList.Add(List[i].CarrierNum, List[i]);
            }
        }
Exemple #7
0
        ///<summary>Refreshes all referrals for all patients.  Need to rework at some point so less memory is consumed.  Also refreshes dynamically, so no need to invalidate local data.</summary>
        public static void Refresh()
        {
            string command =
                "SELECT * from referral "
                + "ORDER BY lname";
            DataTable table = General.GetTable(command);

            List  = new Referral[table.Rows.Count];
            HList = new Hashtable();
            for (int i = 0; i < table.Rows.Count; i++)
            {
                List[i]             = new Referral();
                List[i].ReferralNum = PIn.PInt(table.Rows[i][0].ToString());
                List[i].LName       = PIn.PString(table.Rows[i][1].ToString());
                List[i].FName       = PIn.PString(table.Rows[i][2].ToString());
                List[i].MName       = PIn.PString(table.Rows[i][3].ToString());
                List[i].SSN         = PIn.PString(table.Rows[i][4].ToString());
                List[i].UsingTIN    = PIn.PBool(table.Rows[i][5].ToString());
                List[i].Specialty   = (DentalSpecialty)PIn.PInt(table.Rows[i][6].ToString());
                List[i].ST          = PIn.PString(table.Rows[i][7].ToString());
                List[i].Telephone   = PIn.PString(table.Rows[i][8].ToString());
                List[i].Address     = PIn.PString(table.Rows[i][9].ToString());
                List[i].Address2    = PIn.PString(table.Rows[i][10].ToString());
                List[i].City        = PIn.PString(table.Rows[i][11].ToString());
                List[i].Zip         = PIn.PString(table.Rows[i][12].ToString());
                List[i].Note        = PIn.PString(table.Rows[i][13].ToString());
                List[i].Phone2      = PIn.PString(table.Rows[i][14].ToString());
                List[i].IsHidden    = PIn.PBool(table.Rows[i][15].ToString());
                List[i].NotPerson   = PIn.PBool(table.Rows[i][16].ToString());
                List[i].Title       = PIn.PString(table.Rows[i][17].ToString());
                List[i].EMail       = PIn.PString(table.Rows[i][18].ToString());
                List[i].PatNum      = PIn.PInt(table.Rows[i][19].ToString());
                HList.Add(List[i].ReferralNum, List[i]);
            }
        }
Exemple #8
0
        ///<summary>Gets a list of all RepeatCharges for a given patient.  Supply 0 to get a list for all patients.</summary>
        public static RepeatCharge[] Refresh(int patNum)
        {
            string command = "SELECT * FROM repeatcharge";

            if (patNum != 0)
            {
                command += " WHERE PatNum = " + POut.PInt(patNum);
            }
            command += " ORDER BY DateStart";
            DataTable table = General.GetTable(command);

            RepeatCharge[] List = new RepeatCharge[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                List[i] = new RepeatCharge();
                List[i].RepeatChargeNum = PIn.PInt(table.Rows[i][0].ToString());
                List[i].PatNum          = PIn.PInt(table.Rows[i][1].ToString());
                List[i].ProcCode        = PIn.PString(table.Rows[i][2].ToString());
                List[i].ChargeAmt       = PIn.PDouble(table.Rows[i][3].ToString());
                List[i].DateStart       = PIn.PDate(table.Rows[i][4].ToString());
                List[i].DateStop        = PIn.PDate(table.Rows[i][5].ToString());
                List[i].Note            = PIn.PString(table.Rows[i][6].ToString());
            }
            return(List);
        }
Exemple #9
0
        ///<summary>Gets all PayPlanCharges for a guarantor or patient, ordered by date.</summary>
        public static PayPlanCharge[] Refresh(int patNum)
        {
            string command =
                "SELECT * FROM payplancharge "
                + "WHERE Guarantor='" + POut.PInt(patNum) + "' "
                + "OR PatNum='" + POut.PInt(patNum) + "' "
                + "ORDER BY ChargeDate";
            DataTable table = General.GetTable(command);

            PayPlanCharge[] List = new PayPlanCharge[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                List[i] = new PayPlanCharge();
                List[i].PayPlanChargeNum = PIn.PInt(table.Rows[i][0].ToString());
                List[i].PayPlanNum       = PIn.PInt(table.Rows[i][1].ToString());
                List[i].Guarantor        = PIn.PInt(table.Rows[i][2].ToString());
                List[i].PatNum           = PIn.PInt(table.Rows[i][3].ToString());
                List[i].ChargeDate       = PIn.PDate(table.Rows[i][4].ToString());
                List[i].Principal        = PIn.PDouble(table.Rows[i][5].ToString());
                List[i].Interest         = PIn.PDouble(table.Rows[i][6].ToString());
                List[i].Note             = PIn.PString(table.Rows[i][7].ToString());
                List[i].ProvNum          = PIn.PInt(table.Rows[i][8].ToString());
            }
            return(List);
        }
Exemple #10
0
        ///<summary>Refresh all operatories</summary>
        public static void Refresh()
        {
            string command = "SELECT * FROM operatory "
                             + "ORDER BY ItemOrder";
            DataTable table = General.GetTable(command);

            List = new Operatory[table.Rows.Count];
            ArrayList AL = new ArrayList();

            for (int i = 0; i < table.Rows.Count; i++)
            {
                List[i] = new Operatory();
                List[i].OperatoryNum  = PIn.PInt(table.Rows[i][0].ToString());
                List[i].OpName        = PIn.PString(table.Rows[i][1].ToString());
                List[i].Abbrev        = PIn.PString(table.Rows[i][2].ToString());
                List[i].ItemOrder     = PIn.PInt(table.Rows[i][3].ToString());
                List[i].IsHidden      = PIn.PBool(table.Rows[i][4].ToString());
                List[i].ProvDentist   = PIn.PInt(table.Rows[i][5].ToString());
                List[i].ProvHygienist = PIn.PInt(table.Rows[i][6].ToString());
                List[i].IsHygiene     = PIn.PBool(table.Rows[i][7].ToString());
                List[i].ClinicNum     = PIn.PInt(table.Rows[i][8].ToString());
                if (!List[i].IsHidden)
                {
                    AL.Add(List[i]);
                }
            }
            ListShort = new Operatory[AL.Count];
            AL.CopyTo(ListShort);
        }
Exemple #11
0
        ///<summary>Fills the specified array of Appointments using the supplied SQL command.</summary>
        private static Appointment[] FillList(string command)
        {
            DataTable table = General.GetTable(command);

            Appointment[] list = new Appointment[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                list[i]                 = new Appointment();
                list[i].AptNum          = PIn.PInt(table.Rows[i][0].ToString());
                list[i].PatNum          = PIn.PInt(table.Rows[i][1].ToString());
                list[i].AptStatus       = (ApptStatus)PIn.PInt(table.Rows[i][2].ToString());
                list[i].Pattern         = PIn.PString(table.Rows[i][3].ToString());
                list[i].Confirmed       = PIn.PInt(table.Rows[i][4].ToString());
                list[i].AddTime         = PIn.PInt(table.Rows[i][5].ToString());
                list[i].Op              = PIn.PInt(table.Rows[i][6].ToString());
                list[i].Note            = PIn.PString(table.Rows[i][7].ToString());
                list[i].ProvNum         = PIn.PInt(table.Rows[i][8].ToString());
                list[i].ProvHyg         = PIn.PInt(table.Rows[i][9].ToString());
                list[i].AptDateTime     = PIn.PDateT(table.Rows[i][10].ToString());
                list[i].NextAptNum      = PIn.PInt(table.Rows[i][11].ToString());
                list[i].UnschedStatus   = PIn.PInt(table.Rows[i][12].ToString());
                list[i].Lab             = (LabCase)PIn.PInt(table.Rows[i][13].ToString());
                list[i].IsNewPatient    = PIn.PBool(table.Rows[i][14].ToString());
                list[i].ProcDescript    = PIn.PString(table.Rows[i][15].ToString());
                list[i].Assistant       = PIn.PInt(table.Rows[i][16].ToString());
                list[i].InstructorNum   = PIn.PInt(table.Rows[i][17].ToString());
                list[i].SchoolClassNum  = PIn.PInt(table.Rows[i][18].ToString());
                list[i].SchoolCourseNum = PIn.PInt(table.Rows[i][19].ToString());
                list[i].GradePoint      = PIn.PFloat(table.Rows[i][20].ToString());
                list[i].ClinicNum       = PIn.PInt(table.Rows[i][21].ToString());
                list[i].IsHygiene       = PIn.PBool(table.Rows[i][22].ToString());
            }
            return(list);
        }
Exemple #12
0
        public static List <LabCase> FillFromCommand(string command)
        {
            DataTable      table = General.GetTable(command);
            LabCase        lab;
            List <LabCase> retVal = new List <LabCase>();

            for (int i = 0; i < table.Rows.Count; i++)
            {
                lab                 = new LabCase();
                lab.LabCaseNum      = PIn.PInt(table.Rows[i][0].ToString());
                lab.PatNum          = PIn.PInt(table.Rows[i][1].ToString());
                lab.LaboratoryNum   = PIn.PInt(table.Rows[i][2].ToString());
                lab.AptNum          = PIn.PInt(table.Rows[i][3].ToString());
                lab.PlannedAptNum   = PIn.PInt(table.Rows[i][4].ToString());
                lab.DateTimeDue     = PIn.PDateT(table.Rows[i][5].ToString());
                lab.DateTimeCreated = PIn.PDateT(table.Rows[i][6].ToString());
                lab.DateTimeSent    = PIn.PDateT(table.Rows[i][7].ToString());
                lab.DateTimeRecd    = PIn.PDateT(table.Rows[i][8].ToString());
                lab.DateTimeChecked = PIn.PDateT(table.Rows[i][9].ToString());
                lab.ProvNum         = PIn.PInt(table.Rows[i][10].ToString());
                lab.Instructions    = PIn.PString(table.Rows[i][11].ToString());
                retVal.Add(lab);
            }
            return(retVal);
        }
Exemple #13
0
        ///<summary>Gets a list of subscriber names from the database that have identical plan info as this one. Used to display in the insplan window.  The returned list never includes the plan that we're viewing.  Use excludePlan for this purpose; it's more consistent, because we have no way of knowing if the current plan will be picked up or not.</summary>
        public static string[] GetSubscribersForSamePlans(string employerName, string groupName, string groupNum,
                                                          string divisionNo, string carrierName, bool isMedical, int excludePlan)
        {
            string command = "SELECT CONCAT(CONCAT(LName,', '),FName) "
                             + "FROM patient "
                             + "LEFT JOIN insplan ON patient.PatNum=insplan.Subscriber "
                             + "LEFT JOIN carrier ON carrier.CarrierNum = insplan.CarrierNum "
                             + "LEFT JOIN employer ON employer.EmployerNum = insplan.EmployerNum "
                             + "WHERE (employer.EmpName IS NULL OR "
                             + "    employer.EmpName = '" + POut.PString(employerName) + "') "
                             + "AND insplan.GroupName = '" + POut.PString(groupName) + "' "
                             + "AND insplan.GroupNum = '" + POut.PString(groupNum) + "' "
                             + "AND insplan.DivisionNo = '" + POut.PString(divisionNo) + "' "
                             + "AND carrier.CarrierName = '" + POut.PString(carrierName) + "' "
                             + "AND insplan.IsMedical = '" + POut.PBool(isMedical) + "' "
                             + "AND insplan.PlanNum != " + POut.PInt(excludePlan)
                             + " ORDER BY LName,FName";
            DataTable table = General.GetTable(command);

            string[] retStr = new string[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                retStr[i] = PIn.PString(table.Rows[i][0].ToString());
            }
            return(retStr);
        }
        ///<summary>Will frequently return null when no canadianClaim saved yet.</summary>
        public static CanadianClaim GetForClaim(int claimNum)
        {
            string    command = "SELECT * FROM canadianclaim WHERE ClaimNum=" + POut.PInt(claimNum);
            DataTable table   = General.GetTable(command);

            if (table.Rows.Count == 0)
            {
                return(null);
            }
            CanadianClaim retVal = new CanadianClaim();

            retVal.ClaimNum            = claimNum;
            retVal.MaterialsForwarded  = PIn.PString(table.Rows[0][1].ToString());
            retVal.ReferralProviderNum = PIn.PString(table.Rows[0][2].ToString());
            retVal.ReferralReason      = PIn.PInt(table.Rows[0][3].ToString());
            //retVal.CardSequenceNumber =PIn.PInt   (table.Rows[0][4].ToString());
            retVal.SecondaryCoverage  = PIn.PString(table.Rows[0][4].ToString());
            retVal.IsInitialLower     = PIn.PString(table.Rows[0][5].ToString());
            retVal.DateInitialLower   = PIn.PDate(table.Rows[0][6].ToString());
            retVal.MandProsthMaterial = PIn.PInt(table.Rows[0][7].ToString());
            retVal.IsInitialUpper     = PIn.PString(table.Rows[0][8].ToString());
            retVal.DateInitialUpper   = PIn.PDate(table.Rows[0][9].ToString());
            retVal.MaxProsthMaterial  = PIn.PInt(table.Rows[0][10].ToString());
            retVal.EligibilityCode    = PIn.PInt(table.Rows[0][11].ToString());
            retVal.SchoolName         = PIn.PString(table.Rows[0][12].ToString());
            retVal.PayeeCode          = PIn.PInt(table.Rows[0][13].ToString());
            return(retVal);
        }
Exemple #15
0
        ///<summary>Used in the Plan edit window to get a list of benefits for specified plan and patPlan.  patPlanNum can be 0.</summary>
        public static List <Benefit> RefreshForPlan(int planNum, int patPlanNum)
        {
            string command = "SELECT *" //,IFNULL(covcat.CovCatNum,0) AS covorder "
                             + " FROM benefit"
                                        //+" LEFT JOIN covcat ON covcat.CovCatNum=benefit.CovCatNum"
                             + " WHERE PlanNum = " + POut.PInt(planNum);

            if (patPlanNum != 0)
            {
                command += " OR PatPlanNum = " + POut.PInt(patPlanNum);
            }
            DataTable      table  = General.GetTable(command);
            List <Benefit> retVal = new List <Benefit>();
            Benefit        ben;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                ben                   = new Benefit();
                ben.BenefitNum        = PIn.PInt(table.Rows[i][0].ToString());
                ben.PlanNum           = PIn.PInt(table.Rows[i][1].ToString());
                ben.PatPlanNum        = PIn.PInt(table.Rows[i][2].ToString());
                ben.CovCatNum         = PIn.PInt(table.Rows[i][3].ToString());
                ben.OldCode           = PIn.PString(table.Rows[i][4].ToString());
                ben.BenefitType       = (InsBenefitType)PIn.PInt(table.Rows[i][5].ToString());
                ben.Percent           = PIn.PInt(table.Rows[i][6].ToString());
                ben.MonetaryAmt       = PIn.PDouble(table.Rows[i][7].ToString());
                ben.TimePeriod        = (BenefitTimePeriod)PIn.PInt(table.Rows[i][8].ToString());
                ben.QuantityQualifier = (BenefitQuantity)PIn.PInt(table.Rows[i][9].ToString());
                ben.Quantity          = PIn.PInt(table.Rows[i][10].ToString());
                ben.CodeNum           = PIn.PInt(table.Rows[i][11].ToString());
                ben.CoverageLevel     = (BenefitCoverageLevel)PIn.PInt(table.Rows[i][12].ToString());
                retVal.Add(ben);
            }
            return(retVal);
        }
Exemple #16
0
        /*
         * ///<summary></summary>
         * public static Document[] GetAllWithPat(int patNum) {
         *      string command="SELECT * FROM document WHERE WithPat="+POut.PInt(patNum);
         *      return RefreshAndFill(command);
         * }*/

        public static Document Fill(DataRow document)
        {
            if (document == null)
            {
                return(null);
            }
            Document doc = new Document();

            doc.DocNum         = PIn.PInt(document[0].ToString());
            doc.Description    = PIn.PString(document[1].ToString());
            doc.DateCreated    = PIn.PDate(document[2].ToString());
            doc.DocCategory    = PIn.PInt(document[3].ToString());
            doc.WithPat        = PIn.PInt(document[4].ToString());
            doc.FileName       = PIn.PString(document[5].ToString());
            doc.ImgType        = (ImageType)PIn.PInt(document[6].ToString());
            doc.IsFlipped      = PIn.PBool(document[7].ToString());
            doc.DegreesRotated = PIn.PInt(document[8].ToString());
            doc.ToothNumbers   = PIn.PString(document[9].ToString());
            doc.Note           = PIn.PString(document[10].ToString());
            doc.SigIsTopaz     = PIn.PBool(document[11].ToString());
            doc.Signature      = PIn.PString(document[12].ToString());
            doc.CropX          = PIn.PInt(document[13].ToString());
            doc.CropY          = PIn.PInt(document[14].ToString());
            doc.CropW          = PIn.PInt(document[15].ToString());
            doc.CropH          = PIn.PInt(document[16].ToString());
            doc.WindowingMin   = PIn.PInt(document[17].ToString());
            doc.WindowingMax   = PIn.PInt(document[18].ToString());
            return(doc);
        }
Exemple #17
0
        private static List <Schedule> RefreshAndFill(string command)
        {
            DataTable       table  = General.GetTableEx(command);
            List <Schedule> retVal = new List <Schedule>();
            //Schedule[] List=new Schedule[table.Rows.Count];
            Schedule sched;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                sched              = new Schedule();
                sched.ScheduleNum  = PIn.PInt(table.Rows[i][0].ToString());
                sched.SchedDate    = PIn.PDate(table.Rows[i][1].ToString());
                sched.StartTime    = PIn.PDateT(table.Rows[i][2].ToString());
                sched.StopTime     = PIn.PDateT(table.Rows[i][3].ToString());
                sched.SchedType    = (ScheduleType)PIn.PInt(table.Rows[i][4].ToString());
                sched.ProvNum      = PIn.PInt(table.Rows[i][5].ToString());
                sched.BlockoutType = PIn.PInt(table.Rows[i][6].ToString());
                sched.Note         = PIn.PString(table.Rows[i][7].ToString());
                sched.Status       = (SchedStatus)PIn.PInt(table.Rows[i][8].ToString());
                sched.Op           = PIn.PInt(table.Rows[i][9].ToString());
                sched.EmployeeNum  = PIn.PInt(table.Rows[i][10].ToString());
                retVal.Add(sched);
            }
            return(retVal);
        }
Exemple #18
0
        ///<summary>Called from claimsend window.</summary>
        public static ClaimSendQueueItem[] GetQueueList()
        {
            string command =
                "SELECT claim.ClaimNum,carrier.NoSendElect"
                + ",CONCAT(CONCAT(CONCAT(concat(patient.LName,', '),patient.FName),' '),patient.MiddleI)"
                + ",claim.ClaimStatus,carrier.CarrierName,patient.PatNum,carrier.ElectID,insplan.IsMedical "
                + "FROM claim "
                + "Left join insplan on claim.PlanNum = insplan.PlanNum "
                + "Left join carrier on insplan.CarrierNum = carrier.CarrierNum "
                + "Left join patient on patient.PatNum = claim.PatNum "
                + "WHERE claim.ClaimStatus = 'W' OR claim.ClaimStatus = 'P' "
                + "ORDER BY insplan.IsMedical";               //this puts the medical claims at the end, helping with the looping in X12.
            //MessageBox.Show(string command);
            DataTable table = General.GetTable(command);

            ClaimSendQueueItem[] listQueue = new ClaimSendQueueItem[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                listQueue[i]                  = new ClaimSendQueueItem();
                listQueue[i].ClaimNum         = PIn.PInt(table.Rows[i][0].ToString());
                listQueue[i].NoSendElect      = PIn.PBool(table.Rows[i][1].ToString());
                listQueue[i].PatName          = PIn.PString(table.Rows[i][2].ToString());
                listQueue[i].ClaimStatus      = PIn.PString(table.Rows[i][3].ToString());
                listQueue[i].Carrier          = PIn.PString(table.Rows[i][4].ToString());
                listQueue[i].PatNum           = PIn.PInt(table.Rows[i][5].ToString());
                listQueue[i].ClearinghouseNum = Clearinghouses.GetNumForPayor(PIn.PString(table.Rows[i][6].ToString()));
                listQueue[i].IsMedical        = PIn.PBool(table.Rows[i][7].ToString());
            }
            return(listQueue);
        }
Exemple #19
0
        ///<summary>Fills ListShort and ListLong with all claimforms from the db. Also attaches corresponding claimformitems to each.</summary>
        public static void Refresh()
        {
            string command =
                "SELECT * FROM claimform";
            DataTable table = General.GetTable(command);

            ListLong = new ClaimForm[table.Rows.Count];
            ArrayList tempAL = new ArrayList();

            for (int i = 0; i < table.Rows.Count; i++)
            {
                ListLong[i] = new ClaimForm();
                ListLong[i].ClaimFormNum = PIn.PInt(table.Rows[i][0].ToString());
                ListLong[i].Description  = PIn.PString(table.Rows[i][1].ToString());
                ListLong[i].IsHidden     = PIn.PBool(table.Rows[i][2].ToString());
                ListLong[i].FontName     = PIn.PString(table.Rows[i][3].ToString());
                ListLong[i].FontSize     = PIn.PFloat(table.Rows[i][4].ToString());
                ListLong[i].UniqueID     = PIn.PString(table.Rows[i][5].ToString());
                ListLong[i].PrintImages  = PIn.PBool(table.Rows[i][6].ToString());
                ListLong[i].OffsetX      = PIn.PInt(table.Rows[i][7].ToString());
                ListLong[i].OffsetY      = PIn.PInt(table.Rows[i][8].ToString());
                ListLong[i].Items        = ClaimFormItems.GetListForForm(ListLong[i].ClaimFormNum);
                if (!ListLong[i].IsHidden)
                {
                    tempAL.Add(ListLong[i]);
                }
            }
            ListShort = new ClaimForm[tempAL.Count];
            for (int i = 0; i < ListShort.Length; i++)
            {
                ListShort[i] = (ClaimForm)tempAL[i];
            }
        }
Exemple #20
0
        ///<summary></summary>
        public static void Refresh()
        {
            try {
                if (RemotingClient.OpenDentBusinessIsLocal)
                {
                    UserodB.Refresh();
                }
                else
                {
                    DtoUserodRefresh dto = new DtoUserodRefresh();
                    DataSet          ds  = RemotingClient.ProcessQuery(dto);
                    UserodB.RawData = ds.Tables[0];
                }
            }
            catch (Exception e) {
                MessageBox.Show(e.Message);
                return;
            }
            Listt = new List <Userod>();         //[UserB.RawData.Rows.Count];
            Userod user;

            for (int i = 0; i < UserodB.RawData.Rows.Count; i++)
            {
                user              = new Userod();
                user.UserNum      = PIn.PInt(UserodB.RawData.Rows[i][0].ToString());
                user.UserName     = PIn.PString(UserodB.RawData.Rows[i][1].ToString());
                user.Password     = PIn.PString(UserodB.RawData.Rows[i][2].ToString());
                user.UserGroupNum = PIn.PInt(UserodB.RawData.Rows[i][3].ToString());
                user.EmployeeNum  = PIn.PInt(UserodB.RawData.Rows[i][4].ToString());
                Listt.Add(user);
            }
        }
Exemple #21
0
        public static string GetCurrentDatabase()
        {
            string    command = "SELECT database()";
            DataTable table   = General.GetTable(command);

            return(PIn.PString(table.Rows[0][0].ToString()));
        }
Exemple #22
0
        ///<summary>Gets all distinct notes for the planNums supplied.  Supply a planNum to exclude it.  Only called when closing FormInsPlan.  Includes blank notes.</summary>
        public static string[] GetNotesForPlans(List <int> planNums, int excludePlanNum)
        {
            if (planNums.Count == 0)           //this should never happen, but just in case...
            {
                return(new string[0]);
            }
            if (planNums.Count == 1 && planNums[0] == excludePlanNum)
            {
                return(new string[0]);
            }
            string s = "";

            for (int i = 0; i < planNums.Count; i++)
            {
                if (planNums[i] == excludePlanNum)
                {
                    continue;
                }
                if (s != "")
                {
                    s += " OR";
                }
                s += " PlanNum=" + POut.PInt(planNums[i]);
            }
            string    command = "SELECT DISTINCT PlanNote FROM insplan WHERE" + s;
            DataTable table   = General.GetTable(command);

            string[] retVal = new string[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                retVal[i] = PIn.PString(table.Rows[i][0].ToString());
            }
            return(retVal);
        }
        ///<summary>Retrieves all registration keys for a particular customer's family. There can be multiple keys assigned to a single customer, or keys assigned to individual family members, since the customer may have multiple physical locations of business.</summary>
        public static RegistrationKey[] GetForPatient(int patNum)
        {
            string command = "SELECT * FROM registrationkey WHERE ";
            Family fam     = Patients.GetFamily(patNum);

            for (int i = 0; i < fam.List.Length; i++)
            {
                command += "PatNum='" + fam.List[i].PatNum + "' ";
                if (i < fam.List.Length - 1)
                {
                    command += "OR ";
                }
            }
            DataTable table = General.GetTable(command);

            RegistrationKey[] keys = new RegistrationKey[table.Rows.Count];
            for (int i = 0; i < keys.Length; i++)
            {
                keys[i] = new RegistrationKey();
                keys[i].RegistrationKeyNum = PIn.PInt(table.Rows[i][0].ToString());
                keys[i].PatNum             = PIn.PInt(table.Rows[i][1].ToString());
                keys[i].RegKey             = PIn.PString(table.Rows[i][2].ToString());
                keys[i].Note = PIn.PString(table.Rows[i][3].ToString());
            }
            return(keys);
        }
Exemple #24
0
        ///<summary>Called from FormInsPlan when user wants to view a benefit note for similar plans.  Should never include the current plan that the user is editing.  This function will get one note from the database, not including blank notes.  If no note can be found, then it returns empty string.</summary>
        public static string GetBenefitNotes(List <int> planNums)
        {
            string s = "";

            for (int i = 0; i < planNums.Count; i++)
            {
                if (i > 0)
                {
                    s += " OR";
                }
                s += " PlanNum=" + POut.PInt(planNums[i]);
            }
            string command = "SELECT BenefitNotes FROM insplan WHERE BenefitNotes != '' AND (" + s + ") ";

            if (FormChooseDatabase.DBtype == DatabaseType.Oracle)
            {
                command += "AND ROWNUM<=1";
            }
            else              //Assume MySQL
            {
                command += "LIMIT 1";
            }
            DataTable table = General.GetTable(command);

            //string[] retVal=new string[];
            if (table.Rows.Count == 0)
            {
                return("");
            }
            return(PIn.PString(table.Rows[0][0].ToString()));
        }
Exemple #25
0
        ///<summary>Used when viewing securityLog from the security admin window.  PermTypes can be length 0 to get all types.</summary>
        public static SecurityLog[] Refresh(DateTime dateFrom, DateTime dateTo, Permissions permType, int patNum,
                                            int userNum)
        {
            string command = "SELECT * FROM securitylog "
                             + "WHERE LogDateTime >= " + POut.PDate(dateFrom) + " "
                             + "AND LogDateTime <= " + POut.PDate(dateTo.AddDays(1));

            if (patNum != 0)
            {
                command += " AND PatNum= '" + POut.PInt(patNum) + "'";
            }
            if (permType != Permissions.None)
            {
                command += " AND PermType=" + POut.PInt((int)permType);
            }
            if (userNum != 0)
            {
                command += " AND UserNum=" + POut.PInt(userNum);
            }
            DataTable table = General.GetTable(command);

            SecurityLog[] List = new SecurityLog[table.Rows.Count];
            for (int i = 0; i < List.Length; i++)
            {
                List[i] = new SecurityLog();
                List[i].SecurityLogNum = PIn.PInt(table.Rows[i][0].ToString());
                List[i].PermType       = (Permissions)PIn.PInt(table.Rows[i][1].ToString());
                List[i].UserNum        = PIn.PInt(table.Rows[i][2].ToString());
                List[i].LogDateTime    = PIn.PDateT(table.Rows[i][3].ToString());
                List[i].LogText        = PIn.PString(table.Rows[i][4].ToString());
                List[i].PatNum         = PIn.PInt(table.Rows[i][5].ToString());
            }
            return(List);
        }
Exemple #26
0
        ///<summary>Gets all ProcTPs for a given Patient ordered by ItemOrder.</summary>
        public static ProcTP[] Refresh(int patNum)
        {
            string command = "SELECT * FROM proctp "
                             + "WHERE PatNum=" + POut.PInt(patNum)
                             + " ORDER BY ItemOrder";
            DataTable table = General.GetTable(command);

            ProcTP[] List = new ProcTP[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                List[i]              = new ProcTP();
                List[i].ProcTPNum    = PIn.PInt(table.Rows[i][0].ToString());
                List[i].TreatPlanNum = PIn.PInt(table.Rows[i][1].ToString());
                List[i].PatNum       = PIn.PInt(table.Rows[i][2].ToString());
                List[i].ProcNumOrig  = PIn.PInt(table.Rows[i][3].ToString());
                List[i].ItemOrder    = PIn.PInt(table.Rows[i][4].ToString());
                List[i].Priority     = PIn.PInt(table.Rows[i][5].ToString());
                List[i].ToothNumTP   = PIn.PString(table.Rows[i][6].ToString());
                List[i].Surf         = PIn.PString(table.Rows[i][7].ToString());
                List[i].ADACode      = PIn.PString(table.Rows[i][8].ToString());
                List[i].Descript     = PIn.PString(table.Rows[i][9].ToString());
                List[i].FeeAmt       = PIn.PDouble(table.Rows[i][10].ToString());
                List[i].PriInsAmt    = PIn.PDouble(table.Rows[i][11].ToString());
                List[i].SecInsAmt    = PIn.PDouble(table.Rows[i][12].ToString());
                List[i].PatAmt       = PIn.PDouble(table.Rows[i][13].ToString());
            }
            return(List);
        }
Exemple #27
0
        ///<summary>Gets all recalls for the supplied patients, usually a family or single pat.  Result might have a length of zero.</summary>
        public static Recall[] GetList(int[] patNums)
        {
            string wherePats = "";

            for (int i = 0; i < patNums.Length; i++)
            {
                if (i != 0)
                {
                    wherePats += " OR ";
                }
                wherePats += "PatNum=" + patNums[i].ToString();
            }
            string command =
                "SELECT * from recall "
                + "WHERE " + wherePats;
            DataTable table = General.GetTable(command);

            Recall[] List = new Recall[table.Rows.Count];
            for (int i = 0; i < List.Length; i++)
            {
                List[i]                = new Recall();
                List[i].RecallNum      = PIn.PInt(table.Rows[i][0].ToString());
                List[i].PatNum         = PIn.PInt(table.Rows[i][1].ToString());
                List[i].DateDueCalc    = PIn.PDate(table.Rows[i][2].ToString());
                List[i].DateDue        = PIn.PDate(table.Rows[i][3].ToString());
                List[i].DatePrevious   = PIn.PDate(table.Rows[i][4].ToString());
                List[i].RecallInterval = new Interval(PIn.PInt(table.Rows[i][5].ToString()));
                List[i].RecallStatus   = PIn.PInt(table.Rows[i][6].ToString());
                List[i].Note           = PIn.PString(table.Rows[i][7].ToString());
                List[i].IsDisabled     = PIn.PBool(table.Rows[i][8].ToString());
            }
            return(List);
        }
Exemple #28
0
        ///<summary></summary>
        public static void Refresh()
        {
            string command =
                "SELECT * from account "
                + " ORDER BY AcctType,Description";
            DataTable table = General.GetTable(command);

            listLong = new Account[table.Rows.Count];
            ArrayList AL = new ArrayList();

            for (int i = 0; i < listLong.Length; i++)
            {
                listLong[i]              = new Account();
                listLong[i].AccountNum   = PIn.PInt(table.Rows[i][0].ToString());
                listLong[i].Description  = PIn.PString(table.Rows[i][1].ToString());
                listLong[i].AcctType     = (AccountType)PIn.PInt(table.Rows[i][2].ToString());
                listLong[i].BankNumber   = PIn.PString(table.Rows[i][3].ToString());
                listLong[i].Inactive     = PIn.PBool(table.Rows[i][4].ToString());
                listLong[i].AccountColor = Color.FromArgb(PIn.PInt(table.Rows[i][5].ToString()));
                if (!listLong[i].Inactive)
                {
                    AL.Add(listLong[i].Copy());
                }
            }
            listShort = new Account[AL.Count];
            AL.CopyTo(listShort);
        }
        ///<summary></summary>
        public static TimeAdjust[] Refresh(int empNum, DateTime fromDate, DateTime toDate)
        {
            string command =
                "SELECT * from timeadjust WHERE"
                + " EmployeeNum = '" + POut.PInt(empNum) + "'"
                + " AND TimeEntry >= " + POut.PDate(fromDate)
                //adding a day takes it to midnight of the specified toDate
                + " AND TimeEntry <= " + POut.PDate(toDate.AddDays(1));

            command += " ORDER BY TimeEntry";
            DataTable table = General.GetTable(command);

            TimeAdjust[] List = new TimeAdjust[table.Rows.Count];
            for (int i = 0; i < List.Length; i++)
            {
                List[i] = new TimeAdjust();
                List[i].TimeAdjustNum = PIn.PInt(table.Rows[i][0].ToString());
                List[i].EmployeeNum   = PIn.PInt(table.Rows[i][1].ToString());
                List[i].TimeEntry     = PIn.PDateT(table.Rows[i][2].ToString());
                List[i].RegHours      = TimeSpan.FromHours(PIn.PDouble(table.Rows[i][3].ToString()));
                List[i].OTimeHours    = TimeSpan.FromHours(PIn.PDouble(table.Rows[i][4].ToString()));
                List[i].Note          = PIn.PString(table.Rows[i][5].ToString());
            }
            return(List);
        }
Exemple #30
0
        public static FormPat GetOne(int formPatNum)
        {
            string    command = "SELECT * FROM formpat WHERE FormPatNum=" + POut.PInt(formPatNum);
            DataTable table   = General.GetTable(command);

            if (table.Rows.Count == 0)
            {
                return(null);               //should never happen.
            }
            FormPat form = new FormPat();

            form.FormPatNum   = formPatNum;
            form.PatNum       = PIn.PInt(table.Rows[0][1].ToString());
            form.FormDateTime = PIn.PDateT(table.Rows[0][2].ToString());
            form.QuestionList = new List <Question>();
            command           = "SELECT * FROM question WHERE FormPatNum=" + POut.PInt(formPatNum);
            table             = General.GetTable(command);
            Question quest;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                quest             = new Question();
                quest.QuestionNum = PIn.PInt(table.Rows[i][0].ToString());
                quest.PatNum      = PIn.PInt(table.Rows[i][1].ToString());
                quest.ItemOrder   = PIn.PInt(table.Rows[i][2].ToString());
                quest.Description = PIn.PString(table.Rows[i][3].ToString());
                quest.Answer      = PIn.PString(table.Rows[i][4].ToString());
                quest.FormPatNum  = PIn.PInt(table.Rows[i][5].ToString());
                form.QuestionList.Add(quest);
            }
            return(form);
        }