public PatientViewModel MapToPatientViewModel(PatientDto patientDto)
        {
            if (patientDto == null)
            {
                return(null);
            }

            PatientViewModel patientViewModel = new PatientViewModel();

            PatientAddressViewModelMapper patientAddressViewModelMapper = new PatientAddressViewModelMapper();
            CrudOperationsMapper          crudOperationsMapper          = new CrudOperationsMapper();

            patientViewModel.PatientId              = patientDto.PatientId;
            patientViewModel.Title                  = patientDto.Title;
            patientViewModel.FirstName              = patientDto.FirstName;
            patientViewModel.MiddleName             = patientDto.MiddleName;
            patientViewModel.LastName               = patientDto.LastName;
            patientViewModel.Gender                 = patientDto.Gender;
            patientViewModel.EthnicGroup            = patientDto.EthnicGroup;
            patientViewModel.BirthDate              = Converter.DateToString(patientDto.BirthDate);
            patientViewModel.IDNumber               = patientDto.IDNumber;
            patientViewModel.MobileNumber           = patientDto.MobileNumber;
            patientViewModel.HomeTelephoneCode      = patientDto.HomeTelephoneCode;
            patientViewModel.HomeTelephoneNumber    = patientDto.HomeTelephoneNumber;
            patientViewModel.WorkTelephoneCode      = patientDto.WorkTelephoneCode;
            patientViewModel.WorkTelephoneNumber    = patientDto.WorkTelephoneNumber;
            patientViewModel.EmailAddress           = patientDto.EmailAddress;
            patientViewModel.MaritalStatus          = patientDto.MaritalStatus;
            patientViewModel.MarriageType           = patientDto.MarriageType;
            patientViewModel.PrefferedContactType   = patientDto.PrefferedContactType;
            patientViewModel.MedicalAidName         = patientDto.MedicalAidName;
            patientViewModel.MedicalAidScheme       = patientDto.MedicalAidScheme;
            patientViewModel.MedicalAidNumber       = patientDto.MedicalAidNumber;
            patientViewModel.PrincipalMemberInd     = patientDto.PrincipalMemberInd == null ? false : patientDto.PrincipalMemberInd.Value;
            patientViewModel.PrefferedContactMethod = patientDto.PrefferedContactMethod;
            patientViewModel.SourceOfDiscovery      = patientDto.SourceOfDiscovery;
            patientViewModel.MedicalAidInd          = patientDto.MedicalAidInd == null ? false : patientDto.MedicalAidInd.Value;
            patientViewModel.IDType                 = patientDto.IDType;
            patientViewModel.CrudOperation          = crudOperationsMapper.MapToModelCrudOperations(patientDto.CrudOperation);

            if (patientDto.PhysicalAddress != null)
            {
                patientViewModel.PhysicalAddress = patientAddressViewModelMapper.MapToPatientAddressViewModel(patientDto.PhysicalAddress);
            }

            if (patientDto.PostalAddress != null)
            {
                patientViewModel.PostalAddress = patientAddressViewModelMapper.MapToPatientAddressViewModel(patientDto.PostalAddress);
            }

            return(patientViewModel);
        }
Пример #2
0
        public PatientConsultationViewModel MapToPatientConsultationViewModel(PatientConsultationDto patientConsultationDto)
        {
            if (patientConsultationDto == null)
            {
                return(null);
            }

            PatientConsultationViewModel patientConsultationViewModel = new PatientConsultationViewModel();
            CrudOperationsMapper         crudOperationsMapper         = new CrudOperationsMapper();

            patientConsultationViewModel.PatientConsultationId = patientConsultationDto.PatientConsultationId;
            patientConsultationViewModel.PatientId             = patientConsultationDto.PatientId;
            patientConsultationViewModel.DoctorId           = patientConsultationDto.DoctorId;
            patientConsultationViewModel.ConsultationStatus = patientConsultationDto.ConsultationStatus;
            patientConsultationViewModel.StartDate          = Converter.DateToString(patientConsultationDto.StartDate);
            patientConsultationViewModel.EndDate            = Converter.DateToString(patientConsultationDto.EndDate);
            patientConsultationViewModel.CrudOperation      = crudOperationsMapper.MapToModelCrudOperations(patientConsultationDto.CrudOperation);

            return(patientConsultationViewModel);
        }
Пример #3
0
        public PatientConsultationDto MapToPatientConsultationDto(PatientConsultationViewModel patientConsultationViewModel)
        {
            if (patientConsultationViewModel == null)
            {
                return(null);
            }

            PatientConsultationDto patientConsultationDto = new PatientConsultationDto();
            CrudOperationsMapper   crudOperationsMapper   = new CrudOperationsMapper();

            patientConsultationDto.PatientConsultationId = patientConsultationViewModel.PatientConsultationId;
            patientConsultationDto.PatientId             = patientConsultationViewModel.PatientId == null? int.MinValue : patientConsultationViewModel.PatientId.Value;
            patientConsultationDto.DoctorId           = patientConsultationViewModel.DoctorId == null ? int.MinValue : patientConsultationViewModel.DoctorId.Value;
            patientConsultationDto.ConsultationStatus = patientConsultationViewModel.ConsultationStatus;
            patientConsultationDto.StartDate          = Converter.StringToDate(patientConsultationViewModel.StartDate);
            patientConsultationDto.EndDate            = Converter.StringToDate(patientConsultationViewModel.EndDate);
            patientConsultationDto.CrudOperation      = crudOperationsMapper.MapToCrudOperations(patientConsultationViewModel.CrudOperation);

            return(patientConsultationDto);
        }
Пример #4
0
        public PatientMedicalAidDependancyViewModel MapToPatientMedicalAidDependancyViewModel(PatientMedicalAidDependancyDto patientMedicalAidDependancyDto)
        {
            if (patientMedicalAidDependancyDto == null)
            {
                return(null);
            }

            PatientMedicalAidDependancyViewModel patientMedicalAidDependancyViewModel = new PatientMedicalAidDependancyViewModel();

            CrudOperationsMapper crudOperationsMapper = new CrudOperationsMapper();

            patientMedicalAidDependancyViewModel.PatientMedicalAidDependanciesId = patientMedicalAidDependancyDto.PatientMedicalAidDependanciesId;
            patientMedicalAidDependancyViewModel.PatientId      = patientMedicalAidDependancyDto.PatientId;
            patientMedicalAidDependancyViewModel.Title          = patientMedicalAidDependancyDto.Title;
            patientMedicalAidDependancyViewModel.FirstFullName  = patientMedicalAidDependancyDto.FirstFullName;
            patientMedicalAidDependancyViewModel.LastName       = patientMedicalAidDependancyDto.LastName;
            patientMedicalAidDependancyViewModel.MedicalAidCode = patientMedicalAidDependancyDto.MedicalAidCode;
            patientMedicalAidDependancyViewModel.BirthDate      = Converter.DateToString(patientMedicalAidDependancyDto.BirthDate);
            patientMedicalAidDependancyViewModel.Relationship   = patientMedicalAidDependancyDto.Relationship;
            patientMedicalAidDependancyViewModel.PrincipalInd   = patientMedicalAidDependancyDto.PrincipalInd;
            patientMedicalAidDependancyViewModel.CrudOperation  = crudOperationsMapper.MapToModelCrudOperations(patientMedicalAidDependancyDto.CrudOperation);

            return(patientMedicalAidDependancyViewModel);
        }