BTIUVAR ; IHS/ITSC/LJF - MENU ENTRY & EXIT ACTIONS ;
;;1.0;TEXT INTEGRATION UTILITIES;;NOV 04, 2004
;
;This rtn contains the entry & exit actions for the IHS TIU Menus
;
Q
ENTER(TIUZ) ;EP; entry actions for BTIU MAIN MENUs
NEW TIU,Y,X,Z
S Y=0,Y=$O(^DIC(9.4,"C","TIU",Y)),TIU("VERS")=^DIC(9.4,Y,"VERSION")
S Z=$O(^DIC(9.4,Y,22,"B",+TIU("VERS"),0))
I Z="" S Z=$O(^DIC(9.4,Y,22,"B",TIU("VERS"),0)) I Z="" S XQUIT=1 Q
S Y=$P(^DIC(9.4,Y,22,Z,0),U,2) X ^DD("DD")
S TIU("VERDT")=Y
;
D ^XBCLS W !?18,$$REPEAT^XLFSTR("*",41)
W !?18,"* INDIAN HEALTH SERVICE *"
W !?18,"*",$$SP(9),$S(TIUZ=1:"TIU CLINICIAN'S MENU"_$$SP(10),1:"TIU MEDICAL RECORDS MENU"_$$SP(6)),"*"
W !?18,"* VERSION ",TIU("VERS"),", ",TIU("VERDT"),?58,"*"
W !?18,$$REPEAT^XLFSTR("*",41)
;
I '$D(DUZ(2))!('$D(DUZ(0))) D G XQUIT
.W !!,"YOU MUST SIGN ON PROPERLY THROUGH THE KERNEL TO USE THE"
.W " IHS TEXT-INTEGRATION UTILITY SYSTEM" S XQUIT=1
S X=$P($G(^DIC(4,DUZ(2),0)),U) W !!?74-$L(X)\2,X
I X="" W !!,"INVALID FACILITY; NOTIFY YOUR SITE MANAGER!" S XQUIT=""
;
XQUIT Q
;
;
NEW TIU
S TIU("TITLE")=$P($G(XQY0),U,2)
I $L(TIU("TITLE"))>2 W @IOF,!!?80-$L(TIU("TITLE"))/2,TIU("TITLE")
S X=$P($G(^DIC(4,DUZ(2),0)),U)
W !!?80-$L(X)\2,"(",X,")"
Q
;
EXIT ;ENTRY POINT >>> exit actions for BTIU MENUs
D EN^XBVK("TIU"),EN^XBVK("VALM"),EN^XBVK("USR") K IOSTBM
Q
;
; -- archive copies of PAD and SP subrtns
PAD(DATA,LENGTH) ; pad length of data
Q $E(DATA_$$REPEAT^XLFSTR(" ",LENGTH),1,LENGTH)
;
SP(NUM) ; pad spaces
Q $$PAD(" ",NUM)
BTIUVAR ; IHS/ITSC/LJF - MENU ENTRY & EXIT ACTIONS ;
+1 ;;1.0;TEXT INTEGRATION UTILITIES;;NOV 04, 2004
+2 ;
+3 ;This rtn contains the entry & exit actions for the IHS TIU Menus
+4 ;
+5 QUIT
ENTER(TIUZ) ;EP; entry actions for BTIU MAIN MENUs
+1 NEW TIU,Y,X,Z
+2 SET Y=0
SET Y=$ORDER(^DIC(9.4,"C","TIU",Y))
SET TIU("VERS")=^DIC(9.4,Y,"VERSION")
+3 SET Z=$ORDER(^DIC(9.4,Y,22,"B",+TIU("VERS"),0))
+4 IF Z=""
SET Z=$ORDER(^DIC(9.4,Y,22,"B",TIU("VERS"),0))
IF Z=""
SET XQUIT=1
QUIT
+5 SET Y=$PIECE(^DIC(9.4,Y,22,Z,0),U,2)
XECUTE ^DD("DD")
+6 SET TIU("VERDT")=Y
+7 ;
+8 DO ^XBCLS
WRITE !?18,$$REPEAT^XLFSTR("*",41)
+9 WRITE !?18,"* INDIAN HEALTH SERVICE *"
+10 WRITE !?18,"*",$$SP(9),$SELECT(TIUZ=1:"TIU CLINICIAN'S MENU"_$$SP(10),1:"TIU MEDICAL RECORDS MENU"_$$SP(6)),"*"
+11 WRITE !?18,"* VERSION ",TIU("VERS"),", ",TIU("VERDT"),?58,"*"
+12 WRITE !?18,$$REPEAT^XLFSTR("*",41)
+13 ;
+14 IF '$DATA(DUZ(2))!('$DATA(DUZ(0)))
Begin DoDot:1
+15 WRITE !!,"YOU MUST SIGN ON PROPERLY THROUGH THE KERNEL TO USE THE"
+16 WRITE " IHS TEXT-INTEGRATION UTILITY SYSTEM"
SET XQUIT=1
End DoDot:1
GOTO XQUIT
+17 SET X=$PIECE($GET(^DIC(4,DUZ(2),0)),U)
WRITE !!?74-$LENGTH(X)\2,X
+18 IF X=""
WRITE !!,"INVALID FACILITY; NOTIFY YOUR SITE MANAGER!"
SET XQUIT=""
+19 ;
XQUIT QUIT
+1 ;
+2 ;
+1 NEW TIU
+2 SET TIU("TITLE")=$PIECE($GET(XQY0),U,2)
+3 IF $LENGTH(TIU("TITLE"))>2
WRITE @IOF,!!?80-$LENGTH(TIU("TITLE"))/2,TIU("TITLE")
+4 SET X=$PIECE($GET(^DIC(4,DUZ(2),0)),U)
+5 WRITE !!?80-$LENGTH(X)\2,"(",X,")"
+6 QUIT
+7 ;
EXIT ;ENTRY POINT >>> exit actions for BTIU MENUs
+1 DO EN^XBVK("TIU")
DO EN^XBVK("VALM")
DO EN^XBVK("USR")
KILL IOSTBM
+2 QUIT
+3 ;
+4 ; -- archive copies of PAD and SP subrtns
PAD(DATA,LENGTH) ; pad length of data
+1 QUIT $EXTRACT(DATA_$$REPEAT^XLFSTR(" ",LENGTH),1,LENGTH)
+2 ;
SP(NUM) ; pad spaces
+1 QUIT $$PAD(" ",NUM)