文档库 最新最全的文档下载
当前位置:文档库 › PJ3定点医疗机构门诊业务API嵌入式接口技术方案

PJ3定点医疗机构门诊业务API嵌入式接口技术方案

PJ3定点医疗机构门诊业务API嵌入式接口技术方案
PJ3定点医疗机构门诊业务API嵌入式接口技术方案

广州市医疗保险业务信息系统二期工程建设

公务员子系统项目(Pj3)

定点医疗机构门诊门慢API接口技术方案

状态:草稿标识号:PJ3-05-0004

评审当前版本: 1.0

初始版前一版本:

修订版发布日期:2007-01-08

广州市劳动保障信息中心

广州市医疗保险管理服务中心

湖南创智和宇信息系统有限公司

目录

1运行环境说明 (1)

2函数功能 (1)

2.1函数说明 (1)

2.1.1 long newinterface() (1)

2.1.2long newinterfacewithinit(char *Addr, int Port, char *Servlet) (1)

2.1.3long init(Interface *p_inter, char *Addr, int Port, char *Servlet) (1)

2.1.4 destoryinterface(Interface *p_inter) (1)

2.1.5 long start(Interface *p_inter, char *FUNC_ID) (2)

2.1.6 long put(Interface *p_inter, long row, char *p_name, char *p_value) (2)

2.1.7 long putcol(Interface *p_inter, char * p_name, char *p_value) (2)

2.1.8 long run(Interface *p_inter) (2)

2.1.9 long setresultset(Interface *p_inter, char * result_name) (2)

2.1.10 int nextrow(Interface *p_inter) (3)

2.1.11 int prevrow(Interface *p_inter) (3)

2.1.12 int firstrow(Interface *p_inter) (3)

2.1.13 int lastrow(Interface *p_inter) (3)

2.1.14 int getbyname(Interface *p_inter, char *p_name, void *p_value) (3)

2.1.15 int getbyindex(Interface *p_inter, int index, void *p_name , void *p_value) (4)

2.1.16 long getmessage(Interface *p_inter, char *err) (4)

2.1.17 long getexception(Interface *p_inter, char *exception) (4)

2.1.18 long getresultnamebyindex(Interface *p_inter, int index, char *resultname) (4)

2.1.19 long getrowcount(Interface *p_inter) (4)

2.1.20 long set_ic_commport(Interface *p_inter, int comm) (5)

2.1.21 long encode64(char *pSrc, int nSize, char *pDest) (5)

2.1.22 long decode64(char *pSrc, int nSize, char *pDest) (5)

2.1.23 long encodesize( int nSize) (5)

2.1.24 long decodesize( int nSize) (5)

2.1.25 long decode64_tofile(char *pSrc, int nSize, char *filename) (5)

2.1.26 int setdebug(Interface *pinter,integer flag,char * direct) (6)

2.2函数调用说明 (6)

2.2.1 接口函数调用顺序 (6)

2.2.2 接口函数调用时指针的用法说明 (7)

2.2.3 接口函数调用时数据类型的说明 (7)

2.3程序中接口函数定义 (7)

2.3.1 在PB中定义函数程序 (7)

2.3.2 在Delphi中定义函数程序 (8)

2.4函数调用样例 (10)

2.4.1 在PB中调用接口函数程序 (10)

2.4.2 在Delphi中调用接口函数程序 (11)

2.4.3 在VB中调用接口函数程序 (12)

3功能编号及功能描述 (13)

3.1系统(0) (13)

3.1.1 登录到前置服务器(0) (13)

3.2门诊业务 (14)

3.2.1 门诊挂号登记 (14)

3.2.2 门诊收费 (20)

3.2.3 门诊退费 (26)

3.2.4 取消门诊业务(BIZH131105) (34)

3.3工伤门诊 (35)

3.3.1 工伤门诊挂号登记 (35)

3.3.2 工伤门诊收费 (40)

3.3.3 工伤门诊退费 (45)

3.3.4 取消工伤门诊业务(BIZH131105) (54)

3.4生育门诊 (54)

3.4.1 生育门诊挂号登记 (54)

3.4.2 生育门诊收费 (59)

3.4.3 生育门诊退费 (65)

3.4.4 取消生育门诊业务(BIZH131105) (74)

3.5门诊慢性病业务 (74)

3.5.1 3.5.1 门诊慢性病登记 (74)

3.5.2 门诊慢性病收费 (79)

3.5.3 门诊慢性病退费 (84)

3.5.4 取消门诊慢性病业务(BIZH131105) (92)

3.5.5 根据门慢申请序号获取门诊慢性病申请信息(BIZH120101) (92)

3.6公用功能 (93)

3.6.1 读IC卡(BIZH200900) (93)

3.6.2 提取计算结果(BIZH000106) (94)

3.6.3 提取门诊结算单(BIZH200102) (95)

3.6.4 提取门慢结算单(BIZH200101) (97)

4主要业务流程描述 (101)

4.1门诊业务流程(普通门诊、工伤门诊、生育门诊) (101)

5业务功能调用描述 (102)

5.1普通门诊调用流程(普通门诊、工伤门诊、生育门诊)

读IC 卡(BIZH200900)

获取人员信息(BIZC131001)

费用结算(BIZH131104)

收费收据打印(BIZH000106)iccardno indi_id idcard

indi_id last_balance

serial_no

普通门诊登记流程图

获取业务信息(BIZH131102)

indi_id serial_no

普通门诊收费流程图

serial_no serial_fee

读IC 卡(BIZH200900)

iccardno indi_id idcard

费用结算(BIZH131104)

收费收据打印(BIZH000106)

获取业务信息(BIZH131102)

indi_id serial_no

普通门诊退费流程图

serial_no serial_fee

获取业务信息(BIZH131102)

取消门诊业务(BIZH131105)

indi_id 取消门诊流程图

serial_no

读IC 卡(BIZH200900)

读IC 卡(BIZH200900)

iccardno indi_id idcard

iccardno indi_id idcard

费用结算(BIZH131104)

收费收据打印(BIZH000106)

(103)

5.2

门诊慢性病调用流程 (104)

6附录 (106)

6.1biz_type-业务类型对照表 (106)

6.2treatment_type——待遇类别对照表 (106)

6.3fund_id-基金类别对照表 (106)

6.4medi_item_type-药品项目类型对照表 (107)

6.5stat_type——费用统计类别 (107)

6.6staple_flag-药品性质类型对照表 (108)

6.7office_grade-公务员级别对照表 (108)

1运行环境说明

本接口采用VC编写,它心须在以下软件的支持下运行:

●Win98第二版以上

●IE5.5(允许使用cookie)

●MFC4.2

●MSXML Parser 3

2函数功能

2.1 函数说明

2.1.1long newinterface()

该函数建立一个新的接口实例,但这个函数没有初始化接口,必须再调用init函数初始化接口,此函数返回接口指针p_inter,它将作为其他函数入口参数。

2.1.2long newinterfacewithinit(char *Addr, int Port, char *Servlet)

该函数建立一个新的接口实例并将接口初始化,不需要再调用init函数。参数Addr 为应用服务器IP地址,Port为应用服务器端口号,Servlet为应用服务器入口Servlet 的名称,此函数返回接口指针p_inter,它将作为其他函数入口参数。

2.1.3long init(Interface *p_inter, char *Addr, int Port, char *Servlet)

初始化接口。参数p_inter为函数newinterface()或者newinterfacewithinit的返回值,参数Addr为应用服务器IP地址,Port为应用服务器端口号,Servlet为应用服务器入口Servlet的名称。返回-1表示没有Start成功,返回1表示调用成功。

2.1.4destoryinterface(Interface *p_inter)

从内存中释放接口的实例。

2.1.5long start(Interface *p_inter, char *FUNC_ID)

该函数为一次接口调用的开始,入口参数p_inter为函数newinterface()或者newinterfacewithinit的返回值,参数FUNC_ID为要进行的业务的功能号,在上一次Start的业务没有进行完之前不能进行下一次Start。返回-1表示没有Start成功,返回1表示调用成功。

2.1.6long put(Interface *p_inter, long row, char *p_name, char *p_value)

该函数用来在一次接口调用中传入业务所需的参数,参数p_inter为函数newinterface()或者newinterfacewithinit的返回值,row为多行参数的行号,p_name 为参数名称,以字符串小写表示,p_value为参数值,可以是字符串和数值型。返回-1表示没有Put成功,返回大于零表示Put成功,此值同时为当前的行号。如果入参有多个记录集,可用setresultset函数设置要传参数的记录集。

2.1.7long putcol(Interface *p_inter, char * p_name, char *p_value)

该函数用来在一次接口调用中传入业务所需的参数,参数p_inter为函数newinterface()或者newinterfacewithinit的返回值,在当前的行,p_name为参数名称,以字符串小写表示,p_value为参数值,可以是字符串和数值型。返回-1表示没有Put成功,返回大于零表示Put成功,此值同时为当前的行号。

2.1.8long run(Interface *p_inter)

该函数开始一次接口运行,直接将参数打包成送往Servlet,如果出错,将返回一个错误。返回-1表示没有Run成功,返回大于零的值为返回参数的记录条数。参数p_inter为函数newinterface()或者newinterfacewithinit的返回值。

2.1.9long setresultset(Interface *p_inter, char * result_name)

参数p_inter为函数newinterface()或者newinterfacewithinit的返回值。

当取结果时:

将当前记录集设置为由result_name指定的记录集,如果指的记录集不存在,则不会改变当前记录集。返回-1表示不成功,返回大于等于零的值为记录集记录数。

当设置入参时:

将当前记录集设置为由result_name指定的记录集,如果指的记录集存在,则改变当前记录集为存在的记录集,其中有个特殊的记录集Parameters, 它是个参数集,没有记录行,其他都有记录行,通过nextrow, prevrow, firstrow, lastrow。返回-1表示不成功,返回大于等于零的值为记录集记录数。

2.1.10int nextrow(Interface *p_inter)

跳到结果集后一行记录,返回-1表示调用不成功,返回大于零表示调用成功,同时此值为当前的行号。参数p_inter为函数newinterface()或者newinterfacewithinit 的返回值。

2.1.11int prevrow(Interface *p_inter)

跳到结果集前一行记录,返回-1表示调用不成功,返回大于零表示调用成功,同时此值为当前的行号。参数p_inter为函数newinterface()或者newinterfacewithinit 的返回值。

2.1.12int firstrow(Interface *p_inter)

跳到结果集第一行记录,返回-1表示调用不成功,返回1表示调用成功。参数p_inter为函数newinterface()或者newinterfacewithinit的返回值。

2.1.13int lastrow(Interface *p_inter)

跳到结果集最后一行记录,返回-1表示调用不成功,返回大于零表示为当前记录集记录数。参数p_inter为函数newinterface()或者newinterfacewithinit的返回值。

2.1.14int getbyname(Interface *p_inter, char *p_name, void *p_value)

该函数用来从接口取得返回的参数值。返回值小于零, 表示没有Get成功,返回大于零表示为当前记录集的第几条记录。用getmessage可以取得最近一次出错的错误信息。参数p_inter为函数newinterface()或者newinterfacewithinit的返回值。参数p_name为需要接口返回的字段名,需要用小写表示。参数p_value为接口返回的数值,必须在客户端分配足够大的内存,长度单位为sizeof(char)。

2.1.15int getbyindex(Interface *p_inter, int index, void *p_name , void *p_value)

该函数用来从接口取得返回的参数值。返回值小于零, 表示没有调用成功,返回值大于零, 表示调用成功。用getmessage可以取得最近一次出错的错误信息。参数p_inter为函数newinterface()或者newinterfacewithinit的返回值。参数年第亿升为需要接口返回的字段名的索引值。参数p_value为接口返回的数值,必须在客户端分配足够大的内存,长度单位为sizeof(char)。

2.1.16long getmessage(Interface *p_inter, char *err)

该函数在所有函数出错时,调用它,将得到一个错误信息,错误信息存放在err 指向的一片内存空间中,当入参err为空指针(NULL)时,将返回message的长度。调用此函数应保证err指向的内存有足够的长度存放返回的错误信息。函数返回值小于零时,函数执行不成功。参数p_inter为函数newinterface()或者newinterfacewithinit 的返回值。

2.1.17long getexception(Interface *p_inter, char *exception)

该函数在所有函数出错时,调用它,将得到一个详细的错误信息,通过exception 串返回,当exception为NULL时,将返回message的长度。函数返回值小于零时,函数执行不成功。参数p_inter为函数newinterface()或者newinterfacewithinit的返回值。

2.1.18long getresultnamebyindex(Interface *p_inter, int index, char *resultname)

该函数用来从接口取得第index的记录集名。返回值小于零, 表示没有成功,返回值大于零, 表示调用成功。用getmessage可以取得最近一次出错的错误信息。参数p_inter为函数newinterface()或者newinterfacewithinit的返回值。

2.1.19long getrowcount(Interface *p_inter)

该函数用来从接口取得返回的当前记录集的记录行数。返回值小于零, 表示没有Get成功,返回值大于零, 表示当前记录集的记录行数。参数p_inter为函数

newinterface()或者newinterfacewithinit的返回值。

2.1.20long set_ic_commport(Interface *p_inter, int comm)

该函数用来设置IC卡设备的串口号。返回值小于零, 表示没有成功,返回值大于等于零, 表示调用成功。参数p_inter为函数newinterface()或者newinterfacewithinit的返回值。参数comm为与IC卡连接的串口号,com1表示1,com2表示2…。

2.1.21long encode64(char *pSrc, int nSize, char *pDest)

该函数用来将数据按base64格式编码;返回值小于零, 表示没有成功,返回值大于等于零, 表示为编码后的字节数。参数pSrc为源数据,nSize为源数据长度,pDest 为编码后的数据。

2.1.22long decode64(char *pSrc, int nSize, char *pDest)

该函数用来将数据按base64格式解码;返回值小于零, 表示没有成功,返回值大于等于零, 表示为解码后的字节数。参数pSrc为源数据,nSize为源数据长度,pDest 为解码后的数据。

2.1.23long encodesize( int nSize)

该函数用来将数据按base64格式编码时,用源数据长度来获得编码后的数据长度;

返回值小于零, 表示没有成功,返回值大于等于零, 表示为编码后的字节数。参数nSize为源数据长度。

2.1.24long decodesize( int nSize)

该函数用来将数据按base64格式解码时,用源数据长度来获得解码后的数据长度;

返回值小于零, 表示没有成功,返回值大于等于零, 表示为解码后的字节数。参数nSize为源数据长度。

2.1.25long decode64_tofile(char *pSrc, int nSize, char *filename)

该函数用来将数据按base64格式解码,并将解码后的数据存到filename文件里;

返回值小于零, 表示没有成功,返回值大于等于零, 表示为解码后的字节数。参数pSrc

为源数据,nSize为源数据长度,filename为解码后的数据要保存的文件名。

2.1.26int setdebug(Interface *pinter,integer flag,char * direct)

该函数用来设置接口的运行模式,当flag为1时将产生调试信息并且写入指定目录direct下的日志文件中。返回值小于零, 表示没有成功,返回值大于等于零, 表示成功。参数pinter为函数newinterface()或者newinterfacewithinit的返回值,flag 为调试标志,0表示不作调试,其它为可调试,direct为存放调试信息日志文件的目录,注意此目录必须是存在的。

2.2 函数调用说明

2.2.1接口函数调用顺序

1.接口初始化调用newinterface()或者newinterfacewithinit,这二个函数

的区别在于,前者仅进行接口初始化,而后者还要建立与服务器的连接。

要注意另一个与初始化有关的函数init,它的作用是建立与服务器的连

接,它在二种情况下用,一个是用newinterface()初始化时,调用它建立

与服务器连接,而另一个是程序将要与二个服务器连接时,使用它,而不

必调destoryinterface后,重新初始化接口。

2.调用功能号0登录到前置服务器,不同的定点医疗机构使用不同的登陆工

号。

3.执行其他功能。

4.每个功能的执行顺序如下:

1)调start启动接口。

2)多次调put或者putcol将参数传入接口。

3)如果有记录集,调setresultset设置记录集名,多次调put或者putcol

将记录集的各域值传入接口。

4)调run将数据送入后台。

5)多次调get将后台传回的数据取回,有多行记录时用nexrow, prevrow,

firstrow, lastrow来移动行号。当返回的数据存在多个记录集时,可用

setresultset函数设置当前取数据的记录集。

2.2.2接口函数调用时指针的用法说明

在接口中有很多指针参数,这些参数在传入时,pb都可以用字符串来代替,但必须先赋值来定义其空间,delphi中可直接用指针,然后用StrAlloc或者StrNew来定义空间,但一定要用StrDispose来释放空间。

2.2.3接口函数调用时数据类型的说明

接口指针Interface *p_inter可以用long型变量替代。

接口能识别的数据类型都是字符串,因此在输入数据或是输出数据时候都必须转换成字符串,也就是说数值型和时间型的数据需要做字符串转换。时间的格式:"YYYY-MM-DD HH:MI:SS " (24小时);数值的格式:"########.## "。

2.3 程序中接口函数定义

2.3.1在PB中定义函数程序

FUNCTION long newinterface() LIBRARY "HG_interface.dll"

FUNCTION long init(long pint, string Addr, long port, string Servlet ) LIBRARY "HG_interface.dll"

FUNCTION long newinterfacewithinit(string Addr, long port, string Servlet ) LIBRARY "HG_interface.dll"

SUBROUTINE destoryinterface( long pint ) LIBRARY "HG_interface.dll"

FUNCTION long start( long pint, string id ) LIBRARY "HG_interface.dll"

FUNCTION long put( long pint, long row, string pname, string pvalue ) LIBRARY "HG_interface.dll"

FUNCTION long putcol( long pint, string pname, string pvalue ) LIBRARY "HG_interface.dll" FUNCTION long run( long pint ) LIBRARY "HG_interface.dll"

FUNCTION long runxml( long pint, string xml ) LIBRARY "HG_interface.dll"

FUNCTION long getxmlstr_t(long pint, ref string xml) LIBRARY "HG_interface.dll" FUNCTION long getxmlstr(long pint, ref string xml) LIBRARY "HG_interface.dll" FUNCTION long getbyname ( long pint,string pname, ref string pvalue ) LIBRARY "HG_interface.dll"

FUNCTION long getbyindex ( long pint,long index, ref string pvalue ) LIBRARY "HG_interface.dll"

FUNCTION Long getmessage ( long pint, ref string msg ) LIBRARY "HG_interface.dll" FUNCTION Long getexception ( long pint, ref string msg ) LIBRARY "HG_interface.dll"

FUNCTION long getrowcount(long pint) LIBRARY "HG_interface.dll"

FUNCTION int firstrow(long pint) LIBRARY "HG_interface.dll"

FUNCTION int nextrow(long pint) LIBRARY "HG_interface.dll"

FUNCTION int prevrow(long pint) LIBRARY "HG_interface.dll"

FUNCTION int lastrow(long pint) LIBRARY "HG_interface.dll"

FUNCTION int setresultset(long pint,string result_name) LIBRARY "HG_interface.dll" FUNCTION int setdebug(Long pint,integer flag,String direct) LIBRARY "HG_interface.dll" FUNCTION long set_ic_commport(long pint, int comm) LIBRARY "HG_interface.dll"

FUNCTION Long getcode ( long pint, ref string msg ) LIBRARY "HG_interface.dll" FUNCTION Long geterrtype ( long pint) LIBRARY "HG_interface.dll"

2.3.2在Delphi中定义函数程序

FUNCTION newinterface ( ):pointer; stdcall;external 'HG_interface.dll';

FUNCTION newinterfacewithinit (Addr:char *; port:integer; Servlet:char * ):Pointer; stdcall;external 'HG_interface.dll';

FUNCTION init(pint:Pointer;Addr:char *; port:integer; Servlet:char * ):integer; stdcall;external

'HG_interface.dll';

Procedure destoryinterface ( pint:Pointer ); stdcall;external 'HG_interface.dll';

FUNCTION start ( pint:Pointer; func_id:char * ):integer; stdcall;external 'HG_interface.dll';

FUNCTION put ( pint:Pointer; row:integer; pname:char *; pvalue:char * ):integer; stdcall;external

'HG_interface.dll';

FUNCTION putcol ( pint:Pointer; pname:char *; pvalue:char * ):integer; stdcall;external

'HG_interface.dll';

FUNCTION run ( pint:Pointer ):integer; stdcall;external 'HG_interface.dll';

FUNCTION getbyname ( pint:Pointer; pname:char *; {ref char *} pvalue:pchar):integer; stdcall;external 'HG_interface.dll';

FUNCTION getbyindex ( pint:Pointer; index:integer; {ref char *} pname:pchar; {ref char *}

pvalue:pchar ):integer; stdcall;external 'HG_interface.dll';

FUNCTION getmessage ( pint:Pointer; {ref char *} msg:pchar ):integer; stdcall;external

'HG_interface.dll';

FUNCTION getexception ( pint:Pointer; {ref char *} msg:pchar ):integer; stdcall;external

'HG_interface.dll';

FUNCTION getresultnamebyindex(pint:Pointer;ndex:integer; {ref char *} resultname:pchar ):integer;

stdcall;external 'HG_interface.dll';

FUNCTION getrowcount ( pint:Pointer ):integer; stdcall;external 'HG_interface.dll';

FUNCTION setresultset(pint:Pointer; result_set:char *):integer;stdcall;external 'HG_interface.dll';

FUNCTION nextrow(pint:Pointer):integer;stdcall;external 'HG_interface.dll';

FUNCTION firstrow(pint:Pointer):integer;stdcall;external 'HG_interface.dll';

FUNCTION lastrow(pint:Pointer):integer;stdcall;external 'HG_interface.dll';

FUNCTION prevrow(pint:Pointer):integer;stdcall;external 'HG_interface.dll';

FUNCTION set_ic_commport(pint:Pointer;comm:integer ):integer; stdcall;external 'HG_interface.dll'; 2.3.3在VB中定义函数程序

Public Declare Function newinterface Lib "HG_interface.dll" () As Long

Public Declare Function init Lib "HG_interface.dll" (ByVal pint As Long, ByVal addr As Char *, ByVal port As Long, ByVal servlet As Char *) As Long

Public Declare Function start Lib "HG_interface.dll" (ByVal pint As Long, ByVal func_id As Char *) As Long

Public Declare Function dataput Lib "HG_interface.dll" Alias "put" (ByVal pint As Long, ByVal row As Long, ByVal pname As Char *, ByVal pvalue As Char *) As Long

Public Declare Function run Lib "HG_interface.dll" (ByVal pint As Long) As Long

Public Declare Function setdebug Lib "HG_interface.dll" (ByVal pint As Long, ByVal flag As Integer, ByVal in_direct As Char *) As Long

Public Declare Function getbyname Lib "HG_interface.dll" (ByVal pint As Long, ByVal pname As Char *, ByVal pvalue As Char *) As Long

Public Declare Function getbyindex Lib "HG_interface.dll" (ByVal pint As Long, ByVal pindex As Long, ByVal pvalue As Char *) As Long

Public Declare Function getmessage Lib "HG_interface.dll" (ByVal pint As Long, ByVal msg As Char *) As Long

Public Declare Function getexception Lib "HG_interface.dll" (ByVal pint As Long, ByVal msg As Char *) As Long

Public Declare Sub destoryinterface Lib "HG_interface.dll" (ByVal pint As Long)

Public Declare Function firstrow Lib "HG_interface.dll" (ByVal pint As Long) As Integer

Public Declare Function nextrow Lib "HG_interface.dll" (ByVal pint As Long) As Integer

Public Declare Function prevrow Lib "HG_interface.dll" (ByVal pint As Long) As Integer

Public Declare Function lastrow Lib "HG_interface.dll" (ByVal pint As Long) As Integer

Public Declare Function setresultset Lib "HG_interface.dll" (ByVal pint As Long, ByVal result_name As Char *) As Integer

Public Declare Function set_ic_commport Lib "HG_interface.dll" (ByVal pint As Long, ByVal comm As Integer) As Long

2.4 函数调用样例

2.4.1在PB中调用接口函数程序

1.创建和初始化接口示例:

Long ll_pinterface

Long ll_port

String ls_server

String ls_servle

ls_server =”http://172.18.3.214/HygeiaWebService_GZ/web/ProcessAll.asmx”

ll_port = 7001

ls_servlet =”hygeia”

ll_pinterface = newinterface()

if IsNull(ll_pinterface) or ll_pinterface < 0 then

MessageBox(…错误?, …创建接口失败!?)

return -1

end if

ll_return = init(ll_pinterface, ls_server, ll_port, ls_servlet)

if ll_return<0 then

messagebox(…错误?, …初始化接口失败!)

return

end if

**前面创建和初始化接口两条语句也可以用以下一条语句实现:ll_pinterface = newinterfacewithinit(ls_server, ll_port, ls_servlet)

2.调用业务功能示例:

long ll_return

integer li_ret = -1 //函数返回值

ls_func_id = “BIZH131102”//功能号

ll_return = Start(gl_pinterface,ls_func_id)

if ll_return < 0 then return li_ret

//设置参数

if put(gl_pinterface, 1, "indi_id", is_indi_id) < 0 then return li_ret

if put(gl_pinterface, 1, "hospital_id", is_hospital_id) < 0 then return li_ret

if put(gl_pinterface, 1, "treatment_type", is_ treatment_type) < 0 then return li_ret

//运行

ll_return = run(gl_pinterface)

if ll_return < 0 then

ls_value = Space(1024)

getmessage(gl_pinterface, ref ls_value);

MessageBox(…错误?, ls_value)

return li_ret

end if

//获取结果

setresultset(gl_pinterface,”personinfo”)

li_size = getrowcount(gl_pinterface)

if ll_size > 1 then

//在此处处理多条人员信息的情况

elseif ll_size = 1 then

getbyname(gl_pinterface, “indi_id”, ref ls_ value)

end if

setresultset(gl_pinterface,”bizinfo”)

//逐行取出的数据

do

ls_ hospital_id= Space(100) //调用getbyname函数前, 必须每次分配足够大的内存

ls_biz_type = Space(50)

if getbyname(pinterface, “hospital_id_id”, ref ls_ value) < 0 then return li_ret

if getbyname(pinterface, “biz_type”, ref ls_biz_type) < 0 then return li_ret

loop while nextRow(pinterface) > 0

li_ret = 1

return li_ret

2.4.2在Delphi中调用接口函数程序

1.创建和初始化接口示例:

procedure test_dll();

var

ll_pinterface: Pointer;

ll_port: Pointer;

ls_server:pchar;

ls_servle:pchar;

ll_ret: int;

ls_p:pchar;

begin

ls_server: =”http://172.18.3.214/HygeiaWebService_GZ/web/ProcessAll.asmx”;

ll_port: = 7001;

ls_servlet: =”hygeia”;

il_pinterface :=newinterfacewithinit(ls_server, ll_port, ls_servlet);

//必须每次调用getbyname函数前分配足够大的内存

if (start(il_pinterface,”BIZH131102”)<0) then exit;

ls_p:=StrAlloc(1024);

if (run(ll_pinterface)<0) then

begin

getmessage(ll_pinterface, ls_p);

howmessage(ls_p);

exit;

end;

if (getbyname(l l_pinterface, “indi_id”, ls_p)>0) then exit;

nextrow(ll_pinterface);

if (getbyname(l l_pinterface, “indi_id”, ls_p)>0) then exit;

StrDispose(ls_p);

end;

2.4.3在VB中调用接口函数程序

Private Sub Command1_Click()

Dim pint As Long, ret As Long, port As Long

Dim addr As Char *, servlet As Char *, retval As Char *,func As Char*

Dim as_name As Char *, as_val As Char *

addr =”http://172.18.3.214/HygeiaWebService_GZ/web/ProcessAll.asmx”

port = 7001

servlet = "hygeia"

pint = newinterface()

ret = init(pint, addr, port, servlet)

func=”BIZH131102”

ret = start(pint, func)

If ret >= 0 Then

//设置参数

if put(pint, 1, "indi_id", is_indi_id) < 0 then return -1

if put(pint, 1, "hospital_id", is_hospital_id) < 0 then return -1

if put(pint, 1, "treatment_type", is_ treatment_type) < 0 then return -1

ret = run(pint)

retval = Space(100) //必须每次调用getbyname函数前分配足够大的内存

If ret > 0 Then

MsgBox "success"

ret = getbyname(pint, "name", retval)

Else

MsgBox "fail"

ret = getmessage(pint, retval)

MsgBox retval

End If

End If

destoryinterface (pint)

End Sub

3功能编号及功能描述

3.1 系统(0)

3.1.1登录到前置服务器(0)

功能编码:

?功能描述:

通过输入的医疗机构的登录号和登录密码,登录系统。系统启动后至少要成功登录前置服务器一次。

?入参定义:

序号入参入参说明最大长度是否可为空备注

1 login_id 登录ID 20 否使用所分配的定

点医疗机构编码

2 login_pas

sword 登录密码40 否默认密码:定点医

疗机构编码。

定点医疗机构的

系统管理员应在

系统启动后修改

密码。

?出参定义:

?返回值说明:

返回值=0,登录成功;

返回值<0,登录失败。

?返回数据集个数:

零个

?返回数据集名称及其内容:

无。

3.2 门诊业务

3.2.1门诊挂号登记

3.2.1.1 通过个人标识取人员信息(BIZH131001)

?业务功能编码:

BIZH131001

?业务功能描述:

普通门诊登记时,通过个人标识(电脑号、姓名、公民身份号、借记卡号)取参保人信

息、个人帐户信息及基金冻结信息。

?入参定义:

通过四种不同的入参均可获取病人个人信息、个人帐户信息及基金冻结信息。

1.通过参保人电脑号

序号入参入参说明最大长度是否可为空备注

1 indi_id个人电脑号20 否

2 hospital_id 医疗机构编码20 否

3 biz_type 业务类型 3 否

4 biz_date 业务时间否格式:yyyy-mm-dd

相关文档