Ejemplo n.º 1
0
        public DonorRequestDetailsViewModel(DonorRequest request, PatientRequest patientRequest = null)
        {
            Id                = request.Id;
            Message           = request.Message;
            Status            = request.Status;
            DonorInfoId       = request.DonorInfoId;
            DonorInfo         = new UserInfoDetailedViewModel(request.DonorInfo);
            OrganInfoId       = request.OrganInfoId;
            OrganInfo         = new OrganInfoDetailsViewModel(request.OrganInfo);
            TransplantOrganId = request.TransplantOrganId;
            MedicalExamsCount = request.DonorMedicalExams?.Count ?? 0;

            var lastExam = request.DonorMedicalExams?.LastOrDefault();

            if (lastExam != null)
            {
                LastDonorMedicalExam = new DonorMedicalExamListItemViewModel(lastExam);
                MedicalExamClinic    = new ClinicListItemViewModel(lastExam.Clinic);
            }

            if (patientRequest != null && patientRequest.PatientInfo != null)
            {
                PatientRequest = new PatientRequestDetailsViewModel(patientRequest);
            }
        }
Ejemplo n.º 2
0
        public PatientRequestDetailsViewModel(PatientRequest request, DonorRequest donorRequest = null)
        {
            Id            = request.Id;
            Message       = request.Message;
            Status        = request.Status;
            PatientInfoId = request.PatientInfoId;
            PatientInfo   = new UserInfoDetailedViewModel(request.PatientInfo);
            OrganInfoId   = request.OrganInfoId;
            OrganInfo     = new OrganInfoDetailsViewModel(request.OrganInfo);

            if (donorRequest != null)
            {
                DonorRequest = new DonorRequestDetailsViewModel(donorRequest);
            }
        }