예제 #1
0
        public void IICreatePublicTest()
        {
            II     interactionID  = new II();
            OID    inputOID       = "1.2.3.4";
            string inputExtension = "1";

            interactionID = II.CreatePublic(inputOID, inputExtension);
            Assert.AreEqual(inputOID.ToString(), interactionID.Root);
            Assert.AreEqual("II.PUBLIC", interactionID.Flavor);
            Assert.AreEqual(true, interactionID.Displayable);
            Assert.AreEqual(IdentifierUse.Business, interactionID.Use);
        }
예제 #2
0
        static void Main(string[] args)
        {
            ClinicalDocument cda = new ClinicalDocument();

            cda.MoodCode   = null;
            cda.ClassCode  = null;
            cda.TypeId     = II.CreatePublic("2.16.840.1.113883.1.3", "POCD_HD000040");
            cda.TemplateId = LIST <II> .CreateList(
                new II("2.16.840.1.113883.3.4424.13.10.1.1"),
                new II("2.16.840.1.113883.3.4424.13.10.1.2"),
                new II("2.16.840.1.113883.3.4424.13.10.1.3", "1.1.1"));

            cda.Id = new II("2.16.840.1.113883.3.4424.7.2.1", "2345678")
            {
                Displayable = true
            };
            var pi = new PertinentInformation()
            {
                TemplateId = LIST <II> .CreateList(new II("1.13.2.3"))
            };

            pi.CoveragePlan = new CoveragePlan(new CD <String>("PUBLICPOL", "2.16.840.1.113883.11.19350"));
            pi.CoveragePlan.Code.Qualifier = LIST <CR <String> > .CreateList(
                new CR <String>(
                    new CV <String>("RLEKUD", "1.2.3.4", null, null, "Refundacja ...", null),
                    new CD <String>("IB", "1.2.3.4")
                    )
                );

            //cda.DataEnterer = new MyDataEnterer();
            //cda.PertinentInformation.Add(pi);
            cda.RecordTarget.Add(new RecordTarget {
                PatientRole = new PatientRole()
            });
            cda.RecordTarget[0].PatientRole.Addr = SET <AD> .CreateSET(AD.CreateAD(new ADXPPL("Kiszka", AddressPartType.PostalCode)
            {
                PostCity = "PT"
            }));

            XmlIts1Formatter xftr = new XmlIts1Formatter();

            //xftr.AddFormatterAssembly(Assembly.GetExecutingAssembly());
            xftr.GraphAides.Add(new ClinicalDocumentDatatypeFormatter());
            xftr.ValidateConformance = false;
            xftr.RegisterXSITypeName("POCD_MT000040UV.ClinicalDocument", typeof(ClinicalDocument));
            xftr.Settings |= SettingsType.AlwaysCheckForOverrides;


            using (XmlStateWriter xw = new XmlStateWriter(XmlWriter.Create(Console.Out, new XmlWriterSettings()
            {
                Indent = true
            })))
            {
                xw.WriteStartElement("", "ClinicalDocument", "urn:hl7-org:v3");
                xw.WriteAttributeString("xmlns", "extPL", null, "http://www.csioz.gov.pl/xsd/extPL/r1");
                xw.WriteAttributeString("xmlns", "xsi", null, XmlIts1Formatter.NS_XSI);
                //xw.WriteAttributeString("xsi", "type", XmlIts1Formatter.NS_XSI, "extPL:ClinicalDocument");

                xftr.Graph(xw, cda);
                xw.WriteEndElement();
            }



            PatientData pat = new PatientData()
            {
                Address     = "123 Main Street West",
                City        = "Hamilton",
                DateOfBirth = new DateTime(1995, 04, 03),
                FamilyName  = "Smith",
                Gender      = "F",
                GivenName   = "Sarah",
                Id          = "102-30343",
                OtherIds    = new List <KeyValuePair <string, string> >()
                {
                    new KeyValuePair <string, string>("2.16.2.3.2.3.2.4", "123-231-435")
                },
                State = "ON"
            };

            PhysicianData aut = new PhysicianData()
            {
                AddressLine   = " 35 King Street West ",
                City          = " Hamilton ",
                OrgId         = " 123 - 1221 ",
                OrgName       = new[] { " Good Health Clinics " },
                PhysicianId   = " 1023433 - ON ",
                PhysicianName = new string[] { " Dr.", " Francis ", " F ", " Family " },
                Postal        = "L0R2A0"
            };

            // var o = Parse(@"C:\temp\schematron\rec.xml");
            // Create the CDA
            //ClinicalDocument doc = CreateAPSDocument(pat, null, aut, DateTime.Now);
            //PrintStructure(doc);

            Console.ReadKey();
        }