source: FOIAVistA/trunk/r/EEO_COMPLAINT_TRACKING-EEO/EEOEEDIE.m@ 1437

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

initial load of FOIAVistA 6/30/08 version

File size: 3.2 KB
Line 
1EEOEEDIE ;HISC/JWR - BREAKS DOWN "DR" STRINGS, AND HOLDS DATA FOR TRANSMISSION ;11/23/92 10:03
2 ;;2.0;EEO Complaint Tracking;;Apr 27, 1995
3ENTER ;Entry point, breaks down 'DR' strings, prepares a pre-edit session array of data from file 785
4 K EEOEE S ^XTMP("EEOX",0)=DT+5_"^"_DT
5 S EEOEE("DIE")=$S(+DIE:DIE,1:+$P(@(DIE_"0)"),"^",2)),EEOEE("DA")=DA,EEOEE("DR")=DR
6 F AEE=1:1 S BEE=$P(EEOEE("DR"),";",AEE) Q:BEE="" D
7 .I '(+BEE) S EEOEE("DR")=$P(EEOEE("DR"),";",1,AEE-1)_$S(AEE=1:"",1:";")_$P(EEOEE("DR"),";",AEE+1,AEE+999),AEE=AEE-1
8 .I BEE[":" S CEE=$P(EEOEE("DR"),";",AEE),EEOEE("DR")=$P(EEOEE("DR"),";",1,AEE-1)_$S(AEE=1:"",1:";")_$P(BEE,":",1)_";"_$P(EEOEE("DR"),";",AEE+1,AEE+999) S DEE=$P(BEE,":",1) F S DEE=$O(^DD(785,DEE)) Q:DEE'>0 Q:DEE>$P(BEE,":",2) D
9 ..S:'$D(EEOEE("TEST",DEE)) EEOEE("DR")=$P(EEOEE("DR"),";",1,AEE)_";"_DEE_";"_$P(EEOEE("DR"),";",AEE+1,AEE+999),EEOEE("TEST",DEE)=""
10 F AEE=1:1 S BEE=$P(EEOEE("DR"),";",AEE) Q:BEE="" S EEOEE("TEST",+BEE)=""
11 S EEOEE("ARRAY")="BEFORE" D ARRAY
12 D DIE
13AFTER ;Sets up an array of the data after the edit session and looks for changes from prior to the edit session
14 S EEOEE("ARRAY")="AFTER" D ARRAY
15 S AEE="" F S AEE=$O(EEOEE("BEFORE",785,EEOEE("DA"),AEE)) Q:AEE="" D
16 .I AEE>6&(AEE<12) D MUCMP Q
17 .F BEE=1:1 S DEE=$P(EEOEE("BEFORE",785,EEOEE("DA"),AEE),"^",BEE) Q:$P(EEOEE("BEFORE",785,EEOEE("DA"),AEE),"^",BEE-1,999)=""&($P(EEOEE("AFTER",785,EEOEE("DA"),AEE),"^",BEE-1,999)="") S EEE=$P(EEOEE("AFTER",785,EEOEE("DA"),AEE),"^",BEE) D TEST
18 K EEOEE Q
19SAVE ;Marks those records to be transmitted by the tasked option
20 Q:'$D(DA)!($G(FYI)=$G(DA)) I $P($G(^EEO(785,DA,1)),U,3)>0 S DR="62///X",FYI=DA D ^DIE Q
21 Q
22NEW ;Lookup on complaint
23 D ^DIC Q:Y'>0 Q:DIC(0)'["L" N Y Q
24ARRAY ;Sets up before and after edit arrays to check for changed data
25 S AEE="" F S AEE=$O(EEOEE("TEST",AEE)) Q:AEE="" D
26 .Q:'$D(^DD(785,AEE,0))
27 .S LEE=^DD(785,AEE,0) Q:$P(LEE,"^",2)["C" S NEE=$P(LEE,"^",4),PEE=$P(NEE,";",2),NEE=$P(NEE,";",1) I PEE=0 D MULT Q
28 .S $P(EEOEE(EEOEE("ARRAY"),785,EEOEE("DA"),NEE),"^",PEE)=$P($G(^EEO(785,EEOEE("DA"),NEE)),"^",PEE)
29 Q
30DIE ;The call to ^DIE
31 N EEOEE D ^DIE Q
32MULT ;Makes multiples into test arrays during edits (like 'ARRAY' entry pt.)
33 I '$D(^EEO(785,EEOEE("DA"),NEE,0)) S EEOEE(EEOEE("ARRAY"),785,EEOEE("DA"),NEE,1)="" Q
34 S EEOG=0 F S EEOG=$O(^EEO(785,EEOEE("DA"),NEE,EEOG)) Q:EEOG'>0 D
35 .S EEOEE(EEOEE("ARRAY"),785,EEOEE("DA"),NEE,EEOG)=$G(^EEO(785,EEOEE("DA"),NEE,EEOG,0))
36 Q
37TEST ;Test to determine if data has been changed
38 I DEE=EEE Q
39 I DEE'="",EEE="" D
40 .I AEE>6&(AEE<12) S:BEE=1 $P(^XTMP("EEOX",EEOEE("DA"),AEE,VEE),U,BEE)="@"_DEE D SAVE S:BEE'=1 $P(^XTMP("EEOX",EEOEE("DA"),AEE,VEE),U,BEE)="@" Q
41 .E S X="@" S $P(^XTMP("EEOX",EEOEE("DA"),AEE),U,BEE)="@" D SAVE Q
42 I DEE'=EEE S X=EEE D SAVE Q
43 Q
44MUCMP ;Puts multipes data into variables to be tested for changed data
45 S VEE=0 F S VEE=$O(EEOEE("BEFORE",785,EEOEE("DA"),AEE,VEE)) Q:VEE="" D
46 .F BEE=1:1 S DEE=$P(EEOEE("BEFORE",785,EEOEE("DA"),AEE,VEE),"^",BEE) Q:$P(EEOEE("BEFORE",785,EEOEE("DA"),AEE,VEE),"^",BEE-1,999)=""&($P($G(EEOEE("AFTER",785,EEOEE("DA"),AEE,VEE)),"^",BEE-1,999)="") D
47 ..S EEE=$P($G(EEOEE("AFTER",785,EEOEE("DA"),AEE,VEE)),"^",BEE) D TEST
48 .K EEOEE("AFTER",785,EEOEE("DA"),AEE,VEE)
49ADD I $O(EEOEE("AFTER",785,EEOEE("DA"),AEE,0))>0 D SAVE Q
Note: See TracBrowser for help on using the repository browser.