BDGSYS5 ; IHS/ANMC/LJF - ADT EVENT DRIVER VIEW ;
;;5.3;PIMS;;APR 26, 2002
;
EN ; -- main entry point for BDG SYS EVENT DRIVER
NEW VALMCNT
D TERM^VALM0,CLEAR^VALM1
D EN^VALM("BDG SYS EVENT DRIVER")
D CLEAR^VALM1
Q
;
HDR ; -- header code
Q
;
INIT ; -- init variables and list array
NEW BDGN,ITEM,SEQ,LINE,X
S VALMCNT=0
K ^TMP("BDGSYS5",$J)
;
S BDGN=$O(^ORD(101,"B","BDGPM MOVEMENT EVENTS",0))
I 'BDGN D SET("** ADT EVENT DRIVER NOT FOUND!!! **",.VALMCNT) Q
S X="BDGPM MOVEMENT EVENTS Protocol - ADT Event Driver Menu"
D SET($$SP(79-$L(X)\2)_X,.VALMCNT),SET("",.VALMCNT)
;
; put event driver items into sequence order
S ITEM=0 F S ITEM=$O(^ORD(101,BDGN,10,ITEM)) Q:'ITEM D
. S SEQ=+$$GET1^DIQ(101.01,ITEM_","_BDGN,3) I SEQ=0 S SEQ="??"
. S ^TMP("BDGSYS51",$J,SEQ,ITEM)=""
;
; create display lines from sorted list
S SEQ=0 F S SEQ=$O(^TMP("BDGSYS51",$J,SEQ)) Q:SEQ="" D
. S ITEM=0 F S ITEM=$O(^TMP("BDGSYS51",$J,SEQ,ITEM)) Q:'ITEM D
.. ;
.. S LINE=$$PAD($J(SEQ,7),10) ;sequence
.. S LINE=LINE_$$GET1^DIQ(101.01,ITEM_","_BDGN,.01) ;item
.. S X=$$GET1^DIQ(101.01,ITEM_","_BDGN,.01,"I") ;item ien
.. I X S LINE=$$PAD(LINE,40)_$$GET1^DIQ(101,X,1) ;item text
.. D SET(LINE,.VALMCNT)
;
; include event driver description as documentation
D SET("",.VALMCNT),SET("Documentation:",.VALMCNT)
S X=0 F S X=$O(^ORD(101,BDGN,1,X)) Q:'X D
. D SET($G(^ORD(101,BDGN,1,X,0)),.VALMCNT)
;
Q
;
SET(DATA,NUM) ; put display line into array
S NUM=NUM+1
S ^TMP("BDGSYS5",$J,NUM,0)=DATA
Q
;
HELP ; -- help code
S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ; -- exit code
K ^TMP("BDGSYS5",$J)
Q
;
EXPND ; -- expand code
Q
;
;
PAD(D,L) ;EP -- SUBRTN to pad length of data
; -- D=data L=length
Q $E(D_$$REPEAT^XLFSTR(" ",L),1,L)
;
SP(N) ; -- SUBRTN to pad N number of spaces
Q $$PAD(" ",N)
BDGSYS5 ; IHS/ANMC/LJF - ADT EVENT DRIVER VIEW ;
+1 ;;5.3;PIMS;;APR 26, 2002
+2 ;
EN ; -- main entry point for BDG SYS EVENT DRIVER
+1 NEW VALMCNT
+2 DO TERM^VALM0
DO CLEAR^VALM1
+3 DO EN^VALM("BDG SYS EVENT DRIVER")
+4 DO CLEAR^VALM1
+5 QUIT
+6 ;
HDR ; -- header code
+1 QUIT
+2 ;
INIT ; -- init variables and list array
+1 NEW BDGN,ITEM,SEQ,LINE,X
+2 SET VALMCNT=0
+3 KILL ^TMP("BDGSYS5",$JOB)
+4 ;
+5 SET BDGN=$ORDER(^ORD(101,"B","BDGPM MOVEMENT EVENTS",0))
+6 IF 'BDGN
DO SET("** ADT EVENT DRIVER NOT FOUND!!! **",.VALMCNT)
QUIT
+7 SET X="BDGPM MOVEMENT EVENTS Protocol - ADT Event Driver Menu"
+8 DO SET($$SP(79-$LENGTH(X)\2)_X,.VALMCNT)
DO SET("",.VALMCNT)
+9 ;
+10 ; put event driver items into sequence order
+11 SET ITEM=0
FOR
SET ITEM=$ORDER(^ORD(101,BDGN,10,ITEM))
IF 'ITEM
QUIT
Begin DoDot:1
+12 SET SEQ=+$$GET1^DIQ(101.01,ITEM_","_BDGN,3)
IF SEQ=0
SET SEQ="??"
+13 SET ^TMP("BDGSYS51",$JOB,SEQ,ITEM)=""
End DoDot:1
+14 ;
+15 ; create display lines from sorted list
+16 SET SEQ=0
FOR
SET SEQ=$ORDER(^TMP("BDGSYS51",$JOB,SEQ))
IF SEQ=""
QUIT
Begin DoDot:1
+17 SET ITEM=0
FOR
SET ITEM=$ORDER(^TMP("BDGSYS51",$JOB,SEQ,ITEM))
IF 'ITEM
QUIT
Begin DoDot:2
+18 ;
+19 ;sequence
SET LINE=$$PAD($JUSTIFY(SEQ,7),10)
+20 ;item
SET LINE=LINE_$$GET1^DIQ(101.01,ITEM_","_BDGN,.01)
+21 ;item ien
SET X=$$GET1^DIQ(101.01,ITEM_","_BDGN,.01,"I")
+22 ;item text
IF X
SET LINE=$$PAD(LINE,40)_$$GET1^DIQ(101,X,1)
+23 DO SET(LINE,.VALMCNT)
End DoDot:2
End DoDot:1
+24 ;
+25 ; include event driver description as documentation
+26 DO SET("",.VALMCNT)
DO SET("Documentation:",.VALMCNT)
+27 SET X=0
FOR
SET X=$ORDER(^ORD(101,BDGN,1,X))
IF 'X
QUIT
Begin DoDot:1
+28 DO SET($GET(^ORD(101,BDGN,1,X,0)),.VALMCNT)
End DoDot:1
+29 ;
+30 QUIT
+31 ;
SET(DATA,NUM) ; put display line into array
+1 SET NUM=NUM+1
+2 SET ^TMP("BDGSYS5",$JOB,NUM,0)=DATA
+3 QUIT
+4 ;
HELP ; -- help code
+1 SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
+3 ;
EXIT ; -- exit code
+1 KILL ^TMP("BDGSYS5",$JOB)
+2 QUIT
+3 ;
EXPND ; -- expand code
+1 QUIT
+2 ;
+3 ;
PAD(D,L) ;EP -- SUBRTN to pad length of data
+1 ; -- D=data L=length
+2 QUIT $EXTRACT(D_$$REPEAT^XLFSTR(" ",L),1,L)
+3 ;
SP(N) ; -- SUBRTN to pad N number of spaces
+1 QUIT $$PAD(" ",N)