public static BonesSpaces GetBonesCalculation(MouthCalculationEntity mouseMessure) { var bonesSpaces = new BonesSpaces(); bonesSpaces.PerineoSuperiorArch = mouseMessure.LeftSuperiorCanine.Value + mouseMessure.LeftSuperiorIncisive.Value + mouseMessure.LeftSuperiorPremolar.Value + mouseMessure.RightSuperiorCanine.Value + mouseMessure.RightSuperiorIncisive.Value + mouseMessure.RightSuperiorPremolar.Value; bonesSpaces.PerineoInferiorArch = mouseMessure.LeftInferiorCanine.Value + mouseMessure.LeftInferiorIncisive.Value + mouseMessure.LeftInferiorPremolar.Value + mouseMessure.RightInferiorCanine.Value + mouseMessure.RightInferiorIncisive.Value + mouseMessure.RightInferiorPremolar.Value; bonesSpaces.SuperiorBonesIntercanine = mouseMessure.LeftSuperiorIncisive.Value + mouseMessure.RightSuperiorIncisive.Value; bonesSpaces.InferiorBonesIntercanine = mouseMessure.LeftInferiorIncisive.Value + mouseMessure.RightInferiorIncisive.Value; bonesSpaces.Bones13To23 = mouseMessure.LeftSuperiorIncisive.Value + mouseMessure.LeftSuperiorCanine.Value + mouseMessure.RightSuperiorIncisive.Value + mouseMessure.RightSuperiorCanine.Value; bonesSpaces.Bones33To43 = mouseMessure.LeftInferiorIncisive.Value + mouseMessure.LeftInferiorCanine.Value + mouseMessure.RightInferiorIncisive.Value + mouseMessure.RightInferiorCanine.Value; return(bonesSpaces); }
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; }
public MessuresViewModel() { roothModel = new RoothCalculationEntity(); mouseModel = new MouthCalculationEntity(); patientModel = new PatientInformation() { DateMessure = DateTime.Now }; }
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); }
/// <summary> /// Sets the mouth values. /// </summary> /// <param name="sheet">The sheet.</param> /// <param name="mouthCalculation">The mouth calculation.</param> private static void SetMouthValues(Worksheet sheet, MouthCalculationEntity mouthCalculation) { sheet.get_Range("S17", "S17").Value2 = mouthCalculation.RightSuperiorPremolar.ResultToString(); sheet.get_Range("S15", "S15").Value2 = mouthCalculation.RightSuperiorCanine.ResultToString(); sheet.get_Range("T13", "T13").Value2 = mouthCalculation.RightSuperiorIncisive.ResultToString(); sheet.get_Range("V13", "V13").Value2 = mouthCalculation.LeftSuperiorIncisive.ResultToString(); sheet.get_Range("X15", "X15").Value2 = mouthCalculation.LeftSuperiorCanine.ResultToString(); sheet.get_Range("X17", "X17").Value2 = mouthCalculation.LeftSuperiorPremolar.ResultToString(); sheet.get_Range("S29", "S29").Value2 = mouthCalculation.RightInferiorPremolar.ResultToString(); sheet.get_Range("S31", "S31").Value2 = mouthCalculation.RightInferiorCanine.ResultToString(); sheet.get_Range("T33", "T33").Value2 = mouthCalculation.RightInferiorIncisive.ResultToString(); sheet.get_Range("V33", "V33").Value2 = mouthCalculation.LeftInferiorIncisive.ResultToString(); sheet.get_Range("X31", "X31").Value2 = mouthCalculation.LeftInferiorCanine.ResultToString(); sheet.get_Range("X29", "X29").Value2 = mouthCalculation.LeftInferiorPremolar.ResultToString(); }
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); }
/// <summary> /// Gets the results. /// </summary> /// <param name="mouthCalculation">The mouth calculation.</param> /// <returns></returns> public static MouthSum GetResults(MouthCalculationEntity mouthCalculation) { var result = new MouthSum(); result.RightSuperiorAvailableSpace = mouthCalculation.RightSuperiorCanine.Value + mouthCalculation.RightSuperiorPremolar.Value; result.RightInferiorAvailableSpace = mouthCalculation.RightInferiorCanine.Value + mouthCalculation.RightInferiorPremolar.Value; result.LeftSuperiorAvailableSpace = mouthCalculation.LeftSuperiorCanine.Value + mouthCalculation.LeftSuperiorPremolar.Value; result.LeftInferiorAvailableSpace = mouthCalculation.LeftInferiorCanine.Value + mouthCalculation.LeftInferiorPremolar.Value; return(result); }
/// <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); }
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(); } }
/// <summary> /// Sets the mouth default messures. /// </summary> public MouthCalculationEntity SetMouthDefaultMessures() { var mouthMessure = new MouthCalculationEntity(); mouthMessure.RightSuperiorIncisive = 4; mouthMessure.RightSuperiorCanine = 8; mouthMessure.RightSuperiorPremolar = 16; mouthMessure.LeftSuperiorIncisive = 4; mouthMessure.LeftSuperiorCanine = 8; mouthMessure.LeftSuperiorPremolar = 13; mouthMessure.RightInferiorIncisive = 4; mouthMessure.RightInferiorCanine = 8; mouthMessure.RightInferiorPremolar = 11; mouthMessure.LeftInferiorIncisive = 4; mouthMessure.LeftInferiorCanine = 8; mouthMessure.LeftInferiorPremolar = 19; return(mouthMessure); }
/// <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; }
/// <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); }
private void SetDefaultMessuresInputsValue() { mouthMessure = SetMouthDefaultMessures(); theethMessure = SetRoothTheetDefaultMessures(); }
/// <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)); }