private void butPrint_Click(object sender, System.EventArgs e) { //only visible if sheet==null. if (comboSendStatus.SelectedIndex == (int)RxSendStatus.InElectQueue || comboSendStatus.SelectedIndex == (int)RxSendStatus.SentElect) { //do not change status } else { comboSendStatus.SelectedIndex = (int)RxSendStatus.Printed; } if (!SaveRx()) { return; } SheetDef sheetDef; List <SheetDef> customSheetDefs = SheetDefs.GetCustomForType(SheetTypeEnum.Rx); if (customSheetDefs.Count == 0) { sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.Rx); } else { sheetDef = customSheetDefs[0]; SheetDefs.GetFieldsAndParameters(sheetDef); } sheet = SheetUtil.CreateSheet(sheetDef, PatCur.PatNum); SheetParameter.SetParameter(sheet, "RxNum", RxPatCur.RxNum); SheetFiller.FillFields(sheet); SheetUtil.CalculateHeights(sheet, this.CreateGraphics()); SheetPrinting.PrintRx(sheet, RxPatCur.IsControlled); DialogResult = DialogResult.OK; }
private void butSlip_Click(object sender, EventArgs e) { int idx = gridMain.GetSelectedIndex(); if (idx == -1) { MsgBox.Show(this, "Please select a referral first"); return; } Referral referral = Referrals.GetReferral(RefAttachList[idx].ReferralNum); SheetDef sheetDef; if (referral.Slip == 0) { sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.ReferralSlip); } else { sheetDef = SheetDefs.GetSheetDef(referral.Slip); } Sheet sheet = SheetUtil.CreateSheet(sheetDef, PatNum); SheetParameter.SetParameter(sheet, "PatNum", PatNum); SheetParameter.SetParameter(sheet, "ReferralNum", referral.ReferralNum); SheetFiller.FillFields(sheet); SheetUtil.CalculateHeights(sheet, this.CreateGraphics()); FormSheetFillEdit FormS = new FormSheetFillEdit(sheet); FormS.ShowDialog(); //grid will not be refilled, so no need to reselect. }
///<summary></summary> public static void PrintAppointment(long aptNum) { SheetDef sheetDef; List <SheetDef> customSheetDefs = SheetDefs.GetCustomForType(SheetTypeEnum.LabelAppointment); if (customSheetDefs.Count == 0) { sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabelAppointment); } else { sheetDef = customSheetDefs[0]; SheetDefs.GetFieldsAndParameters(sheetDef); } Sheet sheet = SheetUtil.CreateSheet(sheetDef); SheetParameter.SetParameter(sheet, "AptNum", aptNum); SheetFiller.FillFields(sheet); try { SheetPrinting.Print(sheet); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary>Specify a sheetDefNum of 0 for the internal Routing slip.</summary> private void PrintRoutingSlips(List <long> aptNums, long sheetDefNum) { SheetDef sheetDef; if (sheetDefNum == 0) { sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.RoutingSlip); } else { sheetDef = SheetDefs.GetSheetDef(sheetDefNum); //includes fields and parameters } List <Sheet> sheetBatch = SheetUtil.CreateBatch(sheetDef, aptNums); if (sheetBatch.Count == 0) { MsgBox.Show(this, "There are no routing slips to print."); return; } try { SheetPrinting.PrintBatch(sheetBatch); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
///<summary>Passing in a clinicNum of 0 will use the base default sheet def. Otherwise returns the clinic specific default sheetdef.</summary> public static SheetDef GetSheetsDefault(SheetTypeEnum sheetType, long clinicNum = 0) { //No need to check RemotingRole; no call to db. ClinicPref clinicPrefCur = ClinicPrefs.GetPref(Prefs.GetSheetDefPref(sheetType), clinicNum); SheetDef defaultSheetDef; if (clinicPrefCur == null) //If there wasn't a row for the specific clinic, use the base default sheetdef { defaultSheetDef = GetSheetDef(PrefC.GetDefaultSheetDefNum(sheetType), false); if (defaultSheetDef == null) { defaultSheetDef = SheetsInternal.GetSheetDef(sheetType); } return(defaultSheetDef); //Return the base default sheetdef } //Clinic specific sheet def found if (PIn.Long(clinicPrefCur.ValueString) == 0) //If ValueString is 0 then we want to keep it as the internal sheet def. { defaultSheetDef = SheetsInternal.GetSheetDef(sheetType); } else { defaultSheetDef = GetSheetDef(PIn.Long(clinicPrefCur.ValueString), false); } return(defaultSheetDef); }
private void butSlip_Click(object sender, EventArgs e) { int idx = gridMain.GetSelectedIndex(); if (idx == -1) { MsgBox.Show(this, "Please select a referral first"); return; } Referral referral = ReferralL.GetReferral(((RefAttach)gridMain.ListGridRows[idx].Tag).ReferralNum); if (referral == null) { return; } SheetDef sheetDef; if (referral.Slip == 0) { sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.ReferralSlip); } else { sheetDef = SheetDefs.GetSheetDef(referral.Slip); } Sheet sheet = SheetUtil.CreateSheet(sheetDef, PatNum); SheetParameter.SetParameter(sheet, "PatNum", PatNum); SheetParameter.SetParameter(sheet, "ReferralNum", referral.ReferralNum); SheetFiller.FillFields(sheet); SheetUtil.CalculateHeights(sheet); FormSheetFillEdit.ShowForm(sheet); }
///<summary>Returns the SheetTypeEnum & Sheet Def defaults for a clinic, if clinics is not on/or user is altering HQ settings ///it will instead return user defaults, if neither is present then it will return the pratice default.</summary> public static Dictionary <SheetTypeEnum, SheetDef> GetDefaultSheetDefs(long clinicNum = 0, params SheetTypeEnum[] arrSheetTypes) { //No need to check RemotingRole; no call to db. Dictionary <SheetTypeEnum, SheetDef> retVal = new Dictionary <SheetTypeEnum, SheetDef>(); foreach (SheetTypeEnum sheetTypeEnum in arrSheetTypes) { SheetDef defaultSheetDef = GetSheetDef(PrefC.GetDefaultSheetDefNum(sheetTypeEnum), false); if (clinicNum == 0) { if (defaultSheetDef == null) { defaultSheetDef = SheetsInternal.GetSheetDef(sheetTypeEnum); } retVal.Add(sheetTypeEnum, defaultSheetDef); } else { ClinicPref clinicPrefCur = ClinicPrefs.GetPref(Prefs.GetSheetDefPref(sheetTypeEnum), clinicNum); defaultSheetDef = SheetsInternal.GetSheetDef(sheetTypeEnum); if (clinicPrefCur != null && PIn.Long(clinicPrefCur.ValueString) != 0) //If ValueString is 0 then we want to keep it as the internal sheet def. { defaultSheetDef = GetSheetDef(PIn.Long(clinicPrefCur.ValueString), false); } if (clinicPrefCur != null) //If there was a row in the clinicpref table, add whatever the sheetdef was to the retval dictionary. { retVal.Add(sheetTypeEnum, defaultSheetDef); } } } return(retVal); }
private void FillGridInternal() { //Get the list of SheetDefs that are for Dashboards. SheetDef[] sheetDefs = Enum.GetValues(typeof(SheetInternalType)).OfType <SheetInternalType>() .Where(x => x.GetAttributeOrDefault <SheetInternalAttribute>().DoShowInDashboardSetup) .Select(x => SheetsInternal.GetSheetDef(x)) .ToArray(); FillGrid(gridInternal, true, sheetDefs); }
public static SheetDef GetInternalOrCustom(SheetInternalType sheetInternalType) { SheetDef retVal = SheetsInternal.GetSheetDef(sheetInternalType); SheetDef custom = GetCustomForType(retVal.SheetType).OrderBy(x => x.Description).ThenBy(x => x.SheetDefNum).FirstOrDefault(); if (custom != null) { retVal = GetSheetDef(custom.SheetDefNum); } return(retVal); }
///<summary></summary> public static void PrintCarriers(List <long> carrierNums) { SheetDef sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabelCarrier); List <Sheet> sheetBatch = SheetUtil.CreateBatch(sheetDef, carrierNums); try{ SheetPrinting.PrintBatch(sheetBatch); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void listSheetType_SelectedIndexChanged(object sender, EventArgs e) { if (!IsInitial) { return; } if (listSheetType.SelectedIndex == -1) { return; } SheetDef sheetdef = null; checkHasMobileLayout.Enabled = false; switch (_sheetTypeSelected) { case SheetTypeEnum.LabelCarrier: case SheetTypeEnum.LabelPatient: case SheetTypeEnum.LabelReferral: sheetdef = SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientMail); if (textDescription.Text == "") { textDescription.Text = _sheetTypeSelected.GetDescription(); } comboFontName.Text = sheetdef.FontName; textFontSize.Text = sheetdef.FontSize.ToString(); textWidth.Text = sheetdef.Width.ToString(); textHeight.Text = sheetdef.Height.ToString(); checkIsLandscape.Checked = sheetdef.IsLandscape; break; case SheetTypeEnum.ReferralSlip: sheetdef = SheetsInternal.GetSheetDef(SheetInternalType.ReferralSlip); if (textDescription.Text == "") { textDescription.Text = _sheetTypeSelected.GetDescription(); } comboFontName.Text = sheetdef.FontName; textFontSize.Text = sheetdef.FontSize.ToString(); textWidth.Text = sheetdef.Width.ToString(); textHeight.Text = sheetdef.Height.ToString(); checkIsLandscape.Checked = sheetdef.IsLandscape; break; case SheetTypeEnum.PatientForm: case SheetTypeEnum.MedicalHistory: checkHasMobileLayout.Enabled = true; break; } if (!checkHasMobileLayout.Enabled) //Only change the check state if the selected form does not allow mobile sheet layout { checkHasMobileLayout.Checked = false; } }
///<summary>Reloads the control with any new sheet layouts available. ///This should only be called if a dynamic sheetDef was added/modified/deleted, the SheetLayoutMode has changed, or a new user signed in.</summary> public void ReloadSheetLayout(SheetFieldLayoutMode sheetFieldLayoutMode, Dictionary <string, Control> dictionaryControls) { long practiceDefaultSheetDefNum = PrefC.GetLong(PrefName.SheetsDefaultChartModule); ListSheetDefsLayout = SheetDefs.GetCustomForType(_sheetType); ListSheetDefsLayout.Add(SheetsInternal.GetSheetDef(SheetsInternal.GetInternalType(_sheetType))); //Internal at bottom of list. UI reflects this too. ListSheetDefsLayout = ListSheetDefsLayout .OrderBy(x => x.SheetDefNum != practiceDefaultSheetDefNum) //practice default sheetdef should be at the top of the list .ThenBy(x => x.SheetDefNum == 0) //if the internal sheetdef is not the default it should be last .ThenBy(x => x.Description) //order custom sheetdefs by description .ThenBy(x => x.SheetDefNum).ToList(); //then by SheetDefNum to be deterministic order InitLayoutForSheetDef(GetLayoutForUser(), sheetFieldLayoutMode, dictionaryControls, true); //Force refresh in case they edit current layout. }
public static Dictionary <SheetTypeEnum, SheetDef> GetDefaultSheetDefs() { //No need to check RemotingRole; no call to db. Dictionary <SheetTypeEnum, SheetDef> retVal = new Dictionary <SheetTypeEnum, SheetDef>(); SheetDef defaultRxDef = GetSheetDef(PrefC.GetDefaultSheetDefNum(SheetTypeEnum.Rx), false); if (defaultRxDef == null) { defaultRxDef = SheetsInternal.GetSheetDef(SheetTypeEnum.Rx); } retVal.Add(SheetTypeEnum.Rx, defaultRxDef); return(retVal); }
private List <Sheet> GetSheetsForTransfer(List <long> listPatNumsToTransfer) { List <Sheet> retVal = new List <Sheet>(); List <Patient> listPatients = Patients.GetMultPats(listPatNumsToTransfer).ToList(); foreach (Patient pat in listPatients) { Sheet sheetCemt = SheetUtil.CreateSheet(SheetsInternal.GetSheetDef(SheetInternalType.PatientTransferCEMT)); SheetFiller.FillFieldsForPatientTransferCEMT(sheetCemt, pat); retVal.Add(sheetCemt); } return(retVal); }
/*private void buttonEmail_Click(object sender,EventArgs e) { * int CurPatNum=CaseCur.PatNum; * EmailMessage message=new EmailMessage(); * message.PatNum=CurPatNum; * Patient pat=Patients.GetPat(CurPatNum); * message.ToAddress="";//pat.Email; * message.FromAddress=PrefC.GetString(PrefName.EmailSenderAddress"); * message.Subject=Lan.g(this,"RE: ")+pat.GetNameFL(); * FormEmailMessageEdit FormE=new FormEmailMessageEdit(message); * FormE.IsNew=true; * FormE.ShowDialog(); * * }*/ private void butSlip_Click(object sender, EventArgs e) { if (sheet == null) //create new { if (!SaveToDb()) { return; } Laboratory lab = ListLabs[listLab.SelectedIndex]; SheetDef sheetDef; if (lab.Slip == 0) { sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabSlip); } else { sheetDef = SheetDefs.GetSheetDef(lab.Slip); } sheet = SheetUtil.CreateSheet(sheetDef, CaseCur.PatNum); SheetParameter.SetParameter(sheet, "PatNum", CaseCur.PatNum); SheetParameter.SetParameter(sheet, "LabCaseNum", CaseCur.LabCaseNum); SheetFiller.FillFields(sheet); SheetUtil.CalculateHeights(sheet, this.CreateGraphics()); FormSheetFillEdit FormS = new FormSheetFillEdit(sheet); FormS.ShowDialog(); //if(FormS.DialogResult!=DialogResult.OK) { // sheet=null; // return; //} } else //edit existing { SheetFields.GetFieldsAndParameters(sheet); FormSheetFillEdit FormS = new FormSheetFillEdit(sheet); FormS.ShowDialog(); //if(FormS.DialogResult!=DialogResult.OK) { // return; //} } //refresh sheet = Sheets.GetLabSlip(CaseCur.PatNum, CaseCur.LabCaseNum); if (sheet == null) { butSlip.Text = Lan.g(this, "New Slip"); } else { butSlip.Text = Lan.g(this, "Edit Slip"); } }
public static void PrintPatientLFPatNum(long patNum) { SheetDef sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientLFPatNum); Sheet sheet = SheetUtil.CreateSheet(sheetDef); SheetParameter.SetParameter(sheet, "PatNum", patNum); SheetFiller.FillFields(sheet); try { SheetPrinting.Print(sheet); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void RefreshAndFillGrids(long selectedSheetNum = -1) { #region Refresh both sheetDef lists SheetDefs.RefreshCache(); SheetFieldDefs.RefreshCache(); _listOtherSheetDefs = new List <SheetDef>() { SheetsInternal.GetSheetDef(SheetInternalType.ChartModule) }; //Must always be first in list. List <SheetDef> listCustomSheetDefs = SheetDefs.GetCustomForType(SheetTypeEnum.ChartModule); //_listOtherSheetDefs.AddRange(listCustomSheetDefs.FindAll(x => x.UserNum!=Security.CurUser.UserNum));//All other users. //_listCustomSheetDefs=listCustomSheetDefs.FindAll(x => x.UserNum==Security.CurUser.UserNum); #endregion FillGrid(gridOtherLayouts, _listOtherSheetDefs, selectedSheetNum); FillGrid(gridCustomLayouts, _listCustomSheetDefs, selectedSheetNum); }
private void PrintRoutingSlipsForAppts(List <long> listAptNums) { SheetDef sheetDef; List <SheetDef> customSheetDefs = SheetDefs.GetCustomForType(SheetTypeEnum.RoutingSlip); if (customSheetDefs.Count == 0) { sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.RoutingSlip); } else { sheetDef = customSheetDefs[0]; //Instead of doing this, we could give the user a list to pick from on this form. //SheetDefs.GetFieldsAndParameters(sheetDef); } PrintRoutingSlips(listAptNums, sheetDef.SheetDefNum); }
public static void PrintText(long patNum, string text) { SheetDef sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabelText); Sheet sheet = SheetUtil.CreateSheet(sheetDef); SheetParameter.SetParameter(sheet, "PatNum", patNum); sheet.Parameters.Add(new SheetParameter(false, "text")); SheetParameter.SetParameter(sheet, "text", text); SheetFiller.FillFields(sheet); try { SheetPrinting.Print(sheet); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public static Dictionary <SheetTypeEnum, SheetDef> GetDefaultSheetDefsForClinic(long clinicNum) { //No need to check RemotingRole; no call to db. Dictionary <SheetTypeEnum, SheetDef> retVal = new Dictionary <SheetTypeEnum, SheetDef>(); ClinicPref clinicPrefCur = ClinicPrefs.GetPref(Prefs.GetSheetDefPref(SheetTypeEnum.Rx), clinicNum); SheetDef defaultRxDef = SheetsInternal.GetSheetDef(SheetTypeEnum.Rx); if (clinicPrefCur != null && PIn.Long(clinicPrefCur.ValueString) != 0) //If ValueString is 0 then we want to keep it as the internal sheet def. { defaultRxDef = GetSheetDef(PIn.Long(clinicPrefCur.ValueString), false); } if (clinicPrefCur != null) //If there was a row in the clinicpref table, add whatever the sheetdef was to the retval dictionary. { retVal.Add(SheetTypeEnum.Rx, defaultRxDef); } return(retVal); }
/*private void buttonEmail_Click(object sender,EventArgs e) { * int CurPatNum=CaseCur.PatNum; * EmailMessage message=new EmailMessage(); * message.PatNum=CurPatNum; * Patient pat=Patients.GetPat(CurPatNum); * message.ToAddress="";//pat.Email; * message.FromAddress=PrefC.GetString(PrefName.EmailSenderAddress"); * message.Subject=Lan.g(this,"RE: ")+pat.GetNameFL(); * FormEmailMessageEdit FormE=new FormEmailMessageEdit(message); * FormE.IsNew=true; * FormE.ShowDialog(); * * }*/ private void butSlip_Click(object sender, EventArgs e) { if (sheet == null) //create new { if (!SaveToDb()) { return; } Laboratory lab = ListLabs[listLab.SelectedIndex]; SheetDef sheetDef; if (lab.Slip == 0) { sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabSlip); } else { sheetDef = SheetDefs.GetSheetDef(lab.Slip); } sheet = SheetUtil.CreateSheet(sheetDef, CaseCur.PatNum); SheetParameter.SetParameter(sheet, "PatNum", CaseCur.PatNum); SheetParameter.SetParameter(sheet, "LabCaseNum", CaseCur.LabCaseNum); SheetFiller.FillFields(sheet); SheetUtil.CalculateHeights(sheet, this.CreateGraphics()); FormSheetFillEdit FormS = new FormSheetFillEdit(sheet); FormS.ShowDialog(); } else //edit existing { SheetFields.GetFieldsAndParameters(sheet); FormSheetFillEdit FormS = new FormSheetFillEdit(sheet); FormS.ShowDialog(); } //refresh sheet = Sheets.GetLabSlip(CaseCur.PatNum, CaseCur.LabCaseNum); if (sheet == null) { butSlip.Text = Lan.g(this, "New Slip"); } else { butSlip.Text = Lan.g(this, "Edit Slip"); butCancel.Enabled = false; //user can still click X to close window, but we do handle that as well. } }
private void listSheetType_Click(object sender, EventArgs e) { if (!IsInitial) { return; } if (listSheetType.SelectedIndex == -1) { return; } SheetDef sheetdef = null; switch ((SheetTypeEnum)listSheetType.SelectedIndex) { case SheetTypeEnum.LabelCarrier: case SheetTypeEnum.LabelPatient: case SheetTypeEnum.LabelReferral: sheetdef = SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientMail); if (textDescription.Text == "") { textDescription.Text = ((SheetTypeEnum)listSheetType.SelectedIndex).ToString(); } comboFontName.Text = sheetdef.FontName; textFontSize.Text = sheetdef.FontSize.ToString(); textWidth.Text = sheetdef.Width.ToString(); textHeight.Text = sheetdef.Height.ToString(); checkIsLandscape.Checked = sheetdef.IsLandscape; break; case SheetTypeEnum.ReferralSlip: sheetdef = SheetsInternal.GetSheetDef(SheetInternalType.ReferralSlip); if (textDescription.Text == "") { textDescription.Text = ((SheetTypeEnum)listSheetType.SelectedIndex).ToString(); } comboFontName.Text = sheetdef.FontName; textFontSize.Text = sheetdef.FontSize.ToString(); textWidth.Text = sheetdef.Width.ToString(); textHeight.Text = sheetdef.Height.ToString(); checkIsLandscape.Checked = sheetdef.IsLandscape; break; } }
private void butOK_Click(object sender, System.EventArgs e) { //validate user input if (textDate.errorProvider1.GetError(textDate) != "") { MsgBox.Show(this, "Please fix data entry errors first."); return; } if (textDate.Text.Length == 0) { MessageBox.Show(Lan.g(this, "Date is required.")); return; } date = PIn.Date(textDate.Text); if (listProv.SelectedIndices.Count == 0) { MessageBox.Show(Lan.g(this, "You must select at least one provider.")); return; } List <long> provNums = new List <long>(); for (int i = 0; i < listProv.SelectedIndices.Count; i++) { provNums.Add(ProviderC.ListShort[listProv.SelectedIndices[i]].ProvNum); } List <long> aptNums = Appointments.GetRouting(date, provNums); SheetDef sheetDef; List <SheetDef> customSheetDefs = SheetDefs.GetCustomForType(SheetTypeEnum.RoutingSlip); if (customSheetDefs.Count == 0) { sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.RoutingSlip); } else { sheetDef = customSheetDefs[0]; //Instead of doing this, we could give the user a list to pick from on this form. //SheetDefs.GetFieldsAndParameters(sheetDef); } PrintRoutingSlips(aptNums, sheetDef.SheetDefNum); DialogResult = DialogResult.OK; }
///<summary></summary> public static void PrintCarriers(List <long> carrierNums) { SheetDef sheetDef; List <SheetDef> customSheetDefs = SheetDefs.GetCustomForType(SheetTypeEnum.LabelCarrier); if (customSheetDefs.Count == 0) { sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabelCarrier); } else { sheetDef = customSheetDefs[0]; SheetDefs.GetFieldsAndParameters(sheetDef); } List <Sheet> sheetBatch = SheetUtil.CreateBatch(sheetDef, carrierNums); try{ SheetPrinting.PrintBatch(sheetBatch); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
///<summary></summary> public static void PrintPat(long patNum) { SheetDef sheetDef; if (PrefC.GetLong(PrefName.LabelPatientDefaultSheetDefNum) == 0) { sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientMail); } else { sheetDef = SheetDefs.GetSheetDef(PrefC.GetLong(PrefName.LabelPatientDefaultSheetDefNum)); } Sheet sheet = SheetUtil.CreateSheet(sheetDef); SheetParameter.SetParameter(sheet, "PatNum", patNum); SheetFiller.FillFields(sheet); try{ SheetPrinting.Print(sheet); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
///<summary></summary> public static void PrintPat(long patNum) { SheetDef sheetDef = SheetsInternal.GetSheetDef(SheetInternalType.LabelPatientMail); if (PrefC.GetLong(PrefName.LabelPatientDefaultSheetDefNum) != 0) //Try to use custom label sheet. { try { sheetDef = SheetDefs.GetSheetDef(PrefC.GetLong(PrefName.LabelPatientDefaultSheetDefNum)); } catch { //The default label could not be retrieved so just use the internal sheet. } } Sheet sheet = SheetUtil.CreateSheet(sheetDef); SheetParameter.SetParameter(sheet, "PatNum", patNum); SheetFiller.FillFields(sheet); try{ SheetPrinting.Print(sheet); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
///<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; } }
private void FormSheetPicker_Load(object sender, EventArgs e) { listSheets = SheetDefs.GetCustomForType(SheetType); if (listSheets.Count == 0 && SheetType == SheetTypeEnum.PatientForm) { //showingInternalSheetDefs=true; listSheets.Add(SheetsInternal.GetSheetDef(SheetInternalType.PatientRegistration)); listSheets.Add(SheetsInternal.GetSheetDef(SheetInternalType.FinancialAgreement)); listSheets.Add(SheetsInternal.GetSheetDef(SheetInternalType.HIPAA)); listSheets.Add(SheetsInternal.GetSheetDef(SheetInternalType.COVID19)); //Medical History and Consent forms happen below. } if (SheetType == SheetTypeEnum.PatientForm) //we will also show medical history, and possibly consent forms { List <SheetDef> listMedSheets = SheetDefs.GetCustomForType(SheetTypeEnum.MedicalHistory); List <SheetDef> listConSheets = SheetDefs.GetCustomForType(SheetTypeEnum.Consent); if (listMedSheets.Count == 0) { //showingInternalMed=true; listSheets.Add(SheetsInternal.GetSheetDef(SheetInternalType.MedicalHistSimple)); } else //if user has added any of their own medical history forms { for (int i = 0; i < listMedSheets.Count; i++) { listSheets.Add(listMedSheets[i]); } } labelSheetType.Text = Lan.g(this, "Patient Forms and Medical Histories"); //Change name? if (PrefC.GetBool(PrefName.PatientFormsShowConsent)) //only if they want to see consent forms with patient forms. { if (listConSheets.Count == 0) //use internal consent forms { listSheets.Add(SheetsInternal.GetSheetDef(SheetInternalType.Consent)); } else //if user has added any of their own consent forms { for (int i = 0; i < listConSheets.Count; i++) { listSheets.Add(listConSheets[i]); } } labelSheetType.Text = Lan.g(this, "Patient, Consent, and Medical History Forms"); } } else { labelSheetType.Text = Lan.g("enumSheetTypeEnum", SheetType.ToString()); butTerminal.Visible = false; labelTerminal.Visible = false; } if (HideKioskButton) { butTerminal.Visible = false; labelTerminal.Visible = false; } for (int i = 0; i < listSheets.Count; i++) { listMain.Items.Add(listSheets[i].Description); } }