Ejemplo n.º 1
0
 public OpenHRPatient(int patientId, OpenHR001OpenHealthRecord openHealthRecord)
 {
     PatientId        = patientId;
     OpenHealthRecord = openHealthRecord;
     Patient          = openHealthRecord.adminDomain.patient.Single();
     Person           = openHealthRecord.adminDomain.person.Single(t => t.id == openHealthRecord.adminDomain.patient.Single().patientPerson);
     Organisation     = openHealthRecord.adminDomain.organisation.Single(t => new Guid(t.id) == new Guid(openHealthRecord.author.organisation));
 }
Ejemplo n.º 2
0
        public void AddTask(Task task)
        {
            string taskName    = "External update received";
            string patientName = string.Empty;
            string description = string.Empty;
            Bitmap taskImage   = DotNetGPSystem.Properties.Resources.email;

            try
            {
                task.Display = "Update message:" + Environment.NewLine + Environment.NewLine + Utilities.FormatXml(task.OpenHRXml);

                OpenHR001OpenHealthRecord openHR = Utilities.Deserialize <OpenHR001OpenHealthRecord>(task.OpenHRXml);

                task.Event = [email protected]();

                task.Patient = DataStore.OpenHRPatients.FirstOrDefault(t => new Guid(t.Patient.id) == new Guid(task.Event.patient));

                if (task.Patient != null)
                {
                    patientName = task.Patient.Person.GetCuiDisplayName();

                    description = "Add event '" + (task.Event.code.WhenNotNull(t => t.displayName) ?? "(no code found)") + "'";

                    task.CanFile = true;
                }
                else
                {
                    patientName = "(no patient identified)";
                }
            }
            catch (Exception e)
            {
                patientName  = "(no patient identified)";
                task.Display = "Error occurred parsing openHR XML: " + e.Message + Environment.NewLine + Environment.NewLine + task.Display;
                taskImage    = DotNetGPSystem.Properties.Resources.email_error;
            }

            DataGridViewRow row = (DataGridViewRow)dataGridView.RowTemplate.Clone();

            row.CreateCells(dataGridView);

            row.SetValues(taskImage, task.DateStamp.ToString("dd-MMM-yyyy HH:mm:ss"), patientName, taskName, description);

            row.Tag = task;

            dataGridView.Rows.Add(row);
        }
Ejemplo n.º 3
0
        public void AddTask(string odsCode, string openHRXml)
        {
            OpenHR001OpenHealthRecord record = Utilities.Deserialize <OpenHR001OpenHealthRecord>(openHRXml);

            DataStore.AddTasks(odsCode, record.healthDomain.task);
        }