public StringDropDownControl(MultipleChoiceResult result) { InitializeComponent(); Result = result; if (result.Name.Length != 0) { ResultTitleLabel.Text = result.Name; } else { ResultTitleLabel.Text = result.DisplayName; } ResultPostfixLabel.Text = result.Postfix; ResultValueComboBox.Items.Clear(); ResultValueComboBox.Width = 1; foreach (var x in result.Options) { int w = TextRenderer.MeasureText(x, ResultValueComboBox.Font).Width; //int w = TextRenderer.MeasureText(x, ResultValueComboBox.Font, new Size(int.MaxValue, int.MaxValue), TextFormatFlags.WordEllipsis).Width; //w += (int) (w * 0); w += 30; if (ResultValueComboBox.Width < w) { ResultValueComboBox.Width = w; } } ResultValueComboBox.Items.AddRange(result.Options.ToArray()); ResultValueComboBox.SelectedIndex = 0; }
private string OptionsToString(MultipleChoiceResult result1, MultipleChoiceResult result2, MultipleChoiceResult result3) { return(OptionsToString(new List <MultipleChoiceResult>() { result1, result2, result3 })); }
public PatientData() { PatientAge = new Result("Age", "years"); GestationalAge = new Result("Gestational Age", "weeks"); FemurLength = new Result("Femur Length", "mm"); PatientName = new StringResult("Patient Name"); PatientID = new StringResult("Patient ID"); PatientDOB = new DateResult("DOB"); StudyDate = new DateResult("Study Date"); EstimatedDueDate = new DateResult("Estimated Due Date"); ReasonForStudy = new StringResult("Reason For Study"); ReferringPhysician = new StringResult("Referring Physician"); EchoType = new MultipleChoiceResult("Echo Type", new List <string>() { "Fetal Echo" }); ReportingDoctor = new MultipleChoiceResult("Reporting Doctor", new List <string>() { "Dr Paul Brooks" }); UpdateGestationalAgeResult(); }
public PatientData() { IMeasurementHeader temp; temp = new UnitHeaderAdapter("Age", new Duration(0, DurationUnit.Year365)); PatientAge = new Result(temp, true); PatientSex = new StringResult("Sex"); temp = new UnitHeaderAdapter("Height", new Length(0, LengthUnit.Centimeter)); PatientHeight = new Result(temp, true); temp = new UnitHeaderAdapter("Weight", new Mass(0, MassUnit.Kilogram)); PatientWeight = new Result(temp, true); temp = new MeasurementHeader("Systolic Blood Pressure", 0, "", "mmHg"); SystolicBloodPressure = new Result(temp, true); temp = new MeasurementHeader("Diastolic Blood Pressure", 0, "", "mmHg"); DiastolicBloodPressure = new Result(temp, true); PatientName = new StringResult("Patient Name"); PatientID = new StringResult("Patient ID"); PatientDOB = new StringResult("DOB"); StudyDate = new StringResult("Study Date"); ReasonForStudy = new StringResult("Reason For Study"); ReferringPhysician = new StringResult("Referring Physician"); EchoType = new MultipleChoiceResult("Echo Type", new List <string>() { "Transthoracic echo" }); ReportingDoctor = new MultipleChoiceResult("Reporting Doctor", new List <string>() { "Dr Paul Brooks", "Dr Hannah Bourne" }); UpdateBSAResult(); }
/// <summary> /// Gets the result of the query. /// </summary> /// <returns></returns> /// <remarks>Documented by Dev03, 2008-01-10</remarks> public MultipleChoiceResult GetResult() { MultipleChoiceResult result = MultipleChoiceResult.Wrong; bool first = true; foreach (Choice choice in this) { if (choice.IsCorrect) { result = (choice.Checked && (first || (result == MultipleChoiceResult.Correct))) ? MultipleChoiceResult.Correct : MultipleChoiceResult.Wrong; first = false; } else if (choice.Checked) { result = MultipleChoiceResult.Wrong; break; } } return(result); }
public UserInputSubmitMultipleChoiceEventArgs(string answer, MultipleChoiceResult result) : base() { this.answer = answer; this.result = result; }