public PcpResultExportModel SetAwvHemoglobinData(PcpResultExportModel model, AwvHemaglobinTestResult testResult, bool useBlankValue = false) { if (testResult.Hba1c != null) { if (testResult.Hba1c.Reading != null) { model.HemoglobinReading = testResult.Hba1c.Reading; } } model.HemoglobinUnabletoScreen = testResult.UnableScreenReason != null && testResult.UnableScreenReason.Count > 0 ? PcpResultExportHelper.YesString : (useBlankValue ? "" : PcpResultExportHelper.NoString); if ((testResult.ResultStatus != null && testResult.ResultStatus.SelfPresent) || (testResult.PhysicianInterpretation != null && testResult.PhysicianInterpretation.IsCritical)) { model.HemoglobinCritical = PcpResultExportHelper.YesString; } else if (!useBlankValue) { model.HemoglobinCritical = PcpResultExportHelper.NoString; } if (testResult.PhysicianInterpretation != null) { model.HemoglobinPhysicianNotes = testResult.PhysicianInterpretation.Remarks; } return(model); }
public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestEntity) { var testResult = new AwvHemaglobinTestResult(customerEventScreeningTestEntity.CustomerEventScreeningTestId); var customerEventReadingEntities = customerEventScreeningTestEntity.CustomerEventReading.ToList(); testResult.Hba1c = CreateResultReadingforInputValues((int)ReadingLabels.Hba1c, customerEventReadingEntities); return(testResult); }
public TestResult GetAwvHemaglobinTestResultDomain(KynHealthAssessmentEditModel model, AwvHemaglobinTestResult inpersistence, long uploadedby, bool isNewResultFlow) { if (!IsHemaglobinA1CTestReadingProvided(model) && inpersistence == null) { return(inpersistence); } if (inpersistence == null) { inpersistence = new AwvHemaglobinTestResult { Hba1c = new ResultReading <string> { Reading = model.A1c.HasValue ? model.A1c.Value.ToString() : string.Empty, Label = ReadingLabels.Hba1c, ReadingSource = ReadingSource.Manual }, ResultStatus = new TestResultState { StateNumber = isNewResultFlow ? (int)NewTestResultStateNumber.ResultEntryPartial : (int)TestResultStateNumber.ManualEntry } }; } else { inpersistence.Hba1c = new ResultReading <string> { Reading = model.A1c.HasValue ? model.A1c.Value.ToString() : string.Empty, Label = ReadingLabels.Hba1c, ReadingSource = ReadingSource.Manual }; } inpersistence.ResultStatus.DataRecorderMetaData = SetDataRecorderMetaData(inpersistence.ResultStatus.DataRecorderMetaData, uploadedby); inpersistence.DataRecorderMetaData = SetDataRecorderMetaData(inpersistence.DataRecorderMetaData, uploadedby); return(inpersistence); }