VistA-FOIAVistA/r/EEO_COMPLAINT_TRACKING-EEO/EEOEXE1.m

87 lines
4.8 KiB
Mathematica

EEOEXE1 ;HISC/JWR - EEO SERVER ROUTINE (VERSION 2.0 SITES);2/25/93 13:03
;;2.0;EEO Complaint Tracking;**2**;Apr 27, 1995
S:$D(X) EEODX=X S XQSTXT="XQSTXT("
I '$D(^XMB(3.9,XMZ,2,1,0)) S XQSTXT(10)="<ERROR> Could not find the first line of the message" G EXIT
S STANO=^XMB(3.9,XMZ,2,1,0),TYPE=$P(STANO,"^",2),EEOKEY=$P($G(STANO),"^",3),STANO=+STANO,X=$O(^DIC(4,"D",STANO,""))
G:EEOKEY'>19 ^EEOEEXE
I TYPE'="DATA"&(TYPE'="FILE")&(TYPE'="INV") S XQSTXT(10)="<ERROR> Message missent to the EEO_DATA Server" G EXIT
S X="NOW",%DT="DTXO" D ^%DT S NOWP=Y K %DT
F X=.001:.001 Q:'$D(^XMB(3.9,XMZ,2,X,0)) S Y=^(0) I Y["Message-ID:<" S DOMFROM=$P(Y,"@",2),DOMFROM=$P(DOMFROM,">",1) Q
I '$D(DOMFROM) S DOMFROM=$P(^XMB(1,1,0),"^"),DOMFROM=$P(^DIC(4.2,DOMFROM,0),"^")
F X=2:1 Q:'$D(^XMB(3.9,XMZ,2,X)) Q:^(X,0)="&&&&&"
F EEO("LINE")=2:1 Q:'$D(^XMB(3.9,XMZ,2,EEO("LINE"),0)) Q:(^(0))="&&&&&"
S EEO("LINE")=EEO("LINE")+1
F EEO("LINE")=EEO("LINE"):2 Q:'$D(^XMB(3.9,XMZ,2,EEO("LINE"),0)) D
.D:TYPE="DATA" DEC D:TYPE="FILE"!(TYPE="INV") STAN S EEO("LABEL")=$P(EEO("NODE"),U),EEO("DA")=$P(EEO("NODE"),U,3),(DIDEL,EEO("FILE"))=$P(EEO("NODE"),U,2),GEE=$P(EEO("NODE"),U,5),EEO("NODE")=$P(EEO("NODE"),U,4)
ELOCK .;Breaks doun data strings for decryption
.S:EEO("FILE")=789 EEO("FILE")=785 L +^EEO(EEO("FILE"),EEO("DA")):0 I $T=0 H 10 G ELOCK
.I EEO("LABEL")'="ANODE" S DA=EEO("DA"),DATA=$P(EEO("STRING"),U),DIE=EEO("FILE") K DR D @EEO("LABEL") K DR L -^EEO(EEO("FILE"),EEO("DA")) Q
.F EEO=1:1 S EEO("DATA")=$P(EEO("STRING"),"^",EEO) Q:$P(EEO("STRING"),"^",EEO,999)="" I EEO("DATA")]"" D
..S EEO("FIELD")=$O(^DD(EEO("FILE"),"GL",EEO("NODE"),EEO,""))
..I '$D(^EEO(EEO("FILE"),EEO("DA"))) K DD,DIC,DINUM,DO S DIC="^EEO("_EEO("FILE")_",",DIC(0)="L",DLAYGO=EEO("FILE"),DINUM=EEO("DA"),X=$P(EEO("DATA"),"^",1) D FILE^DICN Q:Y<1 K DINUM,DLAYGO
..Q:EEO("FIELD")=""
..K DR S DIE=EEO("FILE"),DA=EEO("DA")
..I $P(^DD(EEO("FILE"),EEO("FIELD"),0),U,2)["D" S DR=EEO("FIELD")_"////"_EEO("DATA") D ^DIE Q
..;S DIDEL=785
..S DR=EEO("FIELD")_"///"_EEO("DATA") D ^DIE
.I EEO("FILE")=785 S DA=EEO("DA") D CASENO^EEOEOSE
.L -^EEO(EEO("FILE"),EEO("DA"))
EXITOK ;
I $G(EEO("FILE"))>780 L -^EEO(EEO("FILE"),0)
S X="XMA1C" X ^%ZOSF("TEST") I $T S XMSER="S.EEO UPLINK SERVER",XMZ=XQMSG D REMSBMSG^XMA1C
EXIT ;
S XMDUZ="EEO SERVER FOR "_^DD("SITE") K EEOD,EEODX,EEOE,EEO,DR,STANO,EEOKEY,DIDEL,CN1,CN2,CN3,DATA,TYPE,EEON1,EEONOD,EEOL Q
DEC ;Decryption on data strings
K EEO("STRING") S X=^XMB(3.9,XMZ,2,EEO("LINE"),0),X1=$$SITE^EEOEEXMT,X2=EEO("LINE")
D DE^XUSHSHP S EEO("NODE")=X,X2=X2+1
S EEON1=^XMB(3.9,XMZ,2,EEO("LINE")+1,0),EEOL=$L(EEON1)
I EEOL<50 S X=EEON1 D DE^XUSHSHP S EEO("STRING")=X Q
I EEOL'<50 F EEOC=0:50:250 S X=$E(EEON1,EEOC+1,EEOC+50) D DE^XUSHSHP D
.I $D(EEO("STRING")) S EEO("STRING")=EEO("STRING")_X Q
.I '$D(EEO("STRING")) S EEO("STRING")=X
K EEOL,EEON1,EEOC Q
Q
BASIS ;Basis data served
S DR="18.5///"_DATA,DR(2,785.01)=".01///"_DATA D ^DIE
Q
ISSUE ;Issue code served
S DR="17.5///"_DATA,DR(2,785.02)=".01///"_DATA_";1///"_$P(EEO("STRING"),U,2) D ^DIE
Q
CORR ;Corrective action served
S DR="61///"_DATA,DR(2,785.061)=".01///"_DATA D ^DIE
Q
INVEST ;Investigator data served
S EEO("ROOT")=""
I $D(^EEO(785,DA,11,"B",DATA)) S EEOETE=$O(^(DATA,0)) Q:EEOETE'>0 D
.F S EEOETE=$O(^EEO(785,DA,11,"B",DATA,EEOETE)) Q:EEOETE'>0 D
..K ^EEO(785,DA,11,"B",DATA,EEOETE),^EEO(785,DA,11,EEOETE)
.S (EEOFF,EEOETE)=0 F S EEOETE=$O(^EEO(785,DA,11,EEOETE)) Q:EEOETE'>0 S EEOFF=EEOFF+1,EEOFIV=EEOETE
.S:EEOFF>0 ^EEO(785,DA,11,0)="^785.03P^"_EEOFIV_"^"_EEOFF
.K EEOFF,EEOETE,EEOFIV
Q:GEE=0!('$D(^EEO(787.5,DATA))) S DATA(1)=$P($G(^EEO(787.5,DATA,0)),U)
S DR="27.5///"_DATA(1),DR(2,785.03)=".01///"_DATA(1)
F CN1=2:1:10 S DATA1=$P(EEO("STRING"),U,CN1) I DATA1'="" D
.S CN3=$O(^DD(785.03,"GL",0,CN1,""))
.S DR(2,785.03)=DR(2,785.03)_";"_CN3_"///"_DATA1
D ^DIE
WP Q
STAN S EEO("NODE")=^XMB(3.9,XMZ,2,EEO("LINE"),0)
S EEO("STRING")=^XMB(3.9,XMZ,2,EEO("LINE")+1,0)
Q
ADINV ;Update an investigator in file 787.5
S EEO("ROOT")="",DIE=787.5 S:EEO("NODE")=0 EEOINV=$P(EEO("STRING"),U)
F EEOPL=1:1:6 S EEOI(EEOPL)=$P(EEO("STRING"),U,EEOPL)
S DA=EEO("DA")
I EEO("NODE")=0 S DR=".01///"_EEOINV_";2///"_EEOI(3)_";3///"_EEOI(4)_";4///"_EEOI(5)_";5///"_EEOI(6)
I EEO("NODE")>0 S DR="27.5///"_EEOINV_";1///"_EEOI(1),DR(2,787.51)=".01///"_EEOI(1)_";1///"_EEOI(2)_";2///"_EEOI(3)
D ^DIE K EEOI,DR Q
INFILE ;Adds an investigator to file 787.5
N DIC S DINUM=DA,X=EEOINV,DIC="^EEO(787.5,",DIC(0)="L" D FILE^DICN
Q
IN ;Test for incomplete investigator info
S:EEO("DA")=0 DR="1///"_DATA,DR(2,787.51)=".01///"_DATA_";1///"_$P(EEO("STRING"),U,2)_";2///"_$P(EEO("STRING"),U,3) D ^DIE Q
ADDINV F CNT5=1:1:3 S ADDINV(CNT5)=$P(EEO("STRING"),U,CNT5)
S DR(2,787.51)=".01///"_ADDINV(1)_";1///"_ADDINV(2)_";2///"_ADDINV(3)
S DR="1///"_ADDINV(1),DA=EEO("DA"),DIE=787.5 D ^DIE
K CNT5,ADDINV,DR,DIE,DA Q