ACRFDAP ;IHS/OIRM/DSD/THL,AEF - SET DISPLAY OF APPROVALS; [ 11/01/2001 9:44 AM ]
;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
;;ROUTINE TO CHECK IF EACH TYPE OF APPROBAL HAS BEEN COMPLETED,
;;DISPLAYS '#' DURING DOCUMENT EDITING IS APPROVAL COMPLETED
EN ;EP
N ACRY
F ACRX=1:1:4,12:1:14,16,26,"AU","FA" D
.S ACR=$T(@ACRX)
.S ACR=$P(ACR,";;",2)
.S ACR(ACRX)=ACR
I $D(^ACRDOC(D0,"FA")) D
.S ACRX("FA")=$P(^ACRDOC(D0,"FA"),U)
.S ACRI="FA"
.D:ACRX("FA") D1
I $D(^ACRDOC(D0,"AU")) D
.S ACRX("AU")=$P(^ACRDOC(D0,"AU"),U)
.S ACRI="AU"
.D:ACRX("AU") D1
I $D(^ACRDOC(D0,"REQ")) F ACRI=12:1:14 D
.S ACRX(ACRI)=$P(^ACRDOC(D0,"REQ"),U,ACRI)
.D:ACRX(ACRI) D1
Q
D1 ;CHECK APPROVALS FOR COMPLETION
S ACRY=0
F S ACRY=$O(^ACRAPVS("AC",D0,ACRX(ACRI),ACRY)) Q:'ACRY D
.I $D(^ACRAPVS(ACRY,"DT")),$P(^ACRAPVS(ACRY,0),U,3)=ACR(ACRI),$P(^ACRAPVS(ACRY,"DT"),U)]"" D
..S ACRX(ACRI,1)=$P(^ACRAPVS(ACRY,"DT"),U)
Q
DATA ;;
AU ;;1
FA ;;2
12 ;;3
13 ;;4
14 ;;5
16 ;;8
26 ;;9
1 ;;10
2 ;;11
3 ;;12
4 ;;13
ACRFDAP ;IHS/OIRM/DSD/THL,AEF - SET DISPLAY OF APPROVALS; [ 11/01/2001 9:44 AM ]
+1 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
+2 ;;ROUTINE TO CHECK IF EACH TYPE OF APPROBAL HAS BEEN COMPLETED,
+3 ;;DISPLAYS '#' DURING DOCUMENT EDITING IS APPROVAL COMPLETED
EN ;EP
+1 NEW ACRY
+2 FOR ACRX=1:1:4,12:1:14,16,26,"AU","FA"
Begin DoDot:1
+3 SET ACR=$TEXT(@ACRX)
+4 SET ACR=$PIECE(ACR,";;",2)
+5 SET ACR(ACRX)=ACR
End DoDot:1
+6 IF $DATA(^ACRDOC(D0,"FA"))
Begin DoDot:1
+7 SET ACRX("FA")=$PIECE(^ACRDOC(D0,"FA"),U)
+8 SET ACRI="FA"
+9 IF ACRX("FA")
DO D1
End DoDot:1
+10 IF $DATA(^ACRDOC(D0,"AU"))
Begin DoDot:1
+11 SET ACRX("AU")=$PIECE(^ACRDOC(D0,"AU"),U)
+12 SET ACRI="AU"
+13 IF ACRX("AU")
DO D1
End DoDot:1
+14 IF $DATA(^ACRDOC(D0,"REQ"))
FOR ACRI=12:1:14
Begin DoDot:1
+15 SET ACRX(ACRI)=$PIECE(^ACRDOC(D0,"REQ"),U,ACRI)
+16 IF ACRX(ACRI)
DO D1
End DoDot:1
+17 QUIT
D1 ;CHECK APPROVALS FOR COMPLETION
+1 SET ACRY=0
+2 FOR
SET ACRY=$ORDER(^ACRAPVS("AC",D0,ACRX(ACRI),ACRY))
IF 'ACRY
QUIT
Begin DoDot:1
+3 IF $DATA(^ACRAPVS(ACRY,"DT"))
IF $PIECE(^ACRAPVS(ACRY,0),U,3)=ACR(ACRI)
IF $PIECE(^ACRAPVS(ACRY,"DT"),U)]""
Begin DoDot:2
+4 SET ACRX(ACRI,1)=$PIECE(^ACRAPVS(ACRY,"DT"),U)
End DoDot:2
End DoDot:1
+5 QUIT
DATA ;;
AU ;;1
FA ;;2
12 ;;3
13 ;;4
14 ;;5
16 ;;8
26 ;;9
1 ;;10
2 ;;11
3 ;;12
4 ;;13