コード例 #1
0
 public Examination(int id, TypeOfExamination typeOfExamination, DateTime dateAndTime, string anamnesis, Doctor doctor, Room room,
                    PatientCard patientCard, bool isSurveyCompleted = false, ExaminationStatus examinationStatus = ExaminationStatus.CREATED)
 {
     Id          = id;
     Type        = typeOfExamination;
     DateAndTime = dateAndTime;
     Anamnesis   = anamnesis;
     if (doctor == null)
     {
         Doctor = new Doctor();
     }
     else
     {
         Doctor = new Doctor(doctor);
     }
     if (room == null)
     {
         Room = new Room();
     }
     else
     {
         Room = new Room(room);
     }
     if (patientCard == null)
     {
         PatientCard = new PatientCard();
     }
     else
     {
         PatientCard = new PatientCard(patientCard);
     }
     Therapies         = new List <Therapy>();
     ExaminationStatus = examinationStatus;
     IsSurveyCompleted = isSurveyCompleted;
 }
コード例 #2
0
 public IEnumerable <Examination> GetByExaminationStatusAndPatient(ExaminationStatus examinationStatus, string patientId)
 {
     try
     {
         var exams = _context.Examinations.Where(e => e.PatientCard.PatientJmbg.Equals(patientId) &&
                                                 e.ExaminationStatus == examinationStatus.ToBackendExaminationStatus());
         return(exams.Select(exam => new Examination(new ExaminationMemento()
         {
             Appointment = exam.DateAndTime,
             Doctor = _doctorRepository.Get(exam.DoctorJmbg),
             Patient = _patientRepository.Get(exam.PatientCard.PatientJmbg),
             Room = _roomRepository.Get(exam.Room.Id),
             Id = exam.Id,
             ExaminationStatus = exam.ExaminationStatus.ToExaminationStatus(),
             ExaminationType = exam.Type.ToExaminationType()
         })));
     }
     catch (ScheduleServiceException)
     {
         throw;
     }
     catch (Exception e)
     {
         throw new DataStorageException(e.Message);
     }
 }
コード例 #3
0
        internal static Model.ExaminationStatus ToExaminationStatus(this ExaminationStatus status)
        {
            switch (status)
            {
            case ExaminationStatus.CREATED:
                return(Model.ExaminationStatus.Created);

            case ExaminationStatus.CANCELED:
                return(Model.ExaminationStatus.Canceled);

            default:
                return(Model.ExaminationStatus.Finished);
            }
        }
コード例 #4
0
        private bool?SetItem(ExaminationStatus item)
        {
            switch (item)
            {
            case ExaminationStatus.POSITIVE:
                return(true);

            case ExaminationStatus.NEGATIVE:
                return(false);

            case ExaminationStatus.NOT_PERFORMED:
            default:
                return(null);
            }
        }