Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ACRFSCHK

ACRFSCHK.m

Go to the documentation of this file.
ACRFSCHK ;IHS/OIRM/DSD/THL,AEF - CHECK FOR PREVIOUS APPROVALS WHEN DATA IS CHANGED; [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;ROUTINE TO CHECK FOR PREVIOUS APPROVALS TO A DOCUMENT AND
 ;;RESUBMIT FOR APPROVAL IF DATA IS CHANGED
EN I $D(^TMP("ACRSS",$J)) D EN1:$D(^ACRAPVS("AB",ACRDOCDA))
EXIT K ACR,ACRSSDA,ACRX,^TMP("ACRSS",$J)
 Q
EN1 ;CHECK IF DOCUMENT HAS PREVIOUSLY BEEN APPROVED
 K ACRSCHK
 D APCHK
 Q:'$D(ACRSCHK)
 ;COMPARE DATA WITH CURRENT DATA
 K ACRSCHK
 S ACRSSDA=0
 F  S ACRSSDA=$O(^ACRSS(ACRXREF,ACRDOCDA,ACRSSDA)) Q:'ACRSSDA!$D(ACRSCHK)  D
 .F ACRX=0,"APV","DESC","DT","NMS","NOTES","TRAV","VND","VND1" Q:$D(ACRSCHK)  D
 ..I $D(^TMP("ACRSS",$J,ACRSSDA,ACRX))#2,^TMP("ACRSS",$J,ACRSSDA,ACRX)'=$G(^ACRSS(ACRSSDA,ACRX)) S ACRSCHK=""
APPROVE ;EP;RESUBMIT DOCUMENT FOR APPROVAL
 Q:'$D(ACRSCHK)
 Q:'$D(^ACRAPVS("AB",+$G(ACRDOCDA)))
 W *7,*7
 W !!,"DOCUMENT RESUBMITTED FOR APPROVAL DUE TO CHANGES MADE."
 D ^ACRFAPVS
 D PAUSE^ACRFWARN
 Q
APCHK ;EP;TO CHECK APPROVALS FOR 'APPROVED' STATUS
 N X
 S X=0
 F  S X=$O(^ACRAPVS("AB",ACRDOCDA,X)) Q:'X!$D(ACRSCHK)  D
 .I $E($G(^ACRAPVS(X,"DT")))="A",$P(^ACRDOC(ACRDOCDA,0),U,13)=$P($G(^ACRAPVS(X,0)),U,6) S ACRSCHK=""
 Q