Page 1 of 1

Component not support unicode

Posted: Thu Jul 31, 2014 12:02 pm
by xiang_1988
Component does not support unicode, the following code at run time garbled words,why?
var
msg: TdiADT_A01_26;
begin
//示例:(创建报告消息)
//MSH|^~\&|LWUS||CIS||20140620160950||ORU^R01|30412259356494986|P|2.4|||||||||
//PID||0000686142|^^^^IDCard~^^^^PatientNO~^^^^IdentifyNO||王德力|||||||||||||||||||||||||
//PV1||O|||||||||||||||||111220205|||||||||||||||||||||||||||||||||
//OBR||3491900|201406200777|F00000086861^腹部(肝胆胰脾)彩色多普勒超声常规检查;||||||||||||||||||20140620160950|||||||||||||舒红||||||||||||
//OBX|1|TX|^检查所见||肝切面形态、大小正常,包膜规整,肝内回声分布均匀,管系结构显示清晰,肝内、外胆管无明显扩张,门静脉主干内径正常。胆囊大小正常,壁光滑,无增厚,囊内未见明显异常回声。脾大小、形态正常,脾内回声均匀。胰腺大小、形态正常,回声均匀。||||||F|||||^舒红|||
//OBX|2|TX|^检查提示||肝脏、胆囊、脾脏、胰腺未见明显异常。||||||F|||||^舒红|||
msg := TdiADT_A01_26.Create;
msg.MSH.FieldSeparator.AsString := '|';
msg.MSH.EncodingCharacters.AsString := '^~\&';
msg.MSH.Sendingapplication.NamespaceID.AsString := 'LWUS';
msg.MSH.ReceivingApplication.NamespaceID.AsString := 'EAI'; //接收应用程序 --EAI(集成平台)
msg.MSH.ReceivingFacility.NamespaceID.AsString := ''; //接收设备
msg.MSH.DateTimeOfMessage.AsString := FormatDateTime('yyyyMMddHHMMSS', Now); //消息的日期/时间 --20140620114524
msg.MSH.Security.AsString := ''; //安全性
msg.MSH.MessageType.MessageCode.AsString := 'ADT'; //消息类型 --ADT^A01
msg.MSH.MessageType.TriggerEvent.AsString := 'A01';
msg.MSH.MessageControlID.AsString := '15034764'; //消息ID 序列号 --15034764
msg.MSH.ProcessingID.ProcessingID.AsString := 'P'; //处理ID(D:调试;P:产品;T:培训) --P
msg.MSH.VersionID.VersionID.AsString := '2.4'; //版本ID --2.4
msg.MSH.SequenceNumber.AsString := '123'; //序列号
msg.MSH.ContinuationPointer.AsString := ''; //延续指针
msg.MSH.AcceptAcknowledgmentType.AsString := 'AL'; //消息接受确认类型 --AL
msg.MSH.ApplicationAcknowledgmentType.AsString := 'AL'; //应用程序确认类型 --AL
msg.MSH.CountryCode.AsString := 'CHN'; //国家代码 --CHN
msg.MSH.CharacterSet[0].AsString := ''; //字符集 UNICODE
msg.MSH.PrincipalLanguageOfMessage.Text.AsString := ''; //消息采用的主要语言
msg.MSH.AlternateCharacterSetHandlingScheme.AsString := ''; //对备用字符集的操作方案

//-------------------PID组装 -----------------------
msg.PID.SetIDPID.AsString := '1'; //Set ID - PID --1
msg.PID.PatientID.IDNumber.AsString := '0000605284'; //患者病历号 --0000605284
msg.PID.PatientIdentifierList[0].IDNumber.AsString := '0000605284'; //患者标识(患者本次就诊使用的ID) --0000605284
msg.PID.PatientIdentifierList[0].IdentifierTypeCode.AsString := 'IDCard'; //IDCard(诊疗卡号) --IDCard
msg.PID.PatientIdentifierList[1].IDNumber.AsString := '0000321159'; //患者标识 --0000321159
msg.PID.PatientIdentifierList[1].IdentifierTypeCode.AsString := 'PatientNO'; //PatientNO(住院号) --PatientNO
msg.PID.PatientIdentifierList[2].IDNumber.AsString := '430424196808294241'; //患者标识 --430424196808294241
msg.PID.PatientIdentifierList[2].IdentifierTypeCode.AsString := 'IdentifyNO'; //IdentifyNO(身份证号) --IdentifyNO
msg.PID.AlternatePatientIDPID[0].IDNumber.AsString := ''; //患者备用ID
msg.PID.PatientName[0].Familyname.Surname.AsString := '刘爱华'; //患者姓名 --刘爱华
msg.PID.PatientName[0].GivenName.AsString := 'John';
//------------------PV1组装-------------------------
msg.PV1.SetIDPV1.AsString := '1'; //Set ID - PV1 --1
msg.PV1.PatientClass.AsString := 'O'; //患者类别(O:门诊 I:住院 P:体检) --I
msg.PV1.AssignedPatientLocation.PointofCare.AsString := '9505'; //患者当前位置--病区 --9505
msg.PV1.AssignedPatientLocation.Room.AsString := '1'; //患者当前位置--病房
msg.PV1.AssignedPatientLocation.Bed.AsString := '23'; //患者当前位置--床位号
msg.PV1.AssignedPatientLocation.Facility.NamespaceID.AsString := '4506'; //患者当前位置--机构 --4506
msg.PV1.AdmissionType.AsString := '1'; //入院类型(请参照入院情况字典) --1
msg.PV1.ReadmissionIndicator.AsString := '2'; //再次入院标识符(用来存储住院次数) --2
msg.PV1.AdmitSource.AsString := '1'; //入院来源(请参照入院来源字典) --1
msg.PV1.AmbulatoryStatus[0].AsString := ''; //(手术后)走动状况
msg.PV1.VIPIndicator.AsString := '0'; //VIP标识符(1:是 0:否) --0
msg.PV1.AdmittingDoctor[0].IDNumber.AsString := '005382'; //入院医生(入院医生编码) --005382
msg.PV1.AdmittingDoctor[0].FamilyName.Surname.AsString := '张医生'; //入院医生(入院医生名称) --
msg.PV1.PatientType.AsString := '01'; //患者类型(请参照患者结算类别 01:自费02:医保 03:公费) --01
msg.PV1.VisitNumber.IDNumber.AsString := '111218101'; //就诊号码(患者就诊的唯一流水号) --111218101
msg.PV1.AdmitDateTime.AsString := '20140620092600'; //入院日期/时间 --20140620092600
msg.PV1.VisitIndicator.AsString := ''; //就诊标识符
Memo1.Lines.Text := msg.AsString;
Memo2.Lines.Text := msg.AsXML;
msg.Free;

Run result:
MSH|^~\&|LWUS||EAI||20140731200133||ADT^A01|15034764|P|2.4|123||AL|AL|CHN
PID|1|0000605284|0000605284^^^^IDCard~0000321159^^^^PatientNO~430424196808294241^^^^IdentifyNO||\X5218\\X7231\\X534E\^John
PV1|1|O|9505^1^23^4506|1|||||||||2|1||0|005382^\X5F20\\X533B\\X751F\|01|111218101|||||||||||||||||||||||||20140620092600

Re: Component not support unicode

Posted: Fri Aug 01, 2014 2:11 am
by xiang_1988
Why when you create a message will appear as X characters in Chinese?

MSH|^~\&|LWUS||EAI||20140801100922||ADT^A01|15034764|P|2.4|123||AL|AL|CHN
PID|1|0000605284|0000605284^^^^IDCard~0000321159^^^^PatientNO~430424196808294241^^^^IdentifyNO||\X5218\\X7231\\X534E\^John
PV1|1|O|9505^1^23^4506|1|||||||||2|1||0|005382^\X5F20\\X533B\\X751F\|01|111218101|||||||||||||||||||||||||20140620092600


Please help me! Thanks

Re: Component not support unicode

Posted: Fri Aug 01, 2014 4:34 am
by admin
From version 1.6.6.

change msg.EnableEscapedValues value to False;

EnableEscapedValues
Use unicode values, do not use escape characters for encoding. Default :True, used escaped characters.

Re: Component not support unicode

Posted: Fri Aug 01, 2014 4:42 am
by xiang_1988
ok,thanks

Re: Component not support unicode

Posted: Fri Aug 01, 2014 5:47 am
by xiang_1988
hello,admin!
TdiADT_A01_26 not have OBR Segment?The following program cannot compile.

var
msg: TdiADT_A01_26;
begin
msg := TdiADT_A01_26.Create;
msg.OBR.SetIDOBR.AsString := '2'; //SetID-OBR
// OBR.PlacerOrderNumber.EntityIdentifier.AsString := '3491900'; //3491900
// OBR.FillerOrderNumber.EntityIdentifier.AsString := '201406200777'; //201406200777
// OBR.UniversalServiceIdentifier.Identifier.AsString := 'F00000086861'; //检查ID --F00000086861
// OBR.UniversalServiceIdentifier.Text.AsString := '腹部(肝胆胰脾)彩色多普勒超声常规检查;'; //检查名称 --腹部(肝胆胰脾)彩色多普勒超声常规检查;
// OBR.ResultsRptStatusChngDateTime.AsString := '20140620160950'; // --20140620160950
// OBR.Transcriptionist[0].Name_.IDNumber.AsString := '舒红'; //报告医生(姓名) --舒红

end;

Re: Component not support unicode

Posted: Fri Aug 01, 2014 6:03 am
by admin
Hi,

For more details ADT_A01 : http://www.delphihl7.com/doc/html/diHL7 ... 01_26.html
In standart ADT_A06 not have OBR segment.
Please check your documentation.

Re: Component not support unicode

Posted: Fri Aug 01, 2014 6:48 am
by xiang_1988
OK ,thanks , TdiADT_A01_26 not have OBR Segment,It should be TdiORU_R01_26 :)