Пример #1
0
        private void btnRender_Click(object sender, EventArgs e)
        {
            II ii = new II();
            // Determine if null flavor should be attached to the object
            if (cbxNullFlavor.SelectedItem != null)
                switch (cbxNullFlavor.SelectedItem.ToString())
                {
                    case "NAV":
                        ii.NullFlavor = NullFlavor.Unavailable;
                        break;
                    case "OTH":
                        ii.NullFlavor = NullFlavor.Other;
                        break;
                    case "NI":
                        ii.NullFlavor = NullFlavor.NoInformation;
                        break;
                    default:
                        ii.NullFlavor = null;
                        break;
                }

            // Determine if a flavor should be attached
            if (cbxFlavor.SelectedItem != null &&
                cbxFlavor.SelectedItem.ToString() != "None")
                ii.Flavor = cbxFlavor.SelectedItem.ToString();

            // Assign the root and extension
            ii.Root = txtRoot.Text;
            ii.Extension = txtExtension.Text;


            // Represent in txtXml
            txtXml.Text = FormatterHelper.FormatDataType(ii, "II");
        }
Пример #2
0
        /// <summary>
        /// Creates a patient structure
        /// </summary>
        /// <param name="id">The unique identifier</param>
        /// <param name="name">The name of the patient</param>
        /// <param name="addr">The primary address</param>
        /// <param name="telecom">A primary telecom</param>
        /// <returns>A constructed patient structure</returns>
        public static Patient CreatePatient(
                II id,
                EN name,
                AD addr,
                TEL telecom
            )
        {
            // Instantiate the object
            var retVal = new Patient();

            // Populate address
            retVal.Addr = BAG<AD>.CreateBAG(addr);

            // Confidentiality Code
            retVal.ConfidentialityCode = "N";

            // Effective Time of the types
            // High is populated as "Not Applicable"
            retVal.EffectiveTime = new IVL<TS>(
                (TS)DateTime.Now,
                new TS() { NullFlavor = NullFlavor.NotApplicable }
                );

            // Telecom address
            retVal.Telecom = BAG<TEL>.CreateBAG(telecom);

            // Populate the ID
            retVal.Id = SET<II>.CreateSET(id);

            // Status Code
            retVal.StatusCode = RoleStatus.Active;

            // Return result
            return retVal;
        }
Пример #3
0
        internal void AddId(II id)
        {
            if (this.id == null)
            {
                this.id = new List<II>();
            }

            this.id.Add(id);
        }
Пример #4
0
        internal new void SetId(string root, string extension)
        {
            base.id = new List<II>();

            II temp = new II();
            temp.Extension = extension;
            temp.Root = root;

            this.id.Add(temp);
        }
Пример #5
0
        internal void AddId(string root, string extension, string assignedAuthorityName)
        {
            if (this.id == null)
            {
                this.id = new List<II>();
            }

            II temp = new II();
            temp.Extension = extension;
            temp.Root = root;
            temp.AssigningAuthorityName = assignedAuthorityName;
            this.id.Add(temp);
        }
Пример #6
0
 public AdministrativeContactsS()
 {
     this.id   = new IIImpl();
     this.code = new CVImpl();
 }
Пример #7
0
        private static void callServiceWithObject()
        {
            string clientSystemPatientId = "1234567890";
            CDSInput cdsInput = new CDSInput();

            II templateId = new II();
            templateId.root = "2.16.840.1.113883.3.795.11.1.1";
            cdsInput.templateId = new II[] { templateId };

            CDSContext cdsContext = new CDSContext();
            CD preferredLanguage = new CD();
            preferredLanguage.code = "en";
            preferredLanguage.codeSystem = "1.2.3";
            preferredLanguage.displayName = "English";
            cdsContext.cdsInformationRecipientPreferredLanguage = preferredLanguage;
            cdsInput.cdsContext = cdsContext;

            VMR vmr = new VMR();
            cdsInput.vmrInput = vmr;

            II vmrTemplateId = new II();
            vmrTemplateId.root = "2.16.840.1.113883.3.795.11.1.1";
            vmr.templateId = new II[] { vmrTemplateId };

            EvaluatedPerson patient = new EvaluatedPerson();

            II personTemplateId = new II();
            personTemplateId.root = "2.16.840.1.113883.3.795.11.2.1.1";
            patient.templateId = new II[] { personTemplateId };

            II id = new II();
            id.root = "2.16.840.1.113883.3.795.12.100.11";
            id.extension = clientSystemPatientId;
            patient.id = id;

            EvaluatedPersonDemographics demographics = new EvaluatedPersonDemographics();

            TS birthTime = new TS();
            birthTime.value = "20110401";
            demographics.birthTime = birthTime;

            CD gender = new CD();
            gender.code = "F";
            gender.codeSystem = "2.16.840.1.113883.5.1";
            demographics.gender = gender;

            patient.demographics = demographics;
            vmr.patient = patient;

            EvaluatedPersonClinicalStatements statements = new EvaluatedPersonClinicalStatements();
            patient.clinicalStatements = statements;

            SubstanceAdministrationEvent statement1 = getSubstanceAdministrationEvent("185", "20110430");
            SubstanceAdministrationEvent statement2 = getSubstanceAdministrationEvent("184", "20110523");
            SubstanceAdministrationEvent statement3 = getSubstanceAdministrationEvent("183", "20110721");
            SubstanceAdministrationEvent statement4 = getSubstanceAdministrationEvent("182", "20110911");
            SubstanceAdministrationEvent statement5 = getSubstanceAdministrationEvent("181", "20110912");

            statements.substanceAdministrationEvents = new SubstanceAdministrationEvent[] { statement1, statement2, statement3, statement4, statement5 };
            CDSOutput response = getResponse(cdsInput);
            processResponse(response);
        }
Пример #8
0
 public AdjudicatorBillingTaxAccount()
 {
     this.id   = new IIImpl();
     this.code = new CVImpl();
 }
Пример #9
0
 public ToBeRespondedToBy()
 {
     this.telecom  = new TELImpl();
     this.deviceId = new IIImpl();
 }
Пример #10
0
        internal void AddId(string root, string extension)
        {
            if (this.id == null)
            {
                this.id = new List<II>();
            }

            II temp = new II();
            temp.Extension = extension;
            temp.Root = root;

            this.id.Add(temp);
        }
Пример #11
0
 public void R2IIScopeParseTest()
 {
     string ext = Guid.NewGuid().ToString();
     II inti = new II("1.2.3.4.5", ext);
     inti.Scope = IdentifierScope.ObjectIdentifier;
     var actualXml = R2SerializationHelper.SerializeAsString(inti);
     var int2 = R2SerializationHelper.ParseString<II>(actualXml);
     Assert.AreEqual(inti, int2);
 }
Пример #12
0
 public DispensePickup()
 {
     this.id = new IIImpl();
 }
Пример #13
0
 public ActRequest()
 {
     this.id = new IIImpl();
 }
 public RecordTarget()
 {
     this.typeId     = new IIImpl();
     this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl));
 }
Пример #15
0
 public Entry()
 {
     this.typeCode   = new CSImpl();
     this.typeId     = new IIImpl();
     this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl));
 }
Пример #16
0
 public Authorization()
 {
     this.typeId     = new IIImpl();
     this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl));
 }
Пример #17
0
 public HospitalAdmissionMedicationsSectionentriesOptionalComponent3()
 {
     this.typeId     = new IIImpl();
     this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl));
 }
Пример #18
0
 public Organization()
 {
     this.id   = new IIImpl();
     this.name = new STImpl();
     this.addr = new SETImpl <AD, PostalAddress>(typeof(ADImpl));
 }
Пример #19
0
 public void IIExampleTest08()
 {
     II token = new II(Guid.NewGuid());
     token.Extension = "1234";
     token.Displayable = null;
     token.Scope = null;
     Assert.IsFalse(II.IsValidTokenFlavor(token));
 }
Пример #20
0
 public ReasonForVisitSectionComponent3()
 {
     this.typeId     = new IIImpl();
     this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl));
 }
Пример #21
0
 public void IIExampleTest10()
 {
     II bus = new II();
     bus.Root = "1.2.3.4";
     bus.Extension = "1234";
     bus.Scope = 0;
     bus.Displayable = true;
     bus.NullFlavor = null;
     Assert.IsFalse(II.IsValidBusFlavor(bus));
     // testing if token flavor is valid given displayable
 }
Пример #22
0
 public Custodian()
 {
     this.typeId     = new IIImpl();
     this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl));
 }
Пример #23
0
 public void R2IIBasicParseTest()
 {
     string ext = Guid.NewGuid().ToString();
     II inti = new II("1.2.3.4.5", ext);
     var actualXml = R2SerializationHelper.SerializeAsString(inti);
     var int2 = R2SerializationHelper.ParseString<II>(actualXml);
     Assert.AreEqual(inti, int2);
 }
Пример #24
0
 public Organization()
 {
     this.id   = new IIImpl();
     this.name = new STImpl();
     this.addr = new ADImpl();
 }
Пример #25
0
 public void R2IIReliabilitySerializationTest()
 {
     string ext = Guid.NewGuid().ToString();
     II inti = new II("1.2.3.4.5", ext);
     inti.Reliability = IdentifierReliability.IssuedBySystem;
     string expectedXml = String.Format(@"<test xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" root=""1.2.3.4.5"" extension=""{0}"" reliability=""ISS"" xmlns=""urn:hl7-org:v3""/>", ext);
     var actualXml = R2SerializationHelper.SerializeAsString(inti);
     R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
 }
Пример #26
0
 public MedicationActivityEntry()
 {
     this.typeCode   = new CSImpl();
     this.typeId     = new IIImpl();
     this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl));
 }
Пример #27
0
 internal void SetId(II id)
 {
     this.id = new List<II>();
     this.id.Add(id);
 }
Пример #28
0
 public void IIExampleTest02()
 {
     II token = new II(Guid.NewGuid());
     II token2 = Guid.NewGuid();
     token.Extension = null;
     token2.Extension = null;
     token.NullFlavor = null;
     token2.NullFlavor = null;
     Assert.IsTrue(token.Validate());
     Assert.IsTrue(token2.Validate());
 }
Пример #29
0
 public Request_3()
 {
     this.classCode = new CSImpl();
     this.id        = new IIImpl();
 }
Пример #30
0
 public void IIExampleTest04()
 {
     II token = new II(Guid.NewGuid());
     token.NullFlavor = NullFlavor.NoInformation;
     Assert.IsFalse(token.Validate());
 }
Пример #31
0
        private static SubstanceAdministrationEvent getSubstanceAdministrationEvent(string clientImmunizationId, string administrationTime)
        {
            II statementTemplateId = new II();
            statementTemplateId.root = "2.16.840.1.113883.3.795.11.9.1.1";

            CD substanceAdminGeneralPurpose = new CD();
            substanceAdminGeneralPurpose.code = "384810002";
            substanceAdminGeneralPurpose.codeSystem = "2.16.840.1.113883.6.5";

            CD substanceCode = new CD();
            substanceCode.code = "08";
            substanceCode.codeSystem = "2.16.840.1.113883.12.292";

            II id = new II();
            id.root = "2.16.840.1.113883.3.795.12.100.10";
            id.extension = clientImmunizationId;

            SubstanceAdministrationEvent statement = new SubstanceAdministrationEvent();
            statement.templateId = new II[] { statementTemplateId };
            statement.id = id;
            statement.substanceAdministrationGeneralPurpose = substanceAdminGeneralPurpose;

            AdministrableSubstance substance = new AdministrableSubstance();
            II substanceId = new II();
            substanceId.root = System.Guid.NewGuid().ToString("D");
            substance.id = substanceId;

            substance.substanceCode = substanceCode;
            statement.substance = substance;

            IVL_TS administrationTimeInterval = new IVL_TS();
            administrationTimeInterval.high = administrationTime;
            administrationTimeInterval.low = administrationTime;
            statement.administrationTimeInterval = administrationTimeInterval;

            return statement;
        }
Пример #32
0
 public void IIExampleTest06()
 {
     II rootExtension = new II();
     rootExtension.Root = "2.16.840.1.11x3883.1.18";
     rootExtension.Extension = "12345";
     rootExtension.NullFlavor = null;
     Assert.IsFalse(II.IsValidOidFlavor(rootExtension));
 }
Пример #33
0
 public PayerPerformerPerformer2()
 {
     this.templateId = new IIImpl();
 }
Пример #34
0
 public HealthcareWorker()
 {
     this.id = new SETImpl <II, Identifier>(typeof(IIImpl));
     this.assignedPersonName = new PNImpl();
     this.assignedPersonAsHealthCareProviderId = new IIImpl();
 }
Пример #35
0
 public void IIExampleTest03()
 {
     II rootExtension = new II(new OID("1.2.3.4.5.6"), "1234");
     rootExtension.NullFlavor = NullFlavor.Unknown;
     Assert.IsFalse(rootExtension.Validate());
 }
Пример #36
0
 public DataEnterer()
 {
     this.typeId     = new IIImpl();
     this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.time       = new TSCDAR1Impl();
 }
Пример #37
0
 public void IIExampleTest05()
 {
     II oidII = new II();
     oidII.Root = "2.16.840.1.113883.1.18";
     oidII.Extension = null;         // Extension should have to be populated
     oidII.NullFlavor = null;        // when an OID is specified
     Assert.IsTrue(II.IsValidOidFlavor(oidII));
 }
Пример #38
0
 public AuthenticatorPerson()
 {
     this.typeId     = new IIImpl();
     this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.name       = new LISTImpl <PN, PersonName>(typeof(PNImpl));
 }
Пример #39
0
 public void IIExampleTest07()
 {
     II token = new II(Guid.NewGuid());
     token.NullFlavor = null;
     Assert.IsTrue(II.IsValidTokenFlavor(token));
 }
Пример #40
0
 public PolicyOrAccount()
 {
     this.id   = new IIImpl();
     this.code = new CVImpl();
 }
Пример #41
0
 public void IIExampleTest9()
 {
     II bus = new II();
     bus.Root = "1.2.3.4";
     bus.Extension = "1234";
     bus.Scope = 0;
     bus.Displayable = null;
     bus.NullFlavor = null;
     Assert.IsTrue(II.IsValidBusFlavor(bus));
     // testing if token flavor is valid given root, extension, and scope
 }
Пример #42
0
 public Formularies()
 {
     this.id    = new IIImpl();
     this.title = new STImpl();
 }
Пример #43
0
 public void IIExampleTest01()
 {
     II rootExtension = new II(new OID("1.2.3.4.5"), "1234");
     II rootExtension2 = new II("1.2.3.4.5.6", "1234");
     rootExtension.NullFlavor = null;
     rootExtension2.NullFlavor = null;
     Console.WriteLine("1= {0}, 2={1}", rootExtension.Root, rootExtension2.Root);
     Assert.IsTrue(rootExtension.Validate());
     Assert.IsTrue(rootExtension2.Validate());
 }
Пример #44
0
 public AuthenticationToken()
 {
     this.id   = new IIImpl();
     this.text = new STImpl();
 }
Пример #45
0
 public void R2IIScopeSerializationTest()
 {
     string ext = Guid.NewGuid().ToString();
     II inti = new II("1.2.3.4.5", ext);
     inti.Scope = IdentifierScope.ObjectIdentifier;
     string expectedXml = String.Format(@"<test xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" root=""1.2.3.4.5"" extension=""{0}"" scope=""OBJ"" xmlns=""urn:hl7-org:v3""/>", ext);
     var actualXml = R2SerializationHelper.SerializeAsString(inti);
     R2SerializationHelper.XmlIsEquivalent(expectedXml, actualXml);
 }
Пример #46
0
 public EHRRepository()
 {
     this.id = new IIImpl();
     this.assignedRepositoryName = new STImpl();
     this.representedRepositoryJurisdictionName = new STImpl();
 }
Пример #47
0
 public void R2IIReliabilityParseTest()
 {
     string ext = Guid.NewGuid().ToString();
     II inti = new II("1.2.3.4.5", ext);
     inti.Reliability = IdentifierReliability.IssuedBySystem;
     var actualXml = R2SerializationHelper.SerializeAsString(inti);
     var int2 = R2SerializationHelper.ParseString<II>(actualXml);
     Assert.AreEqual(inti, int2);
 }
Пример #48
0
 public RelatedDocument()
 {
     this.typeCode   = new CSImpl();
     this.typeId     = new IIImpl();
     this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl));
 }
Пример #49
0
 public void R2IIFullParseTest()
 {
     string ext = Guid.NewGuid().ToString();
     II inti = new II("1.2.3.4.5", ext);
     inti.Scope = IdentifierScope.ObjectIdentifier;
     inti.Reliability = IdentifierReliability.VerifiedBySystem;
     inti.IdentifierName = "This is an identifier";
     var actualXml = R2SerializationHelper.SerializeAsString(inti);
     var int2 = R2SerializationHelper.ParseString<II>(actualXml);
     Assert.AreEqual(inti, int2);
 }
Пример #50
0
 public HealthDocumentAttachment_1()
 {
     this.id   = new IIImpl();
     this.code = new CVImpl();
     this.text = new EDImpl <EncapsulatedData>();
 }
Пример #51
0
 public All( II a, II b)
 {
     _a = a;
     _b = b;
 }
Пример #52
0
 public MedicationActivityEntry()
 {
     this.typeCode   = new CS_R2Impl <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Domainvalue.x_ActRelationshipEntry>();
     this.typeId     = new IIImpl();
     this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl));
 }
Пример #53
0
        public void setupCDADocument()
        {
            Config = new cdaConfig();
            moodCode = "EVN";
            classCode = "DOCCLIN";

            typeId = new II("2.16.840.1.113883.1.3", "POCD_HD000040");
        }
Пример #54
0
 public SpecialAuthorizationAdditionalInformationRequest()
 {
     this.id   = new IIImpl();
     this.text = new STImpl();
 }
Пример #55
0
 public FunctionalStatusResultObservationEntry()
 {
     this.typeCode   = new CS_R2Impl <Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Domainvalue.x_ActRelationshipEntry>();
     this.typeId     = new IIImpl();
     this.templateId = new LISTImpl <II, Identifier>(typeof(IIImpl));
 }
Пример #56
0
 public SpecialAuthorizationRequest()
 {
     this.id         = new IIImpl();
     this.code       = new CVImpl();
     this.statusCode = new CSImpl();
 }
Пример #57
0
        internal void AddIdNull(string flavorCode)
        {
            NullFlavor flavorValue;

            switch (flavorCode)
            {
                case "NI":
                    flavorValue = NullFlavor.NoInformation;
                    break;
                case "UNK":
                    flavorValue = NullFlavor.Unknown;
                    break;
                default:
                    flavorValue = NullFlavor.NoInformation;
                    break;
            }
            //this.id = new List<II>();
            II temp = new II();
            temp.NullFlavor = flavorValue;

            this.id.Add(temp);
        }
Пример #58
0
 public Subject()
 {
     this.typeId        = new IIImpl();
     this.templateId    = new LISTImpl <II, Identifier>(typeof(IIImpl));
     this.awarenessCode = new CE_R2Impl <Code>();
 }
Пример #59
0
        /// <summary>
        /// Example 69
        /// Creates a patient structure
        /// </summary>
        /// <param name="id">The unique identifier</param>
        /// <param name="name">The name of the patient</param>
        /// <param name="addr">The primary address</param>
        /// <param name="telecom">A primary telecom</param>
        /// <returns>A constructed patient structure</returns>
        public Patient CreatePatient(
                II id,
                EN name,
                AD addr,
                TEL telecom
            )
        {
            try
            {
                // Instantiate the object
                var retVal = new Patient();

                // Populate address
                retVal.Addr = BAG<AD>.CreateBAG(addr);

                // Confidentiality Code
                retVal.ConfidentialityCode = "N";

                // Effective Time of the types
                // High is populated as "Not Applicable"
                retVal.EffectiveTime = new IVL<TS>(
                    (TS)DateTime.Now,
                    new TS() { NullFlavor = NullFlavor.NotApplicable }
                    );

                // Telecom address
                retVal.Telecom = BAG<TEL>.CreateBAG(telecom);

                // Populate the ID
                retVal.Id = SET<II>.CreateSET(id);

                // Status Code
                retVal.StatusCode = RoleStatus.Active;

                // Set entity choice
                retVal.SetPatientEntityChoiceSubject(
                    new Person()
                    {
                        AdministrativeGenderCode = AdministrativeGender.Male,
                        Name = BAG<EN>.CreateBAG(name),
                        BirthTime = DateTime.Now
                    }
                    );

                // cannot return result for unit test purposes
                return retVal;
            }
            catch
            {
                Console.WriteLine("Unit tests must not return a value, but Patient must be returned..");
                return new Patient();
            }
        }
Пример #60
0
        /// <summary>
        /// Example 68
        /// Creates a patient structure
        /// </summary>
        /// <param name="id">The unique identifier</param>
        /// <param name="name">The name of the patient</param>
        /// <param name="addr">The primary address</param>
        /// <param name="telecom">A primary telecom</param>
        /// <returns>A constructed patient structure</returns>
        public Patient CreatePatient(
                II id,
                EN name,
                AD addr,
                TEL telecom
            )
        {
            // Instantiate the object
            var retVal = new Patient();

            // return a value in a unit test
            // will result in Not Runnable
            return retVal;
        }