コード例 #1
0
ファイル: PID.cs プロジェクト: chappytc/HL7Project
        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;
        }
コード例 #2
0
ファイル: MessageTests.cs プロジェクト: chappytc/HL7Project
        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);
        }
コード例 #3
0
ファイル: MessageTests.cs プロジェクト: chappytc/HL7Project
        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);
        }
コード例 #4
0
ファイル: MessageTests.cs プロジェクト: chappytc/HL7Project
        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);
        }
コード例 #5
0
ファイル: MessageTests.cs プロジェクト: chappytc/HL7Project
        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);
        }
コード例 #6
0
ファイル: SegmentV23.cs プロジェクト: chappytc/HL7Project
        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;
        }