Beispiel #1
0
        /// <summary>
        /// Validates this request
        /// </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>
        void IImagingExaminationRequest.Validate(string path, List <ValidationMessage> messages)
        {
            var validationBuilder = new ValidationBuilder(path, messages);

            if (RequesterOrderIdentifier != null)
            {
                RequesterOrderIdentifier.Validate(validationBuilder.Path, messages);
            }

            if (ReportIdentifier != null)
            {
                ReportIdentifier.Validate(validationBuilder.Path, messages);
            }

            if (StudyIdentifier != null)
            {
                StudyIdentifier.Validate(validationBuilder.Path, messages);
            }

            if (LaboratoryTestResultIdentifier != null)
            {
                LaboratoryTestResultIdentifier.Validate(validationBuilder.Path, messages);
            }

            if (ImageDetails != null && ImageDetails.Any())
            {
                foreach (var imageDetail in ImageDetails)
                {
                    imageDetail.Validate(validationBuilder.Path, messages);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Validates this request
        /// </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>
        void ITestRequest.Validate(string path, List <ValidationMessage> messages)
        {
            var validationBuilder = new ValidationBuilder(path, messages);

            if (RequesterOrderIdentifier != null)
            {
                RequesterOrderIdentifier.Validate(validationBuilder.Path, messages);
            }

            if (ReportIdentifier != null)
            {
                ReportIdentifier.Validate(validationBuilder.Path, messages);
            }

            if (StudyIdentifier != null)
            {
                StudyIdentifier.Validate(validationBuilder.Path, messages);
            }

            if (RequesterOrderIdentifier != null)
            {
                RequesterOrderIdentifier.Validate(validationBuilder.Path, messages);
            }

            if (TestsRequestedName != null && TestsRequestedName.Any())
            {
                foreach (var testsRequestedName in TestsRequestedName)
                {
                    testsRequestedName.Validate(path, messages);
                }
            }

            if (RequesterOrderIdentifier != null && TestsRequestedName == null)
            {
                validationBuilder.AddValidationMessage("RequesterOrderIdentifier", null, "This value requires that TestsRequestedName be populated");
            }

            if (LaboratoryTestResultIdentifier != null)
            {
                LaboratoryTestResultIdentifier.Validate(validationBuilder.Path, messages);
            }

            if (ImageDetails != null && ImageDetails.Any())
            {
                foreach (var imageDetail in ImageDetails)
                {
                    imageDetail.Validate(validationBuilder.Path, messages);
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// Validates this Protocol
        /// </summary>
        /// <param name="path">The path to this object as a string</param>
        /// <param name="messages">the validation messages, these may be added to within this method</param>
        public void Validate(string path, List <ValidationMessage> messages)
        {
            var vb = new ValidationBuilder(path, messages);

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

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