コード例 #1
0
ファイル: ProcedureCodes.cs プロジェクト: royedwards/DRDNet
        ///<summary>Resets the descriptions for all ADA codes to the official wording.  Required by the license.</summary>
        public static int ResetADAdescriptions(List <ProcedureCode> codeList)
        {
            //No need to check RemotingRole; no call to db.
            ProcedureCode code;
            int           count = 0;

            for (int i = 0; i < codeList.Count; i++)
            {
                if (!ProcedureCodes.IsValidCode(codeList[i].ProcCode))                 //If this code is not in this database
                {
                    continue;
                }
                code = ProcedureCodes.GetProcCode(codeList[i].ProcCode);
                if (code.Descript == codeList[i].Descript)
                {
                    continue;
                }
                string   oldDescript  = code.Descript;
                DateTime datePrevious = code.DateTStamp;
                code.Descript = codeList[i].Descript;
                ProcedureCodes.Update(code);
                SecurityLogs.MakeLogEntry(Permissions.ProcCodeEdit, 0, "Code " + code.ProcCode + " changed from '" + oldDescript + "' to '" + code.Descript + "' by D-Codes Tool."
                                          , code.CodeNum, datePrevious);
                count++;
            }
            return(count);
            //don't forget to refresh procedurecodes.
        }
コード例 #2
0
        ///<summary>schedI is the currently displayed index of the fee schedule to save to.  If an amt of -1 is passed in, then it indicates a "blank" entry which will cause deletion of any existing fee.</summary>
        public static void Import(string codeText, double amt, long feeSchedNum)
        {
            //No need to check RemotingRole; no call to db.
            if (!ProcedureCodes.IsValidCode(codeText))
            {
                return;                //skip for now. Possibly insert a code in a future version.
            }
            long feeNum = GetFeeNum(ProcedureCodes.GetCodeNum(codeText), feeSchedNum);

            if (feeNum > 0)
            {
                Delete(feeNum);
            }
            if (amt == -1)
            {
                //RefreshCache();
                return;
            }
            Fee fee = new Fee();

            fee.Amount   = amt;
            fee.FeeSched = feeSchedNum;
            fee.CodeNum  = ProcedureCodes.GetCodeNum(codeText);
            Insert(fee);
            //RefreshCache();//moved this outside the loop
        }
コード例 #3
0
ファイル: Fees.cs プロジェクト: kjb7749/testImport
        ///<summary>This method will remove and/or add a fee for the fee information passed in.
        ///codeText will typically be one valid procedure code.  E.g. D1240
        ///If an amt of -1 is passed in, then it indicates a "blank" entry which will cause deletion of any existing fee.
        ///Returns listFees back after importing the passed in fee information.
        ///Does not make any database calls.  This is left up to the user to take action on the list of fees returned.
        ///Also, makes security log entries based on how the fee changed.  Does not make a log for codes that were removed (user already warned)</summary>
        public static List <Fee> Import(string codeText, double amt, long feeSchedNum, long clinicNum, long provNum, List <Fee> listFees)
        {
            //No need to check RemotingRole; no call to db.
            if (!ProcedureCodes.IsValidCode(codeText))
            {
                return(listFees);               //skip for now. Possibly insert a code in a future version.
            }
            string   feeOldStr    = "";
            long     codeNum      = ProcedureCodes.GetCodeNum(codeText);
            Fee      fee          = listFees.FirstOrDefault(x => x.CodeNum == codeNum && x.FeeSched == feeSchedNum && x.ClinicNum == clinicNum && x.ProvNum == provNum);
            DateTime datePrevious = DateTime.MinValue;

            if (fee != null)
            {
                feeOldStr    = Lans.g("FormFeeSchedTools", "Old Fee") + ": " + fee.Amount.ToString("c") + ", ";
                datePrevious = fee.SecDateTEdit;
                listFees.Remove(fee);
            }
            if (amt == -1)
            {
                return(listFees);
            }
            fee           = new Fee();
            fee.Amount    = amt;
            fee.FeeSched  = feeSchedNum;
            fee.CodeNum   = ProcedureCodes.GetCodeNum(codeText);
            fee.ClinicNum = clinicNum;    //Either 0 because you're importing on an HQ schedule or local clinic because the feesched is localizable.
            fee.ProvNum   = provNum;
            listFees.Add(fee);            //Insert new fee specific to the active clinic.
            SecurityLogs.MakeLogEntry(Permissions.ProcFeeEdit, 0, Lans.g("FormFeeSchedTools", "Procedure") + ": " + codeText + ", " + feeOldStr
                                      + Lans.g("FormFeeSchedTools", "New Fee") + ": " + amt.ToString("c") + ", "
                                      + Lans.g("FormFeeSchedTools", "Fee Schedule") + ": " + FeeScheds.GetDescription(feeSchedNum) + ". "
                                      + Lans.g("FormFeeSchedTools", "Fee changed using the Import button in the Fee Tools window."), ProcedureCodes.GetCodeNum(codeText),
                                      DateTime.MinValue);
            SecurityLogs.MakeLogEntry(Permissions.LogFeeEdit, 0, "Fee changed", fee.FeeNum, datePrevious);
            return(listFees);
        }
コード例 #4
0
ファイル: ProcedureCodes.cs プロジェクト: nampn/ODental
        ///<summary>Resets the descriptions for all ADA codes to the official wording.  Required by the license.</summary>
        public static int ResetADAdescriptions(List <ProcedureCode> codeList)
        {
            //No need to check RemotingRole; no call to db.
            ProcedureCode code;
            int           count = 0;

            for (int i = 0; i < codeList.Count; i++)
            {
                if (!ProcedureCodes.IsValidCode(codeList[i].ProcCode))                 //If this code is not in this database
                {
                    continue;
                }
                code = ProcedureCodes.GetProcCode(codeList[i].ProcCode);
                if (code.Descript == codeList[i].Descript)
                {
                    continue;
                }
                code.Descript = codeList[i].Descript;
                ProcedureCodes.Update(code);
                count++;
            }
            return(count);
            //don't forget to refresh procedurecodes.
        }
コード例 #5
0
ファイル: Fees.cs プロジェクト: ChemBrain/OpenDental
        ///<summary>Gets all possible fees associated with the various objects passed in.  Gets fees from db based on code and fee schedule combos.  Includes all provider overrides.  Includes default/no clinic as well as any specified clinic overrides. Although the list always includes extra fees from scheds that we don't need, it's still a very small list.  That list is then used repeatedly by other code in loops to find the actual individual fee amounts.</summary>
        public static List <Fee> GetListFromObjects(List <ProcedureCode> listProcedureCodes, List <string> listMedicalCodes, List <long> listProvNumsTreat, long patPriProv,
                                                    long patSecProv, long patFeeSched, List <InsPlan> listInsPlans, List <long> listClinicNums, List <Appointment> listAppts,
                                                    List <SubstitutionLink> listSubstLinks, long discountPlan
                                                    //listCodeNums,listProvNumsTreat,listProcCodesProvNumDefault,patPriProv,patSecProv,patFeeSched,listInsPlans,listClinicNums
                                                    //List<long> listProcCodesProvNumDefault
                                                    )
        {
            //listMedicalCodes: it already automatically gets the medical codes from procCodes.  This is just for procs. If no procs yet, it will be null.
            //listMedicalCodes can be done by: listProcedures.Select(x=>x.MedicalCode).ToList();  //this is just the strings
            //One way to get listProvNumsTreat is listProcedures.Select(x=>x.ProvNum).ToList()
            //One way to specify a single provNum in listProvNumsTreat is new List<long>(){provNum}
            //One way to get clinicNums is listProcedures.Select(x=>x.ClinicNum).ToList()
            //Another way to get clinicNums is new List<long>(){clinicNum}.
            //These objects will be cleaned up, so they can have duplicates, zeros, invalid keys, nulls, etc
            //In some cases, we need to pass in a list of appointments to make sure we've included all possible providers, both ProvNum and ProvHyg
            //In that case, it's common to leave listProvNumsTreat null because we clearly do not have any of those providers set yet.
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <Fee> >(MethodBase.GetCurrentMethod(), listProcedureCodes, listMedicalCodes, listProvNumsTreat, patPriProv,
                                                    patSecProv, patFeeSched, listInsPlans, listClinicNums, listAppts, listSubstLinks, discountPlan));
            }
            if (listProcedureCodes == null)
            {
                return(new List <Fee>());
            }
            List <long> listCodeNumsOut = new List <long>();

            foreach (ProcedureCode procedureCode in listProcedureCodes)
            {
                if (procedureCode == null)
                {
                    continue;
                }
                if (!listCodeNumsOut.Contains(procedureCode.CodeNum))
                {
                    listCodeNumsOut.Add(procedureCode.CodeNum);
                }
                if (ProcedureCodes.IsValidCode(procedureCode.MedicalCode))
                {
                    long codeNumMed = ProcedureCodes.GetCodeNum(procedureCode.MedicalCode);
                    if (!listCodeNumsOut.Contains(codeNumMed))
                    {
                        listCodeNumsOut.Add(codeNumMed);
                    }
                }
                if (ProcedureCodes.IsValidCode(procedureCode.SubstitutionCode))
                {
                    long codeNumSub = ProcedureCodes.GetCodeNum(procedureCode.SubstitutionCode);
                    if (!listCodeNumsOut.Contains(codeNumSub))
                    {
                        listCodeNumsOut.Add(codeNumSub);
                    }
                }
            }
            if (listMedicalCodes != null)
            {
                foreach (string strMedCode in listMedicalCodes)
                {
                    if (ProcedureCodes.IsValidCode(strMedCode))
                    {
                        long codeNumMed = ProcedureCodes.GetCodeNum(strMedCode);
                        if (!listCodeNumsOut.Contains(codeNumMed))
                        {
                            listCodeNumsOut.Add(codeNumMed);
                        }
                    }
                }
            }
            if (listSubstLinks != null)
            {
                foreach (SubstitutionLink substitutionLink in listSubstLinks)                //Grab all subst codes, since we don't know which ones we will need.
                {
                    if (ProcedureCodes.IsValidCode(substitutionLink.SubstitutionCode))
                    {
                        long codeNum = ProcedureCodes.GetCodeNum(substitutionLink.SubstitutionCode);
                        if (!listCodeNumsOut.Contains(codeNum))
                        {
                            listCodeNumsOut.Add(codeNum);
                        }
                    }
                }
            }
            //Fee schedules. Will potentially include many.=======================================================================================
            List <long> listFeeScheds = new List <long>();
            //Add feesched for first provider (See Claims.CalculateAndUpdate)---------------------------------------------------------------------
            Provider provFirst = Providers.GetFirst();

            if (provFirst != null && provFirst.FeeSched != 0 && !listFeeScheds.Contains(provFirst.FeeSched))
            {
                listFeeScheds.Add(provFirst.FeeSched);
            }
            //Add feesched for PracticeDefaultProv------------------------------------------------------------------------------------------------
            Provider provPracticeDefault = Providers.GetProv(PrefC.GetLong(PrefName.PracticeDefaultProv));

            if (provPracticeDefault != null && provPracticeDefault.FeeSched != 0 && !listFeeScheds.Contains(provPracticeDefault.FeeSched))
            {
                listFeeScheds.Add(provPracticeDefault.FeeSched);
            }
            //Add feescheds for all treating providers---------------------------------------------------------------------------------------------
            if (listProvNumsTreat != null)
            {
                foreach (long provNumTreat in listProvNumsTreat)
                {
                    Provider provTreat = Providers.GetProv(provNumTreat);
                    if (provTreat != null && provTreat.FeeSched != 0 && !listFeeScheds.Contains(provTreat.FeeSched))
                    {
                        listFeeScheds.Add(provTreat.FeeSched);                        //treating provs fee scheds
                    }
                }
            }
            //Add feescheds for the patient's primary and secondary providers----------------------------------------------------------------------
            Provider providerPatPri = Providers.GetProv(patPriProv);

            if (providerPatPri != null && providerPatPri.FeeSched != 0 && !listFeeScheds.Contains(providerPatPri.FeeSched))
            {
                listFeeScheds.Add(providerPatPri.FeeSched);
            }
            Provider providerPatSec = Providers.GetProv(patSecProv);

            if (providerPatSec != null && providerPatSec.FeeSched != 0 && !listFeeScheds.Contains(providerPatSec.FeeSched))
            {
                listFeeScheds.Add(providerPatSec.FeeSched);
            }
            //Add feescheds for all procedurecode.ProvNumDefaults---------------------------------------------------------------------------------
            foreach (ProcedureCode procedureCode in listProcedureCodes)
            {
                if (procedureCode == null)
                {
                    continue;
                }
                long provNumDefault = procedureCode.ProvNumDefault;
                if (provNumDefault == 0)
                {
                    continue;
                }
                Provider provDefault = Providers.GetProv(provNumDefault);
                if (provDefault != null && provDefault.FeeSched != 0 && !listFeeScheds.Contains(provDefault.FeeSched))
                {
                    listFeeScheds.Add(provDefault.FeeSched);
                }
            }
            //Add feescheds for appointment providers---------------------------------------------------------------------------------------------
            if (listAppts != null)
            {
                foreach (Appointment appointment in listAppts)
                {
                    Provider provAppt = Providers.GetProv(appointment.ProvNum);
                    if (provAppt != null && provAppt.FeeSched != 0 && !listFeeScheds.Contains(provAppt.FeeSched))
                    {
                        listFeeScheds.Add(provAppt.FeeSched);
                    }
                    Provider provApptHyg = Providers.GetProv(appointment.ProvHyg);
                    if (provApptHyg != null && provApptHyg.FeeSched != 0 && !listFeeScheds.Contains(provApptHyg.FeeSched))
                    {
                        listFeeScheds.Add(provApptHyg.FeeSched);
                    }
                }
            }
            //Add feesched for patient.  Rare. --------------------------------------------------------------------------------------------------
            if (patFeeSched != 0)
            {
                if (!listFeeScheds.Contains(patFeeSched))
                {
                    listFeeScheds.Add(patFeeSched);
                }
            }
            //Add feesched for each insplan, both reg and allowed--------------------------------------------------------------------------------
            if (listInsPlans != null)
            {
                foreach (InsPlan insPlan in listInsPlans)
                {
                    if (insPlan.FeeSched != 0 && !listFeeScheds.Contains(insPlan.FeeSched))
                    {
                        listFeeScheds.Add(insPlan.FeeSched);                        //insplan feeSched
                    }
                    if (insPlan.AllowedFeeSched != 0 && !listFeeScheds.Contains(insPlan.AllowedFeeSched))
                    {
                        listFeeScheds.Add(insPlan.AllowedFeeSched);                        //allowed feeSched
                    }
                    if (insPlan.CopayFeeSched != 0 && !listFeeScheds.Contains(insPlan.CopayFeeSched))
                    {
                        listFeeScheds.Add(insPlan.CopayFeeSched);                        //copay feeSched
                    }
                }
            }
            if (discountPlan != 0)
            {
                long discountPlanFeeSched = DiscountPlans.GetPlan(discountPlan).FeeSchedNum;
                if (!listFeeScheds.Contains(discountPlanFeeSched))
                {
                    listFeeScheds.Add(discountPlanFeeSched);
                }
            }
            //ClinicNums========================================================================================================================
            List <long> listClinicNumsOut = new List <long>();        //usually empty or one entry

            if (listClinicNums != null)
            {
                foreach (long clinicNum in listClinicNums)
                {
                    if (clinicNum != 0 && !listClinicNumsOut.Contains(clinicNum))
                    {
                        listClinicNumsOut.Add(clinicNum);                        //proc ClinicNums
                    }
                }
            }
            if (listFeeScheds.Count == 0 || listProcedureCodes.Count == 0)
            {
                return(new List <Fee>());
            }
            string command = "SELECT * FROM fee WHERE (";

            for (int i = 0; i < listFeeScheds.Count; i++)
            {
                if (i > 0)
                {
                    command += " OR ";
                }
                command += "FeeSched=" + POut.Long(listFeeScheds[i]);
            }
            command += ") AND (";
            for (int i = 0; i < listCodeNumsOut.Count; i++)
            {
                if (i > 0)
                {
                    command += " OR ";
                }
                command += "CodeNum=" + POut.Long(listCodeNumsOut[i]);
            }
            command += ") AND (ClinicNum=0";
            for (int i = 0; i < listClinicNumsOut.Count; i++)
            {
                command += " OR ClinicNum=" + POut.Long(listClinicNumsOut[i]);
            }
            command += ")";
            return(Crud.FeeCrud.SelectMany(command));
        }
コード例 #6
0
ファイル: ProcedureCodes.cs プロジェクト: nampn/ODental
        public static void ResetApptProcsQuickAdd()
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod());
                return;
            }
            string command = "DELETE FROM definition WHERE Category=3";

            Db.NonQ(command);
            string[] array = new string[] {
                "CompEx-4BW-Pano-Pro-Flo", "D0150,D0274,D0330,D1110,D1204",
                "CompEx-2BW-Pano-ChPro-Flo", "D0150,D0272,D0330,D1120,D1203",
                "PerEx-4BW-Pro-Flo", "D0120,D0274,D1110,D1204",
                "LimEx-PA", "D0140,D0220",
                "PerEx-4BW-Pro-Flo", "D0120,D0274,D1110,D1204",
                "PerEx-2BW-ChildPro-Flo", "D0120,D0272,D1120,D1203",
                "Comp Exam", "D0150",
                "Per Exam", "D0120",
                "Lim Exam", "D0140",
                "1 PA", "D0220",
                "2BW", "D0272",
                "4BW", "D0274",
                "Pano", "D0330",
                "Pro Adult", "D1110",
                "Fluor Adult", "D1204",
                "Pro Child", "D1120",
                "Fuor Child", "D1203",
                "PostOp", "N4101",
                "DentAdj", "N4102",
                "Consult", "D9310"
            };
            Def def;

            string[] codelist;
            bool     allvalid;
            int      itemorder = 0;

            for (int i = 0; i < array.Length; i += 2)
            {
                //first, test all procedures for valid
                codelist = array[i + 1].Split(',');
                allvalid = true;
                for (int c = 0; c < codelist.Length; c++)
                {
                    if (!ProcedureCodes.IsValidCode(codelist[c]))
                    {
                        allvalid = false;
                    }
                }
                if (!allvalid)
                {
                    continue;
                }
                def           = new Def();
                def.Category  = DefCat.ApptProcsQuickAdd;
                def.ItemOrder = itemorder;
                def.ItemName  = array[i];
                def.ItemValue = array[i + 1];
                Defs.Insert(def);
                itemorder++;
            }
        }
コード例 #7
0
        ///<summary>Replaces ImportCanadaFeeSchedule.  Imports a canadian fee schedule. Called only in FormFeeSchedTools, located here to allow unit testing.
        ///Fires FeeSchedEvents for a progress bar.</summary>
        public static List <Fee> ImportCanadaFeeSchedule2(FeeSched feeSched, string feeData, long clinicNum, long provNum, out int numImported, out int numSkipped)
        {
            //No need to check RemotingRole; no call to db.
            string[] feeLines = feeData.Split('\n');
            numImported = 0;
            numSkipped  = 0;
            List <Fee> listFees         = Fees.GetListExact(feeSched.FeeSchedNum, clinicNum, provNum);
            List <Fee> listFeesImported = new List <Fee>(listFees);

            for (int i = 0; i < feeLines.Length; i++)
            {
                string[] fields = feeLines[i].Split('\t');
                if (fields.Length > 1)               // && fields[1]!=""){//we no longer skip blank fees
                {
                    string procCode = fields[0];
                    if (ProcedureCodes.IsValidCode(procCode))
                    {
                        long codeNum = ProcedureCodes.GetCodeNum(procCode);
                        Fee  fee     = Fees.GetFee(codeNum, feeSched.FeeSchedNum, clinicNum, provNum, listFees); //gets best match
                        if (fields[1] == "")                                                                     //an empty entry will delete an existing fee, but not insert a blank override
                        {
                            if (fee == null)                                                                     //nothing to do

                            {
                            }
                            else
                            {
                                //doesn't matter if the existing fee is an override or not.
                                Fees.Delete(fee);
                                listFeesImported.Remove(fee);
                            }
                        }
                        else                          //value found in text file
                        {
                            if (fee == null)          //no current fee
                            {
                                fee           = new Fee();
                                fee.Amount    = PIn.Double(fields[1], doUseEnUSFormat: true);                          //The fees are always in the format "1.00" so we need to parse accordingly.
                                fee.FeeSched  = feeSched.FeeSchedNum;
                                fee.CodeNum   = codeNum;
                                fee.ClinicNum = clinicNum;
                                fee.ProvNum   = provNum;
                                Fees.Insert(fee);
                                listFeesImported.Add(fee);
                            }
                            else
                            {
                                fee.Amount = PIn.Double(fields[1], doUseEnUSFormat: true);
                                Fees.Update(fee);
                            }
                        }
                        numImported++;
                    }
                    else
                    {
                        numSkipped++;
                    }
                    FeeSchedEvent.Fire(ODEventType.FeeSched,
                                       new ProgressBarHelper(Lans.g("FeeScheds", "Processing fees, please wait") + "...", "", (numImported + numSkipped), feeLines.Length,
                                                             ProgBarStyle.Continuous));
                }
            }
            return(listFeesImported);
        }
コード例 #8
0
        public EB271(X12Segment segment, bool isInNetwork, bool isCoinsuranceInverted, X12Segment segHsd = null)
        {
            if (eb01 == null)
            {
                FillDictionaries();
            }
            Segment = segment;
            SupplementalSegments = new List <X12Segment>();
            //start pattern matching to generate closest Benefit
            EB01          eb01val  = eb01.Find(EB01MatchesCode);
            EB02          eb02val  = eb02.Find(EB02MatchesCode);
            EB03          eb03val  = eb03.Find(EB03MatchesCode);
            EB06          eb06val  = eb06.Find(EB06MatchesCode);
            EB09          eb09val  = eb09.Find(EB09MatchesCode);
            ProcedureCode proccode = null;

            if (ProcedureCodes.IsValidCode(Segment.Get(13, 2)))
            {
                proccode = ProcedureCodes.GetProcCode(Segment.Get(13, 2));
            }
            if (!eb01val.IsSupported ||
                (eb02val != null && !eb02val.IsSupported) ||
                (eb03val != null && !eb03val.IsSupported) ||
                (eb06val != null && !eb06val.IsSupported) ||
                (eb09val != null && !eb09val.IsSupported))
            {
                Benefitt = null;
                return;
            }
            if (eb01val.BenefitType == InsBenefitType.ActiveCoverage && Segment.Get(3) == "30")
            {
                Benefitt = null;
                return;
            }
            if (eb01val.BenefitType == InsBenefitType.ActiveCoverage && proccode != null)
            {
                //A code is covered.  Informational only.
                Benefitt = null;
                return;
            }
            if (Segment.Get(8) != "")           //if percentage
            //must have either a category or a proc code
            {
                if (proccode == null)                                                                                                       //if no proc code is specified
                {
                    if (eb03val == null || eb03val.ServiceType == EbenefitCategory.None || eb03val.ServiceType == EbenefitCategory.General) //and no category specified
                    {
                        Benefitt = null;
                        return;
                    }
                }
            }
            //coinsurance amounts are handled with fee schedules rather than benefits
            if (eb01val.BenefitType == InsBenefitType.CoPayment || eb01val.BenefitType == InsBenefitType.CoInsurance)
            {
                if (Segment.Get(7) != "")               //and a monetary amount specified
                {
                    Benefitt = null;
                    return;
                }
            }
            //a limitation without an amount is meaningless
            if (eb01val.BenefitType == InsBenefitType.Limitations &&
                segHsd == null)                 //Some benefits do not have monetary value but limit service in a time period.  Originally done for customer 27936.
            {
                if (Segment.Get(7) == "")       //no monetary amount specified
                {
                    Benefitt = null;
                    return;
                }
            }
            if (isInNetwork && (Segment.Get(12) == "N" || Segment.Get(12) == "U"))
            {
                Benefitt = null;
                return;
            }
            if (!isInNetwork && Segment.Get(12) == "Y")
            {
                Benefitt = null;
                return;
            }
            //if only a quantity is specified with no qualifier, it's meaningless
            if (Segment.Get(10) != "" && eb09val == null)
            {
                Benefitt = null;
                return;
            }
            //if only a qualifier is specified with no quantity, it's meaningless
            if (eb09val != null && Segment.Get(10) == "")
            {
                Benefitt = null;
                return;
            }
            Benefitt = new Benefit();
            //1
            Benefitt.BenefitType = eb01val.BenefitType;
            //2
            if (eb02val != null)
            {
                Benefitt.CoverageLevel = eb02val.CoverageLevel;
            }
            //3
            if (eb03val != null)
            {
                Benefitt.CovCatNum = CovCats.GetForEbenCat(eb03val.ServiceType).CovCatNum;
            }
            //4-Insurance type - we ignore.
            //5-Plan description - we ignore.
            //6
            if (eb06val != null)
            {
                Benefitt.TimePeriod = eb06val.TimePeriod;
            }
            //7
            if (Segment.Get(7) != "")
            {
                Benefitt.MonetaryAmt = PIn.Double(Segment.Get(7));              //Monetary amount. Situational
            }
            //8
            if (Segment.Get(8) != "")
            {
                if (isCoinsuranceInverted && Benefitt.BenefitType == InsBenefitType.CoInsurance) //Some carriers incorrectly send insurance percentage.
                {
                    Benefitt.Percent = (int)(PIn.Double(Segment.Get(8)) * 100);                  //Percent. Came to us inverted, do Not Invert.
                }
                else
                {
                    //OD shows the percentage paid by Insurance by default.
                    //Some carriers submit 271s to us showing percentage paid by Patient, so we need to invert this case to match OD expectations.
                    Benefitt.Percent = 100 - (int)(PIn.Double(Segment.Get(8)) * 100);              //Percent. Invert.
                }
                Benefitt.CoverageLevel = BenefitCoverageLevel.None;
            }
            //9-Quantity qualifier
            if (eb09val != null)
            {
                Benefitt.QuantityQualifier = eb09val.QuantityQualifier;
            }
            //10-Quantity
            if (Segment.Get(10) != "")
            {
                Benefitt.Quantity = (byte)PIn.Double(Segment.Get(10));              //Example: "19.0" with Quantity qualifier "S7" (age).
            }
            //11-Authorization. Ignored.
            //12-In network. Ignored.
            //13-proc
            if (proccode != null)
            {
                Benefitt.CodeNum = proccode.CodeNum;              //element 13,2
            }
            if (Benefitt.BenefitType == InsBenefitType.Limitations &&
                proccode != null &&               //Valid ADA code.
                segHsd != null)
            {
                if (segHsd.Elements.Length < 6 || segHsd.Elements[2] == "" || segHsd.Elements[5] == "")
                {
                    Benefitt = null;
                    return;
                }
                Benefitt.Quantity   = PIn.Byte(segHsd.Elements[2]);                                      //HSD02: Quantity.
                Benefitt.TimePeriod = eb06.FirstOrDefault(x => x.Code == segHsd.Elements[5]).TimePeriod; //HSD05: Frequency.
            }
        }
コード例 #9
0
ファイル: EB271.cs プロジェクト: steev90/opendental
        public EB271(X12Segment segment, bool isInNetwork)
        {
            if (eb01 == null)
            {
                FillDictionaries();
            }
            Segment = segment;
            SupplementalSegments = new List <X12Segment>();
            //start pattern matching to generate closest Benefit
            EB01          eb01val  = eb01.Find(EB01MatchesCode);
            EB02          eb02val  = eb02.Find(EB02MatchesCode);
            EB03          eb03val  = eb03.Find(EB03MatchesCode);
            EB06          eb06val  = eb06.Find(EB06MatchesCode);
            EB09          eb09val  = eb09.Find(EB09MatchesCode);
            ProcedureCode proccode = null;

            if (ProcedureCodes.IsValidCode(Segment.Get(13, 2)))
            {
                proccode = ProcedureCodes.GetProcCode(Segment.Get(13, 2));
            }
            if (!eb01val.IsSupported ||
                (eb02val != null && !eb02val.IsSupported) ||
                (eb03val != null && !eb03val.IsSupported) ||
                (eb06val != null && !eb06val.IsSupported) ||
                (eb09val != null && !eb09val.IsSupported))
            {
                Benefitt = null;
                return;
            }
            if (eb01val.BenefitType == InsBenefitType.ActiveCoverage && Segment.Get(3) == "30")
            {
                Benefitt = null;
                return;
            }
            if (eb01val.BenefitType == InsBenefitType.ActiveCoverage && proccode != null)
            {
                //A code is covered.  Informational only.
                Benefitt = null;
                return;
            }
            if (Segment.Get(8) != "")           //if percentage
            //must have either a category or a proc code
            {
                if (proccode == null)                                                                                                       //if no proc code is specified
                {
                    if (eb03val == null || eb03val.ServiceType == EbenefitCategory.None || eb03val.ServiceType == EbenefitCategory.General) //and no category specified
                    {
                        Benefitt = null;
                        return;
                    }
                }
            }
            //coinsurance amounts are handled with fee schedules rather than benefits
            if (eb01val.BenefitType == InsBenefitType.CoPayment || eb01val.BenefitType == InsBenefitType.CoInsurance)
            {
                if (Segment.Get(7) != "")               //and a monetary amount specified
                {
                    Benefitt = null;
                    return;
                }
            }
            //a limitation without an amount is meaningless
            if (eb01val.BenefitType == InsBenefitType.Limitations)
            {
                if (Segment.Get(7) == "")               //no monetary amount specified
                {
                    Benefitt = null;
                    return;
                }
            }
            if (isInNetwork && Segment.Get(12) == "N")
            {
                Benefitt = null;
                return;
            }
            if (!isInNetwork && Segment.Get(12) == "Y")
            {
                Benefitt = null;
                return;
            }
            //if only a quantity is specified with no qualifier, it's meaningless
            if (Segment.Get(10) != "" && eb09val == null)
            {
                Benefitt = null;
                return;
            }
            //if only a qualifier is specified with no quantity, it's meaningless
            if (eb09val != null && Segment.Get(10) == "")
            {
                Benefitt = null;
                return;
            }
            Benefitt = new Benefit();
            //1
            Benefitt.BenefitType = eb01val.BenefitType;
            //2
            if (eb02val != null)
            {
                Benefitt.CoverageLevel = eb02val.CoverageLevel;
            }
            //3
            if (eb03val != null)
            {
                Benefitt.CovCatNum = CovCats.GetForEbenCat(eb03val.ServiceType).CovCatNum;
            }
            //4-Insurance type - we ignore.
            //5-Plan description - we ignore.
            //6
            if (eb06val != null)
            {
                Benefitt.TimePeriod = eb06val.TimePeriod;
            }
            //7
            if (Segment.Get(7) != "")
            {
                Benefitt.MonetaryAmt = PIn.Double(Segment.Get(7));              //Monetary amount. Situational
            }
            //8
            if (Segment.Get(8) != "")
            {
                Benefitt.Percent       = 100 - (int)(PIn.Double(Segment.Get(8)) * 100);    //Percent. Situational
                Benefitt.CoverageLevel = BenefitCoverageLevel.None;
            }
            //9-Quantity qualifier
            if (eb09val != null)
            {
                Benefitt.QuantityQualifier = eb09val.QuantityQualifier;
            }
            //10-Quantity
            if (Segment.Get(10) != "")
            {
                Benefitt.Quantity = (byte)PIn.Double(Segment.Get(10));              //Example: "19.0" with Quantity qualifier "S7" (age).
            }
            //11-Authorization. Ignored.
            //12-In network. Ignored.
            //13-proc
            if (proccode != null)
            {
                Benefitt.CodeNum = proccode.CodeNum;              //element 13,2
            }
        }
コード例 #10
0
ファイル: ProcButtons.cs プロジェクト: steev90/opendental
        /*//<summary>Used when a button is moved out of a category.  This leaves a 'hole' in the order, so we need to clean up the orders.  Remember to run Refresh before this.</summary>
         * public static void ResetOrder(int cat){
         *
         * }*/

        ///<summary>Deletes all current ProcButtons from the Chart module, and then adds the default ProcButtons.  Procedure codes must have already been entered or they cannot be added as a ProcButton.</summary>
        public static void SetToDefault()
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod());
                return;
            }
            string command = "DELETE FROM procbutton";

            Db.NonQ(command);
            command = "DELETE FROM procbuttonitem";
            Db.NonQ(command);
            command = "DELETE FROM definition WHERE Category=26";
            Db.NonQ(command);
            long category;            //defNum
            long procButtonNum;
            long autoCodeNum;
            long autoCodeNum2;

            //Db---------------------------------------------------------------------------------------------------------
            command = "INSERT INTO definition (Category,ItemOrder,ItemName,ItemValue,ItemColor,IsHidden) "
                      + "VALUES (26,0,'General','',0,0)";
            category = Db.NonQ(command, true);
            //Amalgam
            autoCodeNum = AutoCodes.GetNumFromDescript("Amalgam");
            if (autoCodeNum != 0)
            {
                command = "INSERT INTO procbutton (Description,ItemOrder,Category,ButtonImage) VALUES('Amalgam',0,"
                          + POut.Long(category) + @",'Qk12BgAAAAAAADYAAAAoAAAAFAAAABQAAAABACAAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAA/////////////////////9bW1v+ctbX/vebv/8XW1v+tvbX/hKWt/36crf9+nKX/nLW1/97v7//m9/f/pdbe/5y9vf/3////////////////////////////////////ztbO/5y1rf+cxcX/hKWt/5S1vf+cvcX/nMXO/5S9zv+Mrb3/jK2t/629vf+cxc7/nL29//f///////////////////////////////////+9zs7/fpSM/5S1vf+cxc7/tdbe/87m5v/O5u//1u/v/8Xe5v+lxdb/jK21/4Slrf+cvbX/9////////////////////////////////////7XW1v+ErbX/rc7W/8Xm5v/F3ub/3u/v/9739//W7+//zubv/87m7/+11t7/jK21/5y9vf/////////////////////////////////39/f/nLW9/5zFzv/O5ub/3vf3/8Xe5v/m////7////+/////O5u//zu/v/9739/+11tb/lLW1/+/39////////////////////////////9bW5v9NXb3/VWbv/8XW9//v////vdbm/+b3///v////9////73e3v+UtbX/5vf3/7XF9/9ufr3/zt7m////////////////////////////xcXv/xws3v8THO//bn73/87e5v+MrbX/xd7m/+/////v////rc7W/4ylpf/e7///PU33/xwk5v+1ve////////////////////////////+1ve//HCze/xwk7/80Pe//doy9/5y9vf/O5ub/9/////f///+1ztb/nLW1/4yc9/8cJOb/EyTv/4SU7////////////////////////////5yl7/8kLOb/HCzv/xwk7/80Rc7/foze/5Sl7/+crff/nK33/36U5v9dbsX/PUXv/xwk5v8cJOb/XW7m///////////////////////m9/f/foTv/yQs5v8cLO//HCzm/xws7/8kLOb/JCzm/yQs5v8kLOb/JCzm/xws5v8cJOb/HCzm/xwk7/9FVdb/9////////////////////+/39/9dbt7/HCTm/xws5v8cLOb/HCzm/xws5v8cLOb/HCzm/xws5v8cLOb/HCzm/xws5v8cLOb/HCTv/0VVzv/3/////////////////////////1Vm1v8cJO//HCzm/xws5v8cJOb/HCTv/xwk5v8cJOb/HCTm/xwk5v8cJO//HCTm/xws5v8cJO//RVXO//f39//////////////////3////RVXO/xwk7/8cLOb/HCTm/yw05v8sNOb/ND3v/zQ97/80Pe//ND3v/yw05v8kLO//HCTm/xwk7/9FVc7/9/f3//////////////////f///9FVc7/HCTv/xwk5v8sNOb/jJzm/3aErf+1xff/xdb3/8XW//+ElL3/nLXe/4yc9/8kLOb/HCTv/0VVzv/39/f/////////////////9////0VVzv8THO//ND3v/7XF9//O5ub/lK2l/87e1v/3////9////5y1rf/W7+//9////4yU9/8cJO//RVXW//f/////////////////////////boTF/1Vm7//Fzv//9////97v9/+1ztb/xdbW//f////m9/f/rcXO/+b39//3////7////5Sl7/9NXbX/9/f3//////////////////////+91tb/nL3F//f////v////5vf3/87m5v/e7/f/7////+b39//W7+//7////+/////v////tc7O/629vf////////////////////////////////+lxcX/pcXF/+/////3////1u/v/9739//3////3u/3/97v9//3////7////7XO1v+lvcX/9/////////////////////////////////////f39/+lvcX/nL3F/+b39//3////7////+/////m////7////97v7/+txcX/pb3F//f39/////////////////////////////////////////////f39/+txcX/lLW1/629vf/O3t7/3vf3/8Xe3v+lxcX/jKWc/7XFxf/39/f//////////////////////w==')";
                procButtonNum = Db.NonQ(command, true);
                command       = "INSERT INTO procbuttonitem (ProcButtonNum,CodeNum,AutoCodeNum) VALUES (" + POut.Long(procButtonNum) + ",0,"
                                + POut.Long(autoCodeNum) + ")";
                Db.NonQ(command);
            }
            //Composite
            autoCodeNum = AutoCodes.GetNumFromDescript("Composite");
            if (autoCodeNum != 0)
            {
                command = "INSERT INTO procbutton (Description,ItemOrder,Category,ButtonImage) VALUES('Composite',1,"
                          + POut.Long(category) + @",'Qk12BgAAAAAAADYAAAAoAAAAFAAAABQAAAABACAAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAA///////////e5v//RU3m/yQ05v8kNOb/JDTm/xwk7/8cJO//JCzm/36UnP9+lJT/fpSc/3aUlP9+lIz/xc7O/////////////////////////////////3Z+9/8kLOb/Znbv/3aE7/+ElO//fpTv/zQ97/8kLOb/rcXm/73e3v+11t7/tdbe/5zFzv+EpaX/1t7e////////////////////////////LDTv/11u5v/e7/f/5vf//+/////3////pbX//yQs7//e7///7////+b39//e7/f/zubv/5S1vf+tvbX///////////////////////////80Pff/XW7m/+b////3////7/////f///+1xf//JCzv/+b3///3////7////+b39//W7+//nL3F/629vf///////////////////////////z1F9/9dbu//7/f//+/////v////9////4yc//89Rff/5vf//+/////v////7////9bv7/+cvcX/rb29////////////////////////////ND3v/3aE7//3////7////+/////v////XWb3/36M9//3////7////+/////v////1u/3/5S1vf+9zs7///////////////////////////8sNO//doTv//f////v////7////+////80Pe//pbX///f////v////7////+/////e7/f/jK2t/9be3v///////////////////////////yw07/9ufu//7////+/////v////3u///zQ97/+9zv//9////+/////v////7////87m7/9+lIz/3u/v////////////////////////////JCzv/2Z27//m////7/////f///+MlP//VWb3//f////v////7////+/////v////zubm/36UlP/m7+////////////////////////////89Rff/VWbm/97v9//3////7////11m9/9mbvf/9////+/////v////7////+////+91t7/lK2t//f3/////////////////////////////5yl//80Rd7/zubv//f////O3v//LDTv/7XF///3////7////+/////v////5vf//6W9xf+ctbX/////////////////////////////////1t7//yQ05v+MnO///////4yU//89Rff/5vf//+/////v////7////+/////m9///nL3F/7XFzv/////////////////////////////////39///Zm73/0VV5v+9zvf/LDTv/5yl///3////7////+/////v////7////+b39/+UrbX/1t7e//////////////////////////////////////+UnPf/JCzm/yw07/9dbvf/5vf//+/////v////7////+/////v////1ubv/4ylpf/m7+///////////////////////////////////////97m//8sNO//XW7v/97v///3////7////+/////v////7////+/////F3t7/nK2t/////////////////////////////////////////////////25+vf+Mpc7/7////+/////v////7////+/////v////7////6W9vf/Fzs7/////////////////////////////////////////////////pb21/5Strf/O5ub/7////+/////v////7/////f////e7+//jK2t/+bv7//////////////////////////////////////////////////O5ub/fpyc/7XOzv/e9/f/9////+/////v////9////7XOzv+EpaX/5vf3/////////////////////////////////////////////////+bv7/+MvcX/lK2t/5y1tf/O5ub/5vf3/+bv7/+9zs7/lL29/4ytrf/3////////////////////////////////////////////////////3ubm/5TFxf+95u//rb29/4ylnP+cra3/lK2t/6W9vf+t1t7/nLW1/////////////////////////////////w==')";
                procButtonNum = Db.NonQ(command, true);
                command       = "INSERT INTO procbuttonitem (ProcButtonNum,CodeNum,AutoCodeNum) VALUES (" + POut.Long(procButtonNum) + ",0,"
                                + POut.Long(autoCodeNum) + ")";
                Db.NonQ(command);
            }
            //Crown
            if (ProcedureCodes.IsValidCode("D2750") || ProcedureCodes.IsValidCode("N4118"))
            {
                command = "INSERT INTO procbutton (Description,ItemOrder,Category,ButtonImage) VALUES('Crown',2,"
                          + POut.Long(category) + @",'Qk12BgAAAAAAADYAAAAoAAAAFAAAABQAAAABACAAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+1ve//PVXW/1Vu7/9mdu//Znbv/2Z27/9mdu//XW7v/2Z27/9mbu//Zm7v/2Zu7/9dbu//XW7v/01m7/9FXeb/pa33/////////////////11m7/89Re//XWbv/11m7/9dZu//XWbv/11m7/9dZu//XWbv/11m7/9dZu//XWbv/11m7/9dZu//XWbv/z1F7/9NVe/////////////e3v//LDTv/6Wt9//39///9/f///f3///39///9/f///f3///39///9/f///f3///39///9/f///f3///39///vb3//zQ97//W1v///////5Sc9/80Re//5ub////////////////////////////////////////////////////////////////////////W1v//PUXv/73F9//39///XWbv/2Zu7////////////////////////////////////////////////////////////////////////////9bW//89Re//vcX3/87O//8sNO//tb3/////////////////////////////////////////////////////////////////////////////3t7//zRF7/+cpff/hIz3/z1F7//v7///////////////////////////////////////////////////////////////////////////////////XWbv/2529/9udvf/VV3v//f3//////////////////////////////////////////////////////////////////////////////////+MlPf/TVXv/2529/9VXe//9/f/////////////////////////////7+///6Wl9/+1vf///////////////////////////////////////6Wl9/80Re//bnb3/1Vd7//39//////////////////////////////W1v//RU3v/6Wl9///////////////////////////////////////3t7//yw07/9mdu//XWbv//f3/////////////////////////////87W//9FTe//zs7////////////////////////////////////////39///VV3v/3Z+9/9NVe//9/f/////////////////////////////1tb//1Vd7//Ozv////////////////////////////////////////f3//9VXe//vb3//yQs7//Ozv////////////////////////////+9xff/ND3v/4yU9//v7///////////////////////////////////tb3//yw07//v7///VV3v/z1F7/+cnPf/5ub///f3///m5v//jJT3/zQ97/89Re//LDTv/0VN7/+MlPf/pa33/87O///v9///5ub//5Sc9/8sNO//foT3///////e5v//foT3/z1N7/8sNO//VV3v/zQ97/9FTe//lJz3/+/v///e5v//foT3/01V7/9FTe//LDTv/0VN7/8sNO//ND3v/4yU9////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w==')";
                procButtonNum = Db.NonQ(command, true);
                if (ProcedureCodes.IsValidCode("D2750"))
                {
                    command = "INSERT INTO procbuttonitem (ProcButtonNum,CodeNum,AutoCodeNum) VALUES (" + POut.Long(procButtonNum)
                              + "," + ProcedureCodes.GetCodeNum("D2750") + ",0)";
                    Db.NonQ(command);
                }
                if (ProcedureCodes.IsValidCode("N4118"))
                {
                    command = "INSERT INTO procbuttonitem (ProcButtonNum,CodeNum,AutoCodeNum) VALUES (" + POut.Long(procButtonNum)
                              + "," + ProcedureCodes.GetCodeNum("N4118") + ",0)";
                    Db.NonQ(command);
                }
            }
            //RCT
            autoCodeNum = AutoCodes.GetNumFromDescript("Root Canal");
            if (autoCodeNum != 0)
            {
                command = "INSERT INTO procbutton (Description,ItemOrder,Category,ButtonImage) VALUES('RCT',3,"
                          + POut.Long(category) + @",'Qk12BgAAAAAAADYAAAAoAAAAFAAAABQAAAABACAAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAA///////////////////////////////////////////F1tb/boyt/xwkpf/m5ub//////////////////////////////////////////////////////////////////////////////////////36MjP9VbpT/EySc/7XFxf//////////////////////////////////////////////////////////////////////////////////////XWZm/36lzv8kNMX/ZnZu//////////////////////////////////////////////////////////////////////////////////f39/9NXV3/fpz//wMD//9ddm7/zs7O////////////////////////////////////////////////////////////////////////////3t7e/2Z+dv9mfv//AwP//2aEfv+lpaX////////////////////////////////////////////////////////////////////////////FxcX/XXZ2/26E//8DA///jK2t/5ycnP///////////////////////////////////////////////////////////////////////////8XFxf9mfnb/fpT//wMD//+Era3/lJSU//f39///////////////////////////////////////////////////////////////////////nKWl/2aMjP9uhP//AwP//4y1tf+UnJz/9/f3//////////////////////////////////////////////////////////////////////9mbm7/ZoSE/2Z+//8DA///nMXF/4SMjP/39/f//////////////////////////////////////////////////////////////////////2Zubv9ujIT/Znb//wMD//+lzs7/foyM//f39///////////////////////////////////////////////////////////////////////PUVF/36lpf9ufv//AwP//63W1v9ufn7/9/f3/////////////////////////////////////////////////////////////////+/v7/9VVVX/jLW1/2Z2//8DA///td7m/2Z2dv/v7+//////////////////////////////////////////////////////////////////3t7e/1VVVf+Uxb3/bn7//wMD//+13ub/ZnZ2/+bm5v/////////////////////////////////////////////////////////////////e3t7/XWZu/5TFvf9mdv//AwP//7Xe5v9mdnb/3t7e/////////////////////////////////////////////////////////////////8XFxf9mbm7/nMXF/11m//8DA///zu/3/1VmXf/e3t7/////////////////////////////////////////////////////////////////zs7O/11mZv+cxcX/XW7//wMD///O7/f/VWZm/87Ozv/////////////////////////////////////////////////////////////////FxcX/ZnZ2/6XOzv9dbv//AwP//9bv9/9Vbm7/pa2t/////////////////////////////////////////////////////////////////62trf9VZmb/rdbW/01d//8DA///1u/3/01mZv+UlJT/////////////////////////////////////////////////////////////////nJyc/0VNTf+t3tb/XW7//wMD//+Urf//RV1d/4yUlP////////////////////////////////////////////////////////////////+1tbX/RV1d/7Xe3v9dZv//AwP//4yl//89VVX/foSE/////////////////////////////////w==')";
                procButtonNum = Db.NonQ(command, true);
                command       = "INSERT INTO procbuttonitem (ProcButtonNum,CodeNum,AutoCodeNum) VALUES (" + POut.Long(procButtonNum) + ",0,"
                                + POut.Long(autoCodeNum) + ")";
                Db.NonQ(command);
            }
            //RCT BU PFM
            autoCodeNum  = AutoCodes.GetNumFromDescript("Root Canal");
            autoCodeNum2 = AutoCodes.GetNumFromDescript("BU/P&C");
            if (autoCodeNum != 0 || ProcedureCodes.IsValidCode("D2750"))           //we add this button if either RCT or crown is available.
            {
                command = "INSERT INTO procbutton (Description,ItemOrder,Category,ButtonImage) VALUES('RCT BU PFM',4,"
                          + POut.Long(category) + @",'Qk12BgAAAAAAADYAAAAoAAAAFAAAABQAAAABACAAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAA////////////////pcXF/63W7/89Te//Exzv/01V7/+95u//tebm/7Xm5v9+lO//HCTv/xwk7/9Vbu//pdbe/73m5v////////////////////////////////+cvb3/rdbv/z1N7/8cJO//PUXv/63W7/+15ub/tebm/11u7/8cJO//HCTv/01d7/+cztb/td7e////////////////////////////9/f//5y9tf+t1u//PU3v/xwk7/8kLO//pb33/73m5v/W7/f/PU3v/xwk7/8cJO//PU3v/4zF3v+13t7/////////////////////////////////lL21/6XW7/89Te//HCTv/xwk7/+ElPf/zvfv/5yt9/8kLO//HCTv/xwk7/89Te//lMXe/73e3v////////////////////////////////+UvbX/vd73/0VN7/8cJO//HCzv/yw97/9mbu//LDTv/xwk7/8cLO//HCTv/0VN7/+Uvc7/rc7O/////////////////////////////////6XO1v+13u//RU3v/xwk7/8cLO//HCTv/xwk7/8cJO//HCzv/xws7/8cJO//RU3v/4S13v+lztb////////////////////////////m5v//PU3v/zRF5v8kLO//EyTv/xwk7/8cJO//HCTv/xwk7/8cJO//HCTv/xMk7/8cJO//JCzv/zRF5v/W1v///////////////////////5yl9/8sNO//fn73/4SM9/+EjPf/hIz3/4SM9/+EjPf/hIz3/4SM9/+EjPf/hIz3/4SM9/+EhPf/ND3v/4yU9//////////////////39///TVXv/36E9/////////////////////////////////////////////////////////////////9mbvf/VV3v//f3/////////////8XF//8cLO//zs7//////////////////////////////////////////////////////////////////4SM9/8sPe//7+//////////////hIz3/0VN7//39///////////////////////////////////////////////////////////////////paX3/yQs7//m5v///////+bm//9FTe//hIT3///////////////////////////////////////////////////////////////////////Fxf//JCzv/7299///////xcX//yw07/+9vff//////////////////////////////////////////////////////////////////////+/v//89Re//VV3v///////Ozv//ND3v/7299////////////////////////////+/v///e3v//9/f/////////////////////////////9/f//1Vd7/9FTe///////8XO//80Pe//vb33////////////////////////////ra33/11m7//e3v//////////////////////////////////dn73/yQs7///////xcX//yw07//Fxf////////////////////////////+UlPf/Zm7v//////////////////////////////////////+1tf//JCzv///////W1v//NEXv/7299////////////////////////////5yl9/92fvf//////////////////////////////////////7299/8kLO////////f3//9dZu//fn73////////////////////////////foT3/z1F7//Ozv//////////////////////////////////dn73/zQ97////////////5yl9/8kLO//jJT3/+bm///39///5u///4SM9/8sNO//LDTv/yQs7/9+hPf/vb33/97e///39///5u///3Z+9/8kLO//vb33////////////9/f//5Sc9/9NVe//ND3v/z1F7/80Pe//TVXv/62t9//v7///nKX3/0VN7/8sNO//LDTv/01V7/80Pe//PUXv/7299////////////w==')";
                procButtonNum = Db.NonQ(command, true);
                if (ProcedureCodes.IsValidCode("D2750"))
                {
                    command = "INSERT INTO procbuttonitem (ProcButtonNum,CodeNum,AutoCodeNum) VALUES (" + POut.Long(procButtonNum)
                              + "," + ProcedureCodes.GetCodeNum("D2750") + ",0)";
                    Db.NonQ(command);
                }
                if (ProcedureCodes.IsValidCode("N4118"))
                {
                    command = "INSERT INTO procbuttonitem (ProcButtonNum,CodeNum,AutoCodeNum) VALUES (" + POut.Long(procButtonNum)
                              + "," + ProcedureCodes.GetCodeNum("N4118") + ",0)";
                    Db.NonQ(command);
                }
                if (autoCodeNum != 0)
                {
                    command = "INSERT INTO procbuttonitem (ProcButtonNum,CodeNum,AutoCodeNum) VALUES (" + POut.Long(procButtonNum) + ",0,"
                              + POut.Long(autoCodeNum) + ")";
                    Db.NonQ(command);
                }
                if (autoCodeNum2 != 0)
                {
                    command = "INSERT INTO procbuttonitem (ProcButtonNum,CodeNum,AutoCodeNum) VALUES (" + POut.Long(procButtonNum) + ",0,"
                              + POut.Long(autoCodeNum2) + ")";
                    Db.NonQ(command);
                }
            }
            //Bridge
            autoCodeNum = AutoCodes.GetNumFromDescript("Bridge");
            if (autoCodeNum != 0 || ProcedureCodes.IsValidCode("N4127"))
            {
                command = "INSERT INTO procbutton (Description,ItemOrder,Category,ButtonImage) VALUES('Bridge',5,"
                          + POut.Long(category) + @",'')";
                procButtonNum = Db.NonQ(command, true);
                if (ProcedureCodes.IsValidCode("N4127"))
                {
                    command = "INSERT INTO procbuttonitem (ProcButtonNum,CodeNum,AutoCodeNum) VALUES (" + POut.Long(procButtonNum)
                              + "," + ProcedureCodes.GetCodeNum("N4127") + ",0)";
                    Db.NonQ(command);
                }
                if (autoCodeNum != 0)
                {
                    command = "INSERT INTO procbuttonitem (ProcButtonNum,CodeNum,AutoCodeNum) VALUES (" + POut.Long(procButtonNum) + ",0,"
                              + POut.Long(autoCodeNum) + ")";
                    Db.NonQ(command);
                }
            }
            //Build Up
            autoCodeNum = AutoCodes.GetNumFromDescript("BU/P&C");
            if (autoCodeNum != 0)
            {
                command = "INSERT INTO procbutton (Description,ItemOrder,Category,ButtonImage) VALUES('BU/P&C',6,"
                          + POut.Long(category) + @",'')";
                procButtonNum = Db.NonQ(command, true);
                command       = "INSERT INTO procbuttonitem (ProcButtonNum,CodeNum,AutoCodeNum) VALUES (" + POut.Long(procButtonNum) + ",0,"
                                + POut.Long(autoCodeNum) + ")";
                Db.NonQ(command);
            }
            //Exams/Cleanings Category--------------------------------------------------------------------------------------------
            command = "INSERT INTO definition (Category,ItemOrder,ItemName,ItemValue,ItemColor,IsHidden) "
                      + "VALUES (26,1,'Exams/Cleanings','',0,0)";
            category = Db.NonQ(command, true);
            //PA
            if (ProcedureCodes.IsValidCode("D0220"))
            {
                command = "INSERT INTO procbutton (Description,ItemOrder,Category,ButtonImage) VALUES('PA',0,"
                          + POut.Long(category) + @",'Qk12BgAAAAAAADYAAAAoAAAAFAAAABQAAAABACAAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9/f3/0VFRf8DAwP/AwMD/wMDA/9dXV3/jIyM/yQkJP8DAwP/AwMD/4SEhP8LCwv/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/RUVF/97e3v+MjIz/AwMD/wMDA/8DAwP/AwMD/35+fv/FxcX/JCQk/wMDA/8DAwP/5ubm/5SUlP8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/VVVV/wMDA/8DAwP/AwMD/wMDA/8LCwv/nJyc/+bm5v9dXV3/AwMD/wsLC/+MjIz/ZmZm/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wsLC/+lpaX/xcXF/zQ0NP8DAwP/NDQ0/62trf9dXV3/JCQk/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/TU1N/2ZmZv/Ozs7/dnZ2/wMDA/9dXV3/xcXF/+bm5v80NDT/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/9FRUX/lJSU/8XFxf+tra3/hISE/7W1tf/FxcX/tbW1/2ZmZv8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/01NTf/Ozs7/1tbW/+bm5v/Ozs7/7+/v/+bm5v/v7+//jIyM/yQkJP8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/ZmZm/+bm5v//////5ubm/+/v7//v7+//5ubm//f39//W1tb/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/9mZmb////////////39/f/5ubm//f39///////9/f3/+bm5v80NDT/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/1VVVf/39/f//////+/v7//m5ub/////////////////7+/v/yQkJP8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/3t7e/+/v7//39/f/9/f3/9bW1v/m5ub////////////v7+//AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/+EhIT/paWl/8XFxf//////3t7e/97e3v/v7+//5ubm/5ycnP8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/TU1N/wsLC/8DAwP/AwMD/wMDA/89PT3/1tbW/87Ozv/FxcX/lJSU/35+fv+MjIz/dnZ2/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/2ZmZv//////XV1d/wMDA/8DAwP/AwMD/wMDA/8LCwv/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/9mZmb//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////w==')";
                procButtonNum = Db.NonQ(command, true);
                command       = "INSERT INTO procbuttonitem (ProcButtonNum,CodeNum,AutoCodeNum) VALUES (" + POut.Long(procButtonNum)
                                + "," + ProcedureCodes.GetCodeNum("D0220") + ",0)";
                Db.NonQ(command);
            }
            //NewChildExam
        }
コード例 #11
0
ファイル: AutoCodes.cs プロジェクト: nampn/ODental
        //------

        ///<summary>Deletes all current autocodes and then adds the default autocodes.  Procedure codes must have already been entered or they cannot be added as an autocode.</summary>
        public static void SetToDefault()
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod());
                return;
            }
            string command = "DELETE FROM autocode";

            Db.NonQ(command);
            command = "DELETE FROM autocodecond";
            Db.NonQ(command);
            command = "DELETE FROM autocodeitem";
            Db.NonQ(command);
            long autoCodeNum;
            long autoCodeItemNum;

            //Amalgam-------------------------------------------------------------------------------------------------------
            command     = "INSERT INTO autocode (Description,IsHidden,LessIntrusive) VALUES ('Amalgam',0,0)";
            autoCodeNum = Db.NonQ(command, true);
            //1Surf
            if (ProcedureCodes.IsValidCode("D2140"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2140") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.One_Surf) + ")";
                Db.NonQ(command);
            }
            //2Surf
            if (ProcedureCodes.IsValidCode("D2150"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2150") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Two_Surf) + ")";
                Db.NonQ(command);
            }
            //3Surf
            if (ProcedureCodes.IsValidCode("D2160"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2160") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Three_Surf) + ")";
                Db.NonQ(command);
            }
            //4Surf
            if (ProcedureCodes.IsValidCode("D2161"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2161") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Four_Surf) + ")";
                Db.NonQ(command);
            }
            //5Surf
            if (ProcedureCodes.IsValidCode("D2161"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2161") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Five_Surf) + ")";
                Db.NonQ(command);
            }
            //Composite-------------------------------------------------------------------------------------------------------
            command     = "INSERT INTO autocode (Description,IsHidden,LessIntrusive) VALUES ('Composite',0,0)";
            autoCodeNum = Db.NonQ(command, true);
            //1SurfAnt
            if (ProcedureCodes.IsValidCode("D2330"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2330") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.One_Surf) + ")";
                Db.NonQ(command);
                command = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                          + POut.Long((int)AutoCondition.Anterior) + ")";
                Db.NonQ(command);
            }
            //2SurfAnt
            if (ProcedureCodes.IsValidCode("D2331"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2331") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Two_Surf) + ")";
                Db.NonQ(command);
                command = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                          + POut.Long((int)AutoCondition.Anterior) + ")";
                Db.NonQ(command);
            }
            //3SurfAnt
            if (ProcedureCodes.IsValidCode("D2332"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2332") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Three_Surf) + ")";
                Db.NonQ(command);
                command = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                          + POut.Long((int)AutoCondition.Anterior) + ")";
                Db.NonQ(command);
            }
            //4SurfAnt
            if (ProcedureCodes.IsValidCode("D2335"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2335") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Four_Surf) + ")";
                Db.NonQ(command);
                command = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                          + POut.Long((int)AutoCondition.Anterior) + ")";
                Db.NonQ(command);
            }
            //5SurfAnt
            if (ProcedureCodes.IsValidCode("D2335"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2335") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Five_Surf) + ")";
                Db.NonQ(command);
                command = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                          + POut.Long((int)AutoCondition.Anterior) + ")";
                Db.NonQ(command);
            }
            //Posterior Composite----------------------------------------------------------------------------------------------
            //1SurfPost
            if (ProcedureCodes.IsValidCode("D2391"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2391") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.One_Surf) + ")";
                Db.NonQ(command);
                command = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                          + POut.Long((int)AutoCondition.Posterior) + ")";
                Db.NonQ(command);
            }
            //2SurfPost
            if (ProcedureCodes.IsValidCode("D2392"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2392") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Two_Surf) + ")";
                Db.NonQ(command);
                command = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                          + POut.Long((int)AutoCondition.Posterior) + ")";
                Db.NonQ(command);
            }
            //3SurfPost
            if (ProcedureCodes.IsValidCode("D2393"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2393") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Three_Surf) + ")";
                Db.NonQ(command);
                command = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                          + POut.Long((int)AutoCondition.Posterior) + ")";
                Db.NonQ(command);
            }
            //4SurfPost
            if (ProcedureCodes.IsValidCode("D2394"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2394") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Four_Surf) + ")";
                Db.NonQ(command);
                command = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                          + POut.Long((int)AutoCondition.Posterior) + ")";
                Db.NonQ(command);
            }
            //5SurfPost
            if (ProcedureCodes.IsValidCode("D2394"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2394") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Five_Surf) + ")";
                Db.NonQ(command);
                command = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                          + POut.Long((int)AutoCondition.Posterior) + ")";
                Db.NonQ(command);
            }
            //Root Canal-------------------------------------------------------------------------------------------------------
            command     = "INSERT INTO autocode (Description,IsHidden,LessIntrusive) VALUES ('Root Canal',0,0)";
            autoCodeNum = Db.NonQ(command, true);
            //Ant
            if (ProcedureCodes.IsValidCode("D3310"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D3310") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Anterior) + ")";
                Db.NonQ(command);
            }
            //Premolar
            if (ProcedureCodes.IsValidCode("D3320"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D3320") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Premolar) + ")";
                Db.NonQ(command);
            }
            //Molar
            if (ProcedureCodes.IsValidCode("D3330"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D3330") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Molar) + ")";
                Db.NonQ(command);
            }
            //Bridge-------------------------------------------------------------------------------------------------------
            command     = "INSERT INTO autocode (Description,IsHidden,LessIntrusive) VALUES ('Bridge',0,0)";
            autoCodeNum = Db.NonQ(command, true);
            //Pontic
            if (ProcedureCodes.IsValidCode("D6242"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D6242") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Pontic) + ")";
                Db.NonQ(command);
            }
            //Retainer
            if (ProcedureCodes.IsValidCode("D6752"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D6752") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Retainer) + ")";
                Db.NonQ(command);
            }
            //Denture-------------------------------------------------------------------------------------------------------
            command     = "INSERT INTO autocode (Description,IsHidden,LessIntrusive) VALUES ('Denture',0,0)";
            autoCodeNum = Db.NonQ(command, true);
            //Max
            if (ProcedureCodes.IsValidCode("D5110"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D5110") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Maxillary) + ")";
                Db.NonQ(command);
            }
            //Mand
            if (ProcedureCodes.IsValidCode("D5120"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D5120") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Mandibular) + ")";
                Db.NonQ(command);
            }
            //BU/P&C-------------------------------------------------------------------------------------------------------
            command     = "INSERT INTO autocode (Description,IsHidden,LessIntrusive) VALUES ('BU/P&C',0,0)";
            autoCodeNum = Db.NonQ(command, true);
            //BU
            if (ProcedureCodes.IsValidCode("D2950"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2950") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Posterior) + ")";
                Db.NonQ(command);
            }
            //P&C
            if (ProcedureCodes.IsValidCode("D2954"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D2954") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Anterior) + ")";
                Db.NonQ(command);
            }
            //Root Canal Retreat--------------------------------------------------------------------------------------------------
            command     = "INSERT INTO autocode (Description,IsHidden,LessIntrusive) VALUES ('RCT Retreat',0,0)";
            autoCodeNum = Db.NonQ(command, true);
            //Ant
            if (ProcedureCodes.IsValidCode("D3346"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D3346") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Anterior) + ")";
                Db.NonQ(command);
            }
            //Premolar
            if (ProcedureCodes.IsValidCode("D3347"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D3347") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Premolar) + ")";
                Db.NonQ(command);
            }
            //Molar
            if (ProcedureCodes.IsValidCode("D3348"))
            {
                command = "INSERT INTO autocodeitem (AutoCodeNum,CodeNum) VALUES (" + POut.Long(autoCodeNum) + ","
                          + ProcedureCodes.GetCodeNum("D3348") + ")";
                autoCodeItemNum = Db.NonQ(command, true);
                command         = "INSERT INTO autocodecond (AutoCodeItemNum,Cond) VALUES (" + POut.Long(autoCodeItemNum) + ","
                                  + POut.Long((int)AutoCondition.Molar) + ")";
                Db.NonQ(command);
            }
        }