Beispiel #1
0
 protected Document(User Sender, List<Professional> Receivers, Patient Patient, string Title)
 {
     _receivers = Receivers;
     _patient = Patient;
     _sender = Sender;
     _date = DateTime.Now;
     _title = Title;
 }
 public void PatientSuppression( Patient patient )
 {
     List<Follower> followPatient = _context.SelectRequest.SelectFollowForPatient(patient.PatientId);
     foreach(var follow in followPatient)
     {
         FollowerSuppression(follow);
     }
     _context.Patient.Remove(patient);
     _context.SaveChanges();
 }
Beispiel #3
0
        /// <summary>
        /// Add a patient into the database 
        /// </summary>
        /// <param name="user"> user can't be null and all property of an user can be null exept userId who it must be null</param>
        /// <returns></returns>
        public Patient AddPatient(User user)
        {
            if (user == null) throw new ArgumentNullException("user", "user can't be null");
            if (user.Adress == null || user.Birthdate == null || user.City == null || user.FirstName == null || user.LastName == null || user.Password == null || user.PhoneNumber == 0 || user.Photo == null || user.Postcode == 0 || user.Pseudo == "null" || user.UserId != 0)
                throw new ArgumentException("All property of an user can't be null exept userId who it must be null");
            Patient p = new Patient()
            {
                User = user
            };

            _context.User.Add(user);
            _context.Patient.Add(p);
            _context.SaveChanges();

            return p;
        }
Beispiel #4
0
 private PatientXML CreatePatient(Patient patient)
 {
     PatientXML p = new PatientXML();
     p.Adress = patient.User.Adress;
     p.Birthdate = patient.User.Birthdate;
     p.City = patient.User.City;
     p.FirstName = patient.User.FirstName;
     p.LastName = patient.User.LastName;
     p.Password = patient.User.Password;
     p.PhoneNumber = patient.User.PhoneNumber;
     p.PhotoPath = patient.User.Photo;
     p.Photo = _img.ImageCoverter(_img.LoadImage(patient.User.Photo));
     p.Postcode = patient.User.Postcode;
     p.Pseudo = patient.User.Pseudo;
     p.PatientId = patient.User.UserId;
     p.UserId = patient.User.UserId;
     return p;
 }
Beispiel #5
0
 public Prescription(string Title, string DocPath, User Sender, List<Professional> Receivers, Patient Patient)
     : base(Sender, Receivers, Patient, Title)
 {
     this.DocPath = DocPath;
 }
Beispiel #6
0
        private Tuple<Patient, Professional[]> ProAdd(List<Follower> result, Patient p)
        {
            Professional[] proArray = new Professional[10];
            Tuple<Patient, Professional[]> Follows;
            int x = 0;

            foreach (var follow in result)
            {

                if (follow.PatientId == p.PatientId)
                {
                    proArray.SetValue(follow.Professionnal, x);
                    x++;
                }
            }
            Follows = Tuple.Create(p, proArray);
            return Follows;
        }
Beispiel #7
0
 public Message(string Title, string Contents, User Sender, List<Professional> Receivers, Patient Patient)
     : base(Sender, Receivers, Patient, Title)
 {
     contents = Contents;
 }
Beispiel #8
0
 public DocumentSerializable SeeDocument(Professional pro, Patient patient)
 {
     DocumentSerializable Documents = DeserializeListDoc(GetPathFile(patient.PatientId + "$" + pro.ProfessionalId));
     return Documents;
 }
Beispiel #9
0
 public void CreatePrescription(List<Professional> Receivers, User Sender, Patient Patient, string Title, string DocPath)
 {
     Prescription p = new Prescription(Title, DocPath, Sender, Receivers, Patient);
     CreateDoc(p);
 }
Beispiel #10
0
 public void CreateMessage(List<Professional> Receivers, User Sender, string Title, string Contents, Patient Patient)
 {
     Message m = new Message(Title, Contents, Sender, Receivers, Patient);
     CreateDoc(m);
 }