IHE测试ITI-11与ITI-12的WSDL的问题分析

前两天,公司同事在搞IHE测试的内容,在准备其中的两个测试ITI-11与ITI-12时,发现通过VS自带的WSDL命令是无法生成相应代码的。

其具体的WSDL内容,大家可以Google下面的内容来查找:
Appendix A: Web Service Definition for Retrieve Specific Information for Display and Retrieve Document for Display Transaction

经过一些尝试,发现:
1、该附录中,有两个WSDL文件,两个只差一行
2、两个文件格式都是错误的

这标准出的也太坑爹了吧。

具体修改方式如下:
1、字符集修改为utf-8
2、在文件最后,增加节点结束节点“definitions”
3、types节点增加前缀,变为“s:types”
4、所有的mime:content type=”text/html”,都修改为mime:content type=”text/xml”
然后就OK了

修改后的WSDL文件如下:

<?xml version="1.0" encoding="utf-8"?>
<definitions 
  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
	xmlns:s="http://www.w3.org/2001/XMLSchema"
	xmlns:s0="http://rsna.org/ihe/IHERetrieveForDisplay"
	xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" 
	xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
	targetNamespace="http://rsna.org/ihe/IHERetrieveForDisplay" 
	xmlns="http://schemas.xmlsoap.org/wsdl/">
 <!-- Defines the types available for the parameters -->
 <!-- May also include the return type definitions -->
	<s:types>
		<s:schema elementFormDefault="qualified" targetNamespace="http://rsna.org/ihe/IHERetrieveForDisplay">
 <!-- Add any items that control the returned values list or type here -->
 <!-- Add or remove items in the actual supplied WSDL to show the available types. -->
			<s:simpleType name="summaryRequestType">
				<s:restriction base="s:string">
					<s:enumeration value="SUMMARY" />
					<s:enumeration value="SUMMARY-RADIOLOGY" />
					<s:enumeration value="SUMMARY-CARDIOLOGY" />
					<s:enumeration value="SUMMARY-LABORATORY" />
					<s:enumeration value="SUMMARY-SURGERY" />
					<s:enumeration value="SUMMARY-EMERGENCY" />
					<s:enumeration value="SUMMARY-DISCHARGE" />
					<s:enumeration value="SUMMARY-ICU" />
					<s:enumeration value="SUMMARY-RX" />
				</s:restriction>
			</s:simpleType>

			<s:simpleType name="listRequestType">
				<s:restriction base="s:string">
					<s:enumeration value="LIST-ALLERGIES" />
					<s:enumeration value="LIST-MEDS" />
				</s:restriction>
			</s:simpleType>
 <!-- Please list all content types available, and remove those not available. -->
			<s:simpleType name="contentType">
				<s:restriction base="s:string">
					<s:enumeration value="text/html" />
				</s:restriction>
			</s:simpleType>

 <!-- Indicates that this item is a returned rows restriction -->
			<s:simpleType name="ReturnedResultCount" type="s:positiveInteger" />
 <!-- Please use the string "Search" as a prefix for all search criteria, and list below -->
 <!-- Indicates that this item is a search string -->
			<s:simpleType name="SearchString" type="s:string" />

		</s:schema>
	</s:types>
	<message name="RetrieveSummaryInfoHttpGetIn">
  <!-- Add other parameters here if they are available, using types defined above. -->
		<part name="requestType" type="summaryRequestType" />
		<part name="patientID" type="SearchString" />
		<part name="lowerDateTime" type="s:dateTime" />
		<part name="upperDateTime" type="s:dateTime" />
		<part name="mostRecentResults" type="ReturnedResultCount" />
	</message>
	<message name="RetrieveSummaryInfoHttpGetOut">
  <!-- If a complex type is defined for the return value, then it is suggested that -->
 <!-- it be used here instead of s0:string. If a complex type is allowed as one -->
 <!-- of the options, but an arbitrarily formatted string is also allowed, then create -->
 <!-- a union type here that allows either option. -->
		<part name="Body" element="s0:string" />
	</message>
	<message name="RetrieveListInfoHttpGetIn">
 <!-- Add other parameters here if they are available, using types defined above. -->
		<part name="requestType" type="listRequestType" />
		<part name="patientID" type="SearchString" />
	</message>
	<message name="RetrieveListInfoHttpGetOut">
 <!-- If a complex type is defined for the return value, then it is suggested that -->
  <!-- it be used here instead of s0:string. If a complex type is allowed as one -->
 <!-- of the options, but an arbitrarily formatted string is also allowed, then create -->
 <!-- a union type here that allows either option. -->
		<part name="Body" element="s0:string" />
	</message>
	<message name="RetrieveDocumentHttpGetIn">
 <!-- Add other parameters here if they are available, using types defined above. -->

 <!-- It is recommended that one of the sub-types of SearchUID is chosen here -->
 <!-- Especially if SearchStudyUID is allowed, then the display client can know that -->
  <!-- it is permissible to use a dicom uid here -->
		<part name="documentUID" type="SearchString" />
		<part name="contentType" type="contentType" />
	</message>
	<message name="RetrieveDocumentHttpGetOut">
 <!-- If a complex type is defined for the return value, then it is suggested that -->
 <!-- it be used here instead of s:string. If a complex type is allowed as one -->
  <!-- of the options, but an arbitrarily formatted string is also allowed, then create -->
 <!-- a union type here that allows either option. -->
		<part name="Body" element="s:string" />
	</message>

	<portType name="IHERetrieveForDisplayHttpGet">
		<operation name="RetrieveSummaryInfo">
			<input message="s0:RetrieveSummaryInfoHttpGetIn" />
			<output message="s0:RetrieveSummaryInfoHttpGetOut" />
		</operation>
		<operation name="RetrieveListInfo">

			<input message="s0:RetrieveListInfoHttpGetIn" />
			<output message="s0:RetrieveListInfoHttpGetOut" />
		</operation>
		<operation name="RetrieveDocument">
			<input message="s0:RetrieveDocumentHttpGetIn" />
			<output message="s0:RetrieveDocumentHttpGetOut" />
		</operation>
	</portType>

	<binding name="IHERetrieveForDisplayHttpGet" type="s0:IHERetrieveForDisplayHttpGet">
		<http:binding verb="GET" />
		<operation name="RetrieveSummaryInfo">
			<http:operation location="/IHERetrieveSummaryInfo" />
			<input>
				<http:urlEncoded />
			</input>
			<output>
        <mime:content type="text/xml" />
				<!--mime:content type="text/html" /-->
			</output>
		</operation>
		<operation name="RetrieveListInfo">
			<http:operation location="/IHERetrieveListInfo" />
			<input>
				<http:urlEncoded />
			</input>
			<output>
        <mime:content type="text/xml" />
				<!--mime:content type="text/html" /-->
			</output>
		</operation>

		<operation name="RetrieveDocument">
			<http:operation location="/IHERetrieveDocument" />
			<input>
				<http:urlEncoded />
			</input>
      <!-- The type of the output should be restricted on a per-server basis to the types -->
      <!-- actually provided. -->
			<output>
        <mime:content type="text/xml" />
				<!--mime:content type="text/html" />
				<mime:content type="application/x-hl7-cda-level-one+xml" />
				<mime:content type="application/pdf" />
				<mime:content type="image/jpeg" /-->
			</output>
		</operation>
	</binding>
 <!-- Bind the actual service here -->
	<service name="IHERetrieveForDisplay">

		<port name="IHERetrieveForDisplayHttpGet" binding="s0:IHERetrieveForDisplayHttpGet">
			<http:address location="http://localhost/" />
		</port>
	</service>
</definitions>

条码分类

1、一维条码
一维条码是由一组规则排列的条、空以及对应的字符组成的标记,“条”指对光线反射率较低的部分,“空”指对光线反射率较高的部分,这些条和空组成的数据表达一定的信息,并能够用特定的设备识读,转换成与计算机兼容的二进制和十进制信息。根据不同使用环境,会有不同码制,即不同条码条和空的排列规则,常用的一维码的码制包括:EAN码、39码、交叉25码、UPC码、128码、93码,ISBN码,及Codabar(库德巴码)。

常用一维条码

2、堆叠式/行排式/称堆积式/层排式二维条码
其编码原理是建立在一维条码基础之上,按需要堆积成二行或多行。它在编码设计、校验原理、识读方式等方面继承了一维条码的一些特点,识读设备与条码印刷与一维条码技术兼容。但由于行数的增加,需要对行进行判定,其译码算法与软件也不完全相同于一维条码。有代表性的行排式二维条码有:Code 16K、Code 49、PDF417、MicroPDF417 等。

3、矩阵式/棋盘式二维条码
其编码原理是在一个矩形空间通过黑、白像素在矩阵中的不同分布进行编码。在矩阵相应元素位置上,用点(方点、圆点或其他形状)的出现表示二进制“1”,点的不出现表示二进制的“0”,点的排列组合确定了矩阵式二维条码所代表的意义。矩阵式二维条码是建立在计算机图像处理技术、组合编码原理等基础上的一种新型图形符号自动识读处理码制。具有代表性的矩阵式二维条码有:Code One、MaxiCode、QR Code、 Data Matrix、Han Xin Code、Grid Matrix 等。

常用二维条码

参考:
维-基-百-科(转图片了,方便大家看)

为什么DICOM不适合差异化压缩

前几天,同事参加了一个技术讨论会,会间有人热烈的讨论了DICOM影像的单序列多幅的差异化压缩。

想法很简单,就是类似于视频压缩的方法,找出关键帧影像,对非关键帧影像就可以做差异化压缩了。

说实话,我认为这种做法没什么实际价值,原因如下:

1、现在存储很便宜,存储量已经不是什么大问题,但存储的读写速度却一直上不来(SSD太贵),这才是现在要解决的首要问题,所以现在有些人在尝试用HDFS这样的分布式存储系统,来解决这个问题,同时可以解决可靠性

2、DICOM本身没有关键帧的概念,每一幅扫描的人体部位都不同,差距都不小,差异化压缩效果不一定好

3、DICOM文件原本可以独立打开,差异化压缩后,一个关键帧出了问题,其余非关键帧就都报废了,可靠性其实是降低了

4、DICOM影像的每一幅都有MetaData,差异压缩后MetaData如何存储,也是个问题

5、同时,这些计算太消耗CPU了,而且其他厂商并不支持这种压缩方法

PS:
其实有一种解决方案是这样的,将多个DICOM文件合并为一个更大的文件,并记录每个文件的位置索引,支持顺序和随机读写
这样可以大幅提升存取效率,规避LOSF问题,本身就可以降低存储的使用,并且更适配HDFS
已经申请专利了

如何快速路由DICOM通讯

DICOM通讯是典型的socket通讯,一般的route方式,都是SCP收到图后,然后CStore给第三方。
但这样的效率不会很高,因为要先收取,解析、再转发。

如何提高转发效率呢?
大家知道DICOM通讯中,对带宽的占用率还是比较高的,而DICOM使用的socket是基于TCP协议的应用层,这样一层层上来,量又大,效果不可能会好。
所以直接用DICOM通讯进行转发,效果不会好。

比较好的方法是,借鉴路由器的工作方式,至少应该在网络层或传输层搞定会比较好。
这样,直接调整一下包的内容,就直接发出去了,效率应该是比较高的。

先记录一下,有空了再试试看。

PS:
利用nginx的转发功能,可以达到快速转发的目的。
先存到对象存储,直接转发文件地址,效率也不错。

常用MIME Type

MIME Type组成规则为:content-type/subtype
content-type:消息内容的类型,比如text,application,multipart,image,audio,video,message
subtype:消息内容的子类型,比如:content-type为text时,常用的子类型有plain,html等。最终MIME Type为:text/plain,text/html。

文件类型 MIME 文件类型 MIME
3gp video/3gpp aab application/x-authoware-bin
aam application/x-authoware-map aas application/x-authoware-seg
ai application/postscript aif audio/x-aiff
aifc audio/x-aiff aiff audio/x-aiff
als audio/X-Alpha5 amc application/x-mpeg
ani application/octet-stream apk application/vnd.android.package-archive
asc text/plain asd application/astound
asf video/x-ms-asf asn application/astound
asp application/x-asap asx video/x-ms-asf
au audio/basic avb application/octet-stream
avi video/x-msvideo awb audio/amr-wb
bcpio application/x-bcpio bin application/octet-stream
bld application/bld bld2 application/bld2
bmp image/bmp bpk application/octet-stream
bz2 application/x-bzip2 cal image/x-cals
ccn application/x-cnc cco application/x-cocoa
cdf application/x-netcdf cgi magnus-internal/cgi
chat application/x-chat class application/octet-stream
clp application/x-msclip cmx application/x-cmx
co application/x-cult3d-object cod image/cis-cod
cpio application/x-cpio cpt application/mac-compactpro
crd application/x-mscardfile csh application/x-csh
csm chemical/x-csml csml chemical/x-csml
css text/css cur application/octet-stream
dcm x-lml/x-evm dcr application/x-director
dcx image/x-dcx dhtml text/html
dir application/x-director dll application/octet-stream
dmg application/octet-stream dms application/octet-stream
doc application/msword dot application/x-dot
dvi application/x-dvi dwf drawing/x-dwf
dwg application/x-autocad dxf application/x-autocad
dxr application/x-director ebk application/x-expandedbook
emb chemical/x-embl-dl-nucleotide embl chemical/x-embl-dl-nucleotide
eps application/postscript eri image/x-eri
es audio/echospeech esl audio/echospeech
etc application/x-earthtime etx text/x-setext
evm x-lml/x-evm evy application/x-envoy
exe application/octet-stream fh4 image/x-freehand
fh5 image/x-freehand fhc image/x-freehand
fif image/fif fm application/x-maker
fpx image/x-fpx fvi video/isivideo
gau chemical/x-gaussian-input gca application/x-gca-compressed
gdb x-lml/x-gdb gif image/gif
gps application/x-gps gtar application/x-gtar
gz application/x-gzip hdf application/x-hdf
hdm text/x-hdml hdml text/x-hdml
hlp application/winhlp hqx application/mac-binhex40
htm text/html html text/html
hts text/html ice x-conference/x-cooltalk
ico application/octet-stream ief image/ief
ifm image/gif ifs image/ifs
imy audio/melody ins application/x-NET-Install
ips application/x-ipscript ipx application/x-ipix
it audio/x-mod itz audio/x-mod
ivr i-world/i-vrml j2k image/j2k
jad text/vnd.sun.j2me.app-descriptor jam application/x-jam
jar application/java-archive jnlp application/x-java-jnlp-file
jpe image/jpeg jpeg image/jpeg
jpg image/jpeg jpz image/jpeg
js application/x-javascript jwc application/jwc
kjx application/x-kjx lak x-lml/x-lak
latex application/x-latex lcc application/fastman
lcl application/x-digitalloca lcr application/x-digitalloca
lgh application/lgh lha application/octet-stream
lml x-lml/x-lml lmlpack x-lml/x-lmlpack
lsf video/x-ms-asf lsx video/x-ms-asf
lzh application/x-lzh m13 application/x-msmediaview
m14 application/x-msmediaview m15 audio/x-mod
m3u audio/x-mpegurl m3url audio/x-mpegurl
ma1 audio/ma1 ma2 audio/ma2
ma3 audio/ma3 ma5 audio/ma5
man application/x-troff-man map magnus-internal/imagemap
mbd application/mbedlet mct application/x-mascot
mdb application/x-msaccess mdz audio/x-mod
me application/x-troff-me mel text/x-vmel
mi application/x-mif mid audio/midi
midi audio/midi mif application/x-mif
mil image/x-cals mio audio/x-mio
mmf application/x-skt-lbs mng video/x-mng
mny application/x-msmoney moc application/x-mocha
mocha application/x-mocha mod audio/x-mod
mof application/x-yumekara mol chemical/x-mdl-molfile
mop chemical/x-mopac-input mov video/quicktime
movie video/x-sgi-movie mp2 audio/x-mpeg
mp3 audio/x-mpeg mp4 video/mp4
mpc application/vnd.mpohun.certificate mpe video/mpeg
mpeg video/mpeg mpg video/mpeg
mpg4 video/mp4 mpga audio/mpeg
mpn application/vnd.mophun.application mpp application/vnd.ms-project
mps application/x-mapserver mrl text/x-mrml
mrm application/x-mrm ms application/x-troff-ms
mts application/metastream mtx application/metastream
mtz application/metastream mzv application/metastream
nar application/zip nbmp image/nbmp
nc application/x-netcdf ndb x-lml/x-ndb
ndwn application/ndwn nif application/x-nif
nmz application/x-scream nokia-op-logo image/vnd.nok-oplogo-color
npx application/x-netfpx nsnd audio/nsnd
nva application/x-neva1 oda application/oda
oom application/x-AtlasMate-Plugin pac audio/x-pac
pae audio/x-epac pan application/x-pan
pbm image/x-portable-bitmap pcx image/x-pcx
pda image/x-pda pdb chemical/x-pdb
pdf application/pdf pfr application/font-tdpfr
pgm image/x-portable-graymap pict image/x-pict
pm application/x-perl pmd application/x-pmd
png image/png pnm image/x-portable-anymap
pnz image/png pot application/vnd.ms-powerpoint
ppm image/x-portable-pixmap pps application/vnd.ms-powerpoint
ppt application/vnd.ms-powerpoint pqf application/x-cprplayer
pqi application/cprplayer prc application/x-prc
proxy application/x-ns-proxy-autoconfig ps application/postscript
ptlk application/listenup pub application/x-mspublisher
pvx video/x-pv-pvx qcp audio/vnd.qcelp
qt video/quicktime qti image/x-quicktime
qtif image/x-quicktime r3t text/vnd.rn-realtext3d
ra audio/x-pn-realaudio ram audio/x-pn-realaudio
rar application/x-rar-compressed ras image/x-cmu-raster
rdf application/rdf+xml rf image/vnd.rn-realflash
rgb image/x-rgb rlf application/x-richlink
rm audio/x-pn-realaudio rmf audio/x-rmf
rmm audio/x-pn-realaudio rmvb audio/x-pn-realaudio
rnx application/vnd.rn-realplayer roff application/x-troff
rp image/vnd.rn-realpix rpm audio/x-pn-realaudio-plugin
rt text/vnd.rn-realtext rte x-lml/x-gps
rtf application/rtf rtg application/metastream
rtx text/richtext rv video/vnd.rn-realvideo
rwc application/x-rogerwilco s3m audio/x-mod
s3z audio/x-mod sca application/x-supercard
scd application/x-msschedule sdf application/e-score
sea application/x-stuffit sgm text/x-sgml
sgml text/x-sgml sh application/x-sh
shar application/x-shar shtml magnus-internal/parsed-html
shw application/presentations si6 image/si6
si7 image/vnd.stiwap.sis si9 image/vnd.lgtwap.sis
sis application/vnd.symbian.install sit application/x-stuffit
skd application/x-Koan skm application/x-Koan
skp application/x-Koan skt application/x-Koan
slc application/x-salsa smd audio/x-smd
smi application/smil smil application/smil
smp application/studiom smz audio/x-smd
snd audio/basic spc text/x-speech
spl application/futuresplash spr application/x-sprite
sprite application/x-sprite spt application/x-spt
src application/x-wais-source stk application/hyperstudio
stm audio/x-mod sv4cpio application/x-sv4cpio
sv4crc application/x-sv4crc svf image/vnd
svg image/svg-xml svh image/svh
svr x-world/x-svr swf application/x-shockwave-flash
swfl application/x-shockwave-flash t application/x-troff
tad application/octet-stream talk text/x-speech
tar application/x-tar taz application/x-tar
tbp application/x-timbuktu tbt application/x-timbuktu
tcl application/x-tcl tex application/x-tex
texi application/x-texinfo texinfo application/x-texinfo
tgz application/x-tar thm application/vnd.eri.thm
tif image/tiff tiff image/tiff
tki application/x-tkined tkined application/x-tkined
toc application/toc toy image/toy
tr application/x-troff trk x-lml/x-gps
trm application/x-msterminal tsi audio/tsplayer
tsp application/dsptype tsv text/tab-separated-values
tsv text/tab-separated-values ttf application/octet-stream
ttz application/t-time txt text/plain
ult audio/x-mod ustar application/x-ustar
uu application/x-uuencode uue application/x-uuencode
vcd application/x-cdlink vcf text/x-vcard
vdo video/vdo vib audio/vib
viv video/vivo vivo video/vivo
vmd application/vocaltec-media-desc vmf application/vocaltec-media-file
vmi application/x-dreamcast-vms-info vms application/x-dreamcast-vms
vox audio/voxware vqe audio/x-twinvq-plugin
vqf audio/x-twinvq vql audio/x-twinvq
vre x-world/x-vream vrml x-world/x-vrml
vrt x-world/x-vrt vrw x-world/x-vream
vts workbook/formulaone wav audio/x-wav
wax audio/x-ms-wax wbmp image/vnd.wap.wbmp
web application/vnd.xara wi image/wavelet
wis application/x-InstallShield wm video/x-ms-wm
wma audio/x-ms-wma wmd application/x-ms-wmd
wmf application/x-msmetafile wml text/vnd.wap.wml
wmlc application/vnd.wap.wmlc wmls text/vnd.wap.wmlscript
wmlsc application/vnd.wap.wmlscriptc wmlscript text/vnd.wap.wmlscript
wmv audio/x-ms-wmv wmx video/x-ms-wmx
wmz application/x-ms-wmz wpng image/x-up-wpng
wpt x-lml/x-gps wri application/x-mswrite
wrl x-world/x-vrml wrz x-world/x-vrml
ws text/vnd.wap.wmlscript wsc application/vnd.wap.wmlscriptc
wv video/wavelet wvx video/x-ms-wvx
wxl application/x-wxl x-gzip application/x-gzip
xar application/vnd.xara xbm image/x-xbitmap
xdm application/x-xdma xdma application/x-xdma
xdw application/vnd.fujixerox.docuworks xht application/xhtml+xml
xhtm application/xhtml+xml xhtml application/xhtml+xml
xla application/vnd.ms-excel xlc application/vnd.ms-excel
xll application/x-excel xlm application/vnd.ms-excel
xls application/vnd.ms-excel xlt application/vnd.ms-excel
xlw application/vnd.ms-excel xm audio/x-mod
xml text/xml xmz audio/x-mod
xpi application/x-xpinstall xpm image/x-xpixmap
xsit text/xml xsl text/xml
xul text/xul xwd image/x-xwindowdump
xyz chemical/x-pdb yz1 application/x-yz1
z application/x-compress zac application/x-zaurus-zac
zip application/zip

关于汉字编码

关于汉字编码

  为进行信息交换,各汉字使用地区都制订了一系列汉字字符集标准。

  1、 GB2313字符集,收入汉字6763个,符号715个,总计7478个字符,这是大陆普遍使用的简体字符集。楷体-GB2313、仿宋-GB2313、华文行楷等市面上绝大多数字体支持显示这个字符集,亦是大多数输入法所采用的字符集。市面上绝大多数所谓的繁体字体,其实采用的是GB-2313字符集简体字的编码,用字体显示为繁体字,而不是直接用GBK字符集中繁体字的编码,错误百出。

  2、 BIG-5字符集,收入13060个繁体汉字,808个符号,总计13868个字符,目前普遍使用于台湾、香港等地区。台湾教育部标准宋体楷体等港台大多数字体支持这个字符集的显示。

  3、 GBK字符集,又称大字符集(GB=GuóBiāo国标,K=扩展),包含以上两种字符集汉字,收入21003个汉字,882个符号,共计21885个字符,包括了中日韩(CJK)统一汉字20902个、扩展A集(CJK Ext-A) 中的汉字52个。Windows 95\98简体中文版就带有这个GBK.txt文件。宋体、隶书、黑体、幼圆、华文中宋、华文细黑、华文楷体、标楷体(DFKai-SB)、Arial Unicode MS、MingLiU、PMingLiU等字体支持显示这个字符集。微软拼音输入法2003、全拼、紫光拼音等输入法,能够录入如镕镕炁夬喆嚞姤赟赟龑昳堃慜靕臹等GBK简繁体汉字。

  4、BIG-5 (繁体中文)与GB-2313 (简体中文),编码不相兼容,字符在不同的操作系统中便产生乱码。文本文字的简体与繁体(文字及编码)之间的转换,可用BabelPad、TextPro或Convertz之类的转码软件来解决。若是程序,Windows XP操作系统,可用Microsoft AppLocale Utility 1.0解决;Windows 2000的操作系统,大概只有用:中文之星、四通利方、南极星、金山快译之类的转码软件方能解决了。

  5、 GB18030字符集,包含GBK字符集、CJK Ext-A 全部6582个汉字,共计27533个汉字。宋体-18030、方正楷体(FZKai-Z03)、书同文楷体(MS Song)宋体(ht_cjk+)、香港华康标准宋体(DFSongStd)、华康香港标准楷体、CERG Chinese Font、韩国New Gulim,以及微软Windows Vista操作系统提供的宋黑楷仿宋等字体亦支持这个字符集的显示。Windows 98支持这个字符集,以下的字符集则不支持。手写输入法逍遥笔4.0版支持GB18030字符集及方正超大字符集汉字的录入。

  6、 方正超大字符集,包含GB18030字符集、CJK Ext-B中的36862个汉字,共计64395个汉字。宋体-方正超大字符集支持这个字符集的显示。Microsoft Office XP或2003简体中文版就自带有这个字体。Windows 2000的操作系统需安装超大字符集支持包“Surrogate更新”。

  7、 ISO/IEC 10646 / Unicode字符集,这是全球可以共享的编码字符集,两者相互兼融,涵盖了世界上主要语文的字符,其中包括简繁体汉字,计有:CJK统一汉字20902个,CJK Ext-A 6582个,Ext-B 42711个,共计70195个汉字。SimSun-ExtB(宋体)、MingLiU-ExtB(细明体)能显示全部Ext-B汉字。至今尚无单独一款字体能够显示全部70195个汉字,但可用海峰五笔、新概念五笔、仓颉输入法世纪版、新版的微软新注音、仓颉输入法 6.0 版(单码功能)等输入法录入。Ext-C还有2万多个汉字。详情请参阅香港中文大学网站、马来西亚仓颉之友网站、福建陈清钰个人网站。

  8、 汉字构形数据库2.3版,内含楷书字形60082个、小篆11100个、楚系简帛文字2627个、金文3459个、甲骨文177个、异体字12768组。可以安装该程序,亦可以解压后使用其中的字体文件,对于整理某些古代文献十分有用。

  如果超出了输入法所支持的字符集,就不能录入计算机。如果没有相应字体的支持,则显示为黑框、方框或空白。如果操作系统或应用软件不支持该字符集,则显示为问号(一个或两个)。在网页上亦存在同样的情况。

关于Unicode

  由于各国国家标准字集所收的汉字字数、常用字的差异,虽然象中国两岸GB/BIG5字集常用字基本类似,转换后阅读并不成问题,但是这种编码转换的混乱关系,对文字交流始终是一种障碍。因此相关国家的标准化组织和文字工作者经过共同努力,终于在93年完成了包含中日韩(CJK)汉字的Unicode 汉字标准ISO 10646.1。 Unicode是完全双字节表示的多国文字编码体系,编码空间0x0000-0xFFFF。 ISO 10646.1汉字标准使用编码0x4E00-9FA5,共包含20902个汉字。其中: 大陆(S)提出的汉字17124个,台湾(T)提出的汉字17258个; S与T的并集,即中国(C)提出的汉字为20158个。 日本(J)提出的汉字为12157个,中国未提出的690个(Ja); 韩国(K)提出的汉字为7477个,其中中国未提出的90个(Ka); Ja与Ka并集共744字。 支持Unicode编码的相关电脑系统软件,如Unix, Win95已有推出,但是由于Unicode的ASCII码是用双字节编码(即一般电脑系统中的单字节ASCII码前加 0x00),同时其汉字编码与各国的现有编码也不兼容,造成现有的软件和数据不能直接使用,所以目前完全使用Unicode软件系统的用户并不多,大多数只将它此作为一个国际语言编码标准来使用。

原文:汉字简介

修改Thunderbird Mbox文件,找回丢失邮件

今天周六,起了个早,吃了早饭,沏上茶,一边洗衣服,一遍happy的看邮件。
邮件积攒的太多,于是操作就太快,结果,不知道为什么,一片邮件就消失了。

重要提示:
以下所有操作的前提是:进行完全备份

于是,尝试了重建所在文件夹的.msf索引文件,有两种方式:
1、在文件夹上,右击-》属性-》修复文件夹
2、关闭thunderbird,到邮箱路径下,删掉文件夹的.msf文件,重新打开Thunderbird
然后发现,只找回一部分邮件来。

这可不行,好多邮件很重要,于是,进行了大还原:
关闭Thunderbird,将global-messages-db.sqlite命名为global-messages-db.sqlite.bak,重启Thunderbird。
还是不行~~
哭的心都有了

好吧,找工具~~
尝试了ZMail和Advanced Media Recovery,测试证明,根本不好用~~

那只好找资料,自己开搞了。
Thunderbird的一个最底层邮件文件夹,由两部分组成,
没有后缀的MBox文件,和有后缀的.msf索引文件。

MBox就是邮件和附件的全部了,经过摸索,发现有以下规律
1、MBox可以用靠谱的文本编辑工具进行编辑,用notepad的同学们,您就省省吧
2、每一封邮件都是一段MIME格式的文本,每封邮件以如下格式开始,直到下一个”From – “结束

From - Thu Dec 19 01:26:18 2013
X-Account-Key: account4
X-UIDL: ZC0418-TJAs6xVgg1PigBtJ_pc_a3c
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
X-Mozilla-Keys:                                                                                 
X-QQ-SSF: 00410000000000F0
X-QQ-BUSINESS-ORIGIN: 2
X-Originating-IP: 112.65.5.74
X-QQ-STYLE: 
X-QQ-mid: bizmail35t1387361723t6111701
From: "=?utf-8?B?5pyx6I6J6Imz?=" <xxx@xxx.com>
To: "=?utf-8?B?6auY5pmX?=" <xxx@xxx.com>

3、邮件根据编码不同,主要有gb2312,utf-8和BASE64编码三种
4、附件以MIME方式存储在邮件下面,如:

MIME-Version: 1.0
Content-Type: multipart/related;
	boundary="----=_NextPart_000_0007_01CE78E0.0A87C340"
...

5、两份邮件之间,没有关联关系,可以随便修改顺序,可以随便剪切复制粘贴,但要保证每一封邮件的完整性
6、邮件的状态,由以下两个标志位指定

module Mbox
  #X-Mozilla-Status
  #Message has been read.
  MSG_FLAG_READ=0x0001
  #A reply has been successfully sent.
  MSG_FLAG_REPLIED=0x0002
  #The user has flagged this message.
  MSG_FLAG_MARKED=0x0004
  #Already gone (when folder not compacted). Since actually removing a message from a folder is a semi-expensive operation, we tend to delay it; messages with this bit set will be removed the next time folder compaction is done. Once this bit is set, it never gets un-set.
  MSG_FLAG_EXPUNGED=0x0008
  #Whether subject has “Re:” on the front. The folder summary uniquifies all of the strings in it, and to help this, any string which begins with “Re:” has that stripped first. This bit is then set, so that when presenting the message, we know to put it back (since the “Re:” is not itself stored in the file).
  MSG_FLAG_HAS_RE=0x0010
  #Whether the children of this sub-thread are folded in the display.
  MSG_FLAG_ELIDED=0x0020
  #DB has offline news or imap article.
  MSG_FLAG_OFFLINE=0x0080
  #If set, this thread is watched.
  MSG_FLAG_WATCHED=0x0100
  #If set, then this message's sender has been authenticated when sending this msg. This means the POP3 server gave a positive answer to the XSENDER command. Since this command is no standard and only known by few servers, this flag is unmeaning in most cases.
  MSG_FLAG_SENDER_AUTHED=0x0200
  #If set, then this message's body contains not the whole message, and a link is available in the message to download the rest of it from the POP server. This can be only a few lines of the message (in case of size restriction for the download of messages) or nothing at all (in case of “Fetch headers only”)
  MSG_FLAG_PARTIAL=0x0400
  #If set, this message is queued for delivery. This only ever gets set on messages in the queue folder, but is used to protect against the case of other messages having made their way in there somehow – if some other program put a message in the queue, it won't be delivered later!
  MSG_FLAG_QUEUED=0x0800
  #This message has been forwarded.
  MSG_FLAG_FORWARDED=0x1000
  #These are used to remember the message priority in interal status flags.
  MSG_FLAG_PRIORITIES=0xE000

  
  #X-Mozilla-Status2
  #This message is new since the last time the folder was closed.
  MSG_FLAG2_NEW=0x00010000
  #If set, this thread is ignored.
  MSG_FLAG2_IGNORED=0x00040000
  #If set, this message is marked as deleted on the server. This only applies to messages on IMAP servers.
  MSG_FLAG2_IMAP_DELETED=0x00200000
  #This message required to send a MDN (Message Disposition Notification) to the sender of the message. For information about MDN see Wikipedia:Return receipt.
  MSG_FLAG2_MDN_REPORT_NEEDED=0x00400000
  #An MDN report message has been sent for this message. No more MDN report should be sent to the sender.
  MSG_FLAG2_MDN_REPORT_SENT=0x00800000
  #If set, this message is a template.
  MSG_FLAG2_TEMPLATE=0x01000000
  #These are used to store the message label.
  #label value
  #1 0x02000000
  #2 0x04000000
  #3 0x06000000
  #4 0x08000000
  #5 0x0A000000
  #6 0x0C000000
  #7 0x0E000000
  MSG_FLAG2_LABELS=0x0E000000
  #If set, this message has files attached to it.
  MSG_FLAG2_ATTACHMENT=0x10000000 
end

这样就好办了,写了个程序,查找每个mbox文件内的每个EMail,查看状态,找出状态错误的邮件:
PS:Ruby加起来学了没几天,哈哈哈

#!/usr/bin/ruby

class EnumFiles
  def enumFiles(folderPath)
    #枚举文件
    files = Dir.glob(folderPath+"*")
    return files
  end
  
  def enumFilesAll(folderPath)
    #枚举文件
    files = Dir.glob(folderPath+"**/*")
    return files
  end
end
#!/usr/bin/ruby

class ReadMbox
  def readLine(filePath)
    if File.exist?(filePath)
      f = File.open(filePath,"r+")
      lines=f.readlines
      return lines
    else
      puts(filePath + " does not exist")
    end
  end
  
  def readMsgNum(filePath,rootPath)
    msgNum=0
    msgErr=0
    bError=false
    
    if File.exist?(filePath)
          f = File.open(filePath,"r+")
          f.each{|l|
            if(l[0..6]=="From - ")
              msgNum=msgNum+1
              bError=false
            end
            
            if(l[0..17]=="X-Mozilla-Status: ") && (!bError)
              flag = l[18..21].to_i(16)
              if(flag & 0x0008 > 0)
                puts("]>"+l)
                msgErr=msgErr+1
                bError=true
              end
            end
      
            if(l[0..18]=="X-Mozilla-Status2: ") && (!bError)
              flag2 = l[19..26].to_i(16)
              if(flag2 & 0x00040000 > 0)
                puts("]>"+l)
                msgErr=msgErr+1
                bError=true
              end
            end
          }
    end
          
    puts(filePath.gsub(rootPath,"")+" EmailNum=\t"+msgNum.to_s()+"\terrNum=\t"+msgErr.to_s())
  end
end
#!/usr/bin/ruby

require "./EnumFiles.rb"
require "./ReadMbox.rb"

rootPath="PAHT/TO/MAIL/

files = EnumFiles.new().enumFilesAll(rootPath)
#puts files

mbox = ReadMbox.new()

files.each do |f|
  if(!File.directory?(f)) && (!(File.extname(f).length>0))
    mbox.readMsgNum(f,rootPath)
  end
end

最后,找到文件,发现并不是很多只有5个,就懒得写程序了,手动剪切到回收站,将标志位置为正常,刷新回收站索引,然后一切就太平啦

X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000

后记:
其实Thunderbird在删除邮件时(从回收站删除),为提高效率,并不一定会真的将邮件删掉,而很可能只是打上一个标记。

这样,其实只要用一个靠谱的编辑器,比如VIM、PSPad等,就可以很方便的定位到你需要的邮件,然后就可以进行备份和还原啦。

参考:
全局还原索引文件
官方推荐的编辑工具列表
标志位说明
标志位源码

存储单位

Kilobyte〈KB〉=1024 Bytes
Megabyte〈MB〉=1024 Kilobytes
Gigabyte〈GB〉=1024 Megabytes
Terabyte〈TB〉=1024 Gigabytes
Petabyte〈PB〉=1024 Terabytes
Exabyte〈EB〉 =1024 Petabyte,
Zettabyte〈ZB〉=1024 Exabyte
Yottabyte〈YB〉=1024 Zettabyte

1KB相当于一则短篇故事的文字内容;
1MB相当于阅读一则短篇小说的文字内容;
1GB相当于贝多芬第五章交响曲的乐谱内容;
1TB相当于一家大型医院中所有X光图片资讯量;
1PB相当于50%的全美学术研究图书馆藏书资讯内容;
5EB相当于至今全世界人类所讲过的话语;
1ZB如同全世界海滩的沙子总和;
1YB相当于7000位人类体内的微细胞总和;

HL7 V2消息类型

ACK Acknowledgment 消息回复
ADR^A19 Patient Query – Response
ADT^A04 Register a patient 病人注册
ADT^A08 Update patient information 病人信息更新
ADT^A05 Pre-admit a patient
ADT^A06 Change an outpatient to an inpatient 门诊转住院
ADT^A07 Change an inpatient to an outpatient 住院转门诊
ADT^A01 Admit/visit notification 查房开始
ADT^A03 Discharge/end visit 查房结束
ADT^A02 Transfer a patient 病人转院
ADT^A28 Add person information
ADT^A13 Cancel discharge/end visit
ADT^A14 Pending admit
ADT^A31 Update person information
ADT^A11 Cancel admit/visit notification
ADT^A10 Patient arriving – tracking 病人到达
ADT^A09 Patient departing – tracking 病人出发
ADT^A12 Cancel transfer 取消转院
ADT^A15 Pending transfer
ADT^A16 Pending discharge
ADT^A17 Swap patients
ADT^A18 Merge patient information (for backward compatibility only) 合并病人信息(低版本兼容)
ADT^A20 Bed status update
ADT^A32 Cancel patient arriving – tracking 取消病人到达
ADT^A33 Cancel patient departing – tracking 取消病人出发
ADT^A27 Cancel pending admit
ADT^A25 Cancel pending discharge
ADT^A26 Cancel pending transfer
ADT^A23 Delete a patient record 删除病人记录
ADT^A29 Delete person information 删除病人信息
ADT^A21 Patient goes on a “leave of absence”
ADT^A22 Patient returns from a “leave of absence”
ADT^A24 Link patient information 管理病人信息
ADT^A35 Merge patient information – account number only (for backward compati
ADT^A36 Merge patient information – patient ID and account number (for backwa
ADT^A34 Merge patient information – patient ID only (for backward compatibili
ADT^A30 Merge person information (for backward compatibility only)
ADT^A48 Change alternate patient ID (for backward compatibility only)
ADT^A49 Change patient account number
ADT^A46 Change patient ID (for backward compatibility only)
ADT^A47 Change patient identifier list
ADT^A37 Unlink patient information
ADT^A38 Cancel pre-admit
ADT^A41 Merge account – patient account number
ADT^A40 Merge patient – patient identifier list
ADT^A39 Merge person – patient ID (for backward compatibility only)
ADT^A42 Merge visit – visit number
ADT^A44 Move account information – patient account number
ADT^A43 Move patient information – patient identifier list
ADT^A45 Move visit information – visit number
ADT^A51 Change alternate visit ID
ADT^A50 Change visit number
ADT^A52 Cancel leave of absence for a patient
ADT^A53 Cancel patient returns from a leave of absence
ADT^A55 Cancel change attending doctor
ADT^A54 Change attending doctor
ADT^A60 Update allergy information
ADT^A62 Cancel change consulting doctor
ADT^A61 Change consulting doctor
BAR^P01 Add patient accounts
BAR^P02 Purge patient accounts
BAR^P05 Update account
BAR^P06 End account
BAR^P10 Transmit Ambulatory Payment Classification(APC)
BAR^P12 Update Diagnosis/Procedure
BPS^O29 Blood product dispense status
BRP^O30 Blood product dispense status acknowledgment
BRT^O32 Blood product transfusion/disposition acknowledgment
BTS^O31 Blood product transfusion/disposition
CRM^C02 Cancel a patient registration on clinical trial (for clerical mistakes onl
CRM^C06 Cancel patient entering a phase (clerical mistake)
CRM^C07 Correct/update phase information
CRM^C03 Correct/update registration information
CRM^C05 Patient enters phase of clinical trial
CRM^C04 Patient has gone off a clinical trial
CRM^C08 Patient has gone off phase of clinical trial
CRM^C01 Register a patient on a clinical trial
CSU^C09 Automated time intervals for reporting, like monthly
CSU^C11 Patient completes a phase of the clinical trial
CSU^C10 Patient completes the clinical trial
CSU^C12 Update/correction of patient order/result information
DFT^P03 Post detail financial transaction
DOC^T12 Document Query – Response
DFT^P11 Post Detail Financial Transactions – New
EAC^U07 Automated equipment command
EAN^U09 Automated equipment notification
EAR^U08 Automated equipment response
EHC^E01 Submit HealthCare Services Invoice
ESR^U02 Automated equipment status request
ESU^U01 Automated equipment status update
INR^U06 Automated equipment inventory request
INU^U05 Automated equipment inventory update
LSR^U13 Automated equipment log/service request
LSU^U12 Automated equipment log/service update
MDM^T05 Document addendum notification
MDM^T11 Document cancel notification
MDM^T07 Document edit notification
MDM^T09 Document replacement notification
MDM^T03 Document status change notification
MDM^T01 Original document notification
MDM^T06 Document addendum notification and content
MDM^T08 Document edit notification and content
MDM^T10 Document replacement notification and content
MDM^T04 Document status change notification and content
MDM^T02 Original document notification and content
MFK^M01 Master File – Not Otherwise Specified (for Backward Compatibility Only) – Response
MFN^M01 Master file not otherwise specified (for backward compatibility only)
MFN^M02 Master file – staff practitioner
MFN^M03 Master file – test/observation (for backward compatibility only)
MFN^M04 Master files charge description
MFN^M05 Patient location master file
MFN^M06 Clinical study with phases and schedules master file
MFN^M07 Clinical study without phases but with schedules master file
MFN^M08 Test/observation (numeric) master file
MFN^M09 Test/observation (categorical) master file
MFN^M10 Test /observation batteries master file
MFN^M11 Test/calculated observations master file
MFN^M12 Master file notification message
MFN^M13 Master file notification – general
MFN^M15 Inventory item master file notification
MFN^M14 Master file notification – site defined
MFN^Znn
MFR^M01
NMD^N02 Application management data message (unsolicited)
NMQ^N01 Application management query message
NMR^N01 Application Management Query Message – Response
OMB^O27 Blood product order
OMD^O03 Diet order
OMG^O19 General clinical order
OMI^O23 Imaging order
OML^O21 Laboratory order
OML^O33 Laboratory order for multiple orders related to a single specimen
OML^O35 Laboratory order for multiple orders related to a single container of a sp
OMN^O07 Non-stock requisition order
OMP^O09 Pharmacy/treatment order
OMS^O05 Stock requisition order
ORB^O28 Blood product order acknowledgment
ORD^O04 Diet order acknowledgment
ORF^R04 Response to query; transmission of requested observation
ORG^O20 General clinical order response
ORI^O24 Imaging order response message to any OMI
ORL^O22 General laboratory order response message to any OML
ORL^O34 Laboratory order response message to a multiple order related to single sp
ORL^O36 Laboratory order response message to a single container of a specimen OML
ORM^O01 Order message (also RDE, RDS, RGV, RAS)
ORN^O08 Non-stock requisition acknowledgment
ORP^O10 Pharmacy/treatment order acknowledgment
ORR^O02 Order response (also RRE, RRD, RRG, RRA)
ORS^O06 Stock requisition acknowledgment
ORU^R01 Unsolicited transmission of an observation message
ORU^R31 Unsolicited New Point-Of-Care Observation Message – Search For An Order
ORU^R30 Unsolicited Point-Of-Care Observation Message Without Existing Order – Pla
ORU^R32 Unsolicited Pre-Ordered Point-Of-Care Observation
OSQ^Q06 Query for order status
OSR^Q06 Query For Order Status – Response
OUL^R21 Unsolicited laboratory observation
OUL^R22 Unsolicited Specimen Oriented Observation Message
OUL^R23 Unsolicited Specimen Container Oriented Observation Message
OUL^R24 Unsolicited Order Oriented Observation Message
PEX^P07 Unsolicited initial individual product experience report
PEX^P08 Unsolicited update individual product experience report
PGL^PC6 PC/ goal add
PGL^PC8 PC/ goal delete
PGL^PC7 PC/ goal update
PMU^B01 Add personnel record
PMU^B02 Update personnel record
PMU^B03 Delete personnel re cord
PMU^B04 Active practicing person
PMU^B05 Deactivate practicing person
PMU^B06 Terminate practicing person
PMU^B07 Grant Certificate/Permission
PMU^B08 Revoke Certificate/Permission
PPG^PCG PC/ pathway (goal-oriented) add
PPG^PCJ PC/ pathway (goal-oriented) delete
PPG^PCH PC/ pathway (goal-oriented) update
PPP^PCB PC/ pathway (problem-oriented) add
PPP^PCD PC/ pathway (problem-oriented) delete
PPP^PCC PC/ pathway (problem-oriented) update
PPR^PC1 PC/ problem add
PPR^PC3 PC/ problem delete
PPR^PC2 PC/ problem update
PPT^PCL PC/ pathway (goal-oriented) query response
PPV^PCA PC/ goal response
PRR^PC5 PC/ problem response
PTR^PCF PC/ pathway (problem-oriented) query response
QBP^Z81 Dispense History
QBP^Z87 Dispense Information
QBP^Z89 Lab Results History
QBP^Z85 Pharmacy Information Comprehensive
QBP^Q11 Query by parameter requesting an RSP segment pattern response
QBP^Q31 QBP Query Dispense history
QBP^Q13 Query by parameter requesting an RTB – tabular response
QBP^Z93 Tabular Dispense History
QBP^Z95 Tabular Dispense History
QBP^Z75 Tabular Patient List
QBP^Z77 Tabular Patient List
QBP^Z91 Who Am I
QBP^Z99 Who Am I
QBP^Z97 Dispense History
QBP^Z79 Dispense Information
QBP^Q15 Query by parameter requesting an RDY display response
QBP^Q24 Allocate identifiers
QBP^Q22 Find candidates
QBP^Q23 Get corresponding identifiers
QBP^Q21 Get person demographics
QBP^Q25 Personnel Information by Segment Query
QBP^Z73 Information about Phone Calls
QCN^J01 Cancel query/acknowledge message
QSX^J02 Cancel subscription/acknowledge message
QRY^A19 Patient query
QRY^PC9 PC/ goal query
QRY^PCK PC/ pathway (goal-oriented) query
QRY^PCE PC/ pathway (problem-oriented) query
QRY^PC4 PC/ problem query
QRY^Q27 Pharmacy/treatment administration information
QRY^Q28 Pharmacy/treatment dispense information
QRY^Q29 Pharmacy/treatment encoded order information
QRY^Q30 Pharmacy/treatment dose information
QRY^Q26 Pharmacy/treatment order response
QRY^R02 Query for results of observation
QRY^T12 Document query
QSB^Z83 ORU Subscription
QSB^Q16 Create subscription
QVR^Q17 Query for previous events
RAR^RAR Pharmacy/Treatment Administration Information
RAS^O17 Pharmacy/treatment administration
RCL^I06 Request/Receipt Of Clinical Data Listing – Response
RDE^O11 Pharmacy/treatment encoded order
RDE^O25 Pharmacy/treatment refill authorization request
RDR^RDR Pharmacy/Treatment Dispense Information – Response
RDS^O13 Pharmacy/treatment dispense
RDY^Z98 Dispense History (Response)
RDY^K15 Display response in response to QBP^Q15
REF^I12 Patient referral
RER^RER Pharmacy/Treatment Encoded Order Information
RGR^RGR Pharmacy/Treatment Dose Information
RGV^O15 Pharmacy/treatment give
ROR^ROR Pharmacy prescription order query response
RPA^I08 Request For Treatment Authorization Information – Response
RPI^I01 Request For Insurance Information – Response
RPI^I04 Request For Patient Demographic Data – Response
RPL^I02 Request/Receipt Of Patient Selection Display List – Response
RPR^I03 Request/Receipt Of Patient Selection List – Response
RRI^I12 Patient Referral – Response
RQA^I11 Request for cancellation of an authorization
RQA^I09 Request for modification to an authorization
RQA^I10 Request for resubmission of an authorization
RQA^I08 Request for treatment authorization information
RQC^I05 Request for patient clinical information
RQC^I06 Request/receipt of clinical data listing
PIN^I07 Unsolicited insurance information
RQI^I01 Request for insurance information
RQI^I02 Request/receipt of patient selection display list
RQI^I03 Request/receipt of patient selection list
RQP^I04 Request for patient demographic data
RRA^O18 Pharmacy/treatment administration acknowledgment
RRD^O14 Pharmacy/treatment dispense acknowledgment
RRE^O12 Pharmacy/treatment encoded order acknowledgment
RRE^O26 Pharmacy/Treatment Refill Authorization Acknowledgement
RRG^O16 Pharmacy/treatment give acknowledgment
RDY^Z80 Dispense Information (Response)
RSP^K11 Segment pattern response in response to QBP^Q11
RSP^Z84 Who Am I (Response)
RSP^K22 Find candidates response
RSP^K21 Get person demographics response
RSP^K24 Allocate identifiers response
RSP^K23 Get corresponding identifiers response
RSP^K25 Personnel Information by Segment Response
RSP^K31 Dispense History Response
RSP^Z82 Dispense History (Response)
RSP^Z86 Pharmacy Information Comprehensive (Response)
RSP^Z88 Dispense Information (Response)
RSP^Z90 Lab Results History (Response)
RTB^K13 Tabular response in response to QBP^Q13
RTB^Z94 Tabular Dispense History (Response)
RTB^Z96 Tabular Dispense History (Response)
RTB^Z76 Tabular Patient List (Response)
RTB^Z78 Tabular Patient List (Response)
RTB^Z92 Who Am I (Response)
RTB^Z74 Information about Phone Calls (Response)
SIU^S18 Notification of addition of service/resource on appointment
SIU^S15 Notification of appointment cancellation
SIU^S17 Notification of appointment deletion
SIU^S16 Notification of appointment discontinuation
SIU^S14 Notification of appointment modification
SIU^S13 Notification of appointment rescheduling
SIU^S23 Notification of blocked schedule time slot(s)
SIU^S20 Notification of cancellation of service/resource on appointment
SIU^S22 Notification of deletion of service/resource on appointment
SIU^S21 Notification of discontinuation of service/resource on appointment
SIU^S19 Notification of modification of service/resource on appointment
SIU^S12 Notification of new appointment booking
SIU^S24 Notification of opened (“unblocked”) schedule time slot(s)
SIU^S26 SIU/ACK Notification that patient did not show up for schedule appointment
SQR^S25 Schedule Query Message And Responsem
SQM^S25 Schedule query message and response
SRM^S07 Request addition of service/resource on appointment
SRM^S04 Request appointment cancellation
SRM^S06 Request appointment deletion
SRM^S05 Request appointment discontinuation
SRM^S03 Request appointment modification
SRM^S02 Request appointment rescheduling
SRM^S09 Request cancellation of service/resource on appointment
SRM^S11 Request deletion of service/resource on appointment
SRM^S10 Request discontinuation of service/resource on appointment
SRM^S08 Request modification of service/resource on appointment
SRM^S01 Request new appointment booking
SRR^S01 Request New Appointment Booking – Response
SSR^U04 specimen status request
SSU^U03 Specimen status update
SUR^P09 Summary product experience report
TCR^U11 Automated equipment test code settings request
TCU^U10 Automated equipment test code settings update
VXQ^V01 Query for vaccination record
VXR^V03 Vaccination record response
VXU^V04 Unsolicited vaccination record update
VXX^V02 Response to vaccination query returning multiple PID matches

hl7 v2在socket通讯中应该注意的问题

1.hl7 v2在socket通讯时,是需要有起始及结束字符的
起始字符为0x0b
结束字符为0x1c 0x0d

2.正确处理换行
要将\r\n改为\r(0x0d)
单独的\n也替换为\r(0x0d)

3.同一socket收发信息,可以用msgid作为区分

4.因为utf-8的通用性及其编码规则比较适合网络传输,所以可以采用utf-8编码