Beispiel #1
0
 public Patient UpdatePatient(Patient patient)
 {
     try
     {
         patient.LastUpdated = DateTime.UtcNow;
         _activitySystem.UpdateUser(patient);
         return patient;
     }
     catch (Exception e)
     {
         return null;
     }
 }
Beispiel #2
0
 public void RemovePatient(Patient patient)
 {
     _activitySystem.RemoveUser(patient.Id);
 }
        public ActionResult Create(PatientViewModel model)
        {
            var patient = new Patient
            {
                Name = model.Name,
                Cpr = model.Cpr,
                RfidTag = model.Rfid,
                Location = model.Location,
                DeviceId = model.DeviceId,
                SonitorTag = model.SonitorTag
            };

            Portal.Instance().AddPatient(patient);

            return RedirectToAction("Create");
        }
Beispiel #4
0
        public Patient AddPatient(Patient patient)
        {
            try
            {
                _activitySystem.AddUser(patient);
            }
            catch (Exception e)
            {
                return null;
            }

            return patient;
        }
Beispiel #5
0
        public static PatientViewModel CreateFromPatient(Patient p)
        {
            var lastMessage = "";

            if (p.NurseMessages.Any())
            {
                var m = p.NurseMessages.OrderByDescending(msg => msg.CreatedAt).FirstOrDefault();
                if (m.Message != null)
                    lastMessage = m.Message;
            }
            return new PatientViewModel
            {
                Id = p.Id,
                Color = string.Format("rgb({0}, {1}, {2})", p.Color.Red , p.Color.Green, p.Color.Blue),
                Cpr = p.Cpr,
                Location = string.IsNullOrEmpty(p.Location)? "- - -":p.Location,
                Name = p.Name,
                Procedure = string.IsNullOrEmpty(p.Procedure) ? "- - -": p.Procedure,
                RecordLocation = string.IsNullOrEmpty(p.RecordLoaction) ? "- - -" : p.RecordLoaction,
                Rfid = p.RfidTag,
                LastMessage = string.IsNullOrEmpty(lastMessage)? "- - -":lastMessage,
                NurseMessages = new Collection<NurseMessageViewModel>(),
                Buzz = p.Buzzer? "inherit": "none",
                DeviceId = p.DeviceId,
                SonitorTag = p.SonitorTag,
                LastUpdated = p.LastUpdated.ToBinary(),
                Ews = p.Ews

            };
        }