コード例 #1
0
        /*public static void SetToothNum(Procedure procedure,string toothNum){
         *      Procedure oldProcedure=procedure.Copy();
         *      procedure.ToothNum=toothNum;
         *      Procedures.Update(procedure,oldProcedure);
         * }*/

        public static void SetPriority(Procedure procedure, int priority)
        {
            Procedure oldProcedure = procedure.Copy();

            procedure.Priority = Defs.GetDefsForCategory(DefCat.TxPriorities, true)[priority].DefNum;
            Procedures.Update(procedure, oldProcedure);
        }
コード例 #2
0
        public void PaymentEdit_AutoSplitForPayment_NoNegativeAutoSplits()
        {
            long      provNumA = ProviderT.CreateProvider("provA");
            Patient   pat      = PatientT.CreatePatient(MethodBase.GetCurrentMethod().Name);
            Procedure proc1    = ProcedureT.CreateProcedure(pat, "D0120", ProcStat.C, "", 70);
            Procedure proc2    = ProcedureT.CreateProcedure(pat, "D0150", ProcStat.C, "", 20);
            //make an overpayment for one of the procedures so it spills over.
            DateTime payDate = DateTime.Today;
            Payment  pay     = PaymentT.MakePayment(pat.PatNum, 71, payDate, procNum: proc1.ProcNum); //pre-existing payment
            //attempt to make another payment. Auto splits should not suggest a negative split.
            Payment newPayment = PaymentT.MakePaymentNoSplits(pat.PatNum, 2, payDate, isNew: true,
                                                              payType: Defs.GetDefsForCategory(DefCat.PaymentTypes, true)[0].DefNum);//current payment we're trying to make

            PaymentEdit.LoadData loadData = PaymentEdit.GetLoadData(pat, newPayment, new List <long>()
            {
                pat.PatNum
            }, true, false);
            PaymentEdit.ConstructChargesData chargeData = PaymentEdit.GetConstructChargesData(new List <long> {
                pat.PatNum
            }, pat.PatNum,
                                                                                              PaySplits.GetForPayment(pay.PayNum), pay.PayNum, false);
            PaymentEdit.ConstructResults constructResults = PaymentEdit.ConstructAndLinkChargeCredits(new List <long> {
                pat.PatNum
            }, pat.PatNum
                                                                                                      , chargeData.ListPaySplits, newPayment, new List <Procedure> ());
            PaymentEdit.AutoSplit autoSplits = PaymentEdit.AutoSplitForPayment(constructResults);
            Assert.AreEqual(0, autoSplits.ListAutoSplits.FindAll(x => x.SplitAmt < 0).Count);        //assert no negative auto splits were made.
            Assert.AreEqual(0, autoSplits.ListSplitsCur.FindAll(x => x.SplitAmt < 0).Count);         //auto splits not catching everything
        }
コード例 #3
0
ファイル: ProcedureT.cs プロジェクト: royedwards/DRDNet
        ///<summary>Returns the proc</summary>
        ///<param name="procDate">If not included, will be set to DateTime.Now.</param>
        public static Procedure CreateProcedure(Patient pat, string procCodeStr, ProcStat procStatus, string toothNum, double procFee,
                                                DateTime procDate = default(DateTime), int priority = 0, long plannedAptNum = 0, long provNum = 0)
        {
            Procedure proc = new Procedure();

            proc.CodeNum = ProcedureCodes.GetCodeNum(procCodeStr);
            proc.PatNum  = pat.PatNum;
            if (procDate == default(DateTime))
            {
                proc.ProcDate = DateTime.Today;
            }
            else
            {
                proc.ProcDate = procDate;
            }
            proc.ProcStatus = procStatus;
            proc.ProvNum    = provNum;
            if (provNum == 0)
            {
                proc.ProvNum = pat.PriProv;
            }
            proc.ProcFee       = procFee;
            proc.ToothNum      = toothNum;
            proc.Prosthesis    = "I";
            proc.Priority      = Defs.GetDefsForCategory(DefCat.TxPriorities, true)[priority].DefNum;
            proc.PlannedAptNum = plannedAptNum;
            proc.ClinicNum     = pat.ClinicNum;
            Procedures.Insert(proc);
            return(proc);
        }
コード例 #4
0
        ///<summary>Should run AllFieldsAreValid() first. This is called from the parent form to retrieve the data that the user entered.  Returns an arraylist.  For most fields, the length of the arraylist will be 0 or 1.</summary>
        public ArrayList GetCurrentValues(int item)
        {
            ArrayList retVal = new ArrayList();

            if (multInputItems[item].ValueType == FieldValueType.Boolean)
            {
                if (((CheckBox)inputs[item]).Checked)
                {
                    retVal.Add(true);
                }
            }
            else if (multInputItems[item].ValueType == FieldValueType.Date)
            {
                retVal.Add(PIn.Date(inputs[item].Text));
            }
            else if (multInputItems[item].ValueType == FieldValueType.Def)
            {
                ComboBoxMulti comboBox = (ComboBoxMulti)inputs[item];
                List <Def>    listDefs = Defs.GetDefsForCategory(multInputItems[item].DefCategory, true);
                for (int j = 0; j < comboBox.SelectedIndices.Count; j++)
                {
                    retVal.Add(
                        listDefs[(int)comboBox.SelectedIndices[j]].DefNum);
                }
            }
            else if (multInputItems[item].ValueType == FieldValueType.Enum)
            {
                ComboBoxMulti comboBox = (ComboBoxMulti)inputs[item];
                Type          eType    = Type.GetType("OpenDental." + multInputItems[item].EnumerationType.ToString());
                for (int j = 0; j < comboBox.SelectedIndices.Count; j++)
                {
                    retVal.Add(
                        (int)(Enum.Parse(eType, Enum.GetNames(eType)[(int)comboBox.SelectedIndices[j]])));
                }
            }
            else if (multInputItems[item].ValueType == FieldValueType.Integer)
            {
                retVal.Add(PIn.Long(inputs[item].Text));
            }
            else if (multInputItems[item].ValueType == FieldValueType.Number)
            {
                retVal.Add(PIn.Double(inputs[item].Text));
            }
            else if (multInputItems[item].ValueType == FieldValueType.String)
            {
                if (inputs[item].Text != "")
                {
                    //the text is first stripped of any ?'s
                    retVal.Add(Regex.Replace(inputs[item].Text, @"\?", ""));
                }
            }
            else if (multInputItems[item].ValueType == FieldValueType.YesNoUnknown)
            {
                retVal.Add(((ContrYN)inputs[item]).CurrentValue);
            }
            //MessageBox.Show(multInputItems[1].CurrentValues.Count.ToString());
            return(retVal);
        }
コード例 #5
0
        public void AgingData_GetAgingList_ExcludeNoTruthInLending()
        {
            PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, 50);     //No Signed Truth in Lending
            PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, true, 50);      //Signed Truth in Lending
            List <Def>      listBillTypeDef    = Defs.GetDefsForCategory(DefCat.BillingTypes, true);
            List <long>     listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList();
            List <PatAging> listPatAging       = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, false, false, 0
                                                                       , false, false, new List <long>(), false, false, new List <long>(),
                                                                       new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), true, false, true);

            Assert.AreNotEqual(listPatAging.Count, 0);
            listPatAging.ForEach(x => Assert.IsTrue(x.HasSignedTil));
        }
コード例 #6
0
        public void AgingData_GetAgingList_ExcludeInactiveFamilies()
        {
            PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Inactive, StatementMode.Mail, false, 50);     //Inactive patient
            PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, 50);      //Non-inactive patient
            List <Def>      listBillTypeDef    = Defs.GetDefsForCategory(DefCat.BillingTypes, true);
            List <long>     listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList();
            List <PatAging> listPatAging       = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, false, false, 0
                                                                       , true, false, new List <long>(), false, false, new List <long>(),
                                                                       new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, false, true);

            Assert.AreEqual(listPatAging.Count, 1);
            Assert.IsTrue(listPatAging[0].PatStatus != PatientStatus.Inactive);
        }
コード例 #7
0
        public void AgingData_GetAgingList_ExcludeBadAddress()
        {
            PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, 50);     //Bad Address (no zip code)
            PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, true, PatientStatus.Patient, StatementMode.Mail, false, 50);      //Valid Address
            List <Def>      listBillTypeDef    = Defs.GetDefsForCategory(DefCat.BillingTypes, true);
            List <long>     listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList();
            List <PatAging> listPatAging       = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, true, false, 0
                                                                       , false, false, new List <long>(), false, false, new List <long>(),
                                                                       new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, false, true);

            Assert.AreEqual(listPatAging.Count, 1);
            Assert.IsTrue(listPatAging[0].Zip != "");
        }
コード例 #8
0
ファイル: MiddleTierTests.cs プロジェクト: kjb7749/testImport
        public void MiddleTier_GetProcCodeWithDirtyProperty()
        {
            Def d;

            if (Defs.GetDefsForCategory(DefCat.ProcCodeCats, true).Count == 0)
            {
                d = new Def()
                {
                    Category = DefCat.ProcCodeCats, ItemName = WebServiceTests.DirtyString
                };
                d.DefNum = Defs.Insert(d);
            }
            else
            {
                d          = Defs.GetFirstForCategory(DefCat.ProcCodeCats, true);
                d.ItemName = WebServiceTests.DirtyString;
                Defs.Update(d);
            }
            Defs.RefreshCache();
            d = Defs.GetDef(DefCat.ProcCodeCats, d.DefNum);
            ProcedureCode pc = new ProcedureCode {
                IsNew = true, ProcCat = d.DefNum
            };
            ProcedureCode pc2 = new ProcedureCode {
                IsNew = true
            };
            List <ProcedureCode> listPcs   = new List <ProcedureCode>();
            List <string>        strErrors = new List <string>();

            try {
                listPcs = WebServiceTests.GetProcCodeWithDirtyProperty(pc, pc2);
            }
            catch (Exception ex) {
                strErrors.Add("Cannot serialize a property with a getter that does not retrieve the same value the setter is manipulating.");
                strErrors.Add(ex.Message);
                strErrors.Add(ex.StackTrace);
            }
            if (listPcs.Count > 0 && (listPcs[0].IsNew || listPcs[1].IsNew))
            {
                strErrors.Add(string.Format("One or more of the returned ProcedureCode objects IsNew flag should be {0} but returned {1}.", "false", "true"));
            }
            if (listPcs.Count > 0 && (listPcs[0].ProcCat != d.DefNum || listPcs[1].ProcCat != d.DefNum))
            {
                strErrors.Add("One or more of the ProcedureCode objects returned did not have the correct ProcCat.");
            }
            if (listPcs.Count > 0 && (listPcs[0].ProcCatDescript != d.ItemName || listPcs[1].ProcCatDescript != d.ItemName))
            {
                strErrors.Add("One or more of the ProcedureCode objects returned did not have the correct dirty string.");
            }
            Assert.IsTrue(strErrors.Count == 0);
        }
コード例 #9
0
        public void AgingData_GetAgingList_ExcludeBalLessThan()
        {
            double balMin = 50;

            PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, balMin - 1);  //Less than Balance
            PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, balMin);      //Equal to Balance
            PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, balMin + 1);  //Greater than Balance
            List <Def>      listBillTypeDef    = Defs.GetDefsForCategory(DefCat.BillingTypes, true);
            List <long>     listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList();
            List <PatAging> listPatAging       = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, false, false, balMin, false, false, new List <long>()
                                                                       , false, false, new List <long>(), new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, false, true);

            Assert.AreEqual(listPatAging.Count, 2);
            Assert.IsTrue(listPatAging[0].BalTotal >= balMin);
            Assert.IsTrue(listPatAging[1].BalTotal >= balMin);
        }
コード例 #10
0
        public void AgingData_GetAgingList_FilterAccountsNotBilledSince()
        {
            DateTime dateTimeSinceDate = DateTime.Today;

            //Create dummy Patients with sent dates from today and the last two days
            PatientT.CreatePatWithProcAndStatement(1, dateTimeSinceDate.AddDays(-1), false, PatientStatus.Patient, StatementMode.Mail, false, 50);
            PatientT.CreatePatWithProcAndStatement(1, dateTimeSinceDate, false, PatientStatus.Patient, StatementMode.Mail, false, 50);
            PatientT.CreatePatWithProcAndStatement(1, dateTimeSinceDate.AddDays(1), false, PatientStatus.Patient, StatementMode.Mail, false, 50);
            List <Def>      listBillTypeDef    = Defs.GetDefsForCategory(DefCat.BillingTypes, true);
            List <long>     listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList();
            List <PatAging> listPatAging       = Patients.GetAgingList("", dateTimeSinceDate, listBillTypeDefNum, false, false, 0
                                                                       , false, false, new List <long>(), false, false, new List <long>(),
                                                                       new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, true, true);

            Assert.AreEqual(listPatAging.Count, 2);
            Assert.IsTrue(listPatAging[0].DateLastStatement >= dateTimeSinceDate);
            Assert.IsTrue(listPatAging[1].DateLastStatement >= dateTimeSinceDate);
        }
コード例 #11
0
        public void AgingData_GetAgingList_ExcludeInPersonStatements()
        {
            PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.InPerson, false, 50);  //In Person Statement
            PatientT.CreatePatWithProcAndStatement(1, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, 50);      //Mail Statement
            List <Def>      listBillTypeDef    = Defs.GetDefsForCategory(DefCat.BillingTypes, true);
            List <long>     listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList();
            List <PatAging> listPatAging       = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, false, false, 0
                                                                       , false, false, new List <long>(), false, false, new List <long>(),
                                                                       new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, true, true);

            Assert.AreEqual(listPatAging.Count, 2);
            listPatAging = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, false, false, 0
                                                 , false, true, new List <long>(), false, false, new List <long>(),
                                                 new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, true, true);
            Assert.AreEqual(listPatAging.Count, 1);
            Statement statement = StatementT.GetStatementsForPat(listPatAging[0].PatNum).First();

            Assert.IsTrue(statement.Mode_ != StatementMode.InPerson);
        }
コード例 #12
0
        public void AgingData_GetAgingList_GetAgingListSimple_Compare()
        {
            PatientT.CreatePatWithProcAndStatement(2, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, 50);
            List <Def>  listBillTypeDef    = Defs.GetDefsForCategory(DefCat.BillingTypes, true);
            List <long> listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList();
            //Compare the results of GetAgingList() and GetAgingListSimple() methods (output should be identical)
            List <PatAging> listPatAging = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, false, false, 0, false, false, new List <long>(), false, false
                                                                 , new List <long>(), new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, false, true);
            List <PatAging> listPatAgingSimple = Patients.GetAgingListSimple(listBillTypeDefNum, new List <long> {
            });                                                                                                              //Ordered by PatNum, for thread concurrency

            Assert.IsTrue(listPatAging.Count != 0);
            Assert.IsTrue(listPatAgingSimple.Count != 0);
            Assert.AreEqual(listPatAging.Count, listPatAgingSimple.Count);
            //Ensure both methods return the exact same patients.
            for (int i = 0; i < listPatAging.Count; i++)
            {
                Assert.AreEqual(listPatAging[i].PatNum, listPatAgingSimple[i].PatNum);
            }
        }
コード例 #13
0
ファイル: PaySplitT.cs プロジェクト: ChemBrain/OpenDental
        ///<summary>Use when creating a TP prepayment or a hidden prepayment split (that does not necessariliy need to have a proc) </summary>
        public static PaySplit CreateTpPrepayment(long patNum, int amt, DateTime datePay, long provNum = 0, long clinicNum = 0, long procNum = 0, bool isHidden = false)
        {
            Def      unearnedType = Defs.GetDefsForCategory(DefCat.PaySplitUnearnedType).First(x => isHidden?x.ItemValue != "":x.ItemValue == "");
            Def      payType      = Defs.GetDefByExactName(DefCat.PaymentTypes, "Check") ?? DefT.CreateDefinition(DefCat.PaymentTypes, "Check");
            Payment  pay          = PaymentT.MakePaymentNoSplits(patNum, amt, datePay, clinicNum: clinicNum, payType: payType.DefNum);
            PaySplit split        = new PaySplit();

            split.PayNum       = pay.PayNum;
            split.PatNum       = pay.PatNum;
            split.DatePay      = datePay;
            split.ClinicNum    = pay.ClinicNum;
            split.PayPlanNum   = 0;
            split.ProvNum      = provNum;
            split.ProcNum      = procNum;
            split.SplitAmt     = amt;
            split.DateEntry    = datePay;
            split.UnearnedType = unearnedType.DefNum;
            PaySplits.Insert(split);
            return(split);
        }
コード例 #14
0
        ///<summary>This method calculates the given engineer statistics in the engineer's data view.</summary>
        private void FillEngineerMetrics(long UserNum)
        {
            //list of write code jobs for a specific user
            List <Job> listJobs = _listJobsAll.Where(x => x.OwnerAction == JobAction.WriteCode).Where(x => x.UserNumEngineer == UserNum).ToList();

            labeltotDev.Content       = listJobs.Sum(x => x.HoursEstimate).ToString();
            labelLongEst.Content      = listJobs.Max(x => x.HoursEstimate).ToString();
            labelNoEst.Content        = listJobs.Count(x => x.HoursEstimate == 0).ToString();
            labelRewiewReq.Content    = listJobs.Sum(x => x.ListJobReviews.Count()).ToString();
            labelPriorityJobs.Content = listJobs.Count(x => x.Priority == Defs.GetDefsForCategory(DefCat.JobPriorities, true).FirstOrDefault(y => y.ItemValue.Contains("High")).DefNum).ToString();
            labelQuoteTotal.Content   = listJobs.Sum(x => x.ListJobQuotes.Sum(y => PIn.Double(y.Amount))).ToString("C");
            //all jobs for a given user
            List <Job> listAllJobsForUser = _listJobsAll.Where(x => x.UserNumEngineer == UserNum).ToList();

            labelConceptJobs.Content = listJobs.Count(x => x.PhaseCur == JobPhase.Concept).ToString();
            labelWriteupJobs.Content = listJobs.Count(x => x.OwnerAction == JobAction.WriteConcept || x.OwnerAction == JobAction.WriteJob).ToString();
            labelDevJobs.Content     = listJobs.Count(x => x.PhaseCur == JobPhase.Development).ToString();
            labelAdvisorJobs.Content = listJobs.Count(x => x.OwnerAction == JobAction.Advise).ToString();
            labelJobsOnHold.Content  = listJobs.Count(x => x.Priority == Defs.GetDefsForCategory(DefCat.JobPriorities, true).FirstOrDefault(y => y.ItemValue.Contains("OnHold")).DefNum).ToString();
        }
コード例 #15
0
ファイル: PaymentT.cs プロジェクト: ChemBrain/OpenDental
        public static Payment MakePaymentForPrepayment(Patient pat, Clinic clinic)
        {
            Payment paymentCur = new Payment();

            paymentCur.PayDate   = DateTime.Today;
            paymentCur.PatNum    = pat.PatNum;
            paymentCur.ClinicNum = clinic.ClinicNum;
            paymentCur.DateEntry = DateTime.Today;
            List <Def> listDefs = Defs.GetDefsForCategory(DefCat.PaymentTypes, true);

            if (listDefs.Count > 0)
            {
                paymentCur.PayType = listDefs[0].DefNum;
            }
            paymentCur.PaymentSource = CreditCardSource.None;
            paymentCur.ProcessStatus = ProcessStat.OfficeProcessed;
            paymentCur.PayAmt        = 0;
            Payments.Insert(paymentCur);
            return(paymentCur);
        }
コード例 #16
0
        public void AgingData_GetAgingList_ExcludeInsPending()
        {
            PatientT.CreatePatWithProcAndStatement(2, DateTime.Today, false, PatientStatus.Patient, StatementMode.Mail, false, 50);
            SerializableDictionary <long, PatAgingData> dictPatAgingData = AgingData.GetAgingData(false, true, true, false, false, new List <long>());

            dictPatAgingData.ToList()[0].Value.HasPendingIns = true;          //Set the first Aging Patient to have pending insurance
            List <long> listPendingInsPatNums = new List <long>();

            foreach (KeyValuePair <long, PatAgingData> kvp in dictPatAgingData)           //Grab the patnum since GetAgingList() requires a list of patnums
            {
                if (kvp.Value.HasPendingIns)
                {
                    listPendingInsPatNums.Add(kvp.Key);
                }
            }
            List <Def>      listBillTypeDef    = Defs.GetDefsForCategory(DefCat.BillingTypes, true);
            List <long>     listBillTypeDefNum = listBillTypeDef.Select(x => x.DefNum).ToList();
            List <PatAging> listPatAging       = Patients.GetAgingList("", DateTime.Today, listBillTypeDefNum, false, false, 0
                                                                       , true, false, new List <long>(), false, false, listPendingInsPatNums,
                                                                       new List <long>(), new SerializableDictionary <long, List <PatAgingTransaction> >(), false, false, true);

            Assert.AreEqual(listPatAging.Count, 1);
            Assert.IsTrue(listPatAging[0].HasInsPending == false);
        }
コード例 #17
0
ファイル: TigerView.cs プロジェクト: kjb7749/testImport
 private static void ProcessFile(string fullPath)
 {
     if(PrefC.AtoZfolderUsed==DataStorageType.InDatabase) {
         MsgBox.Show("TigerView","TigerView is not currently supported when storing images in the database.");
         return;
     }
     if(CloudStorage.IsCloudStorage) {
         MsgBox.Show("TigerView","TigerView is not currently supported when storing images in the cloud.");
         return;
     }
     string filename=Path.GetFileName(fullPath);
     //Get the patNum/chartNum from filename.  Example: tmb123.20091119.XXXXXX.tig where X is identifier
     string[] splitFileName=filename.Split(new char[] { '.' });
     if(splitFileName.Length!=4) { //Not correct format
         return;
     }
     string identifier=splitFileName[2]; //Third quadrant
     bool useChartNum=false;
     for(int i=0;i<identifier.Length;i++) { //Check to see if the identifer has anything but numbers, if so it has to be a chartnum or invalid
         if(!Char.IsNumber(identifier,i)) {
             useChartNum=true;
             break;
         }
     }
     if(!useChartNum) { //If it could be a valid patnum, check program pref
         List<ProgramProperty> propertiesForProgram =ProgramProperties.GetForProgram(Programs.GetProgramNum(ProgramName.TigerView));
         ProgramProperty programProperty=ProgramProperties.GetCur(propertiesForProgram,"Enter 0 to use PatientNum, or 1 to use ChartNum");
         if(programProperty.PropertyValue=="1") {//ChartNum
             useChartNum=true;
         }
     }
     Patient patCur;
     if(!useChartNum) {//Use PatNum
         patCur=Patients.GetPat(PIn.Long(identifier));
     }
     else {//Use ChartNum
         patCur=Patients.GetPatByChartNumber(identifier);
     }
     if(patCur==null) { //Could not find a patient with given PatNum/ChartNum
         return;
     }
     long imageCatDefNum=0;
     List<Def> listImageCatDefs=Defs.GetDefsForCategory(DefCat.ImageCats);
     for(int j=0;j<listImageCatDefs.Count;j++) { //Look for an image category with the name "Xray"
         if(listImageCatDefs[j].ItemName.ToLower()=="xray") {
             imageCatDefNum=listImageCatDefs[j].DefNum;
         }
     }
     if(imageCatDefNum==0) { //If no "Xray" category exists, insert new category with the name "Xray"
         Def def = new Def();
         def.ItemName="Xray";
         def.Category=DefCat.ImageCats;
         def.ItemValue="X"; //Will make this category show in the chart module
         def.ItemOrder=listImageCatDefs.Count;
         imageCatDefNum=Defs.Insert(def);
         Cache.Refresh(InvalidType.Defs);
     }
     string newFileName="TV_"+filename.Substring(0,filename.IndexOf('.')+1)+CodeBase.MiscUtils.CreateRandomAlphaNumericString(4);
     newFileName=newFileName.Replace('.','_'); //Get rid of any periods in the file name.
     newFileName+=".tig"; //Add extention on to file name after other '.' were replaced.
     string newpath=CodeBase.ODFileUtils.CombinePaths(ImageStore.GetPatientFolder(patCur,ImageStore.GetPreferredAtoZpath()),newFileName);
     Document docCur = new Document();
     docCur.DocCategory=imageCatDefNum;
     docCur.FileName=newFileName;
     docCur.PatNum=patCur.PatNum;
     docCur.ImgType=ImageType.Photo;
     docCur.DateCreated=DateTime.Now;
     docCur.Description=newFileName;
     System.IO.File.Move(fullPath,newpath);
     Documents.Insert(docCur,patCur);
 }
コード例 #18
0
        ///<summary>This is the load method for the class. It initializes the engineer tiles by creating a model and binding it to the ItemsControl template in the xaml code.</summary>
        public JobManagerDashboardTiles()
        {
            InitializeComponent();
            //labelActiveJobs.Foreground=
            Signalods.SubscribeSignalProcessor(this);
            GridToolbar.Visibility     = Visibility.Hidden;
            EngSpecificInfo.Visibility = Visibility.Collapsed;
            Jobs.FillInMemoryLists(_listJobsAll);
            _engInfoList.Add(
                new EngInformation {
                EngName        = "Total Unfinished Quote Jobs: " + JobQuotes.GetUnfinishedJobQuotes().Count,
                EngClockStatus = "Total Unfinished Quote: $" + JobQuotes.GetUnfinishedJobQuotes().Sum(x => PIn.Double(x.Amount)),
                EngWorkStatus  = "Total Unfinished Jobs: " + _listJobsAll.Where(x => x.PhaseCur != JobPhase.Complete && x.Priority != Defs.GetDefsForCategory(DefCat.JobPriorities, true).FirstOrDefault(y => y.ItemValue.Contains("OnHold")).DefNum).ToList().Count,
                StatField1     = "Total Jobs being worked on: " + _listJobsAll.Where(x => x.OwnerAction == JobAction.WriteCode).ToList().Count
            });
            //list of jobs in WriteCode status
            List <Job> listWriteCodeJobs = _listJobsAll.Where(x => x.OwnerAction == JobAction.WriteCode && x.Priority != Defs.GetDefsForCategory(DefCat.JobPriorities, true).FirstOrDefault(y => y.ItemValue.Contains("OnHold")).DefNum).ToList();

            foreach (Userod user in Userods.GetUsersByJobRole(JobPerm.Engineer, false))
            {
                if (!_listActualEngineers.Contains(user.UserName))
                {
                    continue;
                }
                List <TextBlock> jobTitles = new List <TextBlock>();
                //get only write code jobs
                List <string> listEngJobs = listWriteCodeJobs.Where(x => x.UserNumEngineer == user.UserNum).Select(x => x.Title).ToList();
                foreach (string j in listEngJobs)
                {
                    //TODO: Template this in xaml and pass in the object for the template to autogen, save for after initial working commit.
                    TextBlock tb = new TextBlock();
                    tb.Text         = j;
                    tb.TextWrapping = TextWrapping.WrapWithOverflow;
                    jobTitles.Add(tb);
                }
                string needsWork = "";
                int    devHours  = 0;          //listWriteCodeJobs.Where(x => x.UserNumEngineer==user.UserNum).Sum(x => x.MinutesEstimate);
                if (devHours < 20)
                {
                    needsWork = "Needs Work";
                }
                else
                {
                    needsWork = "~" + devHours.ToString() + " Dev Hours";
                }
                _engInfoList.Add(new EngInformation {
                    EngName        = user.UserName,
                    EngClockStatus = ClockEvents.GetLastEvent(user.EmployeeNum).ClockStatus.ToString(),
                    EngWorkStatus  = needsWork,
                    EngJobs        = jobTitles
                });
            }
            EngTiles.ItemsSource = _engInfoList;
        }
コード例 #19
0
ファイル: ContrChartP.cs プロジェクト: royedwards/DRDNet
        public static void FillPtInfo(OpenDental.ContrChart sender, Patient PatCur)
        {
            //first, get all the objects we need. Because they are by ref, the original gets altered.
            ODGrid     gridPtInfo         = (ODGrid)sender.Controls.Find("gridPtInfo", true)[0];
            TabControl tabControlImages   = (TabControl)sender.Controls.Find("tabControlImages", true)[0];
            ODtextBox  textTreatmentNotes = (ODtextBox)sender.Controls.Find("textTreatmentNotes", true)[0];
            //bool TreatmentNoteChanged=sender.TreatmentNoteChanged;//might have to do a by ref here?
            //Then get some data that we need
            Family         fam            = null;
            PatientNote    PatientNoteCur = null;
            List <PatPlan> PatPlanList    = null;
            List <InsSub>  SubList        = null;
            List <InsPlan> PlanList       = null;

            if (PatCur != null)
            {
                fam            = Patients.GetFamily(PatCur.PatNum);
                PatientNoteCur = PatientNotes.Refresh(PatCur.PatNum, PatCur.Guarantor);
                PatPlanList    = PatPlans.Refresh(PatCur.PatNum);
                SubList        = InsSubs.RefreshForFam(fam);
                PlanList       = InsPlans.RefreshForSubList(SubList);
            }
            //Then, continue with the slightly altered original method.
            gridPtInfo.Height       = tabControlImages.Top - gridPtInfo.Top;
            textTreatmentNotes.Text = "";
            if (PatCur != null)
            {
                textTreatmentNotes.Text    = PatientNoteCur.Treatment;
                textTreatmentNotes.Enabled = true;
                textTreatmentNotes.Select(textTreatmentNotes.Text.Length + 2, 1);
                textTreatmentNotes.ScrollToCaret();
                sender.TreatmentNoteChanged = false;
            }
            gridPtInfo.BeginUpdate();
            gridPtInfo.Columns.Clear();
            ODGridColumn col = new ODGridColumn("", 100);         //Lan.g("TableChartPtInfo",""),);

            gridPtInfo.Columns.Add(col);
            col = new ODGridColumn("", 300);
            gridPtInfo.Columns.Add(col);
            gridPtInfo.Rows.Clear();
            if (PatCur == null)
            {
                gridPtInfo.EndUpdate();
                return;
            }
            ODGridRow row;

            //Age
            row = new ODGridRow();
            row.Cells.Add("Age");
            row.Cells.Add(PatientLogic.DateToAgeString(PatCur.Birthdate));
            row.Tag = null;
            gridPtInfo.Rows.Add(row);
            //Credit type
            row = new ODGridRow();
            row.Cells.Add(Lan.g("TableChartPtInfo", "ABC0"));
            row.Cells.Add(PatCur.CreditType);
            row.Tag = null;
            gridPtInfo.Rows.Add(row);
            //Billing type
            row = new ODGridRow();
            row.Cells.Add(Lan.g("TableChartPtInfo", "Billing Type"));
            row.Cells.Add(Defs.GetName(DefCat.BillingTypes, PatCur.BillingType));
            row.Tag = null;
            gridPtInfo.Rows.Add(row);
            //Referrals
            List <RefAttach> RefAttachList = RefAttaches.Refresh(PatCur.PatNum);

            for (int i = 0; i < RefAttachList.Count; i++)
            {
                row            = new ODGridRow();
                row.ColorBackG = Color.Aquamarine;
                if (RefAttachList[i].RefType == ReferralType.RefFrom)
                {
                    row.Cells.Add("Referred From");
                }
                else
                {
                    row.Cells.Add("Referred To");
                }
                row.Cells.Add(Referrals.GetNameLF(RefAttachList[i].ReferralNum));
                row.Tag = null;
                gridPtInfo.Rows.Add(row);
            }
            //Date First Visit
            row = new ODGridRow();
            row.Cells.Add(Lan.g("TableChartPtInfo", "Date First Visit"));
            if (PatCur.DateFirstVisit.Year < 1880)
            {
                row.Cells.Add("??");
            }
            else if (PatCur.DateFirstVisit == DateTime.Today)
            {
                row.Cells.Add(Lan.g("TableChartPtInfo", "NEW PAT"));
            }
            else
            {
                row.Cells.Add(PatCur.DateFirstVisit.ToShortDateString());
            }
            row.Tag = null;
            gridPtInfo.Rows.Add(row);
            //Prov - Pri & Sec
            row = new ODGridRow();
            row.Cells.Add(Lan.g("TableChartPtInfo", "Prov. (Pri, Sec)"));
            if (PatCur.SecProv != 0)
            {
                row.Cells.Add(Providers.GetAbbr(PatCur.PriProv) + ", " + Providers.GetAbbr(PatCur.SecProv));
            }
            else
            {
                row.Cells.Add(Providers.GetAbbr(PatCur.PriProv) + ", " + "None");
            }
            row.Tag = null;
            gridPtInfo.Rows.Add(row);
            //PriIns
            row = new ODGridRow();
            row.Cells.Add(Lan.g("TableChartPtInfo", "Pri Ins"));
            string name;

            if (PatPlanList.Count > 0)
            {
                name = InsPlans.GetCarrierName(InsSubs.GetOne(PatPlanList[0].InsSubNum).PlanNum, PlanList);
                if (PatPlanList[0].IsPending)
                {
                    name += Lan.g("TableChartPtInfo", " (pending)");
                }
                row.Cells.Add(name);
            }
            else
            {
                row.Cells.Add("");
            }
            row.Tag = null;
            gridPtInfo.Rows.Add(row);
            //SecIns
            row = new ODGridRow();
            row.Cells.Add(Lan.g("TableChartPtInfo", "Sec Ins"));
            if (PatPlanList.Count > 1)
            {
                name = InsPlans.GetCarrierName(InsSubs.GetOne(PatPlanList[1].InsSubNum).PlanNum, PlanList);
                if (PatPlanList[1].IsPending)
                {
                    name += Lan.g("TableChartPtInfo", " (pending)");
                }
                row.Cells.Add(name);
            }
            else
            {
                row.Cells.Add("");
            }
            row.Tag = null;
            gridPtInfo.Rows.Add(row);
            //Registration keys-------------------------------------------------------------------------------------------
            if (PrefC.GetBool(PrefName.DistributorKey))
            {
                RegistrationKey[] keys = RegistrationKeys.GetForPatient(PatCur.PatNum);
                for (int i = 0; i < keys.Length; i++)
                {
                    row = new ODGridRow();
                    row.Cells.Add(Lan.g("TableChartPtInfo", "Registration Key"));
                    string str = keys[i].RegKey.Substring(0, 4) + "-" + keys[i].RegKey.Substring(4, 4) + "-" +
                                 keys[i].RegKey.Substring(8, 4) + "-" + keys[i].RegKey.Substring(12, 4);
                    if (keys[i].IsForeign)
                    {
                        str += "\r\nForeign";
                    }
                    else
                    {
                        str += "\r\nUSA";
                    }
                    str += "\r\nStarted: " + keys[i].DateStarted.ToShortDateString();
                    if (keys[i].DateDisabled.Year > 1880)
                    {
                        str += "\r\nDisabled: " + keys[i].DateDisabled.ToShortDateString();
                    }
                    if (keys[i].DateEnded.Year > 1880)
                    {
                        str += "\r\nEnded: " + keys[i].DateEnded.ToShortDateString();
                    }
                    if (keys[i].Note != "")
                    {
                        str += keys[i].Note;
                    }
                    row.Cells.Add(str);
                    row.Tag = keys[i].Copy();
                    gridPtInfo.Rows.Add(row);
                }
            }
            ODGridCell cell;
            //medical fields-----------------------------------------------------------------
            bool showMed = true;

            if (Programs.IsEnabled(ProgramName.eClinicalWorks) && ProgramProperties.GetPropVal(ProgramName.eClinicalWorks, "IsStandalone") == "0")
            {
                showMed = false;
            }
            if (showMed)
            {
                //Get the Chart Module Medical color from the MiscColors category.
                Color colorChartModuleMedical = Defs.GetDefsForCategory(DefCat.MiscColors)[3].ItemColor;
                //premed flag.
                if (PatCur.Premed)
                {
                    row = new ODGridRow();
                    row.Cells.Add("");
                    cell           = new ODGridCell();
                    cell.Text      = Lan.g("TableChartPtInfo", "Premedicate");
                    cell.ColorText = Color.Red;
                    cell.Bold      = YN.Yes;
                    row.Cells.Add(cell);
                    row.ColorBackG = colorChartModuleMedical;
                    row.Tag        = "med";
                    gridPtInfo.Rows.Add(row);
                }
                //diseases
                List <Disease> DiseaseList = Diseases.Refresh(PatCur.PatNum);
                row       = new ODGridRow();
                cell      = new ODGridCell(Lan.g("TableChartPtInfo", "Diseases"));
                cell.Bold = YN.Yes;
                row.Cells.Add(cell);
                if (DiseaseList.Count > 0)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(Lan.g("TableChartPtInfo", "none"));
                }
                row.ColorBackG = colorChartModuleMedical;
                row.Tag        = "med";
                gridPtInfo.Rows.Add(row);
                for (int i = 0; i < DiseaseList.Count; i++)
                {
                    row            = new ODGridRow();
                    cell           = new ODGridCell(DiseaseDefs.GetName(DiseaseList[i].DiseaseDefNum));
                    cell.ColorText = Color.Red;
                    cell.Bold      = YN.Yes;
                    row.Cells.Add(cell);
                    row.Cells.Add(DiseaseList[i].PatNote);
                    row.ColorBackG = colorChartModuleMedical;
                    row.Tag        = "med";
                    gridPtInfo.Rows.Add(row);
                }
                //MedUrgNote
                row = new ODGridRow();
                row.Cells.Add(Lan.g("TableChartPtInfo", "Med Urgent"));
                cell           = new ODGridCell();
                cell.Text      = PatCur.MedUrgNote;
                cell.ColorText = Color.Red;
                cell.Bold      = YN.Yes;
                row.Cells.Add(cell);
                row.ColorBackG = colorChartModuleMedical;
                row.Tag        = "med";
                gridPtInfo.Rows.Add(row);
                //Medical
                row = new ODGridRow();
                row.Cells.Add(Lan.g("TableChartPtInfo", "Medical Summary"));
                row.Cells.Add(PatientNoteCur.Medical);
                row.ColorBackG = colorChartModuleMedical;
                row.Tag        = "med";
                gridPtInfo.Rows.Add(row);
                //Service
                row = new ODGridRow();
                row.Cells.Add(Lan.g("TableChartPtInfo", "Service Notes"));
                row.Cells.Add(PatientNoteCur.Service);
                row.ColorBackG = colorChartModuleMedical;
                row.Tag        = "med";
                gridPtInfo.Rows.Add(row);
                //medications
                Medications.RefreshCache();
                List <MedicationPat> medList = MedicationPats.Refresh(PatCur.PatNum, false);
                row       = new ODGridRow();
                cell      = new ODGridCell(Lan.g("TableChartPtInfo", "Medications"));
                cell.Bold = YN.Yes;
                row.Cells.Add(cell);
                if (medList.Count > 0)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(Lan.g("TableChartPtInfo", "none"));
                }
                row.ColorBackG = colorChartModuleMedical;
                row.Tag        = "med";
                gridPtInfo.Rows.Add(row);
                string     text;
                Medication med;
                for (int i = 0; i < medList.Count; i++)
                {
                    row  = new ODGridRow();
                    med  = Medications.GetMedication(medList[i].MedicationNum);
                    text = med.MedName;
                    if (med.MedicationNum != med.GenericNum)
                    {
                        text += "(" + Medications.GetMedication(med.GenericNum).MedName + ")";
                    }
                    row.Cells.Add(text);
                    text = medList[i].PatNote
                           + "(" + Medications.GetGeneric(medList[i].MedicationNum).Notes + ")";
                    row.Cells.Add(text);
                    row.ColorBackG = colorChartModuleMedical;
                    row.Tag        = "med";
                    gridPtInfo.Rows.Add(row);
                }
            }            //if !eCW.enabled
            gridPtInfo.EndUpdate();
        }
コード例 #20
0
        /// <summary>Returns the required height.</summary>
        private int ArrangeControls(Graphics g)
        {
            //calculate width of input section
            int inputW = 300;          //the widest allowed for the input section on the right.

            if (IsQuestionnaire)
            {
                inputW = 450;
            }
            if (panelSlide.Width < 600)
            {
                inputW = panelSlide.Width / 2;
            }
            int promptW = panelSlide.Width - inputW;

            panelSlide.Controls.Clear();
            int yPos  = 5;
            int itemH = 0;          //item height

            labels = new Label[multInputItems.Count];
            inputs = new Control[multInputItems.Count];
            for (int i = 0; i < multInputItems.Count; i++)
            {
                //Calculate height
                itemH = (int)g.MeasureString(((MultInputItem)multInputItems[i]).PromptingText, Font, promptW).Height;
                if (itemH < 20)
                {
                    itemH = 20;
                }
                //promptingText
                labels[i]          = new Label();
                labels[i].Location = new Point(2, yPos);
                //labels[i].Name="Label"+i.ToString();
                labels[i].Size      = new Size(promptW - 5, itemH);
                labels[i].Text      = multInputItems[i].PromptingText;
                labels[i].TextAlign = ContentAlignment.MiddleRight;
                //labels[i].BorderStyle=BorderStyle.FixedSingle;//just used in debugging layout
                panelSlide.Controls.Add(labels[i]);
                if (multInputItems[i].ValueType == FieldValueType.Boolean)
                {
                    //add a checkbox
                    inputs[i]          = new CheckBox();
                    inputs[i].Location = new Point(promptW, yPos + (itemH - 20) / 2);
                    inputs[i].Size     = new Size(inputW - 5, 20);
                    if (multInputItems[i].CurrentValues.Count == 0)
                    {
                        ((CheckBox)inputs[i]).Checked = false;
                    }
                    else
                    {
                        ((CheckBox)inputs[i]).Checked = true;
                    }
                    ((CheckBox)inputs[i]).FlatStyle = FlatStyle.System;
                    panelSlide.Controls.Add(inputs[i]);
                }
                else if (multInputItems[i].ValueType == FieldValueType.Date)
                {
                    //add a validDate box
                    inputs[i]          = new ValidDate();
                    inputs[i].Location = new Point(promptW, yPos + (itemH - 20) / 2);
                    if (inputW < 100)                  //not enough room for a fullsize box
                    {
                        inputs[i].Size = new Size(inputW - 20, 20);
                    }
                    else
                    {
                        inputs[i].Size = new Size(75, 20);
                    }
                    ;
                    if (multInputItems[i].CurrentValues.Count > 0)
                    {
                        DateTime myDate = (DateTime)multInputItems[i].CurrentValues[0];
                        inputs[i].Text = myDate.ToShortDateString();
                    }
                    panelSlide.Controls.Add(inputs[i]);
                }
                else if (multInputItems[i].ValueType == FieldValueType.Def)
                {
                    //add a psuedo combobox filled with visible defs for one category
                    inputs[i] = new ComboBoxMulti();
                    List <Def> listDefs = Defs.GetDefsForCategory(multInputItems[i].DefCategory, true);
                    for (int j = 0; j < listDefs.Count; j++)
                    {
                        ((ComboBoxMulti)inputs[i]).Items.Add(listDefs[j].ItemName);
                        if (multInputItems[i].CurrentValues.Count > 0 &&
                            multInputItems[i].CurrentValues
                            .Contains(listDefs[j].DefNum))
                        {
                            ((ComboBoxMulti)inputs[i]).SetSelected(j, true);
                        }
                    }
                    inputs[i].Location = new Point(promptW, yPos + (itemH - 20) / 2);
                    inputs[i].Size     = new Size(inputW - 5, 20);
                    panelSlide.Controls.Add(inputs[i]);
                }
                else if (multInputItems[i].ValueType == FieldValueType.Enum)
                {
                    //add a psuedo combobox filled with values for one enumeration
                    inputs[i] = new ComboBoxMulti();
                    Type eType = Type.GetType("OpenDental." + multInputItems[i].EnumerationType.ToString());
                    for (int j = 0; j < Enum.GetNames(eType).Length; j++)
                    {
                        ((ComboBoxMulti)inputs[i]).Items.Add(Enum.GetNames(eType)[j]);
                        if (multInputItems[i].CurrentValues.Count > 0 &&
                            multInputItems[i].CurrentValues.Contains((int)(Enum.Parse(eType, Enum.GetNames(eType)[j]))))
                        {
                            ((ComboBoxMulti)inputs[i]).SetSelected(j, true);
                        }
                    }
                    inputs[i].Location = new Point(promptW, yPos + (itemH - 20) / 2);
                    inputs[i].Size     = new Size(inputW - 5, 20);
                    panelSlide.Controls.Add(inputs[i]);
                }
                else if (multInputItems[i].ValueType == FieldValueType.ForeignKey)
                {
                    //add a psuedo combobox filled with values from one table
                    inputs[i] = new ComboBoxMulti();
                    //these two arrays are matched item for item
                    string[] foreignRows = GetFRows(multInputItems[i].FKType);
                    long[]   foreignKeys = GetFKeys(multInputItems[i].FKType);
                    for (int j = 0; j < foreignRows.Length; j++)
                    {
                        ((ComboBoxMulti)inputs[i]).Items.Add(foreignRows[j]);
                        if (multInputItems[i].CurrentValues.Count > 0 &&
                            multInputItems[i].CurrentValues.Contains(foreignKeys[j]))
                        {
                            ((ComboBoxMulti)inputs[i]).SetSelected(j, true);
                        }
                    }
                    inputs[i].Location = new Point(promptW, yPos + (itemH - 20) / 2);
                    inputs[i].Size     = new Size(inputW - 5, 20);
                    panelSlide.Controls.Add(inputs[i]);
                }
                else if (multInputItems[i].ValueType == FieldValueType.Integer)
                {
                    //add a validNumber box
                    inputs[i]          = new ValidNumber();
                    inputs[i].Location = new Point(promptW, yPos + (itemH - 20) / 2);
                    if (inputW < 100)                  //not enough room for a fullsize box
                    {
                        inputs[i].Size = new Size(inputW - 20, 20);
                    }
                    else
                    {
                        inputs[i].Size = new Size(75, 20);
                    }
                    if (multInputItems[i].CurrentValues.Count > 0)
                    {
                        inputs[i].Text = ((int)multInputItems[i].CurrentValues[0]).ToString();
                    }
                    panelSlide.Controls.Add(inputs[i]);
                }
                else if (multInputItems[i].ValueType == FieldValueType.Number)
                {
                    //add a validDouble box
                    inputs[i]          = new ValidDouble();
                    inputs[i].Location = new Point(promptW, yPos + (itemH - 20) / 2);
                    if (inputW < 100)                  //not enough room for a fullsize box
                    {
                        inputs[i].Size = new Size(inputW - 20, 20);
                    }
                    else
                    {
                        inputs[i].Size = new Size(75, 20);
                    }
                    if (multInputItems[i].CurrentValues.Count > 0)
                    {
                        inputs[i].Text = ((double)multInputItems[i].CurrentValues[0]).ToString("n");
                    }
                    panelSlide.Controls.Add(inputs[i]);
                }
                else if (multInputItems[i].ValueType == FieldValueType.String)
                {
                    //add a textbox
                    inputs[i]          = new TextBox();
                    inputs[i].Location = new Point(promptW, yPos + (itemH - 20) / 2);
                    //inputs[i].Name=
                    inputs[i].Size = new Size(inputW - 5, 20);
                    if (multInputItems[i].CurrentValues.Count > 0)
                    {
                        inputs[i].Text = multInputItems[i].CurrentValues[0].ToString();
                    }
                    panelSlide.Controls.Add(inputs[i]);
                }
                else if (multInputItems[i].ValueType == FieldValueType.YesNoUnknown)
                {
                    //add two checkboxes: Yes(1) and No(2).
                    inputs[i] = new ContrYN();
                    if (multInputItems[i].CurrentValues.Count > 0)
                    {
                        ((ContrYN)inputs[i]).CurrentValue = (YN)multInputItems[i].CurrentValues[0];
                    }
                    inputs[i].Location = new Point(promptW, yPos + (itemH - 20) / 2);
                    inputs[i].Size     = new Size(inputW - 5, 20);
                    panelSlide.Controls.Add(inputs[i]);
                }
                yPos += itemH + 5;
                if (yPos > panelMain.Height && !vScrollBar2.Visible)
                {
                    return(yPos);                   //There's not enough room, so stop and make the scrollbar visible.
                }
            }
            panelSlide.Height       = yPos;
            vScrollBar2.Maximum     = panelSlide.Height;
            vScrollBar2.Minimum     = 0;
            vScrollBar2.LargeChange = panelMain.Height;
            vScrollBar2.SmallChange = 5;
            return(-1);
        }