Пример #1
0
        protected virtual ISegment CreateMSHSegment(HL7MessageType MessageType, HL7EventType ADTEvent)
        {
            IMessage oHL7 = Creator.Message("2.4", MessageType.GetLiteral(), ADTEvent.GetLiteral());;

            //Sending Application
            oHL7.Segment("MSH").Field(3).AsString = "HIPSClient";

            //Sending Facility
            switch (MessageType)
            {
            case HL7MessageType.ADT:
                oHL7.Segment("MSH").Field(4).AsString = Common.HIPS.HipsConfig.HospitalCode;
                break;

            case HL7MessageType.ORU:
                oHL7.Segment("MSH").Field(4).AsString = Common.HIPS.HipsConfig.LISHospitalCode;
                break;

            default:
                throw new System.ComponentModel.InvalidEnumArgumentException(MessageType.ToString(), (int)MessageType, typeof(HL7MessageType));
            }

            //Receiving Application
            oHL7.Segment("MSH").Field(5).AsString = "HIPS";
            //Receiving Facility
            oHL7.Segment("MSH").Field(6).AsString = "ADHA";

            oHL7.Segment("MSH").Field(7).Convert.DateTime.SetDateTimeOffset(DateTimeOffset.Now, false);
            oHL7.Segment("MSH").Field(15).AsString = "AL";
            oHL7.Segment("MSH").Field(16).AsString = "NE";
            oHL7.Segment("MSH").Field(17).AsString = "AU";
            oHL7.Segment("MSH").Field(18).AsString = "ASCII";
            oHL7.Segment("MSH").Field(19).AsString = "EN";
            return(oHL7.Segment("MSH").Clone());
        }
Пример #2
0
        private ISegment CreateEVNSegment(HL7EventType ADTEvent, string EventDateStamp)
        {
            var oEVN = Creator.Segment("EVN");

            oEVN.Field(1).AsString = ADTEvent.GetLiteral();
            oEVN.Field(2).AsString = EventDateStamp;
            return(oEVN);
        }
Пример #3
0
        private IMessage CreateADTMessage(HL7EventType EventType)
        {
            IMessage oHL7 = Creator.Message(CreateMSHSegment(HL7MessageType.ADT, EventType));

            oHL7.Add(CreateEVNSegment(EventType, oHL7.Segment("MSH").Field(6).AsString));
            oHL7.Add(CreatePIDSegment(this.Patient));
            oHL7.Add(CreatePV1Segment(this.HospitalEncounter));
            return(oHL7);
        }
Пример #4
0
        private void Initailize()
        {
            _comboBox.Items.Clear();
            List <HL7EventType> list = HL7EventType.GetEventTypes();

            foreach (HL7EventType et in list)
            {
                _comboBox.Items.Add(et);
            }
        }
Пример #5
0
        private void CheckExistMessage()
        {
            _mappingAlreadyExist = false;

            GWEventType  gwET = _gwEventCtrl.Value;
            HL7EventType hlET = _hl7EventCtrl.Value;

            foreach (XIMMessage msg in _messageList)
            {
                if (!_isCopyItem)
                {
                    if (_message.GWEventType.Code == gwET.Code &&
                        _message.HL7EventType.Name == hlET.Name &&
                        _message.HL7EventType.Qualifier == hlET.Qualifier)
                    {
                        continue;
                    }
                }

                if (_isInbound)
                {
                    if (msg.GWEventType.Code == gwET.Code &&
                        msg.HL7EventType.Name == hlET.Name &&
                        msg.HL7EventType.Qualifier == hlET.Qualifier)
                    {
                        _mappingAlreadyExist = true;

                        string str = "from [" + hlET.ToString() + "] to [" + gwET.ToString() + "]";

                        MessageBox.Show(this, "Message mapping " + str + " is already exist.",
                                        "Warning", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        break;
                    }
                }
                else
                {
                    if (msg.GWEventType.Code == gwET.Code)
                    {
                        _mappingAlreadyExist = true;

                        string str = "from [" + gwET.ToString() + "]";

                        MessageBox.Show(this, "Message mapping " + str + " is already exist.",
                                        "Warning", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        break;
                    }
                }
            }

            RefreshButtons();
        }
Пример #6
0
        private void _hl7EventCtrl_OnSelectChanged(object sender, EventArgs e)
        {
            _hasChangeMessageEventType = true;

            if (_isInbound)
            {
                CheckExistMessage();
                return;
            }

            if (_isCopyItem)
            {
                CheckExistMessage();
                return;
            }

            HL7EventType et = _hl7EventCtrl.Value;

            if (et == null)
            {
                return;
            }

            foreach (XIMMappingItem item in _message.MappingList)
            {
                if (item.Element.GetLastName() == XmlMessage.Request.Name.GetLastName())
                {
                    item.Translating.Type       = TranslatingType.FixValue;
                    item.Translating.ConstValue = et.Name;
                    _listViewCtrl.SelectItem(item);
                    break;
                }
            }

            foreach (XIMMappingItem item in _message.MappingList)
            {
                if (item.Element.GetLastName() == XmlMessage.Request.Qualifier.GetLastName())
                {
                    item.Translating.Type       = TranslatingType.FixValue;
                    item.Translating.ConstValue = et.Qualifier;
                    _listViewCtrl.SelectItem(item);
                    break;
                }
            }
        }