예제 #1
0
        public ChangeMrnPopup(Appointment appointment)
        {
            InitializeComponent();

            this._appointment = appointment;

            unitnumTextBox.Text = this._appointment.unitnum;
        }
예제 #2
0
        public void EditAppt(int clinicId, Appointment appointment)
        {
            MarkStartedAndPullForwardForm mark = new MarkStartedAndPullForwardForm(appointment.apptID, appointment.unitnum);
            mark.ShowDialog();
            User.setClinicID(clinicId);
            AddAppointmentView view = new AddAppointmentView(appointment, clinicId, AddAppointmentView.Mode.Edit);
            view.ShowDialog();

            SessionManager.Instance.ClearActivePatient();
        }
예제 #3
0
        public void CopyAppt(int clinicId, Appointment toCopy)
        {
            User.setClinicID(clinicId);

            Appointment copiedFromExisting = new Appointment(toCopy, clinicId);

            MarkStartedAndPullForwardForm mark = new MarkStartedAndPullForwardForm(copiedFromExisting.apptID, copiedFromExisting.unitnum);
            mark.ShowDialog();

            AddAppointmentView view = new AddAppointmentView(
                copiedFromExisting,
                clinicId,
                AddAppointmentView.Mode.Copy);
            view.ShowDialog();
        }
예제 #4
0
 public static Appointment FromRAppointment(this RA.Appointment app, bool dnc = false)
 {
     return(new Appointment()
     {
         Id = app.apptID,
         MRN = app.unitnum,
         AppointmentDate = app.apptdatetime,
         DateOfBirth = app.dob.ToDateTime(),
         DiseaseHx = app.diseases,
         Provider = app.apptphysname,
         PatientName = app.patientname,
         DateCompleted = app.riskdatacompleted,
         Survey = app.surveyType,
         DoNotCall = dnc,
         appttime = app.appttime,
         clinicID = app.clinicID
     });
 }
예제 #5
0
        /// <summary>
        /// User for new appointment.
        /// </summary>
        /// <param name="mrn"></param>
        /// <param name="clinicId">clinic to default to when opening wizard</param>
        public AddAppointmentView(string mrn, int? clinicId)
            : this()
        {
            this._mode = Mode.Add;

            InitializeModeConditions();

            this._patient = new Patient(mrn);
            this._patient.Providers.LoadFullList();

            SessionManager.Instance.SetActivePatient(this._patient.unitnum, this._patient.apptid);

            this._appointment = new Appointment (clinicId, mrn) { ClinicList = this._clinics};

            this._clinicId = clinicId;

            MarkStartedAndPullForwardForm mark = new MarkStartedAndPullForwardForm(this._appointment.apptID, this._appointment.unitnum);
            mark.ShowDialog();
        }
예제 #6
0
 public static Appointment FromRAppointment(this RA.Appointment app)
 {
     return(new Appointment()
     {
         Id = app.apptID,
         MRN = app.unitnum,
         AppointmentDate = app.apptdatetime,
         DateOfBirth = app.dob.ToDateTime(),
         DiseaseHx = app.diseases,
         AppointmentPhysician = app.apptphysname,
         PatientName = app.patientname,
         DateCompleted = app.riskdatacompleted,
         Survey = app.surveyType,
         appttime = app.appttime,
         // AssessmentName = app.AssessmentName,
         clinicID = app.clinicID
                    // Language = app.language
                    // Race = app.race,
                    // Nationality = app.nationality
     });
 }
예제 #7
0
        /// <summary>
        /// Use for existing appointment.
        /// </summary>
        /// <param name="currentAppointment"></param>
        /// <param name="clinicId">clinic to default to when opening wizard</param>
        /// <param name="editOrCopy">Are we editing or copying the selected <code>Appointment</code></param>
        public AddAppointmentView(Appointment currentAppointment, int? clinicId, Mode editOrCopy)
            : this()
        {
            if (editOrCopy == Mode.Add)
            {
                throw new InvalidEnumArgumentException(OnlyEditOrCopyIsApplicableForThisConstructor);
            }
            else
            {
                this._mode = editOrCopy;
            }

            InitializeModeConditions();

            this._patient = SessionManager.Instance.GetActivePatient();
            this._patient.Providers.LoadFullList();

            this._appointment = currentAppointment;
            this._appointment.ClinicList = this._clinics;

            this._clinicId = clinicId;
        }
예제 #8
0
파일: Program.cs 프로젝트: mahitosh/HRA4
        private static void SaveAppointment()
        {
            /// RiskApps3.View.Appointments.AddAppointmentView appview = new RiskApps3.View.Appointments.AddAppointmentView("9995623145", 1);

            RiskApps3.Model.PatientRecord.Appointment appointment = new RiskApps3.Model.PatientRecord.Appointment(1, "999111111")
            {
                apptdate    = "02/01/2016",
                appttime    = "8:00 PM",
                dob         = "10/25/1985",
                gender      = "FeMale",
                language    = "EN",
                nationality = "Indian",
                patientname = "mk Test",
            };

            HraModelChangedEventArgs args = new HraModelChangedEventArgs(null);

            args.updatedMembers.Add(appointment.GetMemberByName("appttime")); // Edit And save
            appointment.BackgroundPersistWork(args);

            appointment.BackgroundPersistWork(new HraModelChangedEventArgs(null));// New Appointment
        }
예제 #9
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            if (SessionManager.Instance.ActiveUser.userClinicList.Count > 0)
            {
                appts.Date = DateTime.Now.ToShortDateString();
                appts.clinicId = ((Clinic)(SessionManager.Instance.ActiveUser.userClinicList[0])).clinicID;
                appts.BackgroundListLoad();
            }

            XmlNode x = cloud.FetchCompletedSurveys();
            foreach (XmlNode xmlappt in x.ChildNodes)
            {
                Appointment appt = new Appointment();
                int.TryParse(xmlappt.Attributes["apptid"].Value, out appt.apptID);
                appt.patientname = xmlappt.Attributes["patientname"].Value;
                appt.unitnum = xmlappt.Attributes["unitnum"].Value;
                appt.surveyType = xmlappt.Attributes["surveyType"].Value;
                appt.dob = xmlappt.Attributes["dob"].Value;
                DateTime.TryParse(xmlappt.Attributes["riskdatacompleted"].Value, out appt.riskdatacompleted);
                backgroundWorker1.ReportProgress(0, appt);
            }
        }
예제 #10
0
파일: Program.cs 프로젝트: mahitosh/HRA4
        private static void SaveAppointment()
        {
            /// RiskApps3.View.Appointments.AddAppointmentView appview = new RiskApps3.View.Appointments.AddAppointmentView("9995623145", 1);

            RiskApps3.Model.PatientRecord.Appointment appointment = new RiskApps3.Model.PatientRecord.Appointment(1, "999111111")
            {
                apptdate="02/01/2016",
                appttime="8:00 PM",
                dob = "10/25/1985",
                gender= "FeMale",
                language="EN",
                nationality="Indian",
                patientname="mk Test",

            };

            HraModelChangedEventArgs args = new HraModelChangedEventArgs(null);
            args.updatedMembers.Add(appointment.GetMemberByName("appttime")); // Edit And save
            appointment.BackgroundPersistWork(args);

            appointment.BackgroundPersistWork(new HraModelChangedEventArgs(null));// New Appointment
        }
예제 #11
0
        private void migrantWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            work_papers wp = (work_papers)e.Argument;
            e.Result = -1;
            if (wp.mode == 1)
            {
                string orig_con_string = BCDB2.Instance.getConnectionString();
                string new_con_string = GetConnectionStringLeft();
                BCDB2.Instance.setConnectionString(new_con_string);
                SqlDataReader reader = BCDB2.Instance.ExecuteReader("select apptid,patientname,unitnum,apptdatetime,dob from tblappointments " + textBox41.Text);
                BCDB2.Instance.setConnectionString(orig_con_string);

                if (reader != null)
                {
                    while (reader.Read())
                    {
                        Appointment a = new Appointment();
                        a.apptID = reader.GetInt32(0);
                        a.patientname = reader.GetString(1);
                        a.unitnum = reader.GetString(2);
                        a.apptdatetime = reader.GetDateTime(3);
                        a.dob = reader.GetString(4);

                        ListViewItem lvi = new ListViewItem();
                        lvi.Text = a.apptID.ToString();
                        lvi.SubItems.Add(a.patientname);
                        lvi.SubItems.Add(a.unitnum);
                        lvi.SubItems.Add(a.apptdatetime.ToShortDateString());
                        lvi.SubItems.Add(a.dob);
                        lvi.Tag = a;
                        migrantWorker.ReportProgress(1, lvi);
                    }
                }
            }
            else if (wp.mode == 2)
            {
                string orig_con_string = BCDB2.Instance.getConnectionString();
                string new_con_string = GetConnectionStringRight();
                BCDB2.Instance.setConnectionString(new_con_string);
                SqlDataReader reader = BCDB2.Instance.ExecuteReader("select apptid,patientname,unitnum,apptdatetime,dob from tblappointments " + textBox42.Text);
                BCDB2.Instance.setConnectionString(orig_con_string);

                if (reader != null)
                {
                    while (reader.Read())
                    {
                        Appointment a = new Appointment();
                        a.apptID = reader.GetInt32(0);
                        a.patientname = reader.GetString(1);
                        a.unitnum = reader.GetString(2);
                        a.apptdatetime = reader.GetDateTime(3);
                        a.dob = reader.GetString(4);

                        ListViewItem lvi = new ListViewItem();
                        lvi.Text = a.apptID.ToString();
                        //lvi.SubItems.Add(a.apptID);
                        lvi.SubItems.Add(a.patientname);
                        lvi.SubItems.Add(a.unitnum);
                        lvi.SubItems.Add(a.apptdatetime.ToShortDateString());
                        lvi.SubItems.Add(a.dob);
                        lvi.Tag = a;
                        migrantWorker.ReportProgress(2, lvi);
                    }
                }
            }
            else if (wp.mode == 3)
            {
                string orig_con_string = BCDB2.Instance.getConnectionString();
                try
                {
                    foreach (Appointment a in wp.appts)
                    {
                        BCDB2.Instance.setConnectionString(GetConnectionStringLeft());

                        RiskApps3.Model.PatientRecord.Patient thePatient = new RiskApps3.Model.PatientRecord.Patient(a.unitnum);
                        thePatient.apptid = a.apptID;
                        thePatient.LoadFullObject();

                        BCDB2.Instance.setConnectionString(GetConnectionStringRight());

                        DataContractSerializer ds = new DataContractSerializer(typeof(Patient));
                        MemoryStream stm = new MemoryStream();
                        ds.WriteObject(stm, thePatient);
                        stm.Flush();
                        stm.Position = 0;

                        RiskApps3.Utilities.ParameterCollection pc = new RiskApps3.Utilities.ParameterCollection();
                        pc.Add("unitnum", thePatient.unitnum);
                        pc.Add("apptdate", thePatient.apptdatetime.ToString("MM/dd/yyyy"));
                        pc.Add("appttime", thePatient.apptdatetime.ToShortTimeString());
                        pc.Add("patientname", thePatient.name);
                        pc.Add("dob", thePatient.dob);
                        object o = BCDB2.Instance.ExecuteSpWithRetValAndParams("sp_createMasteryAppointment", SqlDbType.Int, pc);

                        Patient p2 = (Patient)ds.ReadObject(stm);
                        p2.apptid = (int)o;
                        p2.FHx.proband = p2;
                        p2.PersistFullObject(new RiskApps3.Model.HraModelChangedEventArgs(null));

                        BCDB2.Instance.setConnectionString(orig_con_string);

                        e.Result = 1;
                    }
                }
                catch (Exception ee)
                {
                    BCDB2.Instance.setConnectionString(orig_con_string);
                    MessageBox.Show(ee.ToString());
                }
                migrantWorker.ReportProgress(3);
            }
        }
예제 #12
0
        /// <summary>
        /// Used to copy an appointment from another appointment
        /// </summary>
        /// <param name="appointment"></param>
        public Appointment(Appointment appointment, int clinicId)
        {
            this._clinicId = clinicId;

            this.apptID = CreateAppointment();

            this.unitnum = appointment.unitnum;

            this.patientname = appointment.patientname;
            this.diseases = appointment.diseases;
            this.dob = appointment.dob;
            this.gender = appointment.gender;
            this.apptdate = appointment.apptdate;
            this.appttime = appointment.appttime;
            this.apptphysname = appointment.apptphysname;
            this.familyNumber = appointment.familyNumber;
            this.clinic = appointment.clinic;
            this.GoldenApptTime = appointment.GoldenApptTime;
            this.GoldenAppt = appointment.GoldenAppt;
            this.language = appointment.language;
            this.race = appointment.race;
            this.nationality = appointment.nationality;
            this.surveyType = appointment.surveyType;
            this.riskdatacompleted = appointment.riskdatacompleted;
            this.accession = appointment.accession;

            UpdateMrn(this.unitnum);

            this.PersistFullObject(new HraModelChangedEventArgs(null));
        }