Пример #1
0
 protected void OnTransformationError(object sender, FeedExceptionEventArgs e)
 {
     if (TransformError != null)
     {
         foreach (EventHandler <FeedExceptionEventArgs> eh in TransformError.GetInvocationList())
         {
             eh.BeginInvoke(sender, e, null, null);
         }
     }
 }
        private void Validate()
        {
            // Relaxes code vocabulary checks.
            DefaultCodeResolutionConfigurator.ConfigureCodeResolversWithTrivialDefault();

            // a bit of a hack here - we need to force the assembly to load into memory
            Assembly.Load("message-builder-ccda-r1_1");

            ClinicalDocumentValidator validator = CreateNewValidator();

            CdaValidatorResult result = validator.Validate(CreateDocument("Resources.ProcedureNote.xml"), HelloWorldAppBase.MBSpecificationVersion);

            Console.WriteLine("There are " + CountErrorsAndWarnings(result.GetErrors()) + " errors and/or warnings\n");
            IEnumerator <TransformError> enumerator = result.GetErrors().GetEnumerator();

            while (enumerator.MoveNext())
            {
                TransformError cdaError = enumerator.Current;
                if (cdaError.GetErrorLevel() != ErrorLevel.INFO)
                {
                    Console.WriteLine(cdaError.GetErrorLevel() + ": " + cdaError.GetMessage() + " at XPath: " + cdaError.GetPath());
                }
            }
        }