示例#1
0
        public AwvAaaTestResult MapXmlToDomainObject(string filePathtoXml)
        {
            var testResult = new AwvAaaTestResult();
            var xDoc       = XDocument.Load(filePathtoXml);

            GetAwvAaaSaggitalView(testResult, xDoc);

            GetAwvAaaTransverseViewValues(testResult, xDoc);

            var aortaValue = GetMaxofthreeAortaValues(testResult);

            if (aortaValue != null)
            {
                testResult.Finding = new StandardFinding <decimal?>(_testResultService.GetCalculatedStandardFinding(_eventId, _customerId, aortaValue.Value, (int)TestType.AwvAAA, (int)ReadingLabels.AortaSize));
            }

            bool isExceptionCaused;

            testResult.ResultImages = _mediaHelper.GetMediaforTest(Directory.GetParent(filePathtoXml).Parent.FullName, _mediaLocation, TestType.AwvAAA.ToString(), out isExceptionCaused).ToList();

            if (isExceptionCaused)
            {
                _errorSummary += "Media Extraction Failed. ";
            }

            return(testResult);
        }
        private static decimal?GetMaxofthreeAortaValues(AwvAaaTestResult testResult)
        {
            var aortaValues = new decimal[3];
            int index       = 0;

            if (testResult.AortaSize != null && testResult.AortaSize.Reading != null)
            {
                aortaValues[index++] = testResult.AortaSize.Reading.Value;
            }

            if (testResult.TransverseView != null)
            {
                if (testResult.TransverseView.FirstValue != null && testResult.TransverseView.FirstValue.Reading != null)
                {
                    aortaValues[index++] = testResult.TransverseView.FirstValue.Reading.Value;
                }

                if (testResult.TransverseView.SecondValue != null && testResult.TransverseView.SecondValue.Reading != null)
                {
                    aortaValues[index++] = testResult.TransverseView.SecondValue.Reading.Value;
                }
            }

            var aortaValue = aortaValues.Max();

            if (aortaValue > 0)
            {
                return(aortaValue);
            }

            return(null);
        }
示例#3
0
        private void GetAwvAaaSaggitalView(AwvAaaTestResult testResult, XDocument xDoc)
        {
            try
            {
                var aoProxSag = GetValuefromXmlDoc(xDoc, ViewLocProx, ViewtypeSag);
                var aoMidSag  = GetValuefromXmlDoc(xDoc, ViewLocMid, ViewtypeSag);
                var aoDistSag = GetValuefromXmlDoc(xDoc, ViewLocDist, ViewtypeSag);

                if (aoProxSag == null && aoMidSag == null && aoDistSag == null)
                {
                    return;
                }

                IEnumerable <string> viewLocs;
                var aortaValue = GetMaximumOfThree(aoProxSag ?? 0, aoMidSag ?? 0, aoDistSag ?? 0, out viewLocs);

                if (aortaValue == null)
                {
                    return;
                }

                if (_awvAaaReadings.Any(r => r.Label == ReadingLabels.AortaSize))
                {
                    testResult.AortaSize = new ResultReading <decimal?>(ReadingLabels.AortaSize)
                    {
                        Reading       = Decimal.Round(aortaValue.Value, 2),
                        ReadingSource = ReadingSource.Automatic
                    };
                }

                if (viewLocs != null && viewLocs.Any() && _awvAaaReadings.Any(r => r.Label == ReadingLabels.AortaRangeSaggitalView))
                {
                    var sagViewFindings = _testResultService.GetAllStandardFindings <int>((int)TestType.AwvAAA, (int)ReadingLabels.AortaRangeSaggitalView);

                    testResult.AortaRangeSaggitalView = new List <StandardFinding <int> >();
                    foreach (string viewLoc in viewLocs)
                    {
                        var finding = sagViewFindings.SingleOrDefault(s => s.Label.ToLower().Contains(viewLoc));
                        if (finding != null)
                        {
                            testResult.AortaRangeSaggitalView.Add(finding);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                _errorSummary += "Measurement for Saggital View could not be extracted. ";
                _logger.Error("\n Measurement for Saggital View could not be extracted. Error: " + ex.Message + "\n\t\t" + ex.StackTrace);
            }
        }
        public override TestResult CreateActualTestResult(CustomerEventScreeningTestsEntity customerEventScreeningTestsEntity)
        {
            var customerEventReadingEntities = customerEventScreeningTestsEntity.CustomerEventReading.ToList();
            var testResult = new AwvAaaTestResult(customerEventScreeningTestsEntity.CustomerEventScreeningTestId);

            var customerEventTestStandardFindingEntities = customerEventScreeningTestsEntity.CustomerEventTestStandardFinding.ToList();
            var standardFindingTestReadingEntities       = customerEventScreeningTestsEntity.StandardFindingTestReadingCollectionViaCustomerEventReading.ToList();

            standardFindingTestReadingEntities.AddRange(customerEventScreeningTestsEntity.StandardFindingTestReadingCollectionViaCustomerEventTestStandardFinding.ToList());

            testResult.AortaSize = CreateResultReadingforNullableDecimal((int)ReadingLabels.AortaSize, customerEventReadingEntities);

            testResult.TransverseView             = new OrderedPair <ResultReading <decimal?>, ResultReading <decimal?> >(null, null);
            testResult.TransverseView.FirstValue  = CreateResultReadingforNullableDecimal((int)ReadingLabels.TransverseViewDataPointOne, customerEventReadingEntities);
            testResult.TransverseView.SecondValue = CreateResultReadingforNullableDecimal((int)ReadingLabels.TransverseViewDataPointTwo, customerEventReadingEntities);

            testResult.ResidualLumenStandardFindings             = new OrderedPair <ResultReading <decimal?>, ResultReading <decimal?> >(null, null);
            testResult.ResidualLumenStandardFindings.FirstValue  = CreateResultReadingforNullableDecimal((int)ReadingLabels.ResidualLumenTransverseViewDataPointOne, customerEventReadingEntities);
            testResult.ResidualLumenStandardFindings.SecondValue = CreateResultReadingforNullableDecimal((int)ReadingLabels.ResidualLumenTransverseViewDataPointTwo, customerEventReadingEntities);

            var aortaValue = GetMaxofthreeAortaValues(testResult);

            if (aortaValue != null)
            {
                testResult.Finding = new StandardFinding <decimal?>(Convert.ToInt64((new TestResultService()).GetCalculatedStandardFinding(EventId, CustomerId, aortaValue, (int)TestType.AwvAAA, (int)ReadingLabels.AortaSize)));
            }

            if (testResult.Finding != null)
            {
                testResult.Finding = new TestResultService().GetAllStandardFindings <decimal?>((int)TestType.AwvAAA, (int)ReadingLabels.AortaSize).Find(standardFinding => standardFinding.Id == testResult.Finding.Id);
            }

            testResult.PeakSystolicVelocity = CreateResultReadingforNullableDecimal((int)ReadingLabels.PeakSystolicVelocity, customerEventReadingEntities);

            testResult.AorticDissection = CreateResultReading((int)ReadingLabels.AorticDissection, customerEventReadingEntities);
            testResult.Plaque           = CreateResultReading((int)ReadingLabels.Plaque, customerEventReadingEntities);
            testResult.Thrombus         = CreateResultReading((int)ReadingLabels.Thrombus, customerEventReadingEntities);
            testResult.TechnicallyLimitedbutReadable = CreateResultReading((int)ReadingLabels.TechnicallyLimitedbutReadable, customerEventReadingEntities);
            testResult.RepeatStudy = CreateResultReading((int)ReadingLabels.RepeatStudy, customerEventReadingEntities);

            var testResultService = new TestResultService();
            var aortaRangeSaggitalViewFindings   = testResultService.GetAllStandardFindings <int?>((int)TestType.AwvAAA, (int)ReadingLabels.AortaRangeSaggitalView);
            var peakSystolicSaggitalViewFindings = testResultService.GetAllStandardFindings <int?>((int)TestType.AwvAAA, (int)ReadingLabels.AortaRangeSaggitalView);
            var aortaRangeTransverseViewFindings = testResultService.GetAllStandardFindings <int?>((int)TestType.AwvAAA, (int)ReadingLabels.AortaRangeTransverseView);
            var aortaValueFindings = testResultService.GetAllStandardFindings <int?>((int)TestType.AwvAAA, (int)ReadingLabels.AortaSize);

            customerEventTestStandardFindingEntities.ForEach(customerEventTestStandardFindingEntity =>
            {
                var standardFindingTestReadingEntity = standardFindingTestReadingEntities.Find(entity => entity.StandardFindingTestReadingId == customerEventTestStandardFindingEntity.StandardFindingTestReadingId);
                if (standardFindingTestReadingEntity == null)
                {
                    return;
                }

                var finding = CreateFindingObject(customerEventTestStandardFindingEntity, aortaRangeSaggitalViewFindings, standardFindingTestReadingEntity, (int?)ReadingLabels.AortaRangeSaggitalView);
                if (finding != null)
                {
                    if (testResult.AortaRangeSaggitalView == null)
                    {
                        testResult.AortaRangeSaggitalView = new List <StandardFinding <int> >();
                    }
                    testResult.AortaRangeSaggitalView.Add(finding); return;
                }

                finding = CreateFindingObject(customerEventTestStandardFindingEntity, peakSystolicSaggitalViewFindings, standardFindingTestReadingEntity, (int?)ReadingLabels.PeakSystolicVelocitySaggitalView);
                if (finding != null)
                {
                    if (testResult.PeakSystolicVelocityStandardFindings == null)
                    {
                        testResult.PeakSystolicVelocityStandardFindings = new List <StandardFinding <int> >();
                    }
                    testResult.PeakSystolicVelocityStandardFindings.Add(finding); return;
                }

                finding = CreateFindingObject(customerEventTestStandardFindingEntity, aortaRangeTransverseViewFindings, standardFindingTestReadingEntity, (int?)ReadingLabels.AortaRangeTransverseView);
                if (finding != null)
                {
                    if (testResult.AortaRangeTransverseView == null)
                    {
                        testResult.AortaRangeTransverseView = new List <StandardFinding <int> >();
                    }
                    testResult.AortaRangeTransverseView.Add(finding); return;
                }

                finding = CreateFindingObject(customerEventTestStandardFindingEntity, aortaValueFindings, standardFindingTestReadingEntity, (int?)ReadingLabels.AortaSize);
                if (finding != null)
                {
                    testResult.Finding = new StandardFinding <decimal?>(finding.Id)
                    {
                        CustomerEventStandardFindingId = finding.CustomerEventStandardFindingId,
                        Label       = finding.Label,
                        Description = finding.Description
                    };
                    return;
                }
            });

            var testMediaCollection  = customerEventScreeningTestsEntity.TestMedia.ToList();
            var fileEntityCollection = customerEventScreeningTestsEntity.FileCollectionViaTestMedia.ToList();

            if (testMediaCollection.Count > 0)
            {
                var resultMedia = new List <ResultMedia>();
                testMediaCollection.ForEach(testMedia => resultMedia.Add(new ResultMedia(testMedia.MediaId)
                {
                    File          = GetFileObjectfromEntity(testMedia.FileId, fileEntityCollection),
                    Thumbnail     = testMedia.ThumbnailFileId != null ? new File(testMedia.ThumbnailFileId.Value) : null,
                    ReadingSource = testMedia.IsManual ? ReadingSource.Manual : ReadingSource.Automatic
                }));

                testResult.ResultImages = resultMedia;
            }
            return(testResult);
        }
示例#5
0
        private void GetAwvAaaTransverseViewValues(AwvAaaTestResult testResult, XDocument xDoc)
        {
            try
            {
                var aoProxTran1 = GetValuefromXmlDoc(xDoc, ViewLocProx, ViewtypeTran, "1");
                var aoMidTran1  = GetValuefromXmlDoc(xDoc, ViewLocMid, ViewtypeTran, "1");
                var aoDistTran1 = GetValuefromXmlDoc(xDoc, ViewLocDist, ViewtypeTran, "1");

                var aoProxTran2 = GetValuefromXmlDoc(xDoc, ViewLocProx, ViewtypeTran, "2");
                var aoMidTran2  = GetValuefromXmlDoc(xDoc, ViewLocMid, ViewtypeTran, "2");
                var aoDistTran2 = GetValuefromXmlDoc(xDoc, ViewLocDist, ViewtypeTran, "2");

                IEnumerable <string> viewLocs2;
                decimal?aortaValue2;
                decimal?aortaValue1 = aortaValue2 = null;
                var     viewLocs1   = viewLocs2 = null;

                if (aoProxTran1 != null || aoMidTran1 != null || aoDistTran1 != null)
                {
                    aortaValue1 = GetMaximumOfThree(aoProxTran1 ?? 0, aoMidTran1 ?? 0, aoDistTran1 ?? 0, out viewLocs1);
                }

                if (aoProxTran2 != null || aoMidTran2 != null || aoDistTran2 != null)
                {
                    aortaValue2 = GetMaximumOfThree(aoProxTran2 ?? 0, aoMidTran2 ?? 0, aoDistTran2 ?? 0, out viewLocs2);
                }

                if (aortaValue1 != null || aortaValue2 != null)
                {
                    IEnumerable <string> viewLocs;
                    decimal?aortaValue;
                    if ((aortaValue1 ?? 0) > (aortaValue2 ?? 0))
                    {
                        aortaValue = aortaValue1;
                        viewLocs   = viewLocs1;
                    }
                    else
                    {
                        aortaValue = aortaValue2;
                        viewLocs   = viewLocs2;
                    }

                    if (aortaValue != null)
                    {
                        testResult.TransverseView = new OrderedPair <ResultReading <decimal?>, ResultReading <decimal?> >();

                        if (_awvAaaReadings.Any(r => r.Label == ReadingLabels.TransverseViewDataPointOne))
                        {
                            testResult.TransverseView.FirstValue =
                                new ResultReading <decimal?>(ReadingLabels.TransverseViewDataPointOne)
                            {
                                ReadingSource = ReadingSource.Automatic
                            };
                        }

                        if (_awvAaaReadings.Any(r => r.Label == ReadingLabels.TransverseViewDataPointTwo))
                        {
                            testResult.TransverseView.SecondValue =
                                new ResultReading <decimal?>(ReadingLabels.TransverseViewDataPointTwo)
                            {
                                ReadingSource = ReadingSource.Automatic
                            };
                        }
                    }

                    if (viewLocs != null && viewLocs.Any())
                    {
                        if (viewLocs.ElementAt(0) == ViewLocProx)
                        {
                            testResult.TransverseView.FirstValue.Reading  = aoProxTran1.HasValue ? (decimal?)decimal.Round(aoProxTran1.Value, 2) : null;
                            testResult.TransverseView.SecondValue.Reading = aoProxTran2.HasValue ? (decimal?)decimal.Round(aoProxTran2.Value, 2) : null;
                        }
                        else if (viewLocs.ElementAt(0) == ViewLocDist)
                        {
                            testResult.TransverseView.FirstValue.Reading  = aoDistTran1.HasValue ? (decimal?)decimal.Round(aoDistTran1.Value, 2) : null;
                            testResult.TransverseView.SecondValue.Reading = aoDistTran2.HasValue ? (decimal?)decimal.Round(aoDistTran2.Value, 2) : null;
                        }
                        else if (viewLocs.ElementAt(0) == ViewLocMid)
                        {
                            testResult.TransverseView.FirstValue.Reading  = aoMidTran1.HasValue ? (decimal?)decimal.Round(aoMidTran1.Value, 2) : null;
                            testResult.TransverseView.SecondValue.Reading = aoMidTran2.HasValue ? (decimal?)decimal.Round(aoMidTran2.Value, 2) : null;
                        }

                        if (_awvAaaReadings.Any(r => r.Label == ReadingLabels.AortaRangeTransverseView))
                        {
                            var transViewFindings = _testResultService.GetAllStandardFindings <int>((int)TestType.AwvAAA, (int)ReadingLabels.AortaRangeTransverseView);
                            testResult.AortaRangeTransverseView = new List <StandardFinding <int> >();

                            foreach (string viewLoc in viewLocs)
                            {
                                var finding = transViewFindings.SingleOrDefault(s => s.Label.ToLower().Contains(viewLoc));

                                if (finding != null)
                                {
                                    testResult.AortaRangeTransverseView.Add(finding);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                _errorSummary += "Datapoints for Transverse View could not be extracted. ";
                _logger.Error("\n Datapoints for Transverse View could not be extracted." + ex.Message + "\n\t\t" + ex.StackTrace);
            }
        }
示例#6
0
        public void LoadAwvAaaTestresults(HtmlDocument doc, long eventId, long customerId, AwvAaaTestResult testResult, bool removeLongDescription,
                                          List <OrderedPair <long, string> > technicianIdNamePairs, bool loadImages, IEnumerable <CustomerScreeningEvaluatinPhysicianViewModel> physicians,
                                          IEnumerable <EventPhysicianTest> eventPhysicianTests, bool showUnreadableTest, IEnumerable <PhysicianEvaluation> eventCustomerPhysicianEvaluation,
                                          CustomerSkipReview customerSkipReview)
        {
            var incidentalFindings = _incidentalFindingRepository.GetAllIncidentalFinding((int)TestType.AwvAAA);

            if (testResult != null)
            {
                var selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='AwvAaa-rpp-section']");
                if (selectedNode != null && (testResult.UnableScreenReason == null || testResult.UnableScreenReason.Count == 0) && (testResult.TestNotPerformed == null || testResult.TestNotPerformed.TestNotPerformedReasonId <= 0) &&
                    (showUnreadableTest || testResult.RepeatStudy == null || testResult.RepeatStudy.Reading == false))
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='rpp-eus-AwvAaa-div']");
                if (selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", "display:block;");
                }

                _resultPdfHelper.SetPhysicianSignature(doc, "AwvAaa-primaryEvalPhysicianSign", "AwvAaa-overreadEvalPhysicianSign", physicians, eventPhysicianTests, eventCustomerPhysicianEvaluation, customerSkipReview);

                var readings = new TestResultRepository().GetAllReadings((int)TestType.AwvAAA);

                foreach (var resultReading in readings)
                {
                    switch (resultReading.Label)
                    {
                    case ReadingLabels.AortaSize:
                        _resultPdfHelper.SetInputBox(doc, "AwvAaaAortaSizeInputText", testResult.AortaSize);
                        _resultPdfHelper.SetInputBox(doc, "aortasize-AwvAaa-summary", testResult.AortaSize);
                        break;

                    case ReadingLabels.TransverseViewDataPointOne:
                        if (testResult.TransverseView != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "AwvAaaTVDatapointOneTextbox", testResult.TransverseView.FirstValue);
                        }
                        break;

                    case ReadingLabels.TransverseViewDataPointTwo:
                        if (testResult.TransverseView != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "AwvAaaTVDatapointTwoTextbox", testResult.TransverseView.SecondValue);
                        }
                        break;

                    case ReadingLabels.AorticDissection:
                        _resultPdfHelper.SetCheckBox(doc, "AwvAaaAorticDissectionCheckbox", testResult.AorticDissection);
                        break;

                    case ReadingLabels.Plaque:
                        _resultPdfHelper.SetCheckBox(doc, "AwvAaaPlaqueCheckbox", testResult.Plaque);
                        break;

                    case ReadingLabels.Thrombus:
                        _resultPdfHelper.SetCheckBox(doc, "AwvAaaThrombusCheckbox", testResult.Thrombus);
                        break;

                    case ReadingLabels.TechnicallyLimitedbutReadable:
                        _resultPdfHelper.SetCheckBox(doc, "TechnicallyLimitedbutReadableAwvAaaInputCheck", testResult.TechnicallyLimitedbutReadable);
                        break;

                    case ReadingLabels.RepeatStudy:
                        _resultPdfHelper.SetCheckBox(doc, "RepeatStudyAwvAaaInputCheck", testResult.RepeatStudy);
                        break;

                    case ReadingLabels.PeakSystolicVelocity:
                        if (testResult.PeakSystolicVelocity != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "AwvAaaPeakSystolicVelocityTextbox", testResult.PeakSystolicVelocity);
                        }
                        break;

                    case ReadingLabels.ResidualLumenTransverseViewDataPointOne:
                        if (testResult.ResidualLumenStandardFindings != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "AwvAaaResidualLumenTVDatapointOneTextbox", testResult.ResidualLumenStandardFindings.FirstValue);
                        }
                        break;

                    case ReadingLabels.ResidualLumenTransverseViewDataPointTwo:
                        if (testResult.ResidualLumenStandardFindings != null)
                        {
                            _resultPdfHelper.SetInputBox(doc, "AwvAaaResidualLumenTVDatapointTwoTextbox", testResult.ResidualLumenStandardFindings.SecondValue);
                        }
                        break;
                    }
                }

                var maxAortaSize = GetMaxofthreeAwvAaaAortaValues(testResult);
                //TODO: This is a hack for U Screen Text on AAA Summary
                LoadAwvAaaFindings(doc, eventId, customerId, testResult.Finding, testResult.AortaRangeSaggitalView, testResult.AortaRangeTransverseView, maxAortaSize, true, (testResult.UnableScreenReason != null && testResult.UnableScreenReason.Count > 0 && testResult.UnableScreenReason.Count(us => us.Reason == UnableToScreenReason.UnableToTechnicallyVisualize) < 1 ? testResult.UnableScreenReason.First() : null), testResult.PeakSystolicVelocityStandardFindings);
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.AwvAAA, "AwvAaaUnableToScreen", testResult.UnableScreenReason);
                _resultPdfHelper.SetTechnician(doc, testResult, "techAwvAaa", "technotesAwvAaa", technicianIdNamePairs);
                _resultPdfHelper.SetPhysicianRemarks(doc, testResult, "followUpAwvAaa", "criticalAwvAaa", "physicianRemarksAwvAaa");
                _resultPdfHelper.LoadTestMedia(doc, testResult.ResultImages, "testmedia-AwvAaa", loadImages);
                _resultPdfHelper.SetIncidentalFindings(doc, incidentalFindings, testResult.IncidentalFindings, "AwvAaaIncidenatlFindings");

                if (testResult.IncidentalFindings != null && testResult.IncidentalFindings.Any())
                {
                    selectedNode = doc.DocumentNode.SelectSingleNode("//p[@id='incidentalfinding-description-AwvAaa']");
                    if (selectedNode != null)
                    {
                        selectedNode.SetAttributeValue("style", "display:block;");
                    }
                }

                selectedNode = doc.DocumentNode.SelectSingleNode("//div[@id='AwvAaa-longdescription-div']");
                if (selectedNode != null)
                {
                    selectedNode.SetAttributeValue("style", removeLongDescription ? "display:none" : "display:block");
                }
            }
            else
            {
                _resultPdfHelper.SetIncidentalFindings(doc, incidentalFindings, null, "AwvAaaIncidenatlFindings");
                _resultPdfHelper.SetUnableToScreenReasons(doc, TestType.AwvAAA, "AwvAaaUnableToScreen", null);
                LoadAwvAaaFindings(doc, eventId, customerId, null, null, null, null, false);
            }
        }
示例#7
0
        public PcpResultExportModel SetAwvAaaData(PcpResultExportModel model, AwvAaaTestResult testResult, bool useBlankValue = false)
        {
            if (testResult.Finding != null)
            {
                model.AaaResult = testResult.Finding.Label;
            }

            model.AaaLargestSagittalMeasurement = testResult.AortaSize != null ? testResult.AortaSize.Reading != null?testResult.AortaSize.Reading.ToString() : "" : "";

            model.AaaLargestSagittalLocation = string.Join(",", testResult.AortaRangeSaggitalView != null ? testResult.AortaRangeSaggitalView.Select(s => s.Label).ToArray() : new[] { "" });

            model.AaaLargestTransverseMeasurement1 = testResult.TransverseView != null ? testResult.TransverseView.FirstValue != null?testResult.TransverseView.FirstValue.Reading.ToString() : "" : "";

            model.AaaLargestTransverseMeasurement2 = testResult.TransverseView != null ? testResult.TransverseView.SecondValue != null?testResult.TransverseView.SecondValue.Reading.ToString() : "" : "";

            model.AaaLargestMeasurementTransverseLocation = string.Join(",", testResult.AortaRangeTransverseView != null ? testResult.AortaRangeTransverseView.Select(s => s.Label).ToArray() : new[] { "" });

            model.AaaPeakSystolicVelocityMeasurement = testResult.PeakSystolicVelocity != null ? testResult.PeakSystolicVelocity.Reading != null?testResult.PeakSystolicVelocity.Reading.ToString() : "" : "";

            model.AaaPeakSystolicVelocityLocation = string.Join(",", testResult.PeakSystolicVelocityStandardFindings != null ? testResult.PeakSystolicVelocityStandardFindings.Select(s => s.Label).ToArray() : new[] { "" });

            model.AaaResidualLumenMeasurement1 = testResult.ResidualLumenStandardFindings != null ? testResult.ResidualLumenStandardFindings.FirstValue != null?testResult.ResidualLumenStandardFindings.FirstValue.Reading.ToString() : "" : "";

            model.AaaResidualLumenMeasurement2 = testResult.ResidualLumenStandardFindings != null ? testResult.ResidualLumenStandardFindings.SecondValue != null?testResult.ResidualLumenStandardFindings.SecondValue.Reading.ToString() : "" : "";

            model.AaaAorticDissection = PcpResultExportHelper.GetOutputFromBoolTypeResultReading(testResult.AorticDissection, useBlankValue);

            model.AaaPlaque = PcpResultExportHelper.GetOutputFromBoolTypeResultReading(testResult.Plaque, useBlankValue);

            model.AaaThrombus = PcpResultExportHelper.GetOutputFromBoolTypeResultReading(testResult.Thrombus, useBlankValue);

            if (testResult.IncidentalFindings != null && testResult.IncidentalFindings.Count > 0)
            {
                model.AaaAorticStenosis = PcpResultExportHelper.YesString;
            }
            else if (!useBlankValue)
            {
                model.AaaAorticStenosis = PcpResultExportHelper.NoString;
            }

            model.AaaTechnicallyLimitedButReadable = PcpResultExportHelper.GetOutputFromBoolTypeResultReading(testResult.TechnicallyLimitedbutReadable, useBlankValue);
            model.AaaRepeatStudyUnreadable         = PcpResultExportHelper.GetOutputFromBoolTypeResultReading(testResult.RepeatStudy, useBlankValue);

            model.AaaUnabletoScreen = 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.AaaCritical = PcpResultExportHelper.YesString;
            }
            else if (!useBlankValue)
            {
                model.AaaCritical = PcpResultExportHelper.NoString;
            }

            if (testResult.PhysicianInterpretation != null)
            {
                model.AaaPhysicianNotes = testResult.PhysicianInterpretation.Remarks;
            }

            return(model);
        }