示例#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);
        }