Esempio n. 1
0
        public async Task <IActionResult> CreatePatient()
        {
            var patientDataModel = new PatientDataModel
            {
                HealthInsurances = await _healthInsuranceService.GetAll()
            };


            return(PartialView("_CreatePatient", patientDataModel));
        }
Esempio n. 2
0
        public async Task <PatientDataModel> Get(Guid id)
        {
            PatientDataModel patientModel = null;

            var patient = await _patientRepository.GetAsync(id);

            if (patient is null)
            {
                Notify("Dados do Paciente não encontrado.");
            }
            else
            {
                patientModel = new PatientDataModel
                {
                    Id                = patient.Id,
                    BirthDate         = patient.BirthDate,
                    Cep               = patient.Cep,
                    City              = patient.City,
                    Complement        = patient.Complement,
                    Cpf               = patient.Cpf,
                    Telephone         = patient.Telephone,
                    Cellular          = patient.Cellular,
                    Street            = patient.Street,
                    Number            = patient.Number,
                    State             = patient.State,
                    District          = patient.District,
                    Email             = patient.Email,
                    Gender            = patient.Gender,
                    MaritalStatus     = patient.MaritalStatus,
                    Occupation        = patient.Occupation,
                    HealthInsuranceId = patient.HealthInsuranceId,
                    Name              = patient.Name,
                    HealthInsurances  = await _healthInsuranceService.GetAll(),
                };

                if (patient.HealthInsurance is not null)
                {
                    patientModel.HealthInsurance = new HealthInsuranceDataModel()
                    {
                        Id   = patient.HealthInsurance.Id,
                        Name = patient.HealthInsurance.Name,
                        Type = patient.HealthInsurance.Type
                    };
                }
            }

            return(patientModel);
        }
        public async Task <IActionResult> Index()
        {
            var healthInsurances = await _healthInsuranceService.GetAll();

            return(View(healthInsurances));
        }