private Task <Tracking> PregnantTracking(PregnantForm model, string type) { var walkin = type.Equals(_type.Value.WALKIN); var tracking = new Tracking { Code = model.Code, PatientId = model.PatientWomanId, DateReferred = model.ReferredDate, DateTransferred = default,
public PregnantViewModel(PregnantForm form, Baby baby) { Code = form.Code; ReferringMd = GlobalFunctions.GetMDFullName(form.ReferredByNavigation); RecordNumber = form.RecordNo; DateReferred = form.ReferredDate.ToString("dd/MM/yyyy"); ReferringMdContact = form.ReferredByNavigation.Contact; Facility = form.ReferringFacilityNavigation == null ? "" : form.ReferringFacilityNavigation.Name; FacilityContact = form.ReferringFacilityNavigation == null ? "" : form.ReferringFacilityNavigation.Contact; HealthWorker = form.HealthWorker; ReferredTo = form.ReferredToNavigation == null ? "" : form.ReferredToNavigation.Name; Department = form.Department == null ? "" : form.Department.Description; ReferredToAddress = GlobalFunctions.GetAddress(form.ReferredToNavigation); WomanName = GlobalFunctions.GetFullName(form.PatientWoman); WomanAge = GlobalFunctions.ComputeAge(form.PatientWoman.DateOfBirth); WomanAddress = GlobalFunctions.GetAddress(form.PatientWoman); WomanReason = form.WomanReason; WomanFindings = form.WomanMajorFindings; WomanBeforeTreatment = form.WomanBeforeTreatment; WomanBeforeGivenTime = GlobalFunctions.GetDate((DateTime)form.WomanBeforeGivenTime, "dd/MM/yyyy"); WomanDuringTransport = form.WomanDuringTransport; WomanDuringGivenTime = GlobalFunctions.GetDate((DateTime)form.WomanTransportGivenTime, "dd/MM/yyyy"); WomanInformationGiven = form.WomanInformationGiven; BabyName = form.PatientBaby == null? "" : GlobalFunctions.GetFullName(form.PatientBaby); BabyDob = form.PatientBaby == null ? "" : form.PatientBaby.DateOfBirth.ToString("dd/MM/yyyy"); BabyWeight = baby == null ? "" : baby.Weight == 0 ? "" : baby.Weight.ToString(); BabyGestationAge = baby == null? "" : baby.GestationalAge.ToString(); BabyReason = form.BabyReason; BabyFindings = form.BabyMajorFindings; BabyLastFeed = GlobalFunctions.GetDate((DateTime)form.BabyLastFeed, "dd/MM/yyyy"); BabyBeforeTreatment = form.BabyBeforeTreatment; BabyBeforeGivenTime = GlobalFunctions.GetDate((DateTime)form.BabyBeforeGivenTime, "dd/MM/yyyy"); BabyDuringTransport = form.BabyDuringTransport; BabyDuringGivenTime = GlobalFunctions.GetDate((DateTime)form.BabyTransportGivenTime, "dd/MM/yyyy"); BabyInformationGiven = form.BabyInformationGiven; }