XWBRMX ;OIFO-Oakland/REM - M2M Broker Server Request Mgr ;05/17/2002 17:41
;;1.1;RPC BROKER;**28,62**;Mar 21, 2002;Build 13
;Per VHA Directive 6402, this routine should not be modified
;
QUIT
;----------------------------------------------------------------------
;
; Request Manager -Parse XML Requests using SAX interface
;
;----------------------------------------------------------------------
;
EN(DOC,XWBOPT,XWBDATA) ; -- Parse XML uses SAX parser
N XWBCBK,XWBINVAL
SET XWBINVAL="#UNKNOWN#"
;comment out the next 2 lines, P62
;SET XWBDATA("DUZ")=XWBINVAL ;**M2M don't need duz
;SET XWBDATA("SECTOKEN")=XWBINVAL
DO SET(.XWBCBK)
DO EN^MXMLPRSE(DOC,.XWBCBK,.XWBOPT)
ENQ Q
;
SET(CBK) ; -- set the event interface entry points
SET XWBCBK("STARTELEMENT")="ELEST^XWBRMX"
SET XWBCBK("ENDELEMENT")="ELEND^XWBRMX"
SET XWBCBK("CHARACTERS")="CHR^XWBRMX"
QUIT
;
ESC(X) ; -- convert special characters to \x format
Q X
;
N C,Y,Z
F Z=1:1 S C=$E(X,Z) Q:C="" D
.S Y=$TR(C,$C(9,10,13,92),"tnc")
.S:C'=Y $E(X,Z)="" ;$S(Y="":"\\",1:"\"_Y),Z=Z+1
Q X
;
ELEST(ELE,ATR) ; -- element start
IF ELE="vistalink",$G(ATR("type"))="Gov.VA.Med.RPC.Request" DO
. SET XWBDATA("APP")="RPC"
. ;SET XWBDATA("MODE")=$G(ATR("mode"),"singleton") ;Comment out for M2M
. SET XWBDATA("MODE")=$G(ATR("mode"),"RPCBroker") ;M2M change to RPCBroker
;
IF ELE="vistalink",$G(ATR("type"))="Gov.VA.Med.Foundations.CloseSocketRequest" DO QUIT
. SET XWBDATA("APP")="CLOSE"
. SET XWBDATA("MODE")=$G(ATR("mode"),"single call")
;
IF ELE="session" SET XWBSESS=1 QUIT
; -- set session vars here so apps can use during xml parsing
;
;*M2M - check for RPCBroker
IF $G(XWBSESS) DO QUIT
. ;IF ELE="duz" SET (DUZ,XWBDATA("DUZ"))=$G(ATR("value")) IF +DUZ=0 SET (DUZ,XWBDATA("DUZ"))=XWBINVAL QUIT ;P62
. IF $G(XWBSEC) DO QUIT
. . IF ELE="token" SET XWBDATA("SECTOKEN")=$G(ATR("value")) IF XWBDATA("SECTOKEN")="" SET XWBDATA("SECTOKEN")=XWBINVAL QUIT
. IF ELE="security" SET XWBSEC=1 QUIT
;
; -- // TODO: make dynamic off RPC app config
IF $GET(XWBDATA("APP"))="RPC" DO ELEST^XWBRPC(.ELE,.ATR)
Q
;
ELEND(ELE) ; -- element end
IF ELE="session" KILL XWBSESS QUIT
IF $G(XWBSESS) DO QUIT
. IF ELE="security" KILL XWBSEC
;
;
; -- // TODO: make dynamic off RPC app config
IF $G(XWBDATA("APP"))="RPC" DO ELEND^XWBRPC(.ELE)
Q
;
CHR(TXT) ;
; -- // TODO: make dynamic off RPC app config
IF $G(XWBDATA("APP"))="RPC" DO CHR^XWBRPC(.TXT)
Q
;
XWBRMX ;OIFO-Oakland/REM - M2M Broker Server Request Mgr ;05/17/2002 17:41
+1 ;;1.1;RPC BROKER;**28,62**;Mar 21, 2002;Build 13
+2 ;Per VHA Directive 6402, this routine should not be modified
+3 ;
+4 QUIT
+5 ;----------------------------------------------------------------------
+6 ;
+7 ; Request Manager -Parse XML Requests using SAX interface
+8 ;
+9 ;----------------------------------------------------------------------
+10 ;
EN(DOC,XWBOPT,XWBDATA) ; -- Parse XML uses SAX parser
+1 NEW XWBCBK,XWBINVAL
+2 SET XWBINVAL="#UNKNOWN#"
+3 ;comment out the next 2 lines, P62
+4 ;SET XWBDATA("DUZ")=XWBINVAL ;**M2M don't need duz
+5 ;SET XWBDATA("SECTOKEN")=XWBINVAL
+6 DO SET(.XWBCBK)
+7 DO EN^MXMLPRSE(DOC,.XWBCBK,.XWBOPT)
ENQ QUIT
+1 ;
SET(CBK) ; -- set the event interface entry points
+1 SET XWBCBK("STARTELEMENT")="ELEST^XWBRMX"
+2 SET XWBCBK("ENDELEMENT")="ELEND^XWBRMX"
+3 SET XWBCBK("CHARACTERS")="CHR^XWBRMX"
+4 QUIT
+5 ;
ESC(X) ; -- convert special characters to \x format
+1 QUIT X
+2 ;
+3 NEW C,Y,Z
+4 FOR Z=1:1
SET C=$EXTRACT(X,Z)
IF C=""
QUIT
Begin DoDot:1
+5 SET Y=$TRANSLATE(C,$CHAR(9,10,13,92),"tnc")
+6 ;$S(Y="":"\\",1:"\"_Y),Z=Z+1
IF C'=Y
SET $EXTRACT(X,Z)=""
End DoDot:1
+7 QUIT X
+8 ;
ELEST(ELE,ATR) ; -- element start
+1 IF ELE="vistalink"
IF $GET(ATR("type"))="Gov.VA.Med.RPC.Request"
Begin DoDot:1
+2 SET XWBDATA("APP")="RPC"
+3 ;SET XWBDATA("MODE")=$G(ATR("mode"),"singleton") ;Comment out for M2M
+4 ;M2M change to RPCBroker
SET XWBDATA("MODE")=$GET(ATR("mode"),"RPCBroker")
End DoDot:1
+5 ;
+6 IF ELE="vistalink"
IF $GET(ATR("type"))="Gov.VA.Med.Foundations.CloseSocketRequest"
Begin DoDot:1
+7 SET XWBDATA("APP")="CLOSE"
+8 SET XWBDATA("MODE")=$GET(ATR("mode"),"single call")
End DoDot:1
QUIT
+9 ;
+10 IF ELE="session"
SET XWBSESS=1
QUIT
+11 ; -- set session vars here so apps can use during xml parsing
+12 ;
+13 ;*M2M - check for RPCBroker
+14 IF $GET(XWBSESS)
Begin DoDot:1
+15 ;IF ELE="duz" SET (DUZ,XWBDATA("DUZ"))=$G(ATR("value")) IF +DUZ=0 SET (DUZ,XWBDATA("DUZ"))=XWBINVAL QUIT ;P62
+16 IF $GET(XWBSEC)
Begin DoDot:2
+17 IF ELE="token"
SET XWBDATA("SECTOKEN")=$GET(ATR("value"))
IF XWBDATA("SECTOKEN")=""
SET XWBDATA("SECTOKEN")=XWBINVAL
QUIT
End DoDot:2
QUIT
+18 IF ELE="security"
SET XWBSEC=1
QUIT
End DoDot:1
QUIT
+19 ;
+20 ; -- // TODO: make dynamic off RPC app config
+21 IF $GET(XWBDATA("APP"))="RPC"
DO ELEST^XWBRPC(.ELE,.ATR)
+22 QUIT
+23 ;
ELEND(ELE) ; -- element end
+1 IF ELE="session"
KILL XWBSESS
QUIT
+2 IF $GET(XWBSESS)
Begin DoDot:1
+3 IF ELE="security"
KILL XWBSEC
End DoDot:1
QUIT
+4 ;
+5 ;
+6 ; -- // TODO: make dynamic off RPC app config
+7 IF $GET(XWBDATA("APP"))="RPC"
DO ELEND^XWBRPC(.ELE)
+8 QUIT
+9 ;
CHR(TXT) ;
+1 ; -- // TODO: make dynamic off RPC app config
+2 IF $GET(XWBDATA("APP"))="RPC"
DO CHR^XWBRPC(.TXT)
+3 QUIT
+4 ;