public MessuresViewModel(RoothCalculationEntity roothModel, MouthCalculationEntity mouseModel, PatientInformation patientModel)
 {
     this.roothModel               = roothModel;
     this.mouseModel               = mouseModel;
     this.patientModel             = patientModel;
     this.patientModel.DateMessure = patientModel.DateMessure.Equals(DateTime.MinValue) ? DateTime.Now : patientModel.DateMessure;
 }
        /// <summary>
        /// Sets the rooth values.
        /// </summary>
        /// <param name="sheet">The sheet.</param>
        /// <param name="roothCalculation">The rooth calculation.</param>
        private static void SetRoothValues(Worksheet sheet, RoothCalculationEntity roothCalculation)
        {
            sheet.get_Range("C" + roothSuperiorIndex, "C" + roothSuperiorIndex).Value2 = roothCalculation.Tooth17.ResultToString();
            sheet.get_Range("D" + roothSuperiorIndex, "D" + roothSuperiorIndex).Value2 = roothCalculation.Tooth16.ResultToString();
            sheet.get_Range("E" + roothSuperiorIndex, "E" + roothSuperiorIndex).Value2 = roothCalculation.Tooth15.ResultToString();
            sheet.get_Range("F" + roothSuperiorIndex, "F" + roothSuperiorIndex).Value2 = roothCalculation.Tooth14.ResultToString();
            sheet.get_Range("G" + roothSuperiorIndex, "G" + roothSuperiorIndex).Value2 = roothCalculation.Tooth13.ResultToString();
            sheet.get_Range("H" + roothSuperiorIndex, "H" + roothSuperiorIndex).Value2 = roothCalculation.Tooth12.ResultToString();
            sheet.get_Range("I" + roothSuperiorIndex, "I" + roothSuperiorIndex).Value2 = roothCalculation.Tooth11.ResultToString();
            sheet.get_Range("J" + roothSuperiorIndex, "J" + roothSuperiorIndex).Value2 = roothCalculation.Tooth21.ResultToString();
            sheet.get_Range("K" + roothSuperiorIndex, "K" + roothSuperiorIndex).Value2 = roothCalculation.Tooth22.ResultToString();
            sheet.get_Range("L" + roothSuperiorIndex, "L" + roothSuperiorIndex).Value2 = roothCalculation.Tooth23.ResultToString();
            sheet.get_Range("M" + roothSuperiorIndex, "M" + roothSuperiorIndex).Value2 = roothCalculation.Tooth24.ResultToString();
            sheet.get_Range("N" + roothSuperiorIndex, "N" + roothSuperiorIndex).Value2 = roothCalculation.Tooth25.ResultToString();
            sheet.get_Range("O" + roothSuperiorIndex, "O" + roothSuperiorIndex).Value2 = roothCalculation.Tooth26.ResultToString();
            sheet.get_Range("P" + roothSuperiorIndex, "P" + roothSuperiorIndex).Value2 = roothCalculation.Tooth27.ResultToString();

            sheet.get_Range("C" + roothInferiorIndex, "C" + roothInferiorIndex).Value2 = roothCalculation.Tooth47.ResultToString();
            sheet.get_Range("D" + roothInferiorIndex, "D" + roothInferiorIndex).Value2 = roothCalculation.Tooth46.ResultToString();
            sheet.get_Range("E" + roothInferiorIndex, "E" + roothInferiorIndex).Value2 = roothCalculation.Tooth45.ResultToString();
            sheet.get_Range("F" + roothInferiorIndex, "F" + roothInferiorIndex).Value2 = roothCalculation.Tooth44.ResultToString();
            sheet.get_Range("G" + roothInferiorIndex, "G" + roothInferiorIndex).Value2 = roothCalculation.Tooth43.ResultToString();
            sheet.get_Range("H" + roothInferiorIndex, "H" + roothInferiorIndex).Value2 = roothCalculation.Tooth42.ResultToString();
            sheet.get_Range("I" + roothInferiorIndex, "I" + roothInferiorIndex).Value2 = roothCalculation.Tooth41.ResultToString();
            sheet.get_Range("J" + roothInferiorIndex, "J" + roothInferiorIndex).Value2 = roothCalculation.Tooth31.ResultToString();
            sheet.get_Range("K" + roothInferiorIndex, "K" + roothInferiorIndex).Value2 = roothCalculation.Tooth32.ResultToString();
            sheet.get_Range("L" + roothInferiorIndex, "L" + roothInferiorIndex).Value2 = roothCalculation.Tooth33.ResultToString();
            sheet.get_Range("M" + roothInferiorIndex, "M" + roothInferiorIndex).Value2 = roothCalculation.Tooth34.ResultToString();
            sheet.get_Range("N" + roothInferiorIndex, "N" + roothInferiorIndex).Value2 = roothCalculation.Tooth35.ResultToString();
            sheet.get_Range("O" + roothInferiorIndex, "O" + roothInferiorIndex).Value2 = roothCalculation.Tooth36.ResultToString();
            sheet.get_Range("P" + roothInferiorIndex, "P" + roothInferiorIndex).Value2 = roothCalculation.Tooth37.ResultToString();
        }
 public MessuresViewModel()
 {
     roothModel   = new RoothCalculationEntity();
     mouseModel   = new MouthCalculationEntity();
     patientModel = new PatientInformation()
     {
         DateMessure = DateTime.Now
     };
 }
        /// <summary>
        /// Sets the data into sheet messure.
        /// </summary>
        /// <param name="sheet">The sheet.</param>
        /// <param name="roothCalculation">The rooth calculation.</param>
        /// <param name="mouthCalculation">The mouth calculation.</param>
        private static void SetDataIntoSheetMessure(Worksheet sheet, RoothCalculationEntity roothCalculation, MouthCalculationEntity mouthCalculation, PatientInformation patientInformation)
        {
            sheet.Activate();

            SetRoothValues(sheet, roothCalculation);

            SetMouthValues(sheet, mouthCalculation);

            SetPatientInfo(sheet, patientInformation);
        }
        public static TanakaJohnston GetResult(RoothCalculationEntity theethMessure)
        {
            var tanakaResult = new TanakaJohnston();

            var inferiorSum = TheethsSum.GetResults(theethMessure).SumInferiorFour;

            tanakaResult.Superior = (inferiorSum / 2) + 11;
            tanakaResult.Inferior = tanakaResult.Superior - (decimal)0.5;

            return(tanakaResult);
        }
示例#6
0
        public static TheethsSum GetResults(RoothCalculationEntity theethMessure)
        {
            var result = new TheethsSum();

            var incrementalSuperiorListToSum = new List <decimal>()
            {
                theethMessure.Tooth11.Value, theethMessure.Tooth12.Value, theethMessure.Tooth21.Value, theethMessure.Tooth22.Value
            };

            var incrementalInferiorListToSum = new List <decimal>()
            {
                theethMessure.Tooth41.Value, theethMessure.Tooth42.Value, theethMessure.Tooth31.Value, theethMessure.Tooth32.Value
            };

            // Obtain Sum of minor table
            result.SumSuperiorFour = GetSum(incrementalSuperiorListToSum);
            result.SumInferiorFour = GetSum(incrementalInferiorListToSum);

            // Add fields of next table
            incrementalSuperiorListToSum.Add(theethMessure.Tooth13.Value);
            incrementalSuperiorListToSum.Add(theethMessure.Tooth23.Value);

            incrementalInferiorListToSum.Add(theethMessure.Tooth33.Value);
            incrementalInferiorListToSum.Add(theethMessure.Tooth43.Value);

            result.SumSuperiorSix = GetSum(incrementalSuperiorListToSum);
            result.SumInferiorSix = GetSum(incrementalInferiorListToSum);

            // Add fields of next table
            incrementalSuperiorListToSum.Add(theethMessure.Tooth14.Value);
            incrementalSuperiorListToSum.Add(theethMessure.Tooth15.Value);
            incrementalSuperiorListToSum.Add(theethMessure.Tooth24.Value);
            incrementalSuperiorListToSum.Add(theethMessure.Tooth25.Value);

            incrementalInferiorListToSum.Add(theethMessure.Tooth34.Value);
            incrementalInferiorListToSum.Add(theethMessure.Tooth35.Value);
            incrementalInferiorListToSum.Add(theethMessure.Tooth44.Value);
            incrementalInferiorListToSum.Add(theethMessure.Tooth45.Value);

            result.SumSuperiorTen = GetSum(incrementalSuperiorListToSum);
            result.SumInferiorTen = GetSum(incrementalInferiorListToSum);

            // Add fields of next table
            incrementalSuperiorListToSum.Add(theethMessure.Tooth16.Value);
            incrementalSuperiorListToSum.Add(theethMessure.Tooth26.Value);

            incrementalInferiorListToSum.Add(theethMessure.Tooth36.Value);
            incrementalInferiorListToSum.Add(theethMessure.Tooth46.Value);

            result.SumSuperiorTwelve = GetSum(incrementalSuperiorListToSum);
            result.SumInferiorTwelve = GetSum(incrementalInferiorListToSum);

            return(result);
        }
示例#7
0
        public Result(MessuresViewModel messureViewModule)
        {
            this.mouseMessures      = messureViewModule.mouseModel;
            this.theetMessure       = messureViewModule.roothModel;
            this.patientInformation = messureViewModule.patientModel;

            result = new MessuresResultsProvider(mouseMessures, theetMessure).GetResult();

            InitializeComponent();

            SetValues(result);
        }
示例#8
0
        /// <summary>
        /// Gets the result.
        /// </summary>
        /// <param name="theethMessure">The theeth messure.</param>
        /// <returns></returns>
        public static Pont GetResult(RoothCalculationEntity theethMessure)
        {
            var pontResult = new Pont();

            var sumResult = TheethsSum.GetResults(theethMessure);

            pontResult.Pont14To24 = CalculationBase.RoundUpResult(sumResult.SumSuperiorFour * 100 / 84);
            pontResult.Pont16To26 = CalculationBase.RoundUpResult(sumResult.SumSuperiorFour * 100 / 65);

            pontResult.ArchLong = CalculationTables.PontTable.FindPontValue(sumResult.SumSuperiorFour);

            return(pontResult);
        }
示例#9
0
        /// <summary>
        /// Gets the result.
        /// </summary>
        /// <param name="mouthMessure">The mouth messure.</param>
        /// <param name="theethMessure">The theeth messure.</param>
        /// <returns></returns>
        public static Moyers GetResult(MouthCalculationEntity mouthMessure, RoothCalculationEntity theethMessure)
        {
            var result = new Moyers();

            var theeths           = TheethsSum.GetResults(theethMessure);
            var mouthCalculations = MouthSum.GetResults(mouthMessure);

            var incisivesSum = theeths.SumInferiorFour;

            result.RightSuperior = GetMoyerResult(incisivesSum, mouthCalculations.RightSuperiorAvailableSpace, true);

            result.RightInferior = GetMoyerResult(incisivesSum, mouthCalculations.RightInferiorAvailableSpace, false);

            result.LeftSuperior = GetMoyerResult(incisivesSum, mouthCalculations.LeftSuperiorAvailableSpace, true);

            result.LeftInferior = GetMoyerResult(incisivesSum, mouthCalculations.LeftInferiorAvailableSpace, false);

            return(result);
        }
示例#10
0
        public static void Export(RoothCalculationEntity roothCalculation,
                                  MouthCalculationEntity mouthCalculation,
                                  PatientInformation patientInformation,
                                  ResultsMessures result,
                                  string filePath)
        {
            InitializeCultures();

            var excelTemplate = Resources.FilesResources.HaenggiCalculationResult;

            CopyStream(excelTemplate, filePath);

            wapp = new Application();

            try
            {
                wbook = wapp.Workbooks.Open(filePath, true, true,
                                            Missing.Value, Missing.Value, Missing.Value, Missing.Value,
                                            Missing.Value, Missing.Value, Missing.Value, Missing.Value,
                                            Missing.Value, Missing.Value, Missing.Value, Missing.Value);

                var fileNameSubstr = filePath.LastIndexOf("\\") + 1;
                wbook.Title = filePath.Substring(fileNameSubstr, filePath.LastIndexOf(".") - fileNameSubstr);

                SetDataIntoSheetMessure(wbook.Worksheets.get_Item(1), roothCalculation, mouthCalculation, patientInformation);

                SetDataIntoSheetResult(wbook.Worksheets.get_Item(2), result);

                wbook.SaveCopyAs(filePath);
                wbook.Close(false);
            }
            catch (Exception)
            {
                wbook.Close(false);
                throw new Exception("Error al intentar exportar el resultado.");
            }
            finally
            {
                wapp.Workbooks.Close();
                wapp.Quit();
            }
        }
示例#11
0
        /// <summary>
        /// Gets the result.
        /// </summary>
        /// <param name="theethMessure">The theeth messure.</param>
        /// <returns></returns>
        public static BoltonTotal GetBoltonTotalResult(RoothCalculationEntity theethMessure)
        {
            var result = new BoltonTotal();

            var theeths = TheethsSum.GetResults(theethMessure);

            result.Maxilar12Pac    = theeths.SumSuperiorTwelve;
            result.Mandibular12Pac = theeths.SumInferiorTwelve;

            result.Total = CalculationBase.RoundUpResult(result.Mandibular12Pac / result.Maxilar12Pac * 100);

            result.IsSuperiorExcess = result.Total < BoltonTotalBreakPoint;

            result.Maxilar12Ideal = BoltonTable.FindBoltonTotalByMandibularValue(result.Mandibular12Pac);
            result.SuperiorExcess = result.Maxilar12Pac - result.Maxilar12Ideal;

            result.Mandibular12Ideal = BoltonTable.FindBoltonTotalByMaxilarValue(result.Maxilar12Pac);
            result.InferiorExcess    = result.Mandibular12Pac - result.Mandibular12Ideal;

            return(result);
        }
示例#12
0
        /// <summary>
        /// Gets the result.
        /// </summary>
        /// <param name="theethMessure">The theeth messure.</param>
        /// <returns></returns>
        public static BoltonPreviousRelation GetBoltonPreviousResult(RoothCalculationEntity theethMessure)
        {
            var result = new BoltonPreviousRelation();

            var theeths = TheethsSum.GetResults(theethMessure);

            result.Maxilar6Pac    = theeths.SumSuperiorSix;
            result.Mandibular6Pac = theeths.SumInferiorSix;

            result.Total = CalculationBase.RoundUpResult(result.Mandibular6Pac / result.Maxilar6Pac * 100);

            result.IsSuperiorExcess = result.Total < BoltonPreviousBreakPoint;

            result.Mandibular6Ideal = BoltonTable.FindPreviousRelationBoltonByMaxilarValue(result.Maxilar6Pac);
            result.InferiorExcess   = result.Mandibular6Pac - result.Mandibular6Ideal;

            result.Maxilar6Ideal  = BoltonTable.FindPreviousRelationBoltonByMandibularValue(result.Mandibular6Pac);
            result.SuperiorExcess = result.Maxilar6Pac - result.Maxilar6Ideal;

            return(result);
        }
示例#13
0
        /// <summary>
        /// Sets the rooth theet default messures.
        /// </summary>
        /// <returns></returns>
        public RoothCalculationEntity SetRoothTheetDefaultMessures()
        {
            var roothMessures = new RoothCalculationEntity();

            roothMessures.Tooth11 = 8;
            roothMessures.Tooth12 = 6;
            roothMessures.Tooth13 = 8;
            roothMessures.Tooth14 = 8;
            roothMessures.Tooth15 = 7;
            roothMessures.Tooth16 = 11;
            roothMessures.Tooth17 = 0;

            roothMessures.Tooth21 = 8;
            roothMessures.Tooth22 = 6;
            roothMessures.Tooth23 = 8;
            roothMessures.Tooth24 = 8;
            roothMessures.Tooth25 = 8;
            roothMessures.Tooth26 = 11;
            roothMessures.Tooth27 = 0;

            roothMessures.Tooth31 = 6;
            roothMessures.Tooth32 = 6;
            roothMessures.Tooth33 = 7;
            roothMessures.Tooth34 = 7;
            roothMessures.Tooth35 = 7;
            roothMessures.Tooth36 = 11;
            roothMessures.Tooth37 = 11;

            roothMessures.Tooth41 = 6;
            roothMessures.Tooth42 = 6;
            roothMessures.Tooth43 = 7;
            roothMessures.Tooth44 = 7;
            roothMessures.Tooth45 = 7;
            roothMessures.Tooth46 = 11;
            roothMessures.Tooth47 = 11;

            return(roothMessures);
        }
 public void TestInit()
 {
     theethMessure = SetRoothTheetDefaultMessures();
 }
 private void SetDefaultMessuresInputsValue()
 {
     mouthMessure  = SetMouthDefaultMessures();
     theethMessure = SetRoothTheetDefaultMessures();
 }
示例#16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MessuresResultsProvider"/> class.
 /// </summary>
 /// <param name="mouthMessure">The mouse messure.</param>
 /// <param name="theethMessure">The theeth messure.</param>
 public MessuresResultsProvider(MouthCalculationEntity mouthMessure, RoothCalculationEntity theethMessure)
 {
     this.mouthMessure  = mouthMessure;
     this.theethMessure = theethMessure;
 }
        public static DentalBoneDiscrepancy GetResult(MouthCalculationEntity mouseMessure, RoothCalculationEntity theethMessure)
        {
            var bonesSpaces = BonesSpaces.GetBonesCalculation(mouseMessure);
            var theeths     = TheethsSum.GetResults(theethMessure);

            var dentalDiscrepancy = new DentalBoneDiscrepancy();

            dentalDiscrepancy.Superior = bonesSpaces.PerineoSuperiorArch - theeths.SumSuperiorTen;
            dentalDiscrepancy.Inferior = bonesSpaces.PerineoInferiorArch - theeths.SumInferiorTen;

            dentalDiscrepancy.SuperiorAntero = bonesSpaces.Bones13To23 - theeths.SumSuperiorSix;
            dentalDiscrepancy.InferiorAntero = bonesSpaces.Bones33To43 - theeths.SumInferiorSix;

            dentalDiscrepancy.InferiorIncisives = bonesSpaces.InferiorBonesIntercanine - theeths.SumInferiorFour;

            return(dentalDiscrepancy);
        }
示例#18
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Messures"/> class.
        /// </summary>
        /// <param name="theetMessure">The theet messure.</param>
        /// <param name="mouseMessures">The mouse messures.</param>
        /// <param name="patientInformation">The patient information.</param>
        public Messures(RoothCalculationEntity theetMessure, MouthCalculationEntity mouseMessures, PatientInformation patientInformation)
        {
            serialPort = DeviceHelper.Device;

            this.InitForm(new MessuresViewModel(theetMessure, mouseMessures, patientInformation));
        }