Пример #1
0
 public virtual void SetUp()
 {
     MockMessageBeanRegistry.Initialize();
     DefaultCodeResolutionConfigurator.ConfigureCodeResolversWithTrivialDefault();
     CodeResolverRegistry.Register(new TrivialCodeResolver());
     this.service = new MockTestCaseMessageDefinitionService();
 }
        public void Run(string[] args)
        {
            // Relaxes code vocabulary code checks.
            DefaultCodeResolutionConfigurator.ConfigureCodeResolversWithTrivialDefault();

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

            MessageValidator.Validate(HelloWorldApp.ReadResourceFile("Resources.PRPA_EX101104CA_validation.xml"), HelloWorldApp.MBSpecificationVersion);

            Console.WriteLine("\nDone validation. Press any key to exit.");
            Console.ReadLine();
        }
        public void ObtainDocumentXmlAndConvertToBean()
        {
            Console.WriteLine("\n\nNow taking a large sample document (as xml) and converting to objects.\n");

            // this method takes a full sample ConsultationNote document and converts it into objects, walking the object model and printing out various fields

            // Relaxes code vocabulary code checks and sets up some basic code resolvers.
            // This only needs to be done once (which occurred in createDocumentBeanAndConvertToXml()), but including it here for completeness.
            DefaultCodeResolutionConfigurator.ConfigureCodeResolversWithTrivialDefault();

            String xml = ReadResourceFile(this.documentXml);

            ConsultationNote consultationNote = (ConsultationNote)ProcessDocumentXml(xml);

            ConsultationNoteAccessor consultationNoteAccessor = new ConsultationNoteAccessor();

            consultationNoteAccessor.ProcessConsultationNote(consultationNote);
        }
Пример #4
0
        private void Setup()
        {
            //Standard configuration with HL7v3 code resolution
            DefaultCodeResolutionConfigurator.ConfigureCodeResolversWithTrivialDefault();

            //Separate configuration for CDA code resolution
            GenericCodeResolverRegistry cdaCodeResolverRegistry = new GenericCodeResolverRegistryImpl();

            Assembly cdaAssembly = Assembly.Load("message-builder-release-cda-ab-shr");

            cdaCodeResolverRegistry.Register(new CdaCodeResolver(
                                                 new TypedCodeFactory(),
                                                 ResourceLoader.GetResource(cdaAssembly, "/voc.xml"),
                                                 ResourceLoader.GetResource(cdaAssembly, "/vocabNameMap.xml"),
                                                 CdaCodeResolver.MODE_LENIENT
                                                 ));

            CodeResolverRegistry.RegisterCodeResolverRegistryForVersion(SpecificationVersion.CDA_AB_SHR, cdaCodeResolverRegistry);
        }
Пример #5
0
        public void Run(string[] args)
        {
            string username    = "";
            string passwd      = "";
            string serviceType = "";

            if (args.Length == 1)
            {
                isSimulatedMode = true;
                serviceType     = "simulated";
            }
            else if (args.Length == 4)
            {
                username    = args[1];
                passwd      = args[2];
                serviceType = args[3];
            }
            else
            {
                Console.WriteLine("Please use no argument for simulated mode. Or enter userid and " +
                                  "password and serviceType as arguments for REST or SOAP mode.");
                Console.WriteLine("Exited");
                Environment.Exit(0);
            }

            // Relaxes code vocabulary code checks.
            DefaultCodeResolutionConfigurator.ConfigureCodeResolversWithTrivialDefault();

            IInteraction        msg         = this.CreateRequestInteraction();
            CredentialsProvider credentials = this.CreateCredentialsProvider(username, passwd);

            string xmlResponse = this.SubmitRequest(msg, credentials, this.ServiceTypeFor(serviceType));

            Console.WriteLine("\n\nHere's the response (XML):\n");
            Console.WriteLine(xmlResponse);

            IInteraction interaction = this.ConvertXMLToMessageObject(xmlResponse);

            this.ProcessResponseInteraction(interaction);
            Console.WriteLine("\nDone. Press any key to exit.");
            Console.ReadLine();
        }
        public void CreateDocumentBeanAndConvertToXml()
        {
            // this method creates a ConsultationNote object and populates various fields (attempting to match some but not all values in the sample CDA ConsultationNote xml)

            // Relaxes code vocabulary code checks and sets up some basic code resolvers
            DefaultCodeResolutionConfigurator.ConfigureCodeResolversWithTrivialDefault();

            ConsultationNoteCreator  consultationNoteCreator = new ConsultationNoteCreator();
            ConsultationNoteDocument consultationNote        = consultationNoteCreator.CreateConsultationNote();

            string xml = ProcessDocumentObject(consultationNote);

            // note the errors reported about missing the "History of Present Illness Section" - so let's add that section now
            consultationNoteCreator.AddHistoryOfPresentIllness(consultationNote);

            Console.WriteLine("\n\nModifying objects to clear out some errors. Re-converting to xml");
            xml = ProcessDocumentObject(consultationNote);

            // xml can now be used as necessary (embedded in message, sent using a transport mechanism, etc)
        }
        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());
                }
            }
        }
Пример #8
0
 public virtual void Setup()
 {
     DefaultCodeResolutionConfigurator.ConfigureCodeResolversWithTrivialDefault();
 }
Пример #9
0
 public override void SetUp()
 {
     DefaultCodeResolutionConfigurator.ConfigureCodeResolversWithTrivialDefault();
     this.result = new XmlToModelResult();
 }
Пример #10
0
 public virtual void SetUp()
 {
     this.formatter = new IvlPqR2PropertyFormatter();
     DefaultCodeResolutionConfigurator.ConfigureCodeResolversWithTrivialDefault();
 }
Пример #11
0
 public virtual void SetUp()
 {
     DefaultCodeResolutionConfigurator.ConfigureCodeResolversWithTrivialDefault();
     this.xmlResult = new XmlToModelResult();
 }