Пример #1
0
        /// <summary>
        /// Validates this imaging examination result
        /// </summary>
        /// <param name="path">The path to this object as a string</param>
        /// <param name="messages">the validation messages to date, these may be added to within this method</param>
        public void Validate(string path, List <ValidationMessage> messages)
        {
            var vb = new ValidationBuilder(path, messages);

            if (vb.ArgumentRequiredCheck("ExaminationResultName", ExaminationResultName))
            {
                if (ExaminationResultName != null)
                {
                    ExaminationResultName.ValidateMandatory(vb.Path + "ExaminationResultName", messages);
                }
            }

            vb.ArgumentRequiredCheck("ResultDateTime", ResultDateTime);

            if (Modality != null)
            {
                Modality.Validate(vb.Path + "Modality", messages);
            }

            if (AnatomicalSite != null && AnatomicalSite.Any())
            {
                AnatomicalSite.ForEach(anatomicalSite => anatomicalSite.Validate(vb.Path + "AnatomicalSite", messages));
            }

            if (ExaminationRequestDetails != null)
            {
                ExaminationRequestDetails.ForEach(ExaminationRequestDetail => ExaminationRequestDetail.Validate(vb.Path + "ExaminationRequestDetails", messages));
            }

            if (ResultGroup != null && ResultGroup.Any())
            {
                ResultGroup.ForEach(imagingResultGroup => imagingResultGroup.Validate(vb.Path + "ResultGroup", messages));
            }
        }
Пример #2
0
        /// <summary>
        /// Validates this pathology test result
        /// </summary>
        /// <param name="path">The path to this object as a string</param>
        /// <param name="messages">the validation messages to date, these may be added to within this method</param>
        public void Validate(string path, List <ValidationMessage> messages)
        {
            var validationBuilder = new ValidationBuilder(path, messages);

            validationBuilder.ArgumentRequiredCheck("ObservationDateTime", ObservationDateTime);

            validationBuilder.ArgumentRequiredCheck("OverallTestResultStatus", OverallTestResultStatus);

            validationBuilder.ArgumentRequiredCheck("PathologyTestSpecimenDetail", TestSpecimenDetail);

            if (TestSpecimenDetail != null && TestSpecimenDetail.Any())
            {
                TestSpecimenDetail.ForEach(testSpecimenDetail => testSpecimenDetail.Validate(validationBuilder.Path + "PathologyTestSpecimenDetail", messages, !XPreNarrative.IsNullOrEmptyWhitespace()));
            }

            if (ResultGroup != null && ResultGroup.Any())
            {
                ResultGroup.ForEach(testResultGroup => testResultGroup.Validate(validationBuilder.Path + "PathologyTestResultGroup", messages));
            }

            if (validationBuilder.ArgumentRequiredCheck("TestResultName", TestResultName))
            {
                if (TestResultName != null)
                {
                    TestResultName.ValidateMandatory(validationBuilder.Path + "TestResultName", messages);
                }
            }

            if (TestResultRepresentation != null)
            {
                TestResultRepresentation.Validate(validationBuilder.Path + "TestResultRepresentation", messages);
            }

            if (TestRequestDetails != null && TestRequestDetails.Any())
            {
                foreach (var testRequestDetails in TestRequestDetails)
                {
                    testRequestDetails.Validate(validationBuilder.Path + "TestRequestDetails", messages);
                }
            }
        }