Ejemplo n.º 1
0
        public virtual void TestParseValidFull()
        {
            XmlNode node = CreateNode("<something code=\"FRED\" codeSystem=\"1.2.3.4.5\" codeSystemName=\"aCsName\" codeSystemVersion=\"aCsVersion\" displayName=\"aDisplayName\" operator=\"P\">"
                                      + "  <originalText>some original text</originalText>" + "  <qualifier inverted=\"true\"><name code=\"cm\" codeSystem=\"1.2.3.4\"/><value code=\"normal\" codeSystem=\"2.16.840.1.113883.5.14\"/></qualifier>"
                                      + "  <qualifier inverted=\"true\"><name code=\"M\" codeSystem=\"2.16.840.1.113883.5.1\"/><value code=\"ACT\" codeSystem=\"2.16.840.1.113883.5.6\"/></qualifier>"
                                      + "  <translation code=\"M\" codeSystem=\"2.16.840.1.113883.5.1\" />" + "  <translation code=\"F\" codeSystem=\"2.16.840.1.113883.5.1\" />"
                                      + "</something>");
            SXCM_R2 <CodedTypeR2 <MockCharacters> > cd = (SXCM_R2 <CodedTypeR2 <MockCharacters> >) this.parser.Parse(ParseContextImpl.Create
                                                                                                                         ("SXCM<CD>", typeof(MockCharacters), SpecificationVersion.V02R02, null, null, Ca.Infoway.Messagebuilder.Xml.ConformanceLevel
                                                                                                                         .OPTIONAL, null, null, false), node, this.xmlResult);

            Assert.IsTrue(this.xmlResult.IsValid(), "valid");
            Assert.AreEqual(MockEnum.FRED, cd.Value.Code, "enum found properly");
            Assert.AreEqual("aCsName", cd.Value.CodeSystemName);
            Assert.AreEqual("aCsVersion", cd.Value.CodeSystemVersion);
            Assert.AreEqual("aDisplayName", cd.Value.DisplayName);
            Assert.AreEqual("some original text", cd.Value.OriginalText.Content);
            Assert.AreEqual(2, cd.Value.Translation.Count);
            Assert.AreEqual(Ca.Infoway.Messagebuilder.Domainvalue.Payload.AdministrativeGender.MALE.CodeValue, cd.Value.Translation[0
                            ].Code.CodeValue);
            Assert.AreEqual(Ca.Infoway.Messagebuilder.Domainvalue.Payload.AdministrativeGender.MALE.CodeSystem, cd.Value.Translation[
                                0].Code.CodeSystem);
            Assert.AreEqual(Ca.Infoway.Messagebuilder.Domainvalue.Payload.AdministrativeGender.FEMALE.CodeValue, cd.Value.Translation
                            [1].Code.CodeValue);
            Assert.AreEqual(Ca.Infoway.Messagebuilder.Domainvalue.Payload.AdministrativeGender.FEMALE.CodeSystem, cd.Value.Translation
                            [1].Code.CodeSystem);
            Assert.AreEqual(2, cd.Value.Qualifier.Count);
            Assert.IsTrue(cd.Value.Qualifier[0].Inverted);
            Assert.IsTrue(cd.Value.Qualifier[1].Inverted);
            Assert.AreEqual("cm", cd.Value.Qualifier[0].Name.GetCodeValue());
            Assert.AreEqual("M", cd.Value.Qualifier[1].Name.GetCodeValue());
            Assert.AreEqual("normal", cd.Value.Qualifier[0].Value.GetCodeValue());
            Assert.AreEqual("ACT", cd.Value.Qualifier[1].Value.GetCodeValue());
            Assert.AreEqual(SetOperator.PERIODIC_HULL, cd.Value.Operator);
        }
Ejemplo n.º 2
0
        public virtual void TestParseNoCodeAttributeNode()
        {
            XmlNode node = CreateNode("<something notvalue=\"\" />");
            SXCM_R2 <CodedTypeR2 <MockCharacters> > cd = (SXCM_R2 <CodedTypeR2 <MockCharacters> >) this.parser.Parse(ParseContextImpl.Create
                                                                                                                         ("SXCM<CD>", typeof(MockCharacters), SpecificationVersion.V02R02, null, null, Ca.Infoway.Messagebuilder.Xml.ConformanceLevel
                                                                                                                         .OPTIONAL, null, null, false), node, this.xmlResult);

            Assert.IsTrue(this.xmlResult.IsValid());
            Assert.AreEqual(SetOperator.INCLUDE, cd.Value.Operator);
        }
Ejemplo n.º 3
0
        public virtual void TestParseCodeWithNullNodeAndCodeSystem()
        {
            XmlNode node = CreateNode("<something code=\"BARNEY\" codeSystem=\"1.2.3.4.5\" nullFlavor=\"OTH\"/>");
            SXCM_R2 <CodedTypeR2 <MockCharacters> > cd = (SXCM_R2 <CodedTypeR2 <MockCharacters> >) this.parser.Parse(ParseContextImpl.Create
                                                                                                                         ("SXCM<CD>", typeof(MockCharacters), SpecificationVersion.V02R02, null, null, Ca.Infoway.Messagebuilder.Xml.ConformanceLevel
                                                                                                                         .OPTIONAL, null, null, false), node, this.xmlResult);

            Assert.IsTrue(this.xmlResult.IsValid());
            Assert.AreEqual("BARNEY", cd.Value.GetCodeValue(), "value");
            Assert.AreEqual(Ca.Infoway.Messagebuilder.Domainvalue.Nullflavor.NullFlavor.OTHER, cd.NullFlavor, "null flavor");
        }
Ejemplo n.º 4
0
        public virtual void TestParseNullNode()
        {
            XmlNode node = CreateNode("<something nullFlavor=\"NI\"/>");
            SXCM_R2 <CodedTypeR2 <MockCharacters> > cd = (SXCM_R2 <CodedTypeR2 <MockCharacters> >) this.parser.Parse(ParseContextImpl.Create
                                                                                                                         ("SXCM<CD>", typeof(MockCharacters), SpecificationVersion.V02R02, null, null, Ca.Infoway.Messagebuilder.Xml.ConformanceLevel
                                                                                                                         .OPTIONAL, null, null, false), node, this.xmlResult);

            Assert.IsTrue(this.xmlResult.IsValid());
            Assert.IsNull(cd.Value, "value");
            Assert.AreEqual(Ca.Infoway.Messagebuilder.Domainvalue.Nullflavor.NullFlavor.NO_INFORMATION, cd.NullFlavor, "null flavor");
        }
Ejemplo n.º 5
0
        public virtual void TestParseValidWithInvalidNullFavorAttributeValue()
        {
            XmlNode node = CreateNode("<something code=\"BARNEY\" nullFlavor=\"NOT A VALID NULL FAVOR VALUE\"/>");
            SXCM_R2 <CodedTypeR2 <MockCharacters> > cd = (SXCM_R2 <CodedTypeR2 <MockCharacters> >) this.parser.Parse(ParseContextImpl.Create
                                                                                                                         ("SXCM<CD>", typeof(MockCharacters), SpecificationVersion.V02R02, null, null, Ca.Infoway.Messagebuilder.Xml.ConformanceLevel
                                                                                                                         .OPTIONAL, null, null, false), node, this.xmlResult);

            Assert.IsFalse(this.xmlResult.IsValid());
            Assert.AreEqual(1, this.xmlResult.GetHl7Errors().Count);
            Assert.AreEqual("BARNEY", cd.Value.GetCodeValue(), "node with no code attribute returns null");
        }
Ejemplo n.º 6
0
 public Supply()
 {
     this.typeId            = new IIImpl();
     this.templateId        = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.id                = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.code              = new CD_R2Impl <Code>();
     this.text              = new EDImpl <EncapsulatedData>();
     this.statusCode        = new CS_R2Impl <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Domainvalue.MedicationFillStatus>();
     this.effectiveTime     = new SXCM_R2Impl <MbDate>();
     this.priorityCode      = new LISTImpl <CE_R2 <Code>, CodedTypeR2 <Code> >(typeof(CE_R2Impl <Code>));
     this.repeatNumber      = new IVLImpl <INT, Interval <int?> >();
     this.independentInd    = new BLImpl();
     this.quantity          = new PQImpl();
     this.expectedUseTime   = new IVL_TSImpl();
     this.specimen          = new List <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Merged.Specimen>();
     this.author            = new List <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Merged.Author_1>();
     this.informant         = new List <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Merged.Informant12>();
     this.participant       = new List <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Merged.Participant2_2>();
     this.entryRelationship = new List <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Medicationdispense.IEntryRelationshipChoice>();
     this.reference         = new List <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Basemodel.Reference>();
     this.precondition      = new List <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Basemodel.Precondition>();
 }