Exemple #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);
                }
            }
        }
Exemple #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);
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// Validate the CDA Context for Document
        /// </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 (ReportIdentifier != null)
            {
                ReportIdentifier.Validate("ReportIdentifier", messages);
            }

            vb.ArgumentRequiredCheck("ReportDate", ReportDate);
            vb.ArgumentRequiredCheck("ReportName", ReportDescription);

            if (vb.ArgumentRequiredCheck("ReportStatus", ReportStatus))
            {
                ReportStatus.Validate(path, messages);
            }
        }
Exemple #4
0
        /// <summary>
        /// Validate the Content for this Requested Service
        /// </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 (vb.ArgumentRequiredCheck("LinkNature", LinkNature))
            {
                LinkNature.Validate(path + "LinkNature", messages);
            }

            if (vb.ArgumentRequiredCheck("ExternalData", ExternalData))
            {
                ExternalData.Validate(path + "ExternalData", messages);
            }

            if (vb.ArgumentRequiredCheck("ReportIdentifier", ReportIdentifier))
            {
                ReportIdentifier.Validate(path + "ReportIdentifier", messages);
            }

            vb.ArgumentRequiredCheck("ReportStatus", ReportStatus);
        }
Exemple #5
0
        /// <summary>
        /// Validate the Content for this Requested Service
        /// </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 (vb.ArgumentRequiredCheck("ReportIdentifier", ReportIdentifier))
            {
                ReportIdentifier.Validate(path + "ReportIdentifier", messages);
            }

            if (ServiceRequestIdentifier != null)
            {
                ServiceRequestIdentifier.Validate(path + "ServiceRequestIdentifier", messages);
            }

            if (ServiceRequestIdentifierCode != null)
            {
                ServiceRequestIdentifierCode.Validate(path + "ServiceRequestIdentifierCode", messages);
            }

            if ((ServiceRequestIdentifier != null && ServiceRequestIdentifierCode == null) && (ServiceRequestIdentifier == null && ServiceRequestIdentifierCode != null))
            {
                vb.AddValidationMessage(vb.Path + "ServiceRequestIdentifier & ServiceRequestIdentifierCode", null, "ServiceRequestIdentifier & ServiceRequestIdentifierCode must be provided together and represent the item (ServiceRequestIdentifier)");
            }

            if (vb.ArgumentRequiredCheck("Authoriser", Authoriser))
            {
                Authoriser.Validate(vb.Path + "Authoriser", vb.Messages);
            }

            if (vb.ArgumentRequiredCheck("Authorisee", Authorisee))
            {
                Authorisee.Validate(vb.Path + "Authorisee", vb.Messages);
            }

            if (vb.ArgumentRequiredCheck("Repository", Authorisee))
            {
                Repository.Validate(vb.Path + "Repository", vb.Messages);
            }
        }