AMQQMGR5 ; IHS/CMI/THL - SECURE DEVICES ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
;-----
I $P($G(^AMQQ(8,DUZ(2),0)),U,10)'="" D OLD G EXIT
D M2
EXIT K X,DIRUT,DIRDT,DUOUT,DTOUT,DISYS,C,DG,%,%Y
Q
;
M2 W @IOF,!!,?15,"***** IDENTIFY SECURE DEVICES FOR Q-MAN *****",!!
W !!,"You may want to define a group of ""secure devices"" for Q-Man. If you choose"
W !,"this option, Q-Man reports can only be displayed or printed on the devices you"
W !,"specify. First tell me if the set is ""inclusionary"" (all devices on your list"
W !,"are secure) or ""exclusionary"" (all devices are secure unless they appear on"
W !,"your list). You may assign ""secure status"" to all devices or just the printers."
W !,"Finally, I will ask you to enter the devices one at a time.",!
S DIR(0)="SO^1:INCLUSIONARY (secure devices in list);2:EXCLUSIONARY (non-secure devices in list);0:EXIT (no device security requested)"
S DIR("A")=$C(10)_" Your choice"
D ^DIR
K DIR
I Y=0 Q
I Y=U Q
D CHK
I $D(AMQQQUIT) K AMQQQUIT Q
I Y=2 G M2EX
S DIR(0)="SO^1:ALL devices outside of your set are not secure;2:ONLY printers outside of your set are not secure;0:EXIT"
S DIR("A")=$C(10)_" Your choice"
D ^DIR
K DIR
I Y=0!(Y=U) G M2
D CHK
I $D(AMQQQUIT) K AMQQQUIT G M2
S AMQQMGRS=$S(Y=1:1,1:2)
W !!
G SECURE
M2EX S DIR(0)="SO^1:ALL devices outside of your set are secure;2:ONLY printers outside of your set are secure;0:EXIT"
S DIR("A")=$C(10)_" Your choice"
D ^DIR
K DIR
I Y=0!(Y=U) G M2
D CHK
I $D(AMQQQUIT) K AMQQQUIT G M2
S AMQQMGRS=$S(Y=1:3,1:4)
W !!
SECURE S DR=".1////"_$S(AMQQMGRS<3:"I",1:"E")_";.09////"_$S(AMQQMGRS#2:"A",1:"P")
S DA=DUZ(2)
S DIE="^AMQQ(8,"
D ^DIE
K DIE,DA,DR,DIC
D ED
Q
;
OLD ;
W @IOF,!!,?20,"***** DEVICE MANAGEMENT *****",!!!,"Current status =>",!!
S %=^AMQQ(8,DUZ(2),0)
I $P(%,U,10)="I" W !,"INCLUSIONARY PROTOCOL (All devices on the list are secure)",!
E W !,"EXCLUSIONARY PROTOCOL (All devices on the list are NOT secure)",!
I $P(%,U,9)="A" W !,"ALL DEVICES (terminals and printers) NEED SECURITY CLEARANCE",!
E W !,"ONLY PRINTERS NEED SECURITY CLEARANCE",!
W !,"CURRENT LIST OF ",$S($P(%,U,10)="I":"",1:"NON-"),"SECURE DEVICES: ",!
S N=0
F X=0:0 S X=$O(^AMQQ(8,DUZ(2),1,X)) Q:'X D STOP S (Y,%)=^(X,0),%=$P(^%ZIS(1,%,0),U) W ?3,%,?20,$P(^%ZIS(2,^%ZIS(1,Y,"SUBTYPE"),0),U),?48,$P($G(^%ZIS(1,Y,1)),U)
S DIR(0)="SO^1:CLEAR the device list and start over;2:EDIT the device list;0:EXIT"
S DIR("A")="What do you want to do now"
S DIR("B")="EXIT"
D ^DIR
K DIR
I $D(DIRUT)+$D(DUOUT)+$D(DTOUT)+'Y K DIRUT,DTOUT,DUOUT G EXIT
I Y=1 D CLEAR Q
I Y=2 D EDIT
Q
;
CLEAR D WAIT^DICD
S DA(1)=DUZ(2)
S DIK="^AMQQ(8,"_DA(1)_",1,"
F DA=0:0 S DA=$O(^AMQQ(8,DA(1),1,DA)) Q:'DA D ^DIK W "."
S DR=".1///@;.09///@"
S DIE="^AMQQ(8,"
S DA=DUZ(2)
D ^DIE
K DIK,DA,DR,DIC,D,D0,DI,DIE,DQ
Q
;
EDIT I '$O(^AMQQ(8,DUZ(2),1,0)) W !!,"Sorry, there are no devices in the file to edit.",!!,*7 Q
ED S DA(1)=DUZ(2)
S DIC("P")=$P(^DD(9009078,1,0),U,2)
S DIC="^AMQQ(8,"_DA(1)_",1,"
S DIC(0)="AEQLM"
D ^DIC
K DIC,DA
I (Y=-1)+$D(DTOUT)+$D(DUOUT)+($E(X)=U) K DUOUT,DTOUT Q
I $P(Y,U,3) D SCREEN G ED
W !,?3,"This device is already in the file. Want to remove it"
S %=2
D YN^DICN
I $D(DTOUT)+$D(DUOUT) K DTOUT,DUOUT Q
I "Nn"[$E(%Y) G ED
S DA=+Y
S DA(1)=DUZ(2)
S DIK="^AMQQ(8,"_DA(1)_",1,"
D ^DIK
W !!,"DEVICE REMOVED FROM LIST"
K %Y,Y,X,DIK,DA,DIC,D0,DI,DISYS
G ED
;
CHK I $D(DTOUT)+$D(DUOUT)+(Y=-1)+(Y="") K DIRUT,DUOUT,DTOUT S AMQQQUIT="" Q
Q
;
STOP N X
S N=N+1
W !
I N=15 S N=0 R "<>",X:DTIME W $C(13),?79,$C(13)
Q
;
SCREEN I $P(^AMQQ(8,DUZ(2),0),U,9)'="P" Q
I $P(^%ZIS(2,^%ZIS(1,$P(Y,U,2),"SUBTYPE"),0),U)["P-" Q
W !!,"SORRY...This device must be a printer!",!!,*7
S DA(1)=DUZ(2)
S DA=+Y
S DIK="^AMQQ(8,"_DA(1)_",1,"
D ^DIK
K DIK,DA,DIC,D0,DI,DQ
S Y=-1
Q
;
AMQQMGR5 ; IHS/CMI/THL - SECURE DEVICES ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ;-----
+3 IF $PIECE($GET(^AMQQ(8,DUZ(2),0)),U,10)'=""
DO OLD
GOTO EXIT
+4 DO M2
EXIT KILL X,DIRUT,DIRDT,DUOUT,DTOUT,DISYS,C,DG,%,%Y
+1 QUIT
+2 ;
M2 WRITE @IOF,!!,?15,"***** IDENTIFY SECURE DEVICES FOR Q-MAN *****",!!
+1 WRITE !!,"You may want to define a group of ""secure devices"" for Q-Man. If you choose"
+2 WRITE !,"this option, Q-Man reports can only be displayed or printed on the devices you"
+3 WRITE !,"specify. First tell me if the set is ""inclusionary"" (all devices on your list"
+4 WRITE !,"are secure) or ""exclusionary"" (all devices are secure unless they appear on"
+5 WRITE !,"your list). You may assign ""secure status"" to all devices or just the printers."
+6 WRITE !,"Finally, I will ask you to enter the devices one at a time.",!
+7 SET DIR(0)="SO^1:INCLUSIONARY (secure devices in list);2:EXCLUSIONARY (non-secure devices in list);0:EXIT (no device security requested)"
+8 SET DIR("A")=$CHAR(10)_" Your choice"
+9 DO ^DIR
+10 KILL DIR
+11 IF Y=0
QUIT
+12 IF Y=U
QUIT
+13 DO CHK
+14 IF $DATA(AMQQQUIT)
KILL AMQQQUIT
QUIT
+15 IF Y=2
GOTO M2EX
+16 SET DIR(0)="SO^1:ALL devices outside of your set are not secure;2:ONLY printers outside of your set are not secure;0:EXIT"
+17 SET DIR("A")=$CHAR(10)_" Your choice"
+18 DO ^DIR
+19 KILL DIR
+20 IF Y=0!(Y=U)
GOTO M2
+21 DO CHK
+22 IF $DATA(AMQQQUIT)
KILL AMQQQUIT
GOTO M2
+23 SET AMQQMGRS=$SELECT(Y=1:1,1:2)
+24 WRITE !!
+25 GOTO SECURE
M2EX SET DIR(0)="SO^1:ALL devices outside of your set are secure;2:ONLY printers outside of your set are secure;0:EXIT"
+1 SET DIR("A")=$CHAR(10)_" Your choice"
+2 DO ^DIR
+3 KILL DIR
+4 IF Y=0!(Y=U)
GOTO M2
+5 DO CHK
+6 IF $DATA(AMQQQUIT)
KILL AMQQQUIT
GOTO M2
+7 SET AMQQMGRS=$SELECT(Y=1:3,1:4)
+8 WRITE !!
SECURE SET DR=".1////"_$SELECT(AMQQMGRS<3:"I",1:"E")_";.09////"_$SELECT(AMQQMGRS#2:"A",1:"P")
+1 SET DA=DUZ(2)
+2 SET DIE="^AMQQ(8,"
+3 DO ^DIE
+4 KILL DIE,DA,DR,DIC
+5 DO ED
+6 QUIT
+7 ;
OLD ;
+1 WRITE @IOF,!!,?20,"***** DEVICE MANAGEMENT *****",!!!,"Current status =>",!!
+2 SET %=^AMQQ(8,DUZ(2),0)
+3 IF $PIECE(%,U,10)="I"
WRITE !,"INCLUSIONARY PROTOCOL (All devices on the list are secure)",!
+4 IF '$TEST
WRITE !,"EXCLUSIONARY PROTOCOL (All devices on the list are NOT secure)",!
+5 IF $PIECE(%,U,9)="A"
WRITE !,"ALL DEVICES (terminals and printers) NEED SECURITY CLEARANCE",!
+6 IF '$TEST
WRITE !,"ONLY PRINTERS NEED SECURITY CLEARANCE",!
+7 WRITE !,"CURRENT LIST OF ",$SELECT($PIECE(%,U,10)="I":"",1:"NON-"),"SECURE DEVICES: ",!
+8 SET N=0
+9 FOR X=0:0
SET X=$ORDER(^AMQQ(8,DUZ(2),1,X))
IF 'X
QUIT
DO STOP
SET (Y,%)=^(X,0)
SET %=$PIECE(^%ZIS(1,%,0),U)
WRITE ?3,%,?20,$PIECE(^%ZIS(2,^%ZIS(1,Y,"SUBTYPE"),0),U),?48,$PIECE($GET(^%ZIS(1,Y,1)),U)
+10 SET DIR(0)="SO^1:CLEAR the device list and start over;2:EDIT the device list;0:EXIT"
+11 SET DIR("A")="What do you want to do now"
+12 SET DIR("B")="EXIT"
+13 DO ^DIR
+14 KILL DIR
+15 IF $DATA(DIRUT)+$DATA(DUOUT)+$DATA(DTOUT)+'Y
KILL DIRUT,DTOUT,DUOUT
GOTO EXIT
+16 IF Y=1
DO CLEAR
QUIT
+17 IF Y=2
DO EDIT
+18 QUIT
+19 ;
CLEAR DO WAIT^DICD
+1 SET DA(1)=DUZ(2)
+2 SET DIK="^AMQQ(8,"_DA(1)_",1,"
+3 FOR DA=0:0
SET DA=$ORDER(^AMQQ(8,DA(1),1,DA))
IF 'DA
QUIT
DO ^DIK
WRITE "."
+4 SET DR=".1///@;.09///@"
+5 SET DIE="^AMQQ(8,"
+6 SET DA=DUZ(2)
+7 DO ^DIE
+8 KILL DIK,DA,DR,DIC,D,D0,DI,DIE,DQ
+9 QUIT
+10 ;
EDIT IF '$ORDER(^AMQQ(8,DUZ(2),1,0))
WRITE !!,"Sorry, there are no devices in the file to edit.",!!,*7
QUIT
ED SET DA(1)=DUZ(2)
+1 SET DIC("P")=$PIECE(^DD(9009078,1,0),U,2)
+2 SET DIC="^AMQQ(8,"_DA(1)_",1,"
+3 SET DIC(0)="AEQLM"
+4 DO ^DIC
+5 KILL DIC,DA
+6 IF (Y=-1)+$DATA(DTOUT)+$DATA(DUOUT)+($EXTRACT(X)=U)
KILL DUOUT,DTOUT
QUIT
+7 IF $PIECE(Y,U,3)
DO SCREEN
GOTO ED
+8 WRITE !,?3,"This device is already in the file. Want to remove it"
+9 SET %=2
+10 DO YN^DICN
+11 IF $DATA(DTOUT)+$DATA(DUOUT)
KILL DTOUT,DUOUT
QUIT
+12 IF "Nn"[$EXTRACT(%Y)
GOTO ED
+13 SET DA=+Y
+14 SET DA(1)=DUZ(2)
+15 SET DIK="^AMQQ(8,"_DA(1)_",1,"
+16 DO ^DIK
+17 WRITE !!,"DEVICE REMOVED FROM LIST"
+18 KILL %Y,Y,X,DIK,DA,DIC,D0,DI,DISYS
+19 GOTO ED
+20 ;
CHK IF $DATA(DTOUT)+$DATA(DUOUT)+(Y=-1)+(Y="")
KILL DIRUT,DUOUT,DTOUT
SET AMQQQUIT=""
QUIT
+1 QUIT
+2 ;
STOP NEW X
+1 SET N=N+1
+2 WRITE !
+3 IF N=15
SET N=0
READ "<>",X:DTIME
WRITE $CHAR(13),?79,$CHAR(13)
+4 QUIT
+5 ;
SCREEN IF $PIECE(^AMQQ(8,DUZ(2),0),U,9)'="P"
QUIT
+1 IF $PIECE(^%ZIS(2,^%ZIS(1,$PIECE(Y,U,2),"SUBTYPE"),0),U)["P-"
QUIT
+2 WRITE !!,"SORRY...This device must be a printer!",!!,*7
+3 SET DA(1)=DUZ(2)
+4 SET DA=+Y
+5 SET DIK="^AMQQ(8,"_DA(1)_",1,"
+6 DO ^DIK
+7 KILL DIK,DA,DIC,D0,DI,DQ
+8 SET Y=-1
+9 QUIT
+10 ;