Пример #1
0
        ///<summary>Only used for incremental tooth movements.  Automatically adds a movement to any existing movement.  Supply a list of all toothInitials for the patient.</summary>
        public static void AddMovement(List <ToothInitial> initialList, long patNum, string tooth_id, ToothInitialType initialType, float moveAmt)
        {
            //No need to check RemotingRole; no call to db.
            ToothInitial ti = null;

            for (int i = 0; i < initialList.Count; i++)
            {
                if (initialList[i].ToothNum == tooth_id &&
                    initialList[i].InitialType == initialType)
                {
                    ti = initialList[i].Copy();
                }
            }
            if (ti == null)
            {
                ti             = new ToothInitial();
                ti.PatNum      = patNum;
                ti.ToothNum    = tooth_id;
                ti.InitialType = initialType;
                ti.Movement    = moveAmt;
                ToothInitials.Insert(ti);
                return;
            }
            ti.Movement += moveAmt;
            ToothInitials.Update(ti);
        }
Пример #2
0
        ///<summary>Only used for incremental tooth movements.  Automatically adds a movement to any existing movement.  Supply a list of all toothInitials for the patient.</summary>
        public static void AddMovement(List <ToothInitial> initialList, long patNum, string tooth_id, ToothInitialType initialType, float moveAmt)
        {
            //No need to check RemotingRole; no call to db.
            if (moveAmt == 0)
            {
                return;
            }
            ToothInitial ti = initialList.Find(x => x.ToothNum == tooth_id && x.InitialType == initialType)?.Copy();

            if (ti == null)
            {
                ti             = new ToothInitial();
                ti.PatNum      = patNum;
                ti.ToothNum    = tooth_id;
                ti.InitialType = initialType;
                ti.Movement    = moveAmt;
                ToothInitials.Insert(ti);
                return;
            }
            ti.Movement += moveAmt;
            if (ti.Movement == 0)
            {
                ClearValue(patNum, tooth_id, initialType);
            }
            else
            {
                ToothInitials.Update(ti);
            }
        }
Пример #3
0
        ///<summary>Same as SetValue, but does not clear any values first.  Only use this if you have first run ClearAllValuesForType.</summary>
        public static void SetValueQuick(long patNum, string tooth_id, ToothInitialType initialType, float moveAmt)
        {
            //No need to check RemotingRole; no call to db.
            ToothInitial ti = new ToothInitial();

            ti.PatNum      = patNum;
            ti.ToothNum    = tooth_id;
            ti.InitialType = initialType;
            ti.Movement    = moveAmt;
            ToothInitials.Insert(ti);
        }
Пример #4
0
        ///<summary>Returns the toothNums from 1-32 to skip for the given patient.</summary>
        private static List <int> GetSkippedTeethForExam(Patient pat, PerioExam examCur)
        {
            List <int>       listSkippedTeeth     = new List <int>();
            List <PerioExam> listOtherExamsForPat = GetExamsList(pat.PatNum)
                                                    .Where(x => x.PerioExamNum != examCur.PerioExamNum)
                                                    .OrderBy(x => x.ExamDate)
                                                    .ToList();

            //If any other perio exams exist, we'll use the latest exam for the skipped tooth.
            if (!listOtherExamsForPat.IsNullOrEmpty())
            {
                listSkippedTeeth = PerioMeasures.GetSkipped(listOtherExamsForPat.Last().PerioExamNum);
            }
            //For patient's first perio chart, any teeth marked missing are automatically marked skipped.
            else if (PrefC.GetBool(PrefName.PerioSkipMissingTeeth))
            {
                //Procedures will only be queried for as needed.
                List <Procedure> listProcs = null;
                foreach (string missingTooth in ToothInitials.GetMissingOrHiddenTeeth(ToothInitials.Refresh(pat.PatNum)))
                {
                    if (missingTooth.CompareTo("A") >= 0 && missingTooth.CompareTo("Z") <= 0)
                    {
                        //If is a letter (not a number)
                        //Skipped teeth are only recorded by tooth number within the perio exam.
                        continue;
                    }
                    int toothNum = PIn.Int(missingTooth);
                    //Check if this tooth has had an implant done AND the office has the preference to SHOW implants
                    if (PrefC.GetBool(PrefName.PerioTreatImplantsAsNotMissing))
                    {
                        if (listProcs == null)
                        {
                            listProcs = Procedures.Refresh(pat.PatNum);
                        }
                        if (IsToothImplant(toothNum, listProcs))
                        {
                            //Remove the tooth from the list of skipped teeth if it exists.
                            listSkippedTeeth.RemoveAll(x => x == toothNum);
                            //We do not want to add it back to the list below.
                            continue;
                        }
                    }
                    //This tooth is missing and we know it is not an implant OR the office has the preference to ignore implants.
                    //Simply add it to our list of skipped teeth.
                    listSkippedTeeth.Add(toothNum);
                }
            }
            return(listSkippedTeeth);
        }
Пример #5
0
        ///<summary>Same as SetValue, but does not clear any values first.  Only use this if you have first run ClearAllValuesForType.</summary>
        public static void SetValueQuick(long patNum, string tooth_id, ToothInitialType initialType, float moveAmt)
        {
            //No need to check RemotingRole; no call to db.
            //if initialType is a movement and the movement amt is 0, then don't add a row, just return;
            if (moveAmt == 0 &&
                initialType.In(ToothInitialType.ShiftM, ToothInitialType.ShiftO, ToothInitialType.ShiftB, ToothInitialType.Rotate, ToothInitialType.TipM,
                               ToothInitialType.TipB))
            {
                return;
            }
            ToothInitial ti = new ToothInitial();

            ti.PatNum      = patNum;
            ti.ToothNum    = tooth_id;
            ti.InitialType = initialType;
            ti.Movement    = moveAmt;
            ToothInitials.Insert(ti);
        }
Пример #6
0
        public static LoadData GetLoadData(Patient pat, Family fam, Claim claim)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <LoadData>(MethodBase.GetCurrentMethod(), pat, fam, claim));
            }
            LoadData data = new LoadData();

            data.ListPatPlans            = PatPlans.Refresh(pat.PatNum);
            data.ListInsSubs             = InsSubs.RefreshForFam(fam);
            data.ListInsPlans            = InsPlans.RefreshForSubList(data.ListInsSubs);
            data.ListClaimProcs          = ClaimProcs.Refresh(pat.PatNum);
            data.ListProcs               = Procedures.Refresh(pat.PatNum);
            data.ListClaimValCodes       = ClaimValCodeLogs.GetForClaim(claim.ClaimNum);
            data.ClaimCondCodeLogCur     = ClaimCondCodeLogs.GetByClaimNum(claim.ClaimNum);
            data.TablePayments           = ClaimPayments.GetForClaim(claim.ClaimNum);
            data.TablePayments.TableName = "ClaimPayments";
            data.ListToothInitials       = ToothInitials.Refresh(pat.PatNum);
            data.ListCustomStatusEntries = ClaimTrackings.RefreshForClaim(ClaimTrackingType.StatusHistory, claim.ClaimNum);
            return(data);
        }