예제 #1
0
 public void Cleanup()
 {
     this.configuration  = null;
     this.entityAddress  = null;
     this.entityName     = null;
     this.genericMessage = null;
     this.patient        = null;
 }
예제 #2
0
        public void Initialize()
        {
            this.configuration = new Configuration.TargetConfiguration("Test", "llp://localhost:2100", "PAT_IDENTITY_SRC", "UnitTestDevice");

            this.configuration.NotificationDomainConfigurations.Add(new Configuration.NotificationDomainConfiguration("TestNotificationDomain"));

            this.entityAddress = new EntityAddress
            {
                AddressUse = new Concept
                {
                    Key = AddressUseKeys.HomeAddress
                }
            };

            this.entityAddress.Component.Add(new EntityAddressComponent(AddressComponentKeys.City, "Hamilton"));
            this.entityAddress.Component.Add(new EntityAddressComponent(AddressComponentKeys.Country, "Canada"));
            this.entityAddress.Component.Add(new EntityAddressComponent(AddressComponentKeys.PostalCode, "L8N3T2"));
            this.entityAddress.Component.Add(new EntityAddressComponent(AddressComponentKeys.State, "Ontario"));
            this.entityAddress.Component.Add(new EntityAddressComponent(AddressComponentKeys.StreetAddressLine, "123 Main street west"));

            this.entityName = new EntityName(NameUseKeys.OfficialRecord, "Khanna", "Nityan David");

            this.genericMessage = new GenericMessage.V25(new DefaultModelClassFactory());

            this.patient = new Patient
            {
                Addresses = new List <EntityAddress>
                {
                    this.entityAddress
                },
                DateOfBirth          = new DateTime(1970, 01, 01),
                DateOfBirthPrecision = DatePrecision.Day,
                GenderConcept        = new Concept
                {
                    Mnemonic = "male"
                },
                Names = new List <EntityName>()
                {
                    this.entityName
                },
                Relationships = new List <EntityRelationship>
                {
                    new EntityRelationship(EntityRelationshipTypeKeys.Mother, new Person
                    {
                        Names = new List <EntityName>
                        {
                            new EntityName(NameUseKeys.OfficialRecord, "Smith", "Mary L A")
                        }
                    })
                }
            };
        }
예제 #3
0
        public void TestUpdatePID()
        {
            var actual = new ADT_A01().PID;

            Configuration.TargetConfiguration configuration = new Configuration.TargetConfiguration("Test", "llp://localhost:2100", "PAT_IDENTITY_SRC", "UnitTestDevice");

            configuration.NotificationDomainConfigurations.Add(new Configuration.NotificationDomainConfiguration("TestNotificationDomain"));

            NotifierBase.UpdatePID(this.patient, actual, configuration);

            Assert.AreEqual("M", actual.Sex.Value);
            Assert.AreEqual("19700101000000.000-0500", actual.DateTimeOfBirth.TimeOfAnEvent.Value);

            var mothersName = actual.GetMotherSMaidenName(0);

            Assert.AreEqual("Smith", mothersName.FamilyLastName.FamilyName.Value);
            Assert.AreEqual("Mary L A", mothersName.GivenName.Value);

            var name = actual.GetPatientName(0);

            Assert.AreEqual("Khanna", name.FamilyLastName.FamilyName.Value);
            Assert.AreEqual("Nityan David", name.GivenName.Value);
        }