DIRECT(RET,LOC,RPC,RPCVER,P1,P2,P3,P4,P5,P6,P7,P8,P9,P10) |
Use of the DIRECT connect whether it is done through
DIRECT^XWB2HL7 or with DIRECT^HLMA is susceptible to encountering network
errors. This was first noticed with the Institution File Redesign patch and
the Integrated Billing patch(RX Copay). Susequently, HL7 issued patches
HL*1.6*76 and HL*1.6*77 to address these network errors and return the status
of failure back to the calling application. With the DIRECT connect, VistA
HL7 only tries to send the message once. If it encounters an network error
while attepting to send a message, it does not attempt to resend.
When using this API, you should check the returned value of subscript zero of
the first parameter. This parameter is passed by reference. For example, if
you made a call like D DIRECT^XWB2HL7(.MYRET,...
You should check the value of MYRET(0). If there was a problem with sending
the message or receiving a response, MYRET(0) will have a value of -1^error
message
The -1 is both MYRET and MYRET(0), so one can use:
I $P(MYRET(0),"^")=-1!(-1=+MYRET) S ERROR=1 Q
See code below:
DIRECT(RET,LOC,RPC,RPCVER,P1,P2,P3,P4,P5,P6,P7,P8,P9,P10) ;Call a
remote
RPC
N X,I,INX,N,XWBHL7,XWBPAR,XWBPCNT,XWBDVER,XWBESSO,XWBHDL,PMAX
N XWBMSG,XWBSEC,RPCIEN
;Protect caller from HL7
N HLMTIEN,HLDOM,HLECH,HLFS,HLINSTN,HLNEXT,HLNODE,HLPARAM,HLQ,HLQUIT
D SETUP(1) I $G(RET(1))'="" Q
;(procedurename, query tag, error return, destination, Parameter
array)
D DIRECT^XWB2HL7A("ZREMOTE RPC",XWBHDL,.XWBMSG,LOC,.XWBPAR)
I $P(XWBMSG,U,2) S RET(0)="-1^"_$P(XWBMSG,"^",3) Q
I 'HLMTIEN S RET(0)="-1^No Message returned" Q
D RETURN,RTNDATA^XWBDRPC(.RET,XWBHDL)
Q
|
VARIABLES |
TYPE |
VARIABLES DESCRIPTION |
RET |
Output |
This is the return value.
|
LOC |
Input |
This is the Institution name or VISN name or ien of
where to send the RPC call to.
|
RPC |
Input |
This is the name of the RPC to run on the remote
system.
|
RPCVER |
Input |
version number in Remote Procedure file. (optional)
|
P1 |
Input |
1st RPC paramater on remote system.
|
P2 |
Input |
2nd RPC paramater on remote system.
|
P3 |
Input |
3rd RPC paramater on remote system.
|
P4 |
Input |
4th RPC paramater on remote system.
|
P5 |
Input |
5th RPC paramater on remote system.
|
P6 |
Input |
6th RPC paramater on remote system.
|
P7 |
Input |
7th RPC paramater on remote system.
|
P8 |
Input |
8th RPC paramater on remote system.
|
P9 |
Input |
9th RPC paramater on remote system.
|
P10 |
Input |
10th RPC paramater on remote system.
|
|
EN1(RET,LOC,RPC,RPCVER,P1,P2,P3,P4,P5,P6,P7,P8,P9,P10) |
This entry point is used by CPRS Remote Data Views.
It places the HL7 message into the HL7 message queue for deferred transfer.
See the DIRECT entry for parameter descriptions. The return from this call is
a HANDLE that is used in the follow-up calls.
|
VARIABLES |
TYPE |
VARIABLES DESCRIPTION |
RET |
Output |
This variable is passed by reference. If RET(0) is
empty, then RET(1) will have some error text. Otherwise RET(0) will have the
HANDLE that is used in follow-up calls.
|
|
RPCCHK(RET,HDL) |
This entry point is used after a call to EN1^XWB2HL7
to check the status of the call. When it returns "1^Done" a call can be made
to RTNDATA^XWBDRPC to get the data. When it returns "-1^text" there is a
problem with the call.
|
VARIABLES |
TYPE |
VARIABLES DESCRIPTION |
HDL |
Input |
This is the Handle that was returned from the
EN1^XWB2HL7 call.
|
|