EEOUTIL ;HISC/JWR - VERSION 1.0 & 2.0 MISCELLANEOUS SERVER INTERFACES ;Apr 20, 1995
;;2.0;EEO Complaint Tracking;**2**;Apr 27, 1995
F2MUL ;Changes non multiple fields to multiples (fields 17.5,18.5,27.5)
N DIE,DIC,DR
S DIE=785,DA=EEO("DA")
I EEO("NODE")=1 D
.S PFILE=786,MFILE=785.02 F KN=4,9,10 K DR S DR="17.5///" D DR
.S PFILE=785.1,MFILE=785.01 F KN=5,7,8 K DR S DR="18.5///" D DR
STINV3 ;INSTALLS NON-MULTIPLES INTO MULTIPLE FIELDS (Only 1st Xmt from Region)
I EEO("NODE")=3 S DR="27.5///",MFILE=785.03 D
.F KN=1:1:14 S KEE(KN)=$P(EEO("STRING"),U,KN)
.F KN=1,2,7,10 S:KEE(KN)>0 KEE("NODE")=$G(^EEO(787,KEE(KN),0)),KEE(KN)=$P(KEE("NODE"),U),KT(KN)=$P(KEE("NODE"),U,2)
.D INV
Q
DR ;Sets DR for Multiple .01 field
Q:$P(EEO("STRING"),U,KN)="" Q:'$D(^EEO(PFILE,$P(EEO("STRING"),U,KN),0)) S KN1=$P($G(^EEO(PFILE,$P(EEO("STRING"),U,KN),0)),U),DR=DR_KN1,DR(2,MFILE)=".01///"_KN1 D ^DIE S $P(EEO("STRING"),U,KN)=""
Q
INV ;Sets DR for Investigator multiple
I KEE(1)'="" S DR(2,785.03)=".01///"_KEE(1)_";2///"_$G(KT1)_";1///"_KEE(3)_";4///"_KEE(5)_";5///"_KEE(2)_";6///"_KEE(4)_";7///"_KEE(8)_";8///"_KEE(6) D ^DIE
I KEE(7)'="" S DR(2,785.03)=".01///"_KEE(7)_";2///"_$G(KT7)_";1///"_KEE(9)_";4///"_KEE(11)_";5///"_KEE(10)_";6///"_KEE(13)_";7///"_KEE(14)_";8///"_KEE(12) D ^DIE
Q
SECED ;Edit security for edit options
I '$D(^EEO(785,+Y)) S EEOSEC=1 Q
I $G(^EEO(785,+Y,"SEC"))'=DUZ S EEOSEC=1 Q
I $P($G(^EEO(785,+Y,1)),U,3)>0&(XQY0["Edit") S EEOSEC=1 Q
S EEOSEC="" Q
SECOP ;Entry pt. for assigning Counselor Security
I $G(DIR(0))'["SAO" D ^EEOEMAN Q
D ^EEOEOSE Q:'$D(EEOYSTN)
S S DIC="^EEO(785,",DIC(0)="AEMQZ",DIC("S")="I $P($G(^EEO(785,+Y,12)),U,2)="""""
W !! S DIC("A")="Select Complaint: " D ^DIC K DIC("S") S EEODAD=+Y
I Y'>0 K DIC,DR,EEOEEOEO,EEODAD Q
I Y>0 S EEO3=+Y,EEO2=$P($G(Y),U,2),DIC("B")=$P($G(^VA(200,+$G(^EEO(785,+Y,1)),0)),U)
S DIC("A")="Assign to which Counselor: ",DIC="^VA(200," D ^DIC
Q:Y'>0
S EEO1=$P(Y,U,2) I DIC("B")'=EEO1 S EEOC(EEO3)=EEO3_"^"_DUZ_"^"_DT_"^"_DIC("B")_"^1^"_EEO1
S DIE=785,DA=EEODAD,DIC(0)="AELMNQZ",DR="98////"_+Y_";14////"_+Y
D ^DIE
W !!," Counselor Security for ",EEO2," is now assigned to ",EEO1
K EEODAD,Y,DIC,DIE,DA,EEO1,EEO2 G S
SEC ;Informal security check
I $G(^EEO(785,DA,"SEC"))'=DUZ W !!," THIS OPTION MAY ONLY BE INVOKED BY THE COUNSELOR",!," ASSIGNED TO THIS COMPLAINT",! S EEOSEC=1
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEEOUTIL 2413 printed Oct 16, 2024@17:52:07 Page 2
EEOUTIL ;HISC/JWR - VERSION 1.0 & 2.0 MISCELLANEOUS SERVER INTERFACES ;Apr 20, 1995
+1 ;;2.0;EEO Complaint Tracking;**2**;Apr 27, 1995
F2MUL ;Changes non multiple fields to multiples (fields 17.5,18.5,27.5)
+1 NEW DIE,DIC,DR
+2 SET DIE=785
SET DA=EEO("DA")
+3 IF EEO("NODE")=1
Begin DoDot:1
+4 SET PFILE=786
SET MFILE=785.02
FOR KN=4,9,10
KILL DR
SET DR="17.5///"
DO DR
+5 SET PFILE=785.1
SET MFILE=785.01
FOR KN=5,7,8
KILL DR
SET DR="18.5///"
DO DR
End DoDot:1
STINV3 ;INSTALLS NON-MULTIPLES INTO MULTIPLE FIELDS (Only 1st Xmt from Region)
+1 IF EEO("NODE")=3
SET DR="27.5///"
SET MFILE=785.03
Begin DoDot:1
+2 FOR KN=1:1:14
SET KEE(KN)=$PIECE(EEO("STRING"),U,KN)
+3 FOR KN=1,2,7,10
if KEE(KN)>0
SET KEE("NODE")=$GET(^EEO(787,KEE(KN),0))
SET KEE(KN)=$PIECE(KEE("NODE"),U)
SET KT(KN)=$PIECE(KEE("NODE"),U,2)
+4 DO INV
End DoDot:1
+5 QUIT
DR ;Sets DR for Multiple .01 field
+1 if $PIECE(EEO("STRING"),U,KN)=""
QUIT
if '$DATA(^EEO(PFILE,$PIECE(EEO("STRING"),U,KN),0))
QUIT
SET KN1=$PIECE($GET(^EEO(PFILE,$PIECE(EEO("STRING"),U,KN),0)),U)
SET DR=DR_KN1
SET DR(2,MFILE)=".01///"_KN1
DO ^DIE
SET $PIECE(EEO("STRING"),U,KN)=""
+2 QUIT
INV ;Sets DR for Investigator multiple
+1 IF KEE(1)'=""
SET DR(2,785.03)=".01///"_KEE(1)_";2///"_$GET(KT1)_";1///"_KEE(3)_";4///"_KEE(5)_";5///"_KEE(2)_";6///"_KEE(4)_";7///"_KEE(8)_";8///"_KEE(6)
DO ^DIE
+2 IF KEE(7)'=""
SET DR(2,785.03)=".01///"_KEE(7)_";2///"_$GET(KT7)_";1///"_KEE(9)_";4///"_KEE(11)_";5///"_KEE(10)_";6///"_KEE(13)_";7///"_KEE(14)_";8///"_KEE(12)
DO ^DIE
+3 QUIT
SECED ;Edit security for edit options
+1 IF '$DATA(^EEO(785,+Y))
SET EEOSEC=1
QUIT
+2 IF $GET(^EEO(785,+Y,"SEC"))'=DUZ
SET EEOSEC=1
QUIT
+3 IF $PIECE($GET(^EEO(785,+Y,1)),U,3)>0&(XQY0["Edit")
SET EEOSEC=1
QUIT
+4 SET EEOSEC=""
QUIT
SECOP ;Entry pt. for assigning Counselor Security
+1 IF $GET(DIR(0))'["SAO"
DO ^EEOEMAN
QUIT
+2 DO ^EEOEOSE
if '$DATA(EEOYSTN)
QUIT
S SET DIC="^EEO(785,"
SET DIC(0)="AEMQZ"
SET DIC("S")="I $P($G(^EEO(785,+Y,12)),U,2)="""""
+1 WRITE !!
SET DIC("A")="Select Complaint: "
DO ^DIC
KILL DIC("S")
SET EEODAD=+Y
+2 IF Y'>0
KILL DIC,DR,EEOEEOEO,EEODAD
QUIT
+3 IF Y>0
SET EEO3=+Y
SET EEO2=$PIECE($GET(Y),U,2)
SET DIC("B")=$PIECE($GET(^VA(200,+$GET(^EEO(785,+Y,1)),0)),U)
+4 SET DIC("A")="Assign to which Counselor: "
SET DIC="^VA(200,"
DO ^DIC
+5 if Y'>0
QUIT
+6 SET EEO1=$PIECE(Y,U,2)
IF DIC("B")'=EEO1
SET EEOC(EEO3)=EEO3_"^"_DUZ_"^"_DT_"^"_DIC("B")_"^1^"_EEO1
+7 SET DIE=785
SET DA=EEODAD
SET DIC(0)="AELMNQZ"
SET DR="98////"_+Y_";14////"_+Y
+8 DO ^DIE
+9 WRITE !!," Counselor Security for ",EEO2," is now assigned to ",EEO1
+10 KILL EEODAD,Y,DIC,DIE,DA,EEO1,EEO2
GOTO S
SEC ;Informal security check
+1 IF $GET(^EEO(785,DA,"SEC"))'=DUZ
WRITE !!," THIS OPTION MAY ONLY BE INVOKED BY THE COUNSELOR",!," ASSIGNED TO THIS COMPLAINT",!
SET EEOSEC=1