buildPatientObject() public méthode

public buildPatientObject ( string id, string ssn, string firstname, string lastName, string middleName, string dob, string age, string gender, DemographicSet demogs ) : ActorType
id string
ssn string
firstname string
lastName string
middleName string
dob string
age string
gender string
demogs DemographicSet
Résultat ActorType
        public void testBuildPatientObject()
        {
            DemographicSet patientDemogs = new DemographicSet();
            Address addr = new Address() { City = "Hooville", State = "MI", County = "Eggs and Ham", Street1 = "123 Elm St.", Street2 = "Apt 4", Zipcode = "90210" };
            PhoneNum phone = new PhoneNum() { Description = "Cell phone", AreaCode = "555", Exchange = "867", Number = "5309" };
            EmailAddress email = new EmailAddress() { Address = "*****@*****.**" };
            IList<Address> addresses = new List<Address>() { addr };
            IList<PhoneNum> telephones = new List<PhoneNum>() { phone };
            IList<EmailAddress> emails = new List<EmailAddress>() { email };
            patientDemogs.EmailAddresses = emails.ToList<EmailAddress>();
            patientDemogs.PhoneNumbers = telephones.ToList<PhoneNum>();
            patientDemogs.StreetAddresses = addresses.ToList<Address>();

            CCRHelper helper = new CCRHelper();
            ActorType patient = helper.buildPatientObject("1234567890", "987654321", "USER", "ONE", "O", "0000/12/25", "2011", "M", patientDemogs);

            Assert.IsNotNull(patient);
            Assert.IsTrue(patient.Item is ActorTypePerson);
            Assert.AreEqual(patient.Address.Count, 1);
            Assert.AreEqual(patient.EMail.Count, 1);
            Assert.AreEqual(patient.Telephone.Count, 1);
            Assert.AreEqual(patient.IDs.Count, 2);

            Assert.IsTrue(String.Equals(patient.IDs[0].ID, "1234567890"));
            Assert.IsTrue(String.Equals(patient.IDs[0].Type.Text, "ID"));
            Assert.IsTrue(String.Equals(patient.IDs[1].ID, "987654321"));
            Assert.IsTrue(String.Equals(patient.IDs[1].Type.Text, "SSN"));
            Assert.IsTrue(String.Equals(patient.Address[0].City, "Hooville"));
            Assert.IsTrue(String.Equals(patient.Address[0].County, "Eggs and Ham"));
            Assert.IsTrue(String.Equals(patient.Address[0].Line1, "123 Elm St."));
            Assert.IsTrue(String.Equals(patient.Address[0].Line2, "Apt 4"));
            Assert.IsTrue(String.Equals(patient.Address[0].PostalCode, "90210"));
            Assert.IsTrue(String.Equals(patient.Address[0].State, "MI"));
            Assert.IsTrue(String.Equals(patient.EMail[0].Value, "*****@*****.**"));
            Assert.IsTrue(String.Equals(patient.Telephone[0].Value, "5558675309"));

            ActorTypePerson person = (ActorTypePerson)patient.Item;
            Assert.IsTrue(String.Equals(person.DateOfBirth.ExactDateTime, "0000/12/25"));
            Assert.IsTrue(String.Equals(person.DateOfBirth.Age.Value, "2011"));
            Assert.IsTrue(String.Equals(person.Gender.Text, "M"));
            Assert.IsTrue(String.Equals(person.Name.CurrentName.Family.First(), "ONE"));
            Assert.IsTrue(String.Equals(person.Name.CurrentName.Given.First(), "USER"));
            Assert.IsTrue(String.Equals(person.Name.CurrentName.Middle.First(), "O"));
        }
        public void testBuildPatientObject()
        {
            DemographicSet patientDemogs = new DemographicSet();
            Address        addr          = new Address()
            {
                City = "Hooville", State = "MI", County = "Eggs and Ham", Street1 = "123 Elm St.", Street2 = "Apt 4", Zipcode = "90210"
            };
            PhoneNum phone = new PhoneNum()
            {
                Description = "Cell phone", AreaCode = "555", Exchange = "867", Number = "5309"
            };
            EmailAddress email = new EmailAddress()
            {
                Address = "*****@*****.**"
            };
            IList <Address> addresses = new List <Address>()
            {
                addr
            };
            IList <PhoneNum> telephones = new List <PhoneNum>()
            {
                phone
            };
            IList <EmailAddress> emails = new List <EmailAddress>()
            {
                email
            };

            patientDemogs.EmailAddresses  = emails.ToList <EmailAddress>();
            patientDemogs.PhoneNumbers    = telephones.ToList <PhoneNum>();
            patientDemogs.StreetAddresses = addresses.ToList <Address>();

            CCRHelper helper  = new CCRHelper();
            ActorType patient = helper.buildPatientObject("1234567890", "987654321", "USER", "ONE", "O", "0000/12/25", "2011", "M", patientDemogs);

            Assert.IsNotNull(patient);
            Assert.IsTrue(patient.Item is ActorTypePerson);
            Assert.AreEqual(patient.Address.Count, 1);
            Assert.AreEqual(patient.EMail.Count, 1);
            Assert.AreEqual(patient.Telephone.Count, 1);
            Assert.AreEqual(patient.IDs.Count, 2);

            Assert.IsTrue(String.Equals(patient.IDs[0].ID, "1234567890"));
            Assert.IsTrue(String.Equals(patient.IDs[0].Type.Text, "ID"));
            Assert.IsTrue(String.Equals(patient.IDs[1].ID, "987654321"));
            Assert.IsTrue(String.Equals(patient.IDs[1].Type.Text, "SSN"));
            Assert.IsTrue(String.Equals(patient.Address[0].City, "Hooville"));
            Assert.IsTrue(String.Equals(patient.Address[0].County, "Eggs and Ham"));
            Assert.IsTrue(String.Equals(patient.Address[0].Line1, "123 Elm St."));
            Assert.IsTrue(String.Equals(patient.Address[0].Line2, "Apt 4"));
            Assert.IsTrue(String.Equals(patient.Address[0].PostalCode, "90210"));
            Assert.IsTrue(String.Equals(patient.Address[0].State, "MI"));
            Assert.IsTrue(String.Equals(patient.EMail[0].Value, "*****@*****.**"));
            Assert.IsTrue(String.Equals(patient.Telephone[0].Value, "5558675309"));

            ActorTypePerson person = (ActorTypePerson)patient.Item;

            Assert.IsTrue(String.Equals(person.DateOfBirth.ExactDateTime, "0000/12/25"));
            Assert.IsTrue(String.Equals(person.DateOfBirth.Age.Value, "2011"));
            Assert.IsTrue(String.Equals(person.Gender.Text, "M"));
            Assert.IsTrue(String.Equals(person.Name.CurrentName.Family.First(), "ONE"));
            Assert.IsTrue(String.Equals(person.Name.CurrentName.Given.First(), "USER"));
            Assert.IsTrue(String.Equals(person.Name.CurrentName.Middle.First(), "O"));
        }