BEHBUSA ; MSC/JS - BUSA Audit for Info Button ;29-Aug-2013 19:42;du
;;1.1;BEH COMPONENTS;**054001**;Mar 20, 2007;Build 23
;
; BUSA audit for MSC rpc CIAVMCFG GETTEMPL
; Called from BUSA AUDIT RPC DEFINITION file entry field #.06 ENTRY DESCRIPTION EXECUTABLE (FX), [0;6]
;
; Searches the content of the layout template looking
; for the BEHIPL.IPL, BEHMEDS.MEDMANAGEMENT, and BEHLAB.LABVIEW prog ids.
; Stores the result of this search into the BUSA Summary field #1 ENTRY DESCRIPTION using
; the following pattern:
;
; IPL = <0 or 1>
; MEDS = <0 or 1>
; LAB = <0 or 1>
;
; where 1 indicates that the prog id is present in the layout template.
;
;Return template data
BUSACK() ;
I $G(DUZ)="" Q "-1^DUZ not set"
S U="^"
S TMPL=$$GETPAR()
I $G(TMPL)="" Q "-1^Missing VueCentric Template File IEN"
S DATA=$$TMPGBL
M:TMPL @DATA=^CIAVTPL(TMPL,1)
I $G(@DATA@(0))="" Q "-1^Template Data Not Found"
NEW IPL,MEDS,LAB
D PROGID
K STRING
S STRING="MSC - "_"IPL="_$G(IPL)_"/"_"MEDS="_$G(MEDS)_"/"_"LAB="_$G(LAB)
K ^TMP("BEHBUSA",$J)
K IPL,MEDS,LAB,DATA,TMPL
Q STRING
;
;Return template data - interactive
TMCHEK() ;
I $G(DUZ)="" Q "-1^DUZ not set"
S U="^"
S TMPL=$$GETPAR()
I $G(TMPL)="" Q "-1^Missing VueCentric Template File IEN"
S DATA=$$TMPGBL
M:TMPL @DATA=^CIAVTPL(TMPL,1)
I $G(@DATA@(0))="" Q "-1^Template Data Not Found"
NEW IPL,MEDS,LAB
D PROGID
W !,"IPL VALUE:",?15,IPL
W !,"MEDS VALUE:",?15,MEDS
W !,"LAB VALUE:",?15,LAB
K STRING
S STRING="MSC - "_"IPL="_$G(IPL)_"/"_"MEDS="_$G(MEDS)_"/"_"LAB="_$G(LAB)
K ^TMP("BEHBUSA",$J)
K IPL,MEDS,LAB,DATA,TMPL
Q STRING
;
;Return temp global reference
TMPGBL() ;
NEW GBL
S GBL=$NA(^TMP("BEHBUSA",$J))
K @GBL
Q GBL
;
PROGID ; -- Search thru Template for BEHIPL.IPL, BEHMEDS.MEDMANAGEMENT, and BEHLAB.LABVIEW
; 0/not present, 1/present
S (IPL,MEDS,LAB)=0
NEW A
S A=""
F S A=$O(^TMP("BEHBUSA",$J,A)) Q:A="" D
.NEW TMDATA
.S TMDATA=$G(^TMP("BEHBUSA",$J,A,0))
.Q:TMDATA=""
.;
.;W !!,"TEMPLATE LINE ",A,!?2,TMDATA <<<< UNCOMMENT TO TEST
.;
.I TMDATA["PROGID=""BEHIPL.IPL""" S IPL=1
.I TMDATA["PROGID=""BEHMEDS.MEDMANAGEMENT""" S MEDS=1
.I TMDATA["PROGID=""BEHLAB.LABVIEW""" S LAB=1
Q
;
;Return user's default template IEN
GETPAR() ;
S TMPL=$$GET^XPAR("ALL","CIAVM DEFAULT TEMPLATE")
Q TMPL
BEHBUSA ; MSC/JS - BUSA Audit for Info Button ;29-Aug-2013 19:42;du
+1 ;;1.1;BEH COMPONENTS;**054001**;Mar 20, 2007;Build 23
+2 ;
+3 ; BUSA audit for MSC rpc CIAVMCFG GETTEMPL
+4 ; Called from BUSA AUDIT RPC DEFINITION file entry field #.06 ENTRY DESCRIPTION EXECUTABLE (FX), [0;6]
+5 ;
+6 ; Searches the content of the layout template looking
+7 ; for the BEHIPL.IPL, BEHMEDS.MEDMANAGEMENT, and BEHLAB.LABVIEW prog ids.
+8 ; Stores the result of this search into the BUSA Summary field #1 ENTRY DESCRIPTION using
+9 ; the following pattern:
+10 ;
+11 ; IPL = <0 or 1>
+12 ; MEDS = <0 or 1>
+13 ; LAB = <0 or 1>
+14 ;
+15 ; where 1 indicates that the prog id is present in the layout template.
+16 ;
+17 ;Return template data
BUSACK() ;
+1 IF $GET(DUZ)=""
QUIT "-1^DUZ not set"
+2 SET U="^"
+3 SET TMPL=$$GETPAR()
+4 IF $GET(TMPL)=""
QUIT "-1^Missing VueCentric Template File IEN"
+5 SET DATA=$$TMPGBL
+6 IF TMPL
MERGE @DATA=^CIAVTPL(TMPL,1)
+7 IF $GET(@DATA@(0))=""
QUIT "-1^Template Data Not Found"
+8 NEW IPL,MEDS,LAB
+9 DO PROGID
+10 KILL STRING
+11 SET STRING="MSC - "_"IPL="_$GET(IPL)_"/"_"MEDS="_$GET(MEDS)_"/"_"LAB="_$GET(LAB)
+12 KILL ^TMP("BEHBUSA",$JOB)
+13 KILL IPL,MEDS,LAB,DATA,TMPL
+14 QUIT STRING
+15 ;
+16 ;Return template data - interactive
TMCHEK() ;
+1 IF $GET(DUZ)=""
QUIT "-1^DUZ not set"
+2 SET U="^"
+3 SET TMPL=$$GETPAR()
+4 IF $GET(TMPL)=""
QUIT "-1^Missing VueCentric Template File IEN"
+5 SET DATA=$$TMPGBL
+6 IF TMPL
MERGE @DATA=^CIAVTPL(TMPL,1)
+7 IF $GET(@DATA@(0))=""
QUIT "-1^Template Data Not Found"
+8 NEW IPL,MEDS,LAB
+9 DO PROGID
+10 WRITE !,"IPL VALUE:",?15,IPL
+11 WRITE !,"MEDS VALUE:",?15,MEDS
+12 WRITE !,"LAB VALUE:",?15,LAB
+13 KILL STRING
+14 SET STRING="MSC - "_"IPL="_$GET(IPL)_"/"_"MEDS="_$GET(MEDS)_"/"_"LAB="_$GET(LAB)
+15 KILL ^TMP("BEHBUSA",$JOB)
+16 KILL IPL,MEDS,LAB,DATA,TMPL
+17 QUIT STRING
+18 ;
+19 ;Return temp global reference
TMPGBL() ;
+1 NEW GBL
+2 SET GBL=$NAME(^TMP("BEHBUSA",$JOB))
+3 KILL @GBL
+4 QUIT GBL
+5 ;
PROGID ; -- Search thru Template for BEHIPL.IPL, BEHMEDS.MEDMANAGEMENT, and BEHLAB.LABVIEW
+1 ; 0/not present, 1/present
+2 SET (IPL,MEDS,LAB)=0
+3 NEW A
+4 SET A=""
+5 FOR
SET A=$ORDER(^TMP("BEHBUSA",$JOB,A))
IF A=""
QUIT
Begin DoDot:1
+6 NEW TMDATA
+7 SET TMDATA=$GET(^TMP("BEHBUSA",$JOB,A,0))
+8 IF TMDATA=""
QUIT
+9 ;
+10 ;W !!,"TEMPLATE LINE ",A,!?2,TMDATA <<<< UNCOMMENT TO TEST
+11 ;
+12 IF TMDATA["PROGID=""BEHIPL.IPL"""
SET IPL=1
+13 IF TMDATA["PROGID=""BEHMEDS.MEDMANAGEMENT"""
SET MEDS=1
+14 IF TMDATA["PROGID=""BEHLAB.LABVIEW"""
SET LAB=1
End DoDot:1
+15 QUIT
+16 ;
+17 ;Return user's default template IEN
GETPAR() ;
+1 SET TMPL=$$GET^XPAR("ALL","CIAVM DEFAULT TEMPLATE")
+2 QUIT TMPL