source: WorldVistAEHR/trunk/r/RPC_BROKER-XWB/XWBTCPM2.m@ 1087

Last change on this file since 1087 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.2 KB
Line 
1XWBTCPM2 ;ISF/RWF - BROKER Other Service ;08/01/2006 7924986.008072
2 ;;1.1;RPC BROKER;**45**;Mar 28, 1997
3 Q
4OTH ;Check if some other special service.
5 S $ETRAP="D ERR^XWBTCPM2"
6 I XWB="~EAC~" G EAC
7 I XWB="~BSE~" G BSE
8 I XWB="~SVR~" G SVR
9 D LOG("Prefix not known: "_XWB)
10 Q
11 ;
12SVR ;Handle
13 Q
14EAC ;Enterprise Access
15 Q
16 ;
17BSE ;Broker Security Enhansment
18 D LOG("BSE msg")
19 N L,HDL,RET,XWBSBUF
20 S XWBSBUF="",RET=""
21 S L=$$BREAD^XWBRW(3) I L S HDL=$$BREAD^XWBRW(L)
22 ;Check IT
23 D GETVISIT^XUSBSE1(.RET,HDL)
24 D WRITE(RET),WBF
25 Q
26 ;
27ERR ;Error Trap
28 D ^%ZTER
29 G H2^XUSCLEAN
30 ;
31LOG(%) ;Link to logger
32 Q:'$G(XWBDEBUG)
33 D LOG^XWBTCPM(%)
34 Q
35 ;
36WRITE(M,F) ;Write
37 N L S L="" I '$G(F) S L=$E(1000+$L(M),2,4)
38 D WRITE^XWBRW(L_M)
39 Q
40WBF ;Buffer Flush
41 D WBF^XWBRW
42 Q
43 ;
44OPEN(P1,P2) ;Open the device and set the variables
45 D CALL^%ZISTCP(P1,P2) Q:POP
46 S XWBTDEV=IO
47 Q
48 ;
49CALLBSE(SERVER,PORT,TOKEN) ;Special Broker service
50 N XWBDEBUG,XWBOS,XWBRBUF,XWBSBUF,XWBT,XWBTIME,IO
51 N DEMOSTR,XWBTDEV,RET
52 S IO(0)=$P
53 D INIT^XWBTCPM,LOG("CALLBSE")
54 D OPEN(SERVER,PORT) I POP Q "Didn't open connection." Q
55 S XWBSBUF="",XWBRBUF=""
56 U XWBTDEV
57 D WRITE("~BSE~",1),WRITE(TOKEN),WBF^XWBRW
58 S X=$$BREAD^XWBRW(3),RET="No Response" I X S RET=$$BREAD^XWBRW(X)
59 D CLOSE^%ZISTCP,LOG("FINISH")
60 Q RET
Note: See TracBrowser for help on using the repository browser.