///<summary>Show or hides the form fileds based of needs.</summary> private void ShowOrHideFields(AutoCondField autoCondField) { if (autoCondField == AutoCondField.BillingType) { butBillingType.Visible = true; labelCompareString.Text = Lan.g(this, "Text (Type or pick from list) "); } else { butBillingType.Visible = false; labelCompareString.Text = Lan.g(this, "Text"); } if (autoCondField == AutoCondField.InsuranceNotEffective) //Hide fields //labelWarning.Text=""; //Currently, this is the only condition that shows the warning label. No need to dynamically set the text. { labelWarning.Visible = true; labelComparison.Visible = false; labelCompareString.Visible = false; listComparison.Visible = false; textCompareString.Visible = false; } else //Show fields { labelWarning.Visible = false; labelComparison.Visible = true; labelCompareString.Visible = true; listComparison.Visible = true; textCompareString.Visible = true; } }
///<summary>Logic might get more complex as fields and comparisons are added so a seperate function was made.</summary> private bool ReasonableLogic() { AutoCondComparison comp = (AutoCondComparison)listComparison.SelectedIndex; AutoCondField cond = (AutoCondField)listCompareField.SelectedIndex; //So far Age is only thing that allows GreaterThan or LessThan. if (cond != AutoCondField.Age) { if (comp == AutoCondComparison.GreaterThan || comp == AutoCondComparison.LessThan) { return(false); } } return(true); }
///<summary>Show or hides the form fileds based of needs.</summary> private void ShowOrHideFields(AutoCondField autoCondField) { if (autoCondField == AutoCondField.BillingType) { butBillingType.Visible = true; labelCompareString.Text = Lan.g(this, "Text (Type or pick from list) "); } else { butBillingType.Visible = false; labelCompareString.Text = Lan.g(this, "Text"); } if (autoCondField == AutoCondField.InsuranceNotEffective || autoCondField == AutoCondField.IsControlled || autoCondField == AutoCondField.IsProcRequired) { //Hide fields labelWarning.Visible = true; if (autoCondField == AutoCondField.InsuranceNotEffective) { labelWarning.Text = "At any point in time this rule is triggered, the current date and time will be compared to the " + "effective date range of the current patient's primary insurance. If it does not fall within the range then the " + "action for this automation will be triggered."; } else { labelWarning.Text = "This automation field will only work when using the RxCreate trigger."; } labelComparison.Visible = false; labelCompareString.Visible = false; listComparison.Visible = false; textCompareString.Visible = false; } else //Show fields { labelWarning.Visible = false; labelComparison.Visible = true; labelCompareString.Visible = true; listComparison.Visible = true; textCompareString.Visible = true; } }
///<summary>Logic might get more complex as fields and comparisons are added so a seperate function was made.</summary> private bool ReasonableLogic() { AutoCondComparison comp = (AutoCondComparison)listComparison.SelectedIndex; AutoCondField cond = (AutoCondField)listCompareField.SelectedIndex; //So far Age is only thing that allows GreaterThan or LessThan. if (cond != AutoCondField.Age) { if (comp == AutoCondComparison.GreaterThan || comp == AutoCondComparison.LessThan) { return(false); } } else { int age; //Make sure that the user typed in an integer and not a word. if (!int.TryParse(textCompareString.Text, out age)) { return(false); } } return(true); }