TMGRPC1 ;TMG/kst/RPC Functions for Install transfer ;01/07/08 ;;1.0;TMG-LIB;**1**;01/07/08 ;"TMG RPC FUNCTIONS for transferring files from an OLD installation ;" to a NEW installation. ;"Kevin Toppenberg MD ;"GNU General Public License (GPL) applies ;"3/24/07 ;"======================================================================= ;" RPC -- Public Functions. ;"======================================================================= ;"======================================================================= ;"PRIVATE API FUNCTIONS ;"======================================================================= ;"======================================================================= ;"======================================================================= ;"Dependencies: ;"======================================================================= ;"======================================================================= Connect() ;"Purpose: To establish M-2-M connection, from the OLD installation ;" into the NEW installation. ;"Input: None (for now) ;"Results: 1 if connected, 0 if NOT connected new connected set connected=$$CONNECT^XWBM2MC(9230,"127.0.0.1","1>orange;orange>1") quit connected Disconnect() ;"Purpose: to shut down the M-2-M connection. ;"Input: None ;"Results: 1 if closed, 0 if close failed new closed set closed=$$CLOSE^XWBM2MC quit closed Test new IP,PORT,AV,CONTX,RPCN set IP="127.0.0.1",PORT=9230,AV="1>orange;orange>1" set CONTX="" set RPCN="XWB M2M EXAMPLE LARRY" set RPCN="XWB M2M EXAMPLE REF" D EN1^XWBM2MT(CONTX,RPCN,PORT,IP,AV) Q ; Larry ;Example of passing Array (mult). if $$Connect()=0 goto Ldone I '$$SETCONTX^XWBM2MC("XWB BROKER EXAMPLE") D quit . do HOME^%ZIS U IO W !,"Didn't get Context" ;"====================================================== write "run #1",! S XWBPARMS("PARAMS",1,"TYPE")="ARRAY" S XWBPARMS("PARAMS",1,"VALUE","Raul")="Programmer" S XWBPARMS("PARAMS",1,"VALUE","Susan")="Tech Writter" S XWBPARMS("PARAMS",1,"VALUE","Dan")="Project Mgr" I '$$CALLRPC^XWBM2MC("XWB M2M EXAMPLE LARRY","REQ",1) D . do HOME^%ZIS U IO W !,"Could not run RPC." W !,"Result: " F I=1:1 Q:'$D(REQ(I)) W !,REQ(I) W ! ;"====================================================== write "run #2",! S XWBPARMS("PARAMS",1,"TYPE")="ARRAY" S XWBPARMS("PARApArrayMS",1,"VALUE","Raul")="Programmer" S XWBPARMS("PARAMS",1,"VALUE","Susan")="Tech Writter" S XWBPARMS("PARAMS",1,"VALUE","Dan")="Project Mgr" I '$$CALLRPC^XWBM2MC("XWB M2M EXAMPLE LARRY","REQ",1) D . do HOME^%ZIS U IO W !,"Could not run RPC." W !,"Result: " F I=1:1 Q:'$D(REQ(I)) W !,REQ(I) W ! ;"====================================================== write "run #3",! S XWBPARMS("PARApArrayMS",1,"TYPE")="ARRAY" S XWBPARMS("PARAMS",1,"VALUE","Raul")="Programmer" S XWBPARMS("PARAMS",1,"VALUE","Susan")="Tech Writter" S XWBPARMS("PARAMS",1,"VALUE","Dan")="Project Mgr" I '$$CALLRPC^XWBM2MC("XWB M2M EXAMPLE LARRY","REQ",1) D . do HOME^%ZIS U IO W !,"Could not run RPC." W !,"Result: " F I=1:1 Q:'$D(REQ(I)) W !,REQ(I) W ! ;"====================================================== write "run #4",! S XWBPARMS("PARAMS",1,"TYPE")="ARRAY" S XWBPARMS("PARAMS",1,"VALUE","Raul")="Programmer" S XWBPARMS("PARAMS",1,"VALUE","Susan")="Tech Writter" S XWBPARMS("PARAMS",1,"VALUE","Dan")="Project Mgr" I '$$CALLRPC^XWBM2MC("XWB M2M EXAMPLE LARRY","REQ",1) D . do HOME^%ZIS U IO W !,"Could not run RPC." W !,"Result: " F I=1:1 Q:'$D(REQ(I)) W !,REQ(I) W ! if $$Disconnect=0 do . write "couldn't disconnect!",! Ldone Q