source: WorldVistAEHR/trunk/r/EEO_COMPLAINT_TRACKING-EEO/EEOEEXE.m@ 703

Last change on this file since 703 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1EEOEEXE ;HISC/JWR - EEO SERVER ROUTINE (VERSION 1.0 SITES);2/25/93 13:03
2 ;;2.0;EEO Complaint Tracking;;Apr 27, 1995
3 S:$D(X) EEODX=X S XQSTXT="XQSTXT("
4 ;I '$D(^XMB(3.9,XMZ,2,1,0)) S XQSTXT(10)="<ERROR> Could not find the first line of the message" G EXIT
5 S STANO=^XMB(3.9,XMZ,2,1,0),TYPE=$P(STANO,"^",2),EEOKEY=$P($G(STANO),"^",3),STANO=+STANO Q:EEOKEY>19
6 ;S X=$O(^DIC(4,"D",STANO,"")) ;I X="" S XQSTXT(10)="<ERROR> Could not find the station requested "_STANO_" Call the ISC. XMZ= "_XMZ G EXIT
7 ;S STAPTR=X
8 I '(TYPE="DATA") S XQSTXT(10)="<ERROR> Message missent to the EEO_DATA Server" G EXIT
9 ;Q:TYPE["STATUS"
10 S X="NOW",%DT="DTXO" D ^%DT S NOWP=Y K %DT
11 S CNTR=10,EEOKEY=$P(^XMB(3.9,XMZ,2,1,0),U,3)
12 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
13 I '$D(DOMFROM) S DOMFROM=$P(^XMB(1,1,0),"^"),DOMFROM=$P(^DIC(4.2,DOMFROM,0),"^")
14 K EEOD("MESS") F X=2:1 Q:'$D(^XMB(3.9,XMZ,2,X)) Q:^(X,0)="&&&&&"
15 S EEOD("&&&&&")=X
16 F EEO("LINE")=2:1 Q:'$D(^XMB(3.9,XMZ,2,EEO("LINE"),0)) Q:(^(0))="&&&&&" Q:EEO("LINE")'>0
17 S EEOM("DA")="",EEO("LINE")=EEO("LINE")+1
18 F EEO("LINE")=EEO("LINE"):2 Q:'$D(^XMB(3.9,XMZ,2,EEO("LINE"),0)) D
19 .I EEOKEY>10 D DEC S EEO("DA")=$P(EEO("NODE"),U,2),EEO("FILE")=+EEO("NODE"),EEO("NODE")=$P(EEO("NODE"),U,3),EEOQ=-1 D:EEOKEY<20&(EEO("NODE")=1!(EEO("NODE")=3)) F2MUL^EEOUTIL G ELOCK
20NORM .S EEO("NODE")=^XMB(3.9,XMZ,2,EEO("LINE"),0),(DIDEL,EEO("FILE"))=+EEO("NODE"),EEO("DA")=$P(EEO("NODE"),"^",2),EEO("NODE")=$P(EEO("NODE"),"^",3),EEOQ=-1
21 .S EEO("STRING")=^XMB(3.9,XMZ,2,EEO("LINE")+1,0)
22ELOCK .L +^EEO(EEO("FILE"),EEO("DA")):0 I '$T H 30 G ELOCK
23 .F EEO=1:1 S EEO("DATA")=$P(EEO("STRING"),"^",EEO) Q:$P(EEO("STRING"),"^",EEO,999)="" I EEO("DATA")]"" D
24 ..I $O(^DD(EEO("FILE"),"GL",EEO("NODE"),""))=0 D MULT Q
25 ..S EEO("FIELD")=$O(^DD(EEO("FILE"),"GL",EEO("NODE"),EEO,""))
26 ..S EEO("ROOT")=^DIC(EEO("FILE"),0,"GL")
27 ..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
28 ..Q:EEO("FIELD")=""
29 ..K DR S DIE=EEO("FILE"),DA=EEO("DA")
30 ..I $P(^DD(EEO("FILE"),EEO("FIELD"),0),U,2)["D" S DR=EEO("FIELD")_"////"_EEO("DATA") D ^DIE Q
31 ..S DIDEL=785
32 ..S DR=EEO("FIELD")_"///"_EEO("DATA") D ^DIE
33EXITOK S X="XMA1C" X ^%ZOSF("TEST") I $T S XMSER="S.EEO UPLINK SERVER",XMZ=XQMSG D REMSBMSG^XMA1C
34 L -^EEO(EEO("FILE"),EEO("DA"))
35EXIT ;Kills local variables
36 S XMDUZ="EEO SERVER FOR "_^DD("SITE") K EEOD,EEODX,EEOE,EEO,DR,STANO,EEOKEY,DIDEL,CN1,CN2,CN3,DATA,EENOD,EEOL,EEON,TYPE Q
37ERR G EXIT
38 Q
39DEC ;Decrypts messages from version 1.0 sites
40 K EEO("STRING") S X=^XMB(3.9,XMZ,2,EEO("LINE"),0),X1=$$SITE^EEOEEXMT,X2=EEO("LINE")
41 D DE^XUSHSHP S EEO("NODE")=X,X2=X2+1
42 S EEON1=^XMB(3.9,XMZ,2,EEO("LINE")+1,0),EEOL=$L(EEON1)
43 I EEOL<50 S X=EEON1 D DE^XUSHSHP S EEO("STRING")=X Q
44 I EEOL'<50 F EEOC=0:50:250 S X=$E(EEON1,EEOC+1,EEOC+50) D DE^XUSHSHP D
45 .I $D(EEO("STRING")) S EEO("STRING")=EEO("STRING")_X Q
46 .I '$D(EEO("STRING")) S EEO("STRING")=X
47 K EEOL,EEON1,EEOC Q
48 Q
49MULT ;Converts Version 1 non-multiples into version 2 multiple fields
50 S DIE=EEO("FILE"),EEO("FIELD")=$O(^DD(EEO("FILE"),"GL",EEO("NODE"),0,"")),SUB=+$P($G(^DD(EEO("FILE"),EEO("FIELD"),0)),U,2)
51 S DR=EEO("FIELD")_"///"_$P(EEO("STRING"),U)
52SUBDR ;Makes sub-DR strings for Multiple fields
53 F EEO1=1:1 Q:$P(EEO("STRING"),U,EEO1,999)="" S EEO("DATA1")=$P(EEO("STRING"),U,EEO1) D
54 .S SUB1=$O(^DD(SUB,"GL",0,EEO1,"")),DR(2,SUB)=SUB1_"///"_EEO("DATA1")
55 D ^DIE
56 K DR,SUB,SUB1,EEO1 Q
57STAN S EEO("NODE")=^XMB(3.9,XMZ,2,EEO("LINE"),0)
58 S EEO("STRING")=^XMB(3.9,XMZ,2,EEO("LINE")+1,0) Q
Note: See TracBrowser for help on using the repository browser.