Beispiel #1
0
        public override ExtendedPersonName GetPatientName()
        {
            // Tennessee Health care only sends the first name, middle initial, and last name, in that order.
            // Since it is not the standard v2.3 format...
            ExtendedPersonName xpn = new ExtendedPersonName();

            string fieldValue = GetField(5);

            xpn.GivenName = GetComponent(fieldValue, 0);
            xpn.MiddleNameOrInitial = GetComponent(fieldValue, 1);
            xpn.FamilyName = GetComponent(fieldValue, 2);

            return xpn;
        }
Beispiel #2
0
        public void TennesseeHealthSystemsAdtA01MessagePatientIsDarthAVader()
        {
            MessageFactory messageFactory = new MessageFactory();
            ExtendedPersonName expectedExtendedPersonName = new ExtendedPersonName()
            {
                GivenName = "DARTH",
                MiddleNameOrInitial = "A",
                FamilyName = "VADER"
            };

            Message newMessage = messageFactory.MakeMessage(TestMessages.TennesseeHealthSystems_ADT_A01);
            PID pidSegment = (PID)newMessage.Segments.Find(s => s.SegmentType == SegmentTypes.PID);
            ExtendedPersonName actualExtendedPersonName = pidSegment.GetPatientName();

            Assert.AreEqual(expectedExtendedPersonName, actualExtendedPersonName);
        }
Beispiel #3
0
        public void TennesseeHealthCareAdtA01MessagePatientIsThomasCChapman()
        {
            MessageFactory messageFactory = new MessageFactory();
            ExtendedPersonName expectedExtendedPersonName = new ExtendedPersonName()
            {
                GivenName = "THOMAS",
                MiddleNameOrInitial = "C",
                FamilyName = "CHAPMAN"
            };

            Message newMessage = messageFactory.MakeMessage(TestMessages.TennesseeHealthCare_ADT_A01);
            PID pidSegment = (PID)newMessage.Segments.Find(s => s.SegmentType == SegmentTypes.PID);
            ExtendedPersonName actualExtendedPersonName = pidSegment.GetPatientName();

            Assert.AreEqual(expectedExtendedPersonName, actualExtendedPersonName);
        }
Beispiel #4
0
        public void GenericV23AdtA01MessagePatientIsDonaldDDuck()
        {
            MessageFactory messageFactory = new MessageFactory();
            ExtendedPersonName expectedExtendedPersonName = new ExtendedPersonName()
            {
                GivenName = "DONALD",
                MiddleNameOrInitial = "D",
                FamilyName = "DUCK"
            };

            Message newMessage = messageFactory.MakeMessage(TestMessages.GenericV23_ADT_A01);
            PID pidSegment = (PID)newMessage.Segments.Find(s => s.SegmentType == SegmentTypes.PID);
            ExtendedPersonName actualExtendedPersonName = pidSegment.GetPatientName();

            Assert.AreEqual(expectedExtendedPersonName, actualExtendedPersonName);
        }
Beispiel #5
0
        public void USAHealthCareAdtA01MessagePatientIsBobaBountyhunterFett()
        {
            MessageFactory messageFactory = new MessageFactory();
            ExtendedPersonName expectedExtendedPersonName = new ExtendedPersonName()
            {
                GivenName = "BOBA",
                MiddleNameOrInitial = "BOUNTYHUNTER",
                FamilyName = "FETT"
            };

            Message newMessage = messageFactory.MakeMessage(TestMessages.USAHealthCare_ADT_A01);
            PID pidSegment = (PID)newMessage.Segments.Find(s => s.SegmentType == SegmentTypes.PID);
            ExtendedPersonName actualExtendedPersonName = pidSegment.GetPatientName();

            Assert.AreEqual(expectedExtendedPersonName, actualExtendedPersonName);
        }
Beispiel #6
0
        internal ExtendedPersonName GetExtendedPersonName(int fieldIndex)
        {
            ExtendedPersonName xpn = new ExtendedPersonName();

            string fieldValue = GetField(fieldIndex);

            xpn.FamilyName = GetComponent(fieldValue, 0);
            xpn.GivenName = GetComponent(fieldValue, 1);
            xpn.MiddleNameOrInitial = GetComponent(fieldValue, 2);
            xpn.Suffix = GetComponent(fieldValue, 3);
            xpn.Prefix = GetComponent(fieldValue, 4);
            xpn.Degree = GetComponent(fieldValue, 5);
            xpn.NameTypeCode = GetComponent(fieldValue, 6);

            return xpn;
        }