예제 #1
0
        ///<summary>Fills the combo box passed in with all of the sheet defs available for the passed in sheet type.</summary>
        private void FillSheetDefComboBox(ComboBox comboBox, SheetTypeEnum sheetType)
        {
            List <SheetDef> listSheetDefs = new List <SheetDef>();

            //Some sheet types have multiple "internal" examples for user convenience.
            //We need to make sure that we give ALL internal types as options for defaults.
            switch (sheetType)
            {
            case SheetTypeEnum.LabelPatient:
                //TODO: When there are multiple "internal" sheet defs available for the user to pick,
                //	we need to store the selection made as a string within the clinicpref tables "ValueString" column.
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientMail));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientLFAddress));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientLFChartNumber));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientLFPatNum));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientRadiograph));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.LabelText));
                break;

            case SheetTypeEnum.PatientForm:
                //TODO: When there are multiple "internal" sheet defs available for the user to pick,
                //	we need to store the selection made as a string within the clinicpref tables "ValueString" column.
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.PatientRegistration));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.FinancialAgreement));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.HIPAA));
                break;

            case SheetTypeEnum.MedicalHistory:
                //TODO: When there are multiple "internal" sheet defs available for the user to pick,
                //	we need to store the selection made as a string within the clinicpref tables "ValueString" column.
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.MedicalHistNewPat));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.MedicalHistSimple));
                listSheetDefs.Add(SheetsInternal.GetSheetDef(SheetInternalType.MedicalHistUpdate));
                break;

            case SheetTypeEnum.Consent:
            case SheetTypeEnum.DepositSlip:
            case SheetTypeEnum.ExamSheet:
            case SheetTypeEnum.LabelAppointment:
            case SheetTypeEnum.LabelCarrier:
            case SheetTypeEnum.LabelReferral:
            case SheetTypeEnum.LabSlip:
            case SheetTypeEnum.MedLabResults:
            case SheetTypeEnum.PatientLetter:
            case SheetTypeEnum.PaymentPlan:
            case SheetTypeEnum.ReferralLetter:
            case SheetTypeEnum.ReferralSlip:
            case SheetTypeEnum.RoutingSlip:
            case SheetTypeEnum.Rx:
            case SheetTypeEnum.RxMulti:
            case SheetTypeEnum.Screening:
            case SheetTypeEnum.Statement:
            case SheetTypeEnum.TreatmentPlan:
            default:
                //Sheet types will typically only have one internal example for the user to copy from.
                listSheetDefs.Add(SheetsInternal.GetSheetDef(sheetType));
                break;
            }
            listSheetDefs.AddRange(SheetDefs.GetCustomForType(sheetType));
            comboBox.Items.Clear();
            comboBox.DisplayMember = "Description";
            comboBox.ValueMember   = "SheetDef";
            if (PrefC.HasClinicsEnabled && ((ClinicWrapper)comboClinicDefault.SelectedItem).Clinic.ClinicNum != 0)
            {
                comboBox.Items.Add(new SheetDefWrapper(Lan.g(this, "Default")));
            }
            foreach (SheetDef defCur in listSheetDefs)
            {
                SheetDefWrapper defNew = new SheetDefWrapper(defCur);
                comboBox.Items.Add(defNew);
                if (defCur.SheetDefNum == PrefC.GetDefaultSheetDefNum(sheetType))
                {
                    comboBox.SelectedItem = defNew;
                }
            }
            if (comboBox.SelectedIndex == -1 && comboBox.Items.Count > 0)
            {
                comboBox.SelectedIndex = 0;
            }
        }