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);
        }
Beispiel #2
0
        private void FillData()
        {
            Referral referral = ReferralL.GetReferral(RefAttachCur.ReferralNum);

            if (referral == null)
            {
                return;
            }
            textName.Text             = referral.GetNameFL();
            labelPatient.Visible      = referral.PatNum > 0;
            textReferralNotes.Text    = referral.Note;
            listRefType.SelectedIndex = (int)RefAttachCur.RefType;
            if (RefAttachCur.RefDate.Year < 1880)
            {
                textRefDate.Text = "";
            }
            else
            {
                textRefDate.Text = RefAttachCur.RefDate.ToShortDateString();
            }
            textOrder.Text     = RefAttachCur.ItemOrder.ToString();
            textOrder.ReadOnly = true;          //It can be reordered by the Up/Down buttons on FormReferralsPatient.
            comboRefToStatus.Items.Clear();
            for (int i = 0; i < Enum.GetNames(typeof(ReferralToStatus)).Length; i++)
            {
                comboRefToStatus.Items.Add(Lan.g("enumReferralToStatus", Enum.GetNames(typeof(ReferralToStatus))[i]));
                if ((int)RefAttachCur.RefToStatus == i)
                {
                    comboRefToStatus.SelectedIndex = i;
                }
            }
            textNote.Text = RefAttachCur.Note;
            checkIsTransitionOfCare.Checked = RefAttachCur.IsTransitionOfCare;
            textProc.Text = "";
            if (RefAttachCur.ProcNum != 0)
            {
                Procedure proc = Procedures.GetOneProc(RefAttachCur.ProcNum, false);
                textProc.Text = Procedures.GetDescription(proc);
            }
            if (RefAttachCur.DateProcComplete.Year < 1880)
            {
                textDateProcCompleted.Text = "";
            }
            else
            {
                textDateProcCompleted.Text = RefAttachCur.DateProcComplete.ToShortDateString();
            }
        }
Beispiel #3
0
        private void butEditReferral_Click(object sender, EventArgs e)
        {
            try{
                DataToCur();
            }
            catch (ApplicationException ex) {
                MessageBox.Show(ex.Message);
                return;
            }
            Referral referral = ReferralL.GetReferral(RefAttachCur.ReferralNum);

            if (referral == null)
            {
                return;
            }
            FormReferralEdit FormRE = new FormReferralEdit(referral);

            FormRE.ShowDialog();
            Referrals.RefreshCache();
            FillData();
        }
Beispiel #4
0
        ///<summary>Pass in all the refattaches for the patient.  This funtion finds the first referral from a Dr and returns that Dr's name.  Used in specialty practices.  Function is only used right now in the Dr. Ceph bridge.</summary>
        public static string GetReferringDr(List <RefAttach> attachList)
        {
            if (attachList.Count == 0)
            {
                return("");
            }
            if (attachList[0].RefType != ReferralType.RefFrom)
            {
                return("");
            }
            Referral referral = ReferralL.GetReferral(attachList[0].ReferralNum);

            if (referral == null || referral.PatNum != 0)
            {
                return("");
            }
            string retVal = referral.FName + " " + referral.MName + " " + referral.LName;

            if (referral.Title != "")
            {
                retVal += ", " + referral.Title;
            }
            return(retVal);
        }
        private void FillGrid()
        {
            RefAttachList = RefAttaches.RefreshFiltered(PatNum, true, 0);
            string referralDescript = DisplayFields.GetForCategory(DisplayFieldCategory.PatientInformation)
                                      .FirstOrDefault(x => x.InternalName == "Referrals")?.Description;

            if (string.IsNullOrWhiteSpace(referralDescript))             //either not displaying the Referral field or no description entered, default to 'Referral (other)'
            {
                referralDescript = Lan.g(this, "Referral (other)");
            }
            gridMain.BeginUpdate();
            gridMain.ListGridColumns.Clear();
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableRefList", "Referral Type"), 85));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableRefList", "Name"), 120));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableRefList", "Date"), 65));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableRefList", "Status"), 70));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableRefList", "Proc"), 120));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableRefList", "Note"), 170));
            gridMain.ListGridColumns.Add(new GridColumn(Lan.g("TableRefList", "Email"), 190));
            gridMain.ListGridRows.Clear();
            bool          hasInvalidRef = false;
            GridRow       row;
            List <string> listRefTypeNames = new List <string>()
            {
                Lan.g(this, "To"), Lan.g(this, "From"), referralDescript
            };

            for (int i = 0; i < RefAttachList.Count; i++)
            {
                RefAttach refAttachCur = RefAttachList[i];
                if (ProcNum != 0 && !checkShowAll.Checked &&
                    ProcNum != refAttachCur.ProcNum)
                {
                    continue;
                }
                row = new GridRow();
                row.Cells.Add(listRefTypeNames[(int)refAttachCur.RefType]);
                row.Cells.Add(Referrals.GetNameFL(refAttachCur.ReferralNum));
                if (refAttachCur.RefDate.Year < 1880)
                {
                    row.Cells.Add("");
                }
                else
                {
                    row.Cells.Add(refAttachCur.RefDate.ToShortDateString());
                }
                row.Cells.Add(Lan.g("enumReferralToStatus", refAttachCur.RefToStatus.ToString()));
                if (refAttachCur.ProcNum == 0)
                {
                    row.Cells.Add("");
                }
                else
                {
                    Procedure proc = Procedures.GetOneProc(refAttachCur.ProcNum, false);
                    string    str  = Procedures.GetDescription(proc);
                    row.Cells.Add(str);
                }
                row.Cells.Add(refAttachCur.Note);
                Referral referral = ReferralL.GetReferral(refAttachCur.ReferralNum, false);
                if (referral == null)
                {
                    hasInvalidRef = true;
                    continue;
                }
                row.Cells.Add(referral.EMail);
                row.Tag = refAttachCur;
                gridMain.ListGridRows.Add(row);
            }
            if (hasInvalidRef)
            {
                ReferralL.ShowReferralErrorMsg();
            }
            gridMain.EndUpdate();
            for (int i = 0; i < RefAttachList.Count; i++)
            {
                if (RefAttachList[i].RefAttachNum == DefaultRefAttachNum)
                {
                    gridMain.SetSelected(i, true);
                    break;
                }
            }
        }