Ejemplo n.º 1
0
        public ORM(compositeType parent, string name) : base(parent, name)
        {
            data = new abstractType[19];

            data[0] = new MSH(this, "MSH");
            data[1] = new NTE(this, "NTE");
            //Patient
            data[2] = new PID(this, "PID");
            data[3] = new PD1(this, "PD1");
            //Patient_VISIT
            data[4] = new PV1(this, "PV1");
            data[5] = new PV2(this, "PV2");
            //INsurance
            data[6] = new IN1(this, "IN1");
            data[7] = new IN2(this, "IN2");
            data[8] = new IN3(this, "IN3");

            data[9]  = new GT1(this, "GT1");
            data[10] = new AL1(this, "AL1");
            //Order
            data[11] = new ORC(this, "ORC");
            //Order_Detail
            data[12] = new OBR(this, "OBR");
            data[13] = new NTE(this, "NTE");
            data[14] = new DG1(this, "DG1");
            //Observation
            data[15] = new OBX(this, "OBX");
            data[16] = new NTE(this, "NTE");
            data[17] = new CTI(this, "CTI");
            data[18] = new BLG(this, "BLG");
        }
Ejemplo n.º 2
0
 public void Parse(string str)
 {
     PID.Parse(str);
     AL1.Parse(str);
     ORC.Parse(str);
     PV1.Parse(str);
     MSH.Parse(str);
     NTE.Parse(str);
     OBR.Parse(str);
 }
Ejemplo n.º 3
0
        private void SetPhysician(PV1 pv1, string role, ExternalPractitioner practitioner)
        {
            XCN physician = ParseRole(role, pv1);

            if (physician == null)
            {
                return;
            }
            SetPhysician(physician, GetPhysicianDetails(practitioner));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Notifies a remote system.
        /// </summary>
        /// <param name="workItem">The work item of the notification.</param>
        public void Notify <T>(NotificationQueueWorkItem <T> workItem) where T : IdentifiedData
        {
            IMessage notificationMessage = null;

            var patient = workItem.Event as Patient;

            MSH msh = null;
            PID pid = null;
            EVN evn = null;
            PV1 pv1 = null;

            switch (workItem.ActionType)
            {
            case ActionType.Create:
            case ActionType.DuplicatesResolved:
            case ActionType.Update:
            {
                tracer.TraceEvent(TraceEventType.Information, 0, "Received update notification");

                ADT_A05 message = new ADT_A05();

                msh = message.MSH;
                msh.MessageType.TriggerEvent.Value = "A31";

                pid = message.PID;

                evn = message.EVN;
                evn.EventTypeCode.Value = "A31";

                pv1 = message.PV1;
                notificationMessage = message;

                break;
            }

            default:
                throw new ArgumentOutOfRangeException($"Invalid notification type {workItem.ActionType}");
            }

            NotifierBase.UpdateMSH(msh, patient, this.TargetConfiguration);

            evn.RecordedDateTime.TimeOfAnEvent.Value = (TS)patient.CreationTime.DateTime;

            NotifierBase.UpdatePID(patient, pid, this.TargetConfiguration);

            pv1.PatientClass.Value = "N";

            var queueItem = new MessageQueueWorkItem(notificationMessage, this.TargetConfiguration);

            if (!queueItem.TrySend())
            {
                tracer.TraceEvent(TraceEventType.Warning, 0, "Unable to send message to remote endpoint: {0}", this.TargetConfiguration.ConnectionString);
                Hl7MessageQueue.Current.Enqueue(queueItem);
            }
        }
Ejemplo n.º 5
0
        private void SetPhysician(PV1 pv1, string role, string physicianInfo)
        {
            XCN physician = ParseRole(role, pv1);

            if (physician == null)
            {
                return;
            }

            SetPhysician(physician, physicianInfo.Split(new[] { ',' }));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Notify the operation
        /// </summary>
        public void Notify(NotificationQueueWorkItem workItem)
        {
            // configuration service
            ISystemConfigurationService config = this.Context.GetService(typeof(ISystemConfigurationService)) as ISystemConfigurationService;
            ILocalizationService        locale = this.Context.GetService(typeof(ILocalizationService)) as ILocalizationService;

            // Common message bits we need to update
            IMessage notificationMessage = null;
            MSH      msh = null;
            PID      pid = null;
            EVN      evn = null;
            PV1      pv1 = null;


            // Identify the work item action
            switch (workItem.Action)
            {
            case MARC.HI.EHRS.CR.Notification.PixPdq.Configuration.ActionType.Create:
            case MARC.HI.EHRS.CR.Notification.PixPdq.Configuration.ActionType.DuplicatesResolved:
            case MARC.HI.EHRS.CR.Notification.PixPdq.Configuration.ActionType.Update:
            {
                ADT_A05 message = new ADT_A05();
                msh = message.MSH;
                pid = message.PID;
                evn = message.EVN;
                pv1 = message.PV1;
                notificationMessage = message;
                msh.MessageType.TriggerEvent.Value = "A31";
                break;
            }
            }

            // Populate the MSH header first
            this.UpdateMSH(msh, config);

            // Populate the EVN segment
            evn.EventTypeCode.Value         = workItem.Event.Mode.ToString();
            evn.RecordedDateTime.Time.Value = (TS)workItem.Event.Timestamp;

            // Populate the PID segment
            Person subject = workItem.Event.FindComponent(SVC.Core.ComponentModel.HealthServiceRecordSiteRoleType.SubjectOf) as Person;

            this.UpdatePID(subject, pid, config);
            pv1.PatientClass.Value = "N";

            // Send
            var queueItem = new Hl7MessageQueue.MessageQueueWorkItem(this.Target, notificationMessage);

            if (!queueItem.TrySend())
            {
                Trace.TraceWarning(locale.GetString("NTFW005"));
                Hl7MessageQueue.Current.EnqueueMessageItem(queueItem);
            }
        }
Ejemplo n.º 7
0
        public virtual void SetPV1(PV1 pv1, Visit visit)
        {
            pv1.VisitNumber.IDNumber.Value = visit.VisitNumber.Id;
            pv1.ServicingFacility.Value    = visit.Facility.Code;
            if (visit.PatientClass != null)
            {
                pv1.PatientClass.Value = visit.PatientClass.Code;
            }
            if (visit.AdmissionType != null)
            {
                pv1.AdmissionType.Value = visit.AdmissionType.Code;
            }
            if (visit.PatientType != null)
            {
                pv1.PatientType.Value = visit.PatientType.Code;
            }
            if (visit.CurrentLocation != null)
            {
                pv1.AssignedPatientLocation.PointOfCare.Value          = visit.CurrentLocation.PointOfCare;
                pv1.AssignedPatientLocation.Room.Value                 = visit.CurrentRoom;
                pv1.AssignedPatientLocation.Bed.Value                  = visit.CurrentBed;
                pv1.AssignedPatientLocation.Facility.NamespaceID.Value = visit.CurrentLocation.Facility.Code;
                pv1.AssignedPatientLocation.Building.Value             = visit.CurrentLocation.Building;
                pv1.AssignedPatientLocation.Floor.Value                = visit.CurrentLocation.Floor;
            }

            foreach (var practitioner in visit.Practitioners)
            {
                SetPhysician(pv1, practitioner);
            }

            foreach (var property in visit.ExtendedProperties)
            {
                if (!property.Key.Contains("Physician"))
                {
                    continue;
                }
                var role = property.Key.Substring(0, property.Key.IndexOf("Physician"));
                SetPhysician(pv1, role, property.Value);
            }

            pv1.VIPIndicator.Value = BoolToString(visit.VipIndicator);
            if (visit.AdmitTime.HasValue)
            {
                pv1.AdmitDateTime.Time.Value = ExtractHL7DateTime(visit.AdmitTime);
            }
            if (visit.DischargeTime.HasValue)
            {
                pv1.GetDischargeDateTime(0).Time.Value = ExtractHL7DateTime(visit.DischargeTime);
            }
            pv1.DischargeDisposition.Value = visit.DischargeDisposition;
            pv1.VisitIndicator.Value       = "V";
        }
Ejemplo n.º 8
0
 public static void GetPatientVisit1(ADT_A01 parsedMessage, ref PV1 patientVisit)
 {
     patientVisit.Patient_Ward   = parsedMessage.PV1.AssignedPatientLocation.Floor.Value;
     patientVisit.Patient_Room   = parsedMessage.PV1.AssignedPatientLocation.Room.Value;
     patientVisit.Patient_Bed    = parsedMessage.PV1.AssignedPatientLocation.Bed.Value;
     patientVisit.Admission_Type = parsedMessage.PV1.AdmissionType.Value;
     patientVisit.Attending_Doc  = parsedMessage.PV1.GetAttendingDoctor(0).IDNumber.Value;
     patientVisit.Referring_Doc  = parsedMessage.PV1.GetReferringDoctor(0).IDNumber.Value;
     patientVisit.Consulting_Doc = parsedMessage.PV1.GetConsultingDoctor(0).IDNumber.Value;
     patientVisit.Admit_Date     = parsedMessage.PV1.AdmitDateTime.Time.Value;
     patientVisit.Discharge_Date = parsedMessage.PV1.GetDischargeDateTime(0).Time.Value;
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Get CONTRACTPERIOD Records from PV1
        /// </summary>
        public static IEnumerable GetCONTRACTPERIODRecords(this PV1 message)
        {
            object[] result = message.GetRecords("CONTRACTPERIODRepetitionsUsed", "GetCONTRACTPERIOD");

            if ((result != null) && (result.Count() > 0))
            {
                for (int i = 0; i < result.Count(); i++)
                {
                    yield return(result[i]);
                }
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Get FINANCIALCLASS Records from PV1
        /// </summary>
        public static IEnumerable GetFINANCIALCLASSRecords(this PV1 message)
        {
            object[] result = message.GetRecords("FINANCIALCLASSRepetitionsUsed", "GetFINANCIALCLASS");

            if ((result != null) && (result.Count() > 0))
            {
                for (int i = 0; i < result.Count(); i++)
                {
                    yield return(result[i]);
                }
            }
        }
Ejemplo n.º 11
0
        protected virtual void HandleVisit(PV1 pv1)
        {
            bool doneCreatedVisit;

            var visit = _persistenceManager.GetVisit(pv1.VisitNumber.IDNumber.Value,
                                                     pv1.VisitNumber.AssigningAuthority.NamespaceID.Value,
                                                     true,
                                                     out doneCreatedVisit);

            if (visit == null)
            {
                return;
            }

            visit.Patient       = Patient;
            visit.PatientClass  = TryFind <PatientClassEnum>(pv1.PatientClass.Value);
            visit.AdmissionType = TryFind <AdmissionTypeEnum>(pv1.AdmissionType.Value);
            visit.VipIndicator  = StringToBool(pv1.VIPIndicator.Value);
            visit.PatientType   = TryFind <PatientTypeEnum>(pv1.PatientType.Value);

            visit.AdmitTime     = ParseNullableDateTimeFromDateField(pv1.AdmitDateTime.Time.Value);
            visit.DischargeTime = ParseNullableDateTimeFromDateField(pv1.GetDischargeDateTime(0).Time.Value);
            visit.InferVisitStatus();

            for (int i = 0; i < pv1.AmbulatoryStatusRepetitionsUsed; ++i)
            {
                visit.AmbulatoryStatuses.Add(TryFind <AmbulatoryStatusEnum>(pv1.GetAmbulatoryStatus(i).Value));
            }

            for (int i = 0; i < pv1.AttendingDoctorRepetitionsUsed; ++i)
            {
                HandlePractitioner(visit, pv1.GetAttendingDoctor(i), VisitPractitionerRole.AT);
            }

            for (int i = 0; i < pv1.ReferringDoctorRepetitionsUsed; ++i)
            {
                HandlePractitioner(visit, pv1.GetReferringDoctor(i), VisitPractitionerRole.RF);
            }

            for (int i = 0; i < pv1.ConsultingDoctorRepetitionsUsed; ++i)
            {
                HandlePractitioner(visit, pv1.GetConsultingDoctor(i), VisitPractitionerRole.CN);
            }

            for (int i = 0; i < pv1.AdmittingDoctorRepetitionsUsed; ++i)
            {
                HandlePractitioner(visit, pv1.GetConsultingDoctor(i), VisitPractitionerRole.AD);
            }

            HandlePatientLocation(visit, pv1);
            Visit = visit;
        }
Ejemplo n.º 12
0
        public HL7Patient(string messageType)
        {
            PIDSegment  = new PID(messageType);
            PD1Segment  = new PD1();
            NTESegments = new List <NTE>();
            Visit1      = new PV1();
            Visit2      = new PV2();
            Insurance1  = new IN1();
            Insurance2  = new IN1();
            Insurance3  = new IN1();
            GT1Segment  = new GT1();
            AL1Segments = new List <AL1>();

            Errors = new List <string>();
        }
Ejemplo n.º 13
0
    {/// <summary>
     /// 段工厂创建消息工厂创建segmentType,生成MSH|MSA|EVN|PID等
     /// </summary>
     /// <param name="parent"></param>
     /// <param name="product"></param>
     /// <param name="name"></param>
     /// <returns></returns>
        public override abstractType Create(compositeType parent, Enum product, string name)
        {
            abstractType tmp = null;

            switch (product)
            {
            case enumSegment.PID: tmp = new PID(parent, name); break;

            case enumSegment.MSH: tmp = new MSH(parent, name); break;

            case enumSegment.MSA: tmp = new MSA(parent, name); break;

            case enumSegment.ERR: tmp = new ERR(parent, name); break;

            case enumSegment.NTE: tmp = new NTE(parent, name); break;

            case enumSegment.PD1: tmp = new PD1(parent, name); break;

            case enumSegment.PV1: tmp = new PV1(parent, name); break;

            case enumSegment.PV2: tmp = new PV2(parent, name); break;

            case enumSegment.IN1: tmp = new IN1(parent, name); break;

            case enumSegment.IN2: tmp = new IN2(parent, name); break;

            case enumSegment.IN3: tmp = new IN3(parent, name); break;

            case enumSegment.GT1: tmp = new GT1(parent, name); break;

            case enumSegment.AL1: tmp = new AL1(parent, name); break;

            case enumSegment.ORC: tmp = new ORC(parent, name); break;

            case enumSegment.OBR: tmp = new OBR(parent, name); break;

            case enumSegment.CTI: tmp = new CTI(parent, name); break;

            case enumSegment.BLG: tmp = new BLG(parent, name); break;

            case enumSegment.DG1: tmp = new DG1(parent, name); break;

            case enumSegment.OBX: tmp = new OBX(parent, name); break;

            default: throw new NotSupportedException();
            }
            return(tmp);
        }
Ejemplo n.º 14
0
        public void ParseData(string Type)
        {
            if (Type == Utility.Constants.Patient_details_fileName)
            {
                string messagePath    = Utility.Utility.GetAppConfigValues("FilePath") + Utility.Constants.Patient_details_fileName;
                string MessageContent = Utility.Utility.GetFileContent(messagePath);

                var     parser         = new PipeParser();
                var     decodedMessage = parser.Parse(MessageContent);
                ADT_A01 parsedMessage  = decodedMessage as ADT_A01;

                PID patientModel = new PID();
                Utility.DataExtraction.GetPIDData(parsedMessage, ref patientModel);

                PV1 patientVisit = new PV1();
                Utility.DataExtraction.GetPatientVisit1(parsedMessage, ref patientVisit);

                PV2 patientVisit2 = new PV2();
                Utility.DataExtraction.GetPatientVisit2(parsedMessage, ref patientVisit2);
            }
            else if (Type == Utility.Constants.Vital_Update_fileName)
            {
                string messagePath    = Utility.Utility.GetAppConfigValues("FilePath") + Utility.Constants.Vital_Update_fileName;
                string MessageContent = Utility.Utility.GetFileContent(messagePath);

                var     parser         = new PipeParser();
                var     decodedMessage = parser.Parse(MessageContent);
                ADT_A01 parsedMessage  = decodedMessage as ADT_A01;

                PID patientModel = new PID();
                Utility.DataExtraction.GetPIDData(parsedMessage, ref patientModel);

                PV1 patientVisit = new PV1();
                Utility.DataExtraction.GetPatientVisit1(parsedMessage, ref patientVisit);

                List <OBX> observationList = new List <OBX>();
                Utility.DataExtraction.GetObservationData(parsedMessage, ref observationList);
            }
        }
Ejemplo n.º 15
0
        private static void ProducePV1(PV1 pv1, Neusoft.HISFC.Models.RADT.PVisit patientVisit)
        {
            pv1.SetIDPV1.Value     = "1";
            pv1.PatientClass.Value = patientVisit.PatientType.ID.ToString();
            pv1.PendingLocation.PointOfCare.Value = patientVisit.PatientLocation.Dept.ID;
            //pv1.PatientType.Value = patientVisit.PatientType.ID.ToString();
            pv1.AssignedPatientLocation.PointOfCare.Value         = patientVisit.PatientLocation.Dept.ID;
            pv1.AssignedPatientLocation.Room.Value                = patientVisit.PatientLocation.Room;
            pv1.AssignedPatientLocation.Bed.Value                 = patientVisit.PatientLocation.Bed.ID;
            pv1.AssignedPatientLocation.Building.Value            = patientVisit.PatientLocation.Building;
            pv1.AssignedPatientLocation.Floor.Value               = patientVisit.PatientLocation.Floor;
            pv1.AssignedPatientLocation.LocationDescription.Value = patientVisit.PatientLocation.Dept.Name;

            //主治医生
            XCN attendingDoctor = pv1.GetAttendingDoctor(0);

            attendingDoctor.IDNumber.Value = patientVisit.AttendingDoctor.ID;
            attendingDoctor.FamilyLastName.FamilyName.Value = patientVisit.AttendingDoctor.Name.Substring(0, 1);
            attendingDoctor.GivenName.Value = patientVisit.AttendingDoctor.Name.Substring(1);

            XCN referringDoctor = pv1.GetReferringDoctor(0);

            referringDoctor.IDNumber.Value = patientVisit.ReferringDoctor.ID;
            referringDoctor.FamilyLastName.FamilyName.Value = patientVisit.ReferringDoctor.Name.Substring(0, 1);
            referringDoctor.GivenName.Value = patientVisit.ReferringDoctor.Name.Substring(1);

            XCN consultingDoctor = pv1.GetConsultingDoctor(0);

            consultingDoctor.IDNumber.Value = patientVisit.ConsultingDoctor.ID;
            consultingDoctor.FamilyLastName.FamilyName.Value = patientVisit.ConsultingDoctor.Name.Substring(0, 1);
            consultingDoctor.GivenName.Value = patientVisit.ConsultingDoctor.Name.Substring(1);

            //入院途径
            pv1.AdmitSource.Value = patientVisit.AdmitSource.ID;

            pv1.AdmitDateTime.TimeOfAnEvent.Value = patientVisit.InTime.ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture);
        }
Ejemplo n.º 16
0
        private XCN ParseRole(string role, PV1 pv1)
        {
            XCN physician = null;

            switch (role.ToUpper())
            {
            case "RF":
                physician = pv1.GetReferringDoctor(0);
                break;

            case "AT":
                physician = pv1.GetAttendingDoctor(0);
                break;

            case "CN":
                physician = pv1.GetConsultingDoctor(0);
                break;

            case "AD":
                physician = pv1.GetConsultingDoctor(0);
                break;
            }
            return(physician);
        }
Ejemplo n.º 17
0
 /// <summary>
 /// Add a new CONTRACTAMOUNT to PV1
 /// </summary>
 public static NM AddCONTRACTAMOUNT(this PV1 message)
 {
     return(message.GetCONTRACTAMOUNT(message.CONTRACTAMOUNTRepetitionsUsed));
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Add a new CONTRACTEFFECTIVEDATE to PV1
 /// </summary>
 public static DT AddCONTRACTEFFECTIVEDATE(this PV1 message)
 {
     return(message.GetCONTRACTEFFECTIVEDATE(message.CONTRACTEFFECTIVEDATERepetitionsUsed));
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Get all CONTRACTEFFECTIVEDATE Records from PV1
 /// </summary>
 public static List <DT> GetAllCONTRACTEFFECTIVEDATERecords(this PV1 message)
 {
     return(message.GetAllRecords <DT>("CONTRACTEFFECTIVEDATERepetitionsUsed", "GetCONTRACTEFFECTIVEDATE"));
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Add a new CONTRACTCODE to PV1
 /// </summary>
 public static ID AddCONTRACTCODE(this PV1 message)
 {
     return(message.GetCONTRACTCODE(message.CONTRACTCODERepetitionsUsed));
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Get all CONTRACTCODE Records from PV1
 /// </summary>
 public static List <ID> GetAllCONTRACTCODERecords(this PV1 message)
 {
     return(message.GetAllRecords <ID>("CONTRACTCODERepetitionsUsed", "GetCONTRACTCODE"));
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Add a new FINANCIALCLASS to PV1
 /// </summary>
 public static ID AddFINANCIALCLASS(this PV1 message)
 {
     return(message.GetFINANCIALCLASS(message.FINANCIALCLASSRepetitionsUsed));
 }
Ejemplo n.º 23
0
 /// <summary>
 /// Get all FINANCIALCLASS Records from PV1
 /// </summary>
 public static List <ID> GetAllFINANCIALCLASSRecords(this PV1 message)
 {
     return(message.GetAllRecords <ID>("FINANCIALCLASSRepetitionsUsed", "GetFINANCIALCLASS"));
 }
Ejemplo n.º 24
0
 /// <summary>
 /// Add a new CONSULTINGDOCTOR to PV1
 /// </summary>
 public static CN AddCONSULTINGDOCTOR(this PV1 message)
 {
     return(message.GetCONSULTINGDOCTOR(message.CONSULTINGDOCTORRepetitionsUsed));
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Get all CONSULTINGDOCTOR Records from PV1
 /// </summary>
 public static List <CN> GetAllCONSULTINGDOCTORRecords(this PV1 message)
 {
     return(message.GetAllRecords <CN>("CONSULTINGDOCTORRepetitionsUsed", "GetCONSULTINGDOCTOR"));
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Add a new CONTRACTPERIOD to PV1
 /// </summary>
 public static NM AddCONTRACTPERIOD(this PV1 message)
 {
     return(message.GetCONTRACTPERIOD(message.CONTRACTPERIODRepetitionsUsed));
 }
Ejemplo n.º 27
0
 /// <summary>
 /// Get all CONTRACTPERIOD Records from PV1
 /// </summary>
 public static List <NM> GetAllCONTRACTPERIODRecords(this PV1 message)
 {
     return(message.GetAllRecords <NM>("CONTRACTPERIODRepetitionsUsed", "GetCONTRACTPERIOD"));
 }
Ejemplo n.º 28
0
        public void ConsumeMessage_PersistPatientInfoToDatabase_RetrievePatientInfo_IsSuccess()
        {
            // Consume a message
            MessageFactory messageFactory = new MessageFactory();
            Message        newMessage     = messageFactory.MakeMessage(TestMessages.TennesseeHealthCare_ADT_A01);

            // Parse some segments
            PID pidSegment = (PID)newMessage.Segments.Find(s => s.SegmentType == SegmentTypes.PID);
            DG1 dg1Segment = (DG1)newMessage.Segments.Find(s => s.SegmentType == SegmentTypes.DG1);
            PV1 pv1Segment = (PV1)newMessage.Segments.Find(s => s.SegmentType == SegmentTypes.PV1);

            // Populate some models with the parsed data
            ExtendedPersonName patientExtendedPersonName = pidSegment.GetPatientName();
            var name = new HL7Model.PersonName();

            name.FirstName  = patientExtendedPersonName.GivenName;
            name.LastName   = patientExtendedPersonName.FamilyName;
            name.MiddleName = patientExtendedPersonName.MiddleNameOrInitial;

            var newDiagnosis1 = new HL7Model.Diagnosis();

            newDiagnosis1.SetId             = dg1Segment.GetSetId();
            newDiagnosis1.DiagnosisDateTime = dg1Segment.GetDiagnosisDateTime();
            newDiagnosis1.Description       = dg1Segment.GetDiagnosisDescription();
            newDiagnosis1.Clinician         = dg1Segment.GetDiagnosingClinician();

            PersonLocation patientLocation = pv1Segment.GetAssignedPatientLocation();
            var            newPatientVisit = new HL7Model.PatientVisit();

            newPatientVisit.SetId                        = pv1Segment.GetSetID();
            newPatientVisit.Location.Bed                 = patientLocation.Bed;
            newPatientVisit.Location.Building            = patientLocation.Building;
            newPatientVisit.Location.Facility            = patientLocation.Facility;
            newPatientVisit.Location.Floor               = patientLocation.Floor;
            newPatientVisit.Location.LocationDescription = patientLocation.LocationDescription;
            newPatientVisit.Location.LocationStatus      = patientLocation.LocationStatus;
            newPatientVisit.Location.Room                = patientLocation.Room;

            Address     patientAddress     = pidSegment.GetPatientAddress();
            PhoneNumber patientPhoneNumber = pidSegment.GetHomePhoneNumber();
            var         newPatient         = new HL7Model.Patient();

            newPatient.ExternalPatientId              = pidSegment.GetExternalPatientId();
            newPatient.InternalPatientId              = pidSegment.GetInternalPatientId();
            newPatient.Address.Address1               = patientAddress.Address1;
            newPatient.Address.Address2               = patientAddress.Address2;
            newPatient.Address.City                   = patientAddress.City;
            newPatient.Address.State                  = patientAddress.State;
            newPatient.Address.PostalCode             = patientAddress.ZipCode;
            newPatient.Gender                         = pidSegment.GetGender();
            newPatient.DateOfBirth                    = pidSegment.GetDateOfBirth();
            newPatient.PrimaryPhoneNumber.AreaCode    = patientPhoneNumber.AreaCode;
            newPatient.PrimaryPhoneNumber.CountryCode = patientPhoneNumber.CountryCode;
            newPatient.PrimaryPhoneNumber.LineNumber  = patientPhoneNumber.LineNumber;
            newPatient.Names.Add(name);
            newPatient.Diagnosis.Add(newDiagnosis1);
            newPatient.PatientVisit.Add(newPatientVisit);

            // Commit the patient to the database
            IHL7UnitOfWork uow = new HL7UnitOfWork();

            uow.Patients.Add(newPatient);
            uow.Commit();

            // Retrieve the patient back from the database
            Patient patient = uow.Patients.GetPatientByExternalId(pidSegment.GetExternalPatientId());

            // Assert that the data retrieved from the database is the same as what went in.
            Assert.AreEqual(pidSegment.GetInternalPatientId(), patient.InternalPatientId);
            Assert.AreEqual(patientExtendedPersonName.GivenName, patient.Names[0].FirstName);
            Assert.AreEqual(dg1Segment.GetDiagnosisDescription(), patient.Diagnosis[0].Description);
            Assert.AreEqual(patientLocation.Room, patient.PatientVisit[0].Location.Room);
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Constructs an HL7 segment for the specified Segments enum object
        /// </summary>
        /// <param name="seg">The Segments enum object to construct for</param>
        public Segment(Segments seg)
        {
            switch (seg)
            {
            case Segments.ABS:
                ABS abs = new ABS();
                Name        = abs.Name;
                Description = abs.Description;
                Fields      = abs.Fields;
                break;

            case Segments.ACC:
                ACC acc = new ACC();
                Name        = acc.Name;
                Description = acc.Description;
                Fields      = acc.Fields;
                break;

            case Segments.ADD:
                ADD add = new ADD();
                Name        = add.Name;
                Description = add.Description;
                Fields      = add.Fields;
                break;

            case Segments.AFF:
                AFF aff = new AFF();
                Name        = aff.Name;
                Description = aff.Description;
                Fields      = aff.Fields;
                break;

            case Segments.AIG:
                AIG aig = new AIG();
                Name        = aig.Name;
                Description = aig.Description;
                Fields      = aig.Fields;
                break;

            case Segments.AIL:
                AIL ail = new AIL();
                Name        = ail.Name;
                Description = ail.Description;
                Fields      = ail.Fields;
                break;

            case Segments.AIP:
                AIP aip = new AIP();
                Name        = aip.Name;
                Description = aip.Description;
                Fields      = aip.Fields;
                break;

            case Segments.AIS:
                AIS ais = new AIS();
                Name        = ais.Name;
                Description = ais.Description;
                Fields      = ais.Fields;
                break;

            case Segments.AL1:
                AL1 al1 = new AL1();
                Name        = al1.Name;
                Description = al1.Description;
                Fields      = al1.Fields;
                break;

            case Segments.APR:
                APR apr = new APR();
                Name        = apr.Name;
                Description = apr.Description;
                Fields      = apr.Fields;
                break;

            case Segments.ARQ:
                ARQ arq = new ARQ();
                Name        = arq.Name;
                Description = arq.Description;
                Fields      = arq.Fields;
                break;

            case Segments.AUT:
                AUT aut = new AUT();
                Name        = aut.Name;
                Description = aut.Description;
                Fields      = aut.Fields;
                break;

            case Segments.BHS:
                BHS bhs = new BHS();
                Name        = bhs.Name;
                Description = bhs.Description;
                Fields      = bhs.Fields;
                break;

            case Segments.BLC:
                BLC blc = new BLC();
                Name        = blc.Name;
                Description = blc.Description;
                Fields      = blc.Fields;
                break;

            case Segments.BLG:
                BLG blg = new BLG();
                Name        = blg.Name;
                Description = blg.Description;
                Fields      = blg.Fields;
                break;

            case Segments.BPO:
                BPO bpo = new BPO();
                Name        = bpo.Name;
                Description = bpo.Description;
                Fields      = bpo.Fields;
                break;

            case Segments.BPX:
                BPX bpx = new BPX();
                Name        = bpx.Name;
                Description = bpx.Description;
                Fields      = bpx.Fields;
                break;

            case Segments.BTS:
                BTS bts = new BTS();
                Name        = bts.Name;
                Description = bts.Description;
                Fields      = bts.Fields;
                break;

            case Segments.BTX:
                BTX btx = new BTX();
                Name        = btx.Name;
                Description = btx.Description;
                Fields      = btx.Fields;
                break;

            case Segments.CDM:
                CDM cdm = new CDM();
                Name        = cdm.Name;
                Description = cdm.Description;
                Fields      = cdm.Fields;
                break;

            case Segments.CER:
                CER cer = new CER();
                Name        = cer.Name;
                Description = cer.Description;
                Fields      = cer.Fields;
                break;

            case Segments.CM0:
                CM0 cm0 = new CM0();
                Name        = cm0.Name;
                Description = cm0.Description;
                Fields      = cm0.Fields;
                break;

            case Segments.CM1:
                CM1 cm1 = new CM1();
                Name        = cm1.Name;
                Description = cm1.Description;
                Fields      = cm1.Fields;
                break;

            case Segments.CM2:
                CM2 cm2 = new CM2();
                Name        = cm2.Name;
                Description = cm2.Description;
                Fields      = cm2.Fields;
                break;

            case Segments.CNS:
                CNS cns = new CNS();
                Name        = cns.Name;
                Description = cns.Description;
                Fields      = cns.Fields;
                break;

            case Segments.CON:
                CON con = new CON();
                Name        = con.Name;
                Description = con.Description;
                Fields      = con.Fields;
                break;

            case Segments.CSP:
                CSP csp = new CSP();
                Name        = csp.Name;
                Description = csp.Description;
                Fields      = csp.Fields;
                break;

            case Segments.CSR:
                CSR csr = new CSR();
                Name        = csr.Name;
                Description = csr.Description;
                Fields      = csr.Fields;
                break;

            case Segments.CSS:
                CSS css = new CSS();
                Name        = css.Name;
                Description = css.Description;
                Fields      = css.Fields;
                break;

            case Segments.CTD:
                CTD ctd = new CTD();
                Name        = ctd.Name;
                Description = ctd.Description;
                Fields      = ctd.Fields;
                break;

            case Segments.CTI:
                CTI cti = new CTI();
                Name        = cti.Name;
                Description = cti.Description;
                Fields      = cti.Fields;
                break;

            case Segments.DB1:
                DB1 db1 = new DB1();
                Name        = db1.Name;
                Description = db1.Description;
                Fields      = db1.Fields;
                break;

            case Segments.DG1:
                DG1 dg1 = new DG1();
                Name        = dg1.Name;
                Description = dg1.Description;
                Fields      = dg1.Fields;
                break;

            case Segments.DRG:
                DRG drg = new DRG();
                Name        = drg.Name;
                Description = drg.Description;
                Fields      = drg.Fields;
                break;

            case Segments.DSC:
                DSC dsc = new DSC();
                Name        = dsc.Name;
                Description = dsc.Description;
                Fields      = dsc.Fields;
                break;

            case Segments.DSP:
                DSP dsp = new DSP();
                Name        = dsp.Name;
                Description = dsp.Description;
                Fields      = dsp.Fields;
                break;

            case Segments.ECD:
                ECD ecd = new ECD();
                Name        = ecd.Name;
                Description = ecd.Description;
                Fields      = ecd.Fields;
                break;

            case Segments.ECR:
                ECR ecr = new ECR();
                Name        = ecr.Name;
                Description = ecr.Description;
                Fields      = ecr.Fields;
                break;

            case Segments.EDU:
                EDU edu = new EDU();
                Name        = edu.Name;
                Description = edu.Description;
                Fields      = edu.Fields;
                break;

            case Segments.EQL:
                EQL eql = new EQL();
                Name        = eql.Name;
                Description = eql.Description;
                Fields      = eql.Fields;
                break;

            case Segments.EQP:
                EQP eqp = new EQP();
                Name        = eqp.Name;
                Description = eqp.Description;
                Fields      = eqp.Fields;
                break;

            case Segments.EQU:
                EQU equ = new EQU();
                Name        = equ.Name;
                Description = equ.Description;
                Fields      = equ.Fields;
                break;

            case Segments.ERQ:
                ERQ erq = new ERQ();
                Name        = erq.Name;
                Description = erq.Description;
                Fields      = erq.Fields;
                break;

            case Segments.ERR:
                ERR err = new ERR();
                Name        = err.Name;
                Description = err.Description;
                Fields      = err.Fields;
                break;

            case Segments.EVN:
                EVN evn = new EVN();
                Name        = evn.Name;
                Description = evn.Description;
                Fields      = evn.Fields;
                break;

            case Segments.FAC:
                FAC fac = new FAC();
                Name        = fac.Name;
                Description = fac.Description;
                Fields      = fac.Fields;
                break;

            case Segments.FHS:
                FHS fhs = new FHS();
                Name        = fhs.Name;
                Description = fhs.Description;
                Fields      = fhs.Fields;
                break;

            case Segments.FT1:
                FT1 ft1 = new FT1();
                Name        = ft1.Name;
                Description = ft1.Description;
                Fields      = ft1.Fields;
                break;

            case Segments.FTS:
                FTS fts = new FTS();
                Name        = fts.Name;
                Description = fts.Description;
                Fields      = fts.Fields;
                break;

            case Segments.GOL:
                GOL gol = new GOL();
                Name        = gol.Name;
                Description = gol.Description;
                Fields      = gol.Fields;
                break;

            case Segments.GP1:
                GP1 gp1 = new GP1();
                Name        = gp1.Name;
                Description = gp1.Description;
                Fields      = gp1.Fields;
                break;

            case Segments.GP2:
                GP2 gp2 = new GP2();
                Name        = gp2.Name;
                Description = gp2.Description;
                Fields      = gp2.Fields;
                break;

            case Segments.GT1:
                GT1 gt1 = new GT1();
                Name        = gt1.Name;
                Description = gt1.Description;
                Fields      = gt1.Fields;
                break;

            case Segments.IAM:
                IAM iam = new IAM();
                Name        = iam.Name;
                Description = iam.Description;
                Fields      = iam.Fields;
                break;

            case Segments.IIM:
                IIM iim = new IIM();
                Name        = iim.Name;
                Description = iim.Description;
                Fields      = iim.Fields;
                break;

            case Segments.IN1:
                IN1 in1 = new IN1();
                Name        = in1.Name;
                Description = in1.Description;
                Fields      = in1.Fields;
                break;

            case Segments.IN2:
                IN2 in2 = new IN2();
                Name        = in2.Name;
                Description = in2.Description;
                Fields      = in2.Fields;
                break;

            case Segments.IN3:
                IN3 in3 = new IN3();
                Name        = in3.Name;
                Description = in3.Description;
                Fields      = in3.Fields;
                break;

            case Segments.INV:
                INV inv = new INV();
                Name        = inv.Name;
                Description = inv.Description;
                Fields      = inv.Fields;
                break;

            case Segments.IPC:
                IPC ipc = new IPC();
                Name        = ipc.Name;
                Description = ipc.Description;
                Fields      = ipc.Fields;
                break;

            case Segments.ISD:
                ISD isd = new ISD();
                Name        = isd.Name;
                Description = isd.Description;
                Fields      = isd.Fields;
                break;

            case Segments.LAN:
                LAN lan = new LAN();
                Name        = lan.Name;
                Description = lan.Description;
                Fields      = lan.Fields;
                break;

            case Segments.LCC:
                LCC lcc = new LCC();
                Name        = lcc.Name;
                Description = lcc.Description;
                Fields      = lcc.Fields;
                break;

            case Segments.LCH:
                LCH lch = new LCH();
                Name        = lch.Name;
                Description = lch.Description;
                Fields      = lch.Fields;
                break;

            case Segments.LDP:
                LDP ldp = new LDP();
                Name        = ldp.Name;
                Description = ldp.Description;
                Fields      = ldp.Fields;
                break;

            case Segments.LOC:
                LOC loc = new LOC();
                Name        = loc.Name;
                Description = loc.Description;
                Fields      = loc.Fields;
                break;

            case Segments.LRL:
                LRL lrl = new LRL();
                Name        = lrl.Name;
                Description = lrl.Description;
                Fields      = lrl.Fields;
                break;

            case Segments.MFA:
                MFA mfa = new MFA();
                Name        = mfa.Name;
                Description = mfa.Description;
                Fields      = mfa.Fields;
                break;

            case Segments.MFE:
                MFE mfe = new MFE();
                Name        = mfe.Name;
                Description = mfe.Description;
                Fields      = mfe.Fields;
                break;

            case Segments.MFI:
                MFI mfi = new MFI();
                Name        = mfi.Name;
                Description = mfi.Description;
                Fields      = mfi.Fields;
                break;

            case Segments.MRG:
                MRG mrg = new MRG();
                Name        = mrg.Name;
                Description = mrg.Description;
                Fields      = mrg.Fields;
                break;

            case Segments.MSA:
                MSA msa = new MSA();
                Name        = msa.Name;
                Description = msa.Description;
                Fields      = msa.Fields;
                break;

            case Segments.MSH:
                MSH msh = new MSH();
                Name        = msh.Name;
                Description = msh.Description;
                Fields      = msh.Fields;
                break;

            case Segments.NCK:
                NCK nck = new NCK();
                Name        = nck.Name;
                Description = nck.Description;
                Fields      = nck.Fields;
                break;

            case Segments.NDS:
                NDS nds = new NDS();
                Name        = nds.Name;
                Description = nds.Description;
                Fields      = nds.Fields;
                break;

            case Segments.NK1:
                NK1 nk1 = new NK1();
                Name        = nk1.Name;
                Description = nk1.Description;
                Fields      = nk1.Fields;
                break;

            case Segments.NPU:
                NPU npu = new NPU();
                Name        = npu.Name;
                Description = npu.Description;
                Fields      = npu.Fields;
                break;

            case Segments.NSC:
                NSC nsc = new NSC();
                Name        = nsc.Name;
                Description = nsc.Description;
                Fields      = nsc.Fields;
                break;

            case Segments.NST:
                NST nst = new NST();
                Name        = nst.Name;
                Description = nst.Description;
                Fields      = nst.Fields;
                break;

            case Segments.NTE:
                NTE nte = new NTE();
                Name        = nte.Name;
                Description = nte.Description;
                Fields      = nte.Fields;
                break;

            case Segments.OBR:
                OBR obr = new OBR();
                Name        = obr.Name;
                Description = obr.Description;
                Fields      = obr.Fields;
                break;

            case Segments.OBX:
                OBX obx = new OBX();
                Name        = obx.Name;
                Description = obx.Description;
                Fields      = obx.Fields;
                break;

            case Segments.ODS:
                ODS ods = new ODS();
                Name        = ods.Name;
                Description = ods.Description;
                Fields      = ods.Fields;
                break;

            case Segments.ODT:
                ODT odt = new ODT();
                Name        = odt.Name;
                Description = odt.Description;
                Fields      = odt.Fields;
                break;

            case Segments.OM1:
                OM1 om1 = new OM1();
                Name        = om1.Name;
                Description = om1.Description;
                Fields      = om1.Fields;
                break;

            case Segments.OM2:
                OM2 om2 = new OM2();
                Name        = om2.Name;
                Description = om2.Description;
                Fields      = om2.Fields;
                break;

            case Segments.OM3:
                OM3 om3 = new OM3();
                Name        = om3.Name;
                Description = om3.Description;
                Fields      = om3.Fields;
                break;

            case Segments.OM4:
                OM4 om4 = new OM4();
                Name        = om4.Name;
                Description = om4.Description;
                Fields      = om4.Fields;
                break;

            case Segments.OM5:
                OM5 om5 = new OM5();
                Name        = om5.Name;
                Description = om5.Description;
                Fields      = om5.Fields;
                break;

            case Segments.OM6:
                OM6 om6 = new OM6();
                Name        = om6.Name;
                Description = om6.Description;
                Fields      = om6.Fields;
                break;

            case Segments.OM7:
                OM7 om7 = new OM7();
                Name        = om7.Name;
                Description = om7.Description;
                Fields      = om7.Fields;
                break;

            case Segments.ORC:
                ORC orc = new ORC();
                Name        = orc.Name;
                Description = orc.Description;
                Fields      = orc.Fields;
                break;

            case Segments.ORG:
                ORG org = new ORG();
                Name        = org.Name;
                Description = org.Description;
                Fields      = org.Fields;
                break;

            case Segments.OVR:
                OVR ovr = new OVR();
                Name        = ovr.Name;
                Description = ovr.Description;
                Fields      = ovr.Fields;
                break;

            case Segments.PCR:
                PCR pcr = new PCR();
                Name        = pcr.Name;
                Description = pcr.Description;
                Fields      = pcr.Fields;
                break;

            case Segments.PD1:
                PD1 pd1 = new PD1();
                Name        = pd1.Name;
                Description = pd1.Description;
                Fields      = pd1.Fields;
                break;

            case Segments.PDA:
                PDA pda = new PDA();
                Name        = pda.Name;
                Description = pda.Description;
                Fields      = pda.Fields;
                break;

            case Segments.PDC:
                PDC pdc = new PDC();
                Name        = pdc.Name;
                Description = pdc.Description;
                Fields      = pdc.Fields;
                break;

            case Segments.PEO:
                PEO peo = new PEO();
                Name        = peo.Name;
                Description = peo.Description;
                Fields      = peo.Fields;
                break;

            case Segments.PES:
                PES pes = new PES();
                Name        = pes.Name;
                Description = pes.Description;
                Fields      = pes.Fields;
                break;

            case Segments.PID:
                PID pid = new PID();
                Name        = pid.Name;
                Description = pid.Description;
                Fields      = pid.Fields;
                break;

            case Segments.PR1:
                PR1 pr1 = new PR1();
                Name        = pr1.Name;
                Description = pr1.Description;
                Fields      = pr1.Fields;
                break;

            case Segments.PRA:
                PRA pra = new PRA();
                Name        = pra.Name;
                Description = pra.Description;
                Fields      = pra.Fields;
                break;

            case Segments.PRB:
                PRB prb = new PRB();
                Name        = prb.Name;
                Description = prb.Description;
                Fields      = prb.Fields;
                break;

            case Segments.PRC:
                PRC prc = new PRC();
                Name        = prc.Name;
                Description = prc.Description;
                Fields      = prc.Fields;
                break;

            case Segments.PRD:
                PRD prd = new PRD();
                Name        = prd.Name;
                Description = prd.Description;
                Fields      = prd.Fields;
                break;

            case Segments.PSH:
                PSH psh = new PSH();
                Name        = psh.Name;
                Description = psh.Description;
                Fields      = psh.Fields;
                break;

            case Segments.PTH:
                PTH pth = new PTH();
                Name        = pth.Name;
                Description = pth.Description;
                Fields      = pth.Fields;
                break;

            case Segments.PV1:
                PV1 pv1 = new PV1();
                Name        = pv1.Name;
                Description = pv1.Description;
                Fields      = pv1.Fields;
                break;

            case Segments.PV2:
                PV2 pv2 = new PV2();
                Name        = pv2.Name;
                Description = pv2.Description;
                Fields      = pv2.Fields;
                break;

            case Segments.QAK:
                QAK qak = new QAK();
                Name        = qak.Name;
                Description = qak.Description;
                Fields      = qak.Fields;
                break;

            case Segments.QID:
                QID qid = new QID();
                Name        = qid.Name;
                Description = qid.Description;
                Fields      = qid.Fields;
                break;

            case Segments.QPD:
                QPD qpd = new QPD();
                Name        = qpd.Name;
                Description = qpd.Description;
                Fields      = qpd.Fields;
                break;

            case Segments.QRD:
                QRD qrd = new QRD();
                Name        = qrd.Name;
                Description = qrd.Description;
                Fields      = qrd.Fields;
                break;

            case Segments.QRF:
                QRF qrf = new QRF();
                Name        = qrf.Name;
                Description = qrf.Description;
                Fields      = qrf.Fields;
                break;

            case Segments.QRI:
                QRI qri = new QRI();
                Name        = qri.Name;
                Description = qri.Description;
                Fields      = qri.Fields;
                break;

            case Segments.RCP:
                RCP rcp = new RCP();
                Name        = rcp.Name;
                Description = rcp.Description;
                Fields      = rcp.Fields;
                break;

            case Segments.RDF:
                RDF rdf = new RDF();
                Name        = rdf.Name;
                Description = rdf.Description;
                Fields      = rdf.Fields;
                break;

            case Segments.RF1:
                RF1 rf1 = new RF1();
                Name        = rf1.Name;
                Description = rf1.Description;
                Fields      = rf1.Fields;
                break;

            case Segments.RGS:
                RGS rgs = new RGS();
                Name        = rgs.Name;
                Description = rgs.Description;
                Fields      = rgs.Fields;
                break;

            case Segments.RMI:
                RMI rmi = new RMI();
                Name        = rmi.Name;
                Description = rmi.Description;
                Fields      = rmi.Fields;
                break;

            case Segments.ROL:
                ROL rol = new ROL();
                Name        = rol.Name;
                Description = rol.Description;
                Fields      = rol.Fields;
                break;

            case Segments.RQ1:
                RQ1 rq1 = new RQ1();
                Name        = rq1.Name;
                Description = rq1.Description;
                Fields      = rq1.Fields;
                break;

            case Segments.RQD:
                RQD rqd = new RQD();
                Name        = rqd.Name;
                Description = rqd.Description;
                Fields      = rqd.Fields;
                break;

            case Segments.RXA:
                RXA rxa = new RXA();
                Name        = rxa.Name;
                Description = rxa.Description;
                Fields      = rxa.Fields;
                break;

            case Segments.RXC:
                RXC rxc = new RXC();
                Name        = rxc.Name;
                Description = rxc.Description;
                Fields      = rxc.Fields;
                break;

            case Segments.RXD:
                RXD rxd = new RXD();
                Name        = rxd.Name;
                Description = rxd.Description;
                Fields      = rxd.Fields;
                break;

            case Segments.RXE:
                RXE rxe = new RXE();
                Name        = rxe.Name;
                Description = rxe.Description;
                Fields      = rxe.Fields;
                break;

            case Segments.RXG:
                RXG rxg = new RXG();
                Name        = rxg.Name;
                Description = rxg.Description;
                Fields      = rxg.Fields;
                break;

            case Segments.RXO:
                RXO rxo = new RXO();
                Name        = rxo.Name;
                Description = rxo.Description;
                Fields      = rxo.Fields;
                break;

            case Segments.RXR:
                RXR rxr = new RXR();
                Name        = rxr.Name;
                Description = rxr.Description;
                Fields      = rxr.Fields;
                break;

            case Segments.SAC:
                SAC sac = new SAC();
                Name        = sac.Name;
                Description = sac.Description;
                Fields      = sac.Fields;
                break;

            case Segments.SCH:
                SCH sch = new SCH();
                Name        = sch.Name;
                Description = sch.Description;
                Fields      = sch.Fields;
                break;

            case Segments.SFT:
                SFT sft = new SFT();
                Name        = sft.Name;
                Description = sft.Description;
                Fields      = sft.Fields;
                break;

            case Segments.SID:
                SID sid = new SID();
                Name        = sid.Name;
                Description = sid.Description;
                Fields      = sid.Fields;
                break;

            case Segments.SPM:
                SPM spm = new SPM();
                Name        = spm.Name;
                Description = spm.Description;
                Fields      = spm.Fields;
                break;

            case Segments.SPR:
                SPR spr = new SPR();
                Name        = spr.Name;
                Description = spr.Description;
                Fields      = spr.Fields;
                break;

            case Segments.STF:
                STF stf = new STF();
                Name        = stf.Name;
                Description = stf.Description;
                Fields      = stf.Fields;
                break;

            case Segments.TCC:
                TCC tcc = new TCC();
                Name        = tcc.Name;
                Description = tcc.Description;
                Fields      = tcc.Fields;
                break;

            case Segments.TCD:
                TCD tcd = new TCD();
                Name        = tcd.Name;
                Description = tcd.Description;
                Fields      = tcd.Fields;
                break;

            case Segments.TQ1:
                TQ1 tq1 = new TQ1();
                Name        = tq1.Name;
                Description = tq1.Description;
                Fields      = tq1.Fields;
                break;

            case Segments.TQ2:
                TQ2 tq2 = new TQ2();
                Name        = tq2.Name;
                Description = tq2.Description;
                Fields      = tq2.Fields;
                break;

            case Segments.TXA:
                TXA txa = new TXA();
                Name        = txa.Name;
                Description = txa.Description;
                Fields      = txa.Fields;
                break;

            case Segments.UB1:
                UB1 ub1 = new UB1();
                Name        = ub1.Name;
                Description = ub1.Description;
                Fields      = ub1.Fields;
                break;

            case Segments.UB2:
                UB2 ub2 = new UB2();
                Name        = ub2.Name;
                Description = ub2.Description;
                Fields      = ub2.Fields;
                break;

            case Segments.URD:
                URD urd = new URD();
                Name        = urd.Name;
                Description = urd.Description;
                Fields      = urd.Fields;
                break;

            case Segments.URS:
                URS urs = new URS();
                Name        = urs.Name;
                Description = urs.Description;
                Fields      = urs.Fields;
                break;

            case Segments.VAR:
                VAR var = new VAR();
                Name        = var.Name;
                Description = var.Description;
                Fields      = var.Fields;
                break;

            case Segments.VTQ:
                VTQ vtq = new VTQ();
                Name        = vtq.Name;
                Description = vtq.Description;
                Fields      = vtq.Fields;
                break;
            }
        }
Ejemplo n.º 30
0
 public void testPV1()
 {
     var __pv1 = new PV1(@"PV1|1|I|2000^2012^01||||004777^LEBAUER^SIDNEY^J.|||SUR||-||1|A0-");
 }