EDPCBRD ;SLC/KCM - Controller for ED Tracking Board ;2/28/12 08:33am
;;2.0;EMERGENCY DEPARTMENT;;May 2, 2012;Build 103
;
RPC(EDPXML,SESS,PARAMS) ; Process request via RPC instead of CSP
N X,REQ,EDPSITE,EDPUSER,EDPDBUG
K EDPXML
S EDPUSER=$P($G(SESS),U),EDPSTA=$P($G(SESS),U,2),EDPSITE=$$IEN^XUAF4(EDPSTA)
S X="" F S X=$O(PARAMS(X)) Q:X="" S REQ(X,1)=PARAMS(X)
S EDPDBUG=$$DEBUG^EDPCDBG("board")
I EDPDBUG D PUTREQ^EDPCDBG(EDPDBUG,.PARAMS)
;
COMMON ; Come here for both CSP and RPC Mode
;
N EDPFAIL,CMD
S CMD=$G(REQ("command",1))
I $L($G(REQ("machine",1))) D G:$D(EDPXML)>0 OUT ; exit on error
. N BRD
. S REQ("machine",1)=$$LOW^XLFSTR(REQ("machine",1))
. S BRD=$$GET^XPAR("DIV","EDPF BIGBOARD KIOSKS",REQ("machine",1),"I")
. I '$L(BRD) D
.. S BRD=$$GET^XPAR(EDPSITE_";DIC(4,","EDPF BIGBOARD KIOSKS",REQ("machine",1),"I")
. I '$L(BRD) D XML^EDPX("<error>Computer name not found.</error>") Q
. S REQ("board",1)=BRD
;
; switch on command
;
; ---------------------------------
;
; initTracking
; return <user area="" areaNm="" />...
I CMD="initTracking" D BRDUSER^EDPQAR($$VAL("area")) G OUT
;
; ---------------------------------
;
; initDisplayBoard
; return <spec>
; <color><map />...</color>...
; <rows><row />...</rows>
I CMD="initDisplayBoard" D G OUT
. D GET^EDPQDBS($$VAL("area"),$$VAL("board"))
. D GET^EDPQDB($$VAL("area"),$$VAL("board"),-1)
;
; ---------------------------------
;
; refreshDisplayBoard
; return <rows><row />...</rows>
I CMD="refreshDisplayBoard" D G OUT
. D GET^EDPQDB($$VAL("area"),$$VAL("board"),$$VAL("last"))
;
; ---------------------------------
; else
D XML^EDPX("<error msg='"_$$MSG^EDPX(2300010)_"' />")
; end switch
;
OUT ; output the XML
I EDPDBUG D PUTXML^EDPCDBG(EDPDBUG,.EDPXML)
I $L($G(EDPHTTP)) D ; if in CSP mode
. U EDPHTTP
. W "<results>",!
. N I S I=0 F S I=$O(EDPXML(I)) Q:'I W EDPXML(I),!
. W "</results>",!
K EDPHTTP
END Q
;
VAL(X) ; return value from request
Q $G(REQ(X,1))
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEDPCBRD 2079 printed Oct 16, 2024@17:52:29 Page 2
EDPCBRD ;SLC/KCM - Controller for ED Tracking Board ;2/28/12 08:33am
+1 ;;2.0;EMERGENCY DEPARTMENT;;May 2, 2012;Build 103
+2 ;
RPC(EDPXML,SESS,PARAMS) ; Process request via RPC instead of CSP
+1 NEW X,REQ,EDPSITE,EDPUSER,EDPDBUG
+2 KILL EDPXML
+3 SET EDPUSER=$PIECE($GET(SESS),U)
SET EDPSTA=$PIECE($GET(SESS),U,2)
SET EDPSITE=$$IEN^XUAF4(EDPSTA)
+4 SET X=""
FOR
SET X=$ORDER(PARAMS(X))
if X=""
QUIT
SET REQ(X,1)=PARAMS(X)
+5 SET EDPDBUG=$$DEBUG^EDPCDBG("board")
+6 IF EDPDBUG
DO PUTREQ^EDPCDBG(EDPDBUG,.PARAMS)
+7 ;
COMMON ; Come here for both CSP and RPC Mode
+1 ;
+2 NEW EDPFAIL,CMD
+3 SET CMD=$GET(REQ("command",1))
+4 ; exit on error
IF $LENGTH($GET(REQ("machine",1)))
Begin DoDot:1
+5 NEW BRD
+6 SET REQ("machine",1)=$$LOW^XLFSTR(REQ("machine",1))
+7 SET BRD=$$GET^XPAR("DIV","EDPF BIGBOARD KIOSKS",REQ("machine",1),"I")
+8 IF '$LENGTH(BRD)
Begin DoDot:2
+9 SET BRD=$$GET^XPAR(EDPSITE_";DIC(4,","EDPF BIGBOARD KIOSKS",REQ("machine",1),"I")
End DoDot:2
+10 IF '$LENGTH(BRD)
DO XML^EDPX("<error>Computer name not found.</error>")
QUIT
+11 SET REQ("board",1)=BRD
End DoDot:1
if $DATA(EDPXML)>0
GOTO OUT
+12 ;
+13 ; switch on command
+14 ;
+15 ; ---------------------------------
+16 ;
+17 ; initTracking
+18 ; return <user area="" areaNm="" />...
+19 IF CMD="initTracking"
DO BRDUSER^EDPQAR($$VAL("area"))
GOTO OUT
+20 ;
+21 ; ---------------------------------
+22 ;
+23 ; initDisplayBoard
+24 ; return <spec>
+25 ; <color><map />...</color>...
+26 ; <rows><row />...</rows>
+27 IF CMD="initDisplayBoard"
Begin DoDot:1
+28 DO GET^EDPQDBS($$VAL("area"),$$VAL("board"))
+29 DO GET^EDPQDB($$VAL("area"),$$VAL("board"),-1)
End DoDot:1
GOTO OUT
+30 ;
+31 ; ---------------------------------
+32 ;
+33 ; refreshDisplayBoard
+34 ; return <rows><row />...</rows>
+35 IF CMD="refreshDisplayBoard"
Begin DoDot:1
+36 DO GET^EDPQDB($$VAL("area"),$$VAL("board"),$$VAL("last"))
End DoDot:1
GOTO OUT
+37 ;
+38 ; ---------------------------------
+39 ; else
+40 DO XML^EDPX("<error msg='"_$$MSG^EDPX(2300010)_"' />")
+41 ; end switch
+42 ;
OUT ; output the XML
+1 IF EDPDBUG
DO PUTXML^EDPCDBG(EDPDBUG,.EDPXML)
+2 ; if in CSP mode
IF $LENGTH($GET(EDPHTTP))
Begin DoDot:1
+3 USE EDPHTTP
+4 WRITE "<results>",!
+5 NEW I
SET I=0
FOR
SET I=$ORDER(EDPXML(I))
if 'I
QUIT
WRITE EDPXML(I),!
+6 WRITE "</results>",!
End DoDot:1
+7 KILL EDPHTTP
END QUIT
+1 ;
VAL(X) ; return value from request
+1 QUIT $GET(REQ(X,1))