Esempio n. 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (fastDataListView1.SelectedObject == null)
            {
                MessageBox.Show("Please select a patient first.", "WARNING");
                return;
            }
            Appointment appt = ((Appointment) (fastDataListView1.SelectedObject));
            int apptid = appt.apptID;

            if (appt.GoldenAppt != appt.apptID)
            {
                if (appt.apptdatetime < appt.GoldenApptTime)
                {
                    //MessageBox.Show("You have selected an older appointment.  The most recent record for this patient is from " + appt.GoldenApptTime,");
                    LegacyApptForm laf = new LegacyApptForm();
                    laf.selected = appt.apptdatetime;
                    laf.golden = appt.GoldenApptTime;
                    laf.ShowDialog();
                    if (laf.result == "Continue")
                    {
                        SessionManager.Instance.ClearActivePatient();
                        SessionManager.Instance.SetActivePatient(appt.Unitnum, apptid);
                    }
                    else
                    {
                        SessionManager.Instance.ClearActivePatient();
                        SessionManager.Instance.SetActivePatient(appt.Unitnum, appt.GoldenAppt);
                        apptid = appt.GoldenAppt;
                    }
                }
                else
                {
                    SessionManager.Instance.ClearActivePatient();
                    SessionManager.Instance.SetActivePatient(appt.Unitnum, apptid);
                }
            }
            MarkStartedAndPullForwardForm msapf = new MarkStartedAndPullForwardForm(apptid, appt.Unitnum);
            msapf.ShowDialog();

            PedigreeForm pf = new PedigreeForm();
            PushViewStack(pf, DockState.Document);
        }
Esempio n. 2
0
        private void saveAsXMLToolStripMenuItem_Click(object sender, EventArgs e, bool deIdentify)
        {
            Appointment appt = ((Appointment)(fastDataListView1.SelectedObject));
            int apptid = appt.apptID;
            if (appt.GoldenAppt != appt.apptID)
            {
                if (appt.apptdatetime <= appt.GoldenApptTime)
                {
                    //MessageBox.Show("You have selected an older appointment.  The most recent record for this patient is from " + appt.GoldenApptTime,");
                    LegacyApptForm laf = new LegacyApptForm();
                    laf.selected = appt.apptdatetime;
                    laf.golden = appt.GoldenApptTime;
                    laf.ShowDialog();
                    if (laf.result == "Continue")
                    {
                        SessionManager.Instance.ClearActivePatient();
                        SessionManager.Instance.SetActivePatient(appt.Unitnum, apptid);
                    }
                    else
                    {
                        SessionManager.Instance.ClearActivePatient();
                        SessionManager.Instance.SetActivePatient(appt.Unitnum, appt.GoldenAppt);
                    }
                }
                else
                {
                    SessionManager.Instance.ClearActivePatient();
                    SessionManager.Instance.SetActivePatient(appt.Unitnum, apptid);
                }
            }

            Patient patient = SessionManager.Instance.GetActivePatient();

            string fileName = "";
            string initDir = Configurator.GetDocumentStorage();
            if (string.IsNullOrEmpty(initDir))
                exportSaveFileDialog.InitialDirectory = Configurator.getNodeValue("Globals", "DocumentStorage"); //"c:\\Program Files\\riskappsv2\\documents";
            else
                exportSaveFileDialog.InitialDirectory = initDir;

            exportSaveFileDialog.Filter = "Patient Serialization File (*.xml)|*.xml";
            exportSaveFileDialog.FilterIndex = 2;
            exportSaveFileDialog.RestoreDirectory = true;
            exportSaveFileDialog.OverwritePrompt = true;
            exportSaveFileDialog.FileName =
                SessionManager.Instance.GetActivePatient().name + " " +
                SessionManager.Instance.GetActivePatient().unitnum +
                " Serialization " +
                DateTime.Now.ToString("yyyy-MM-dd-HHmm");

            if (exportSaveFileDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    fileName = exportSaveFileDialog.FileName;
                    if (fileName.Length != 0)
                    {
                        //xmlExport(fileName, patient);

                        ImportExportArgs args = new ImportExportArgs();
                        args.mode = ImportExportMode.ExportXML;
                        args.fileName = fileName;
                        args.patient = patient;
                        args.apptID = SessionManager.Instance.GetActivePatient().apptid;
                        args.deIdentify = deIdentify;

                        disableButtons();
                        importExportBackgroundWorker.RunWorkerAsync(args);
                    }
                }
                catch (Exception eee)
                {
                    // get call stack
                    StackTrace stackTrace = new StackTrace();

                    // get calling method name
                    String callingRoutine = stackTrace.GetFrame(1).GetMethod().Name;
                    Logger.Instance.WriteToLog("[MyPatientsView] from [" + callingRoutine + "]\n\t" + eee);
                    return;
                }
            }
        }