public void TestReligionExtensionConstructValidRoleNoReligion()
        {
            var patient             = new Patient();
            var constructedReligion = this.m_extension.Construct(patient).ToArray();

            Assert.IsEmpty(constructedReligion);
        }
        public void TestNationalityExtensionConstructValidRoleNoNationality()
        {
            var patient = new Patient();
            var constructedNationality = this.m_extension.Construct(patient).ToArray();

            Assert.IsEmpty(constructedNationality);
        }
        public void TestReligionExtensionParseValidRoleInvalidExtension()
        {
            var extensionUnderTest = new Extension("http://hl7.org/fhir/StructureDefinition/patient-religion", new CodeableConcept("http://terminology.hl7.org/CodeSystem/v2-2.4", "ASDF"));
            var patient            = new Patient();

            Assert.Throws <FhirException>(() => this.m_extension.Parse(extensionUnderTest, patient));
        }
        public void TestImportanceExtensionConstructValidRoleNoVipStatus()
        {
            var patient = new Patient();
            var constructedVipStatus = this.m_extension.Construct(patient).ToArray();

            Assert.IsEmpty(constructedVipStatus);
        }
        public void TestImportanceExtensionParseInvalidExtension()
        {
            var extensionforTest = new Extension("http://hl7.org/fhir/StructureDefinition/patient-religion", new FhirString("Test"));
            var patient          = new Patient();

            this.m_extension.Parse(extensionforTest, patient);
            Assert.IsNull(patient.VipStatus);
        }
        public void TestNationalityExtensionParseInvalidExtensionValue()
        {
            var extensionforTest = new Extension("http://hl7.org/fhir/StructureDefinition/patient-nationality", new FhirString("Test"));
            var patient          = new Patient();

            this.m_extension.Parse(extensionforTest, patient);

            Assert.IsNull(patient.Nationality);
        }
        public void TestNationalityExtensionParseValidRoleInvalidExtension()
        {
            //due to lack of nationality data, using family member data here for test
            var extensionforTest = new Extension("http://hl7.org/fhir/StructureDefinition/patient-nationality",
                                                 new CodeableConcept("http://santedb.org/conceptset/v3-FamilyMember", "DFSFSDF"));
            var patient = new Patient();

            Assert.Throws <FhirException>(() => this.m_extension.Parse(extensionforTest, patient));
        }
        public void TestReligionExtensionParseValidRoleExtension()
        {
            var extensionforTest = new Extension("http://hl7.org/fhir/StructureDefinition/patient-religion",
                                                 new CodeableConcept("http://terminology.hl7.org/CodeSystem/v2-2.4", "ATH"));
            var patient = new Patient();

            this.m_extension.Parse(extensionforTest, patient);

            Assert.IsNotNull(patient.ReligiousAffiliation);
            Assert.AreEqual("RELIGION-Atheist", patient.ReligiousAffiliation.Mnemonic);
        }
        public void TestImportanceExtensionParseValidRoleExtension()
        {
            var extensionforTest = new Extension("http://hl7.org/fhir/StructureDefinition/patient-importance",
                                                 new CodeableConcept("http://terminology.hl7.org/CodeSystem/v3-PatientImportance", "BM"));
            var patient = new Patient();

            this.m_extension.Parse(extensionforTest, patient);

            Assert.IsNotNull(patient.VipStatus);
            Assert.AreEqual("VIPStatus-BoardMember", patient.VipStatus.Mnemonic);
        }
        /// <summary>
        /// Tests the parse functionality in <see cref="NationalityExtension" /> class.
        /// With valid role and extension.
        /// </summary>
        //[Test]
        public void TestNationalityExtensionParseValidRoleExtension()
        {
            //due to lack of nationality data, using family member data here for test
            var extensionforTest = new Extension("http://hl7.org/fhir/StructureDefinition/patient-nationality",
                                                 new CodeableConcept("http://santedb.org/conceptset/v3-FamilyMember", "BRO"));
            var patient = new Patient();

            this.m_extension.Parse(extensionforTest, patient);

            Assert.IsNotNull(patient.Nationality);
            Assert.AreEqual("Brother", patient.Nationality.Mnemonic);
        }
        public void TestNationalityExtensionConstructValidRoleNationality()
        {
            var patient = new Patient
            {
                Nationality = new Concept()
                {
                    Mnemonic = "Harkonen", Key = Guid.NewGuid()
                }
            };

            var constructedNationality = this.m_extension.Construct(patient).ToArray();

            Assert.AreEqual(1, constructedNationality.Length);
            Assert.IsInstanceOf <CodeableConcept>(constructedNationality.First().Value);
            var codeableConcept = (CodeableConcept)constructedNationality.First().Value;

            Assert.AreEqual("Harkonen", codeableConcept.Coding.First().Code);
        }
        public void TestReligionExtensionConstructValidRoleReligion()
        {
            var patient = new Patient
            {
                ReligiousAffiliation = new Concept
                {
                    Mnemonic = "Talos", Key = Guid.NewGuid()
                }
            };

            var constructedReligion = this.m_extension.Construct(patient).ToArray();

            Assert.AreEqual(1, constructedReligion.Length);
            Assert.IsInstanceOf <CodeableConcept>(constructedReligion.First().Value);
            var codeableConcept = (CodeableConcept)constructedReligion.First().Value;

            Assert.AreEqual("Talos", codeableConcept.Coding.First().Code);
        }
        public void TestImportanceExtensionConstructValidRoleVipStatus()
        {
            var patient = new Patient
            {
                VipStatus = new Concept
                {
                    Mnemonic = "VIPStatus-ForeignDignitary",
                    Key      = Guid.NewGuid(),
                }
            };

            var constructedVipStatus = this.m_extension.Construct(patient).ToArray();

            Assert.AreEqual(1, constructedVipStatus.Length);
            Assert.IsInstanceOf <CodeableConcept>(constructedVipStatus.First().Value);
            var codeableConcept = (CodeableConcept)constructedVipStatus.First().Value;

            Assert.AreEqual("VIPStatus-ForeignDignitary", codeableConcept.Coding.First().Code);
        }