public async Task CreatePatient(CreatePatientInput input) { var patient = Patient.Create(AbpSession.GetTenantId(), input.FirstName, input.LastName, input.Age, input.Phone, input.Email, input.Gender, input.Weight, input.Height); await _healthPackageManager.CreatePatientAsync(patient); }
public async Task <long> CreatePatientAsync(CreatePatientInput input) { PatientProfile patient = _mapper.Map <PatientProfile>(input); long patientId = await _patientrepository.InsertAndGetIdAsync(patient); return(patientId); }
public async Task <AppResponse> CreatePatientAsync(CreatePatientInput input) { bool isPatientExist = await _patienManager.IsPatientExistAsync(new PatientIdNumberSpecification(input.IdNumber) .Or(new PatientProfileNumberSpecification(input.ProfileNumber))); if (isPatientExist) { return new AppResponse { IsSuccessful = false, StatusCode = StatusCodes.ENTITY_ALREADY_EXIST, StatusDescription = "Patient is already registered on the system" } } ; await _patienManager.CreatePatientAsync(input); return(new AppResponse { IsSuccessful = true, StatusCode = StatusCodes.SUCCESS, StatusDescription = "Patient has been created successfully" }); }
void IPatientAppService.CreatePatient(CreatePatientInput input) { Logger.Info("Creating Patientt Record..."); var patient = new BizData.Patient { Surname = input.Surname, Othernames = input.Othernames, Phone = input.Phone, HomeAddress = input.HomeAddress, WorkAddress = input.WorkAddress, Email = input.Email, PicPath = input.PicPath, NHISCardId = input.NHISCardId, PrevVisit = input.PrevVisit, IsActive = input.IsActive, PrevHosp = input.PrevHosp, DateLastVisitPrevHosp = input.DateLastVisitPrevHosp, ReasonLastVisitToPrev = input.ReasonLastVisitToPrev, }; _patientRepository.Insert(patient); }
public async Task <IActionResult> CreateAsync([FromBody] CreatePatientInput input) { AppResponse response = await _patientService.CreatePatientAsync(input); return(Ok(response)); }