Example #1
0
 private void LoadProgressNotes()
 {
     foreach (ProgressNoteInformation pnObj in ProgressNoteInformation.ReturnClientProgressNotes(Client.Id))
     {
         int             newRow = dataGridViewNoteList.Rows.Add();
         DataGridViewRow dgr    = dataGridViewNoteList.Rows[newRow];
         dgr.Cells["colDate"].Value      = pnObj.DateOfService.ToShortDateString();
         dgr.Cells["colTreatment"].Value = pnObj.TreatmentGoalAddressed;
         dgr.Tag = pnObj.Id;
     }
 }
Example #2
0
        private void ShowProgressNote(int clientId, int noteId = 0)
        {
            ProgressNoteInformation clientProgressNote = null;

            // Create a note object
            if (noteId == 0)
            {
                // Create a new note object
                clientProgressNote = new ProgressNoteInformation {
                    ClientId = clientId
                };

                ClientAppointment lastAppointment = ClientAppointment.GetLastAppointmentForClient(clientId);

                if (lastAppointment != null)
                {
                    clientProgressNote.DateOfService = lastAppointment.StartTime.Date;
                    clientProgressNote.TimeStarted   = lastAppointment.StartTime;
                    clientProgressNote.TimeEnded     = lastAppointment.EndTime;
                }
            }
            else
            {
                clientProgressNote = ProgressNoteInformation.ReturnClientProgressNote(noteId);
            }

            // Create the progress note form
            ProgressNoteForm progressForm = new ProgressNoteForm
            {
                MainFormObject      = this,
                CurrentProgressNote = clientProgressNote
            };

            // Pass in the note
            if (noteId > 0)
            {
                progressForm.EditMode = true;
            }

            // Show the screen
            DialogResult dlgResult = progressForm.ShowDialog();

            // Refresh the list
            FillClientTreeView();

            // If we deleted what we had selected, select the first item in the list
            if (dlgResult == DialogResult.Abort)
            {
                treeViewClients.SelectedNode = treeViewClients.Nodes[0].Nodes[0];
            }
        }
Example #3
0
        private void buttonSave_Click(object sender, EventArgs e)
        {
            // Get the data from the binding source
            progressNoteBindingSource.EndEdit();

            // Pull the object from the data source
            CurrentNote = progressNoteBindingSource.DataSource as ProgressNoteInformation;

            // save the progress note
            CurrentNote?.Insert();

            // close the screen
            DialogResult = DialogResult.OK;
        }
Example #4
0
        private void ShowProgressNoteReport(int progressNoteId)
        {
            ProgressNoteInformation selProgressNote = ProgressNoteInformation.ReturnClientProgressNote(progressNoteId);

            if (selProgressNote != null)
            {
                ProgressNoteReport progressNoteReport = new ProgressNoteReport
                {
                    objectDataSourcePN = { DataSource = selProgressNote }
                };

                documentViewerMain.PrintingSystem = progressNoteReport.PrintingSystem;
                progressNoteReport.CreateDocument();
            }
        }
Example #5
0
        private void simpleButtonEdit_Click(object sender, System.EventArgs e)
        {
            if (dataGridViewNoteList.SelectedRows.Count > 0)
            {
                DataGridViewRow dgr = dataGridViewNoteList.SelectedRows[0];

                // get the progress note id from the tag of the selected item
                int progressNoteId = (int)dgr.Tag;

                ProgressNoteForm noteForm = new ProgressNoteForm
                {
                    CurrentProgressNote = ProgressNoteInformation.ReturnClientProgressNote(progressNoteId)
                };

                // Show the screen
                noteForm.ShowDialog();
            }
        }
Example #6
0
        private void barButtonItemEditClient_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int currentId = GetSelectedNodeId();

            if (currentId < 0)
            {
                currentId = ProgressNoteInformation.ReturnClientIdFromNote(Math.Abs(currentId));
            }

            // Show the edit form for the client
            if (currentId > 0)
            {
                ClientInfoForm frm = new ClientInfoForm {
                    EditMode = true, ClientId = currentId
                };
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    FillClientTreeView();
                }
            }
        }
Example #7
0
        private void barButtonItemClientAssessment_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int currentId = GetSelectedNodeId();

            if (currentId < 0)
            {
                currentId = ProgressNoteInformation.ReturnClientIdFromNote(Math.Abs(currentId));
            }

            if (currentId > 0)
            {
                ClientAssessment clientAssessment = ClientAssessment.GetAssessment(currentId) ??
                                                    ClientAssessment.CreateNewClientAssessment(currentId);

                // call the form
                ClientAssessmentForm assessmentForm = new ClientAssessmentForm {
                    ClientAssessment = clientAssessment
                };
                if (assessmentForm.ShowDialog() == DialogResult.OK)
                {
                    ShowAssessmentReport(assessmentForm.ClientAssessment);
                }
            }
        }
Example #8
0
        public void ProgressNoteContextMenuHandler(object sender, EventArgs e)
        {
            // Get the apppintment
            Appointment appt = schedulerControlMain.SelectedAppointments[0];

            // Make sure we have a client Id
            if (appt.CustomFields["ClientId"] != null)
            {
                // Get the client id
                int clientId = (int)appt.CustomFields["ClientId"];

                // At this point, see if a Progress Note for this day exists
                ProgressNoteInformation pNote = ProgressNoteInformation.ReturnClientProgressNoteBySessionDate(clientId, appt.Start);

                if (pNote == null)
                {
                    ShowProgressNote(clientId);
                }
                else
                {
                    ShowProgressNote(0, pNote.Id);
                }
            }
        }