/// <summary>
        /// Creates and hydrates the 'Imaging Examination Results' section.
        /// </summary>
        /// <param name="mandatorySectionsOnly">Includes on the mandatory sections</param>
        /// <param name="showDescription">Determines wether the anatomicalSite.Description is displayed or not</param>
        /// <returns>A hydrated 'IImagingExaminationResult' object.</returns>
        public static IDiagnosticImagingExaminationResult CreateDiagnosticImagingResults(Boolean mandatorySectionsOnly, bool showDescription)
        {
            var diagnosticImagingExaminationResult = DiagnosticImagingReport.CreateDiagnosticImagingExaminationResult();

            // Examination Result Name
            diagnosticImagingExaminationResult.ExaminationResultName = BaseCDAModel.CreateCodableText("399208008", CodingSystem.SNOMED, "Plain chest X-ray");

            // Begin Modality (Imaging Modality)
            diagnosticImagingExaminationResult.Modality = BaseCDAModel.CreateCodableText("363680008", CodingSystem.SNOMED, "X-ray");

            // Observation Date Time
            diagnosticImagingExaminationResult.ObservationDateTime = new ISO8601DateTime(DateTime.Now);

            // ExaminationDetails
            diagnosticImagingExaminationResult.ExaminationDetails = CreateExaminationDetails(mandatorySectionsOnly);

            // Examination Procedure
            diagnosticImagingExaminationResult.ExaminationProcedure = "The examination was carried out using the particular procedure.";

            // Overall Result Status
            diagnosticImagingExaminationResult.OverallResultStatus = BaseCDAModel.CreateResultStatus(Hl7V3ResultStatus.FinalResults, "Final Results"); // or BaseCDAModel.CreateResultStatus(Hl7V3ResultStatus.FinalResults)

            if (!mandatorySectionsOnly)
            {
                // Please note optional field - Note: This field is only displayed in the Narrative
                diagnosticImagingExaminationResult.ReportingRadiologistForImagingExaminationResult = "DR Arreza Araceli";

                // Related Image
                diagnosticImagingExaminationResult.RelatedImage = BaseCDAModel.CreateRelatedImage("http://bassendeanwellness.com.au/sites/default/files/Chest%2520X-Ray%2520Image.jpg", MediaType.JPEG);

                // Anatomical Site
                var anatomicalSite = DiagnosticImagingReport.CreateAnatomicalSiteExtended();

                // Anatomical Location
                anatomicalSite.SpecificLocation = BaseCDAModel.CreateAnatomicalLocation();

                if (showDescription)
                {
                    // Description
                    anatomicalSite.Description = "Chest/Thorax";
                }
                else
                {
                    // Anatomical Location - Name Of Location
                    anatomicalSite.SpecificLocation.NameOfLocation = BaseCDAModel.CreateCodableText("302551006", CodingSystem.SNOMED, "Entire thorax");

                    // Anatomical Location - Side
                    anatomicalSite.SpecificLocation.Side = BaseCDAModel.CreateCodableText("7771000", CodingSystem.SNOMED, "left");

                    // Anatomical Region
                    diagnosticImagingExaminationResult.AnatomicalRegion = AnatomicalRegion.Chest;
                }

                // Assign Anatomical Site
                diagnosticImagingExaminationResult.AnatomicalSite = new List <IAnatomicalSiteExtended>
                {
                    anatomicalSite,
                    anatomicalSite
                };
            }

            return(diagnosticImagingExaminationResult);
        }
        /// <summary>
        /// Create the diagnostic imaging examination test results from information in the HL7 V2 message.
        /// </summary>
        /// <param name="genericMessage">The HL7 V2 message.</param>
        /// <returns>List of DiagnosticImagingExaminationResult</returns>
        internal IList <IDiagnosticImagingExaminationResult> CreateImagingExaminationResults(HL7GenericMessage hl7GenericMessage)
        {
            IList <IDiagnosticImagingExaminationResult> imagingTestResults = new List <IDiagnosticImagingExaminationResult>();

            foreach (var order in hl7GenericMessage.Order)
            {
                foreach (var observation in order.Observation)
                {
                    OBR obrSegment = observation.ObservationsReportID;

                    if (obrSegment.UniversalServiceID.identifier != TransformerConstants.ReportText)
                    {
                        IDiagnosticImagingExaminationResult testResult = DiagnosticImagingReport.CreateDiagnosticImagingExaminationResult();

                        // ReportingRadiologistForImagingExaminationResult
                        var principalResultInterpreter = hl7GenericMessage.Order.First().Observation.First().ObservationsReportID.PrincipalResultInterpreter.name;
                        testResult.ReportingRadiologistForImagingExaminationResult = GetNameStringFromCN(principalResultInterpreter);

                        // ExaminationResultName
                        testResult.ExaminationResultName = GetTestResultName(obrSegment.UniversalServiceID);

                        // Modality
                        DiagnosticService diagnosticService;
                        if (EnumHelper.TryGetEnumValue <DiagnosticService, NameAttribute>(
                                attribute => attribute.Code == obrSegment.DiagnosticServSectID, out diagnosticService))
                        {
                            testResult.Modality = BaseCDAModel.CreateCodableText(obrSegment.DiagnosticServSectID,
                                                                                 CodingSystem.HL7DiagnosticServiceSectionID,
                                                                                 diagnosticService.GetAttributeValue <NameAttribute, string>(a => a.Name));
                        }
                        else
                        {
                            testResult.Modality = BaseCDAModel.CreateCodableText(obrSegment.DiagnosticServSectID);
                        }

                        // Examination Procedure (Validate this, must be present)
                        if (obrSegment.UniversalServiceID != null &&
                            !string.IsNullOrEmpty(obrSegment.UniversalServiceID.text))
                        {
                            testResult.ExaminationProcedure = obrSegment.UniversalServiceID.text;
                        }

                        // Examination Details (Validate this, must be present)
                        testResult.ExaminationDetails = DiagnosticImagingReport.CreateExaminationDetails();
                        testResult.ExaminationDetails.ImageDateTime = new ISO8601DateTime(obrSegment.ObservationDateTime.TimestampValue.GetValueOrDefault());

                        // Observation Date Time
                        testResult.ObservationDateTime = new ISO8601DateTime(obrSegment.ObservationDateTime.TimestampValue.GetValueOrDefault());

                        // Overall Result Status
                        Hl7V3ResultStatus resultStatus;
                        if (EnumHelper.TryGetEnumValue <Hl7V3ResultStatus, NameAttribute>(
                                attribute => attribute.Code == obrSegment.ResultStatus, out resultStatus))
                        {
                            testResult.OverallResultStatus = BaseCDAModel.CreateResultStatus(resultStatus);
                        }
                        else
                        {
                            testResult.OverallResultStatus = BaseCDAModel.CreateCodableText(NullFlavour.NoInformation);
                        }

                        imagingTestResults.Add(testResult);
                    }
                }
            }

            return(imagingTestResults);
        }