EEOEINP ;HISC/JWR - DETERMINES THE PROPER SEQUENCE OF DATES ENTERED FOR CERTAIN FIELDS ;09/09/93 13:35 ;;2.0;EEO Complaint Tracking;;Apr 27, 1995 ;Compares sequenciality of dates being entered in edit sessions and provides help for improper order. S (EEOO2,EEOO3)="",EO=EEOS D DD I $D(EEOSEQ) F EEE=1:1 S EO=$P(EEOSEQ,U,EEE) Q:EO="" D DD,SEQ I $D(EEOREV) F EEE=1:1 S EO=$P(EEOREV,U,EEE) Q:EO="" D DD,REV G PRINT DD ;Gathers data dictionary information for fields being evaluated S EEOR=$G(^DD(785,EO,0)) Q:$P(EEOR,U,2)["C" S EEOO(EO)=$P(EEOR,U,4),EEOOE(EO)=$P(EEOR,U) DG ;Gathers information from this edit session for the field being tested. K EOO S EEOA=$P(EEOO(EO),";"),EEOB=$P(EEOO(EO),";",2) S:$D(DG(EEOO(EO))) EOO=DG(EEOO(EO)) GLOBE ;Gathers data from the EEOA node of the record being evaluated S EEOT=$G(^EEO(785,D0,EEOA)) S EOO=$G(EOO) S:EOO="" $P(EEOO(EO),U,4)="D" Q:$P(EEOT,U,EEOB)=""&(EOO)="" S Y=$P(EEOT,U,EEOB) D DD^%DT S $P(EEOO(EO),U,2)=Y I EOO'="" S Y=EOO D DD^%DT S $P(EEOO(EO),U,3)=Y Q SEQ ;Test the date entered against the other dates it is dependent on S EOO1=$P($G(EEOT),U,EEOB) Q:EOO'>0&(EOO1'>0) I EO>EEOS,X>EOO,EOO'="" D BAD I EO>EEOS&(X>EOO1)&(EOO="") D BAD I EO0&(EOO1'>0) ;Q:$P(EEOO(EO),U,4)["D" S:EO>EEOS EEOO2=EEOO2_"^"_EO S:EO0&(EOO1'>0) I EO>EEOS,XEEOS&(XEOO,EOO'="" D OOPS I EOEOO1)&(EOO="") D OOPS Q OOPS ;Checks for deleted records Q:$P(EEOO(EO),U,4)["D" S:EOEEOS EEOO3=EEOO3_"^"_EO Q