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

ACRFDISA.m

Go to the documentation of this file.
ACRFDISA ;IHS/OIRM/DSD/THL,AEF - DISPLAY DISAPPROVALS AND APPROVAL COMMENTS; [ 09/23/2005   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**19**;NOV 05, 2001
 ;;ROUTINE USED TO DISPLAY DISAPPROVALS AND APPROVAL COMMENTS
EN D EN1
EXIT K ACRINDVA,ACRINAM,ACRIANAM,ACRNO
 Q
EN1 K ACRQUIT
 N ACRAPDA,ACRYES
 S (ACRAPDA,ACRYES)=0
 F  S ACRAPDA=$O(^ACRAPVS("AB",ACRDOCDA,ACRAPDA)) Q:'ACRAPDA  D
 . Q:'$D(^ACRAPVS(ACRAPDA,0))
 . Q:'$D(^ACRAPVS(ACRAPDA,"DT"))
 . Q:$G(^ACRAPVS(ACRAPDA,"RSN"))']""!($G(^ACRAPVS(ACRAPDA,"CNG"))']"")!($G(^ACRAPVS(ACRAPDA,"RESP"))']"")!($P(^ACRAPVS(ACRAPDA,"DT"),U)'="D")!'$D(^ACRAPVS(ACRAPDA,1,0))
 . S ACRYES=1
 I $G(ACRYES) D YES
 I $D(ACRQUIT)!$D(ACROUT) K ACRQUIT Q
 N ACRRSN,ACRCNG,ACRRESP,ACRX,ACRI,ACRINDV,ACRDATE
 S ACRAPDA=0
 F  S ACRAPDA=$O(^ACRAPVS("AB",ACRDOCDA,ACRAPDA)) Q:'ACRAPDA  D
 . Q:'$D(^ACRAPVS(ACRAPDA,0))
 . Q:'$D(^ACRAPVS(ACRAPDA,"DT"))
 . Q:$G(^ACRAPVS(ACRAPDA,"RSN"))']""!($G(^ACRAPVS(ACRAPDA,"CNG"))']"")!($G(^ACRAPVS(ACRAPDA,"RESP"))']"")!($P(^ACRAPVS(ACRAPDA,"DT"),U)'="D")!'$D(^ACRAPVS(ACRAPDA,1,0))
 . D APDA
 S ACRRSN=$G(^ACROBL(ACRDOCDA,"RSN"))
 S ACRCNG=$G(^ACROBL(ACRDOCDA,"CNG"))
 S ACRRESP=$G(^ACROBL(ACRDOCDA,"RESP"))
 I ACRRSN]""!(ACRCNG]"")!(ACRRESP]"") D
 .S ACRZ=$G(ACRZ)+1,ACR0=""
 .D MESS
 Q
YES S DIR(0)="YOA"
 S DIR("A")="Review APPROVAL COMMENTS or reason for DISAPPROVAL: "
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 I Y'=1 S ACRQUIT=""
 Q
APDA ;EP;TO DISPLAY REMARKS FOR SELECTED APPROVAL
 W @IOF
 W !!?10,"COMMENTS REGARDING THIS APPROVAL"
 W !?10,"--------------------------------"
 S ACRRSN=$G(^ACRAPVS(ACRAPDA,"RSN"))
 S ACRCNG=$G(^ACRAPVS(ACRAPDA,"CNG"))
 S ACRRESP=$G(^ACRAPVS(ACRAPDA,"RESP"))
 S ACRNO=$G(^ACRAPVS(ACRAPDA,"DT"))
 S ACRDATE=$P(ACRNO,U,4)
 S ACRINDV=$P(ACRNO,U,2)
 S ACRINDVA=$P(ACRNO,U,6)
 S:ACRRSN="" ACRRSN=$G(^ACROBL(ACRDOCDA,"RSN"))
 S:ACRCNG="" ACRCNG=$G(^ACROBL(ACRDOCDA,"CNG"))
 S:ACRRESP="" ACRRESP=$G(^ACROBL(ACRDOCDA,"RESP"))
 ;I ACRINDVA,ACRINDVA'=ACRINDV S ACRIANAM=$P($P($P(^VA(200,ACRINDVA,0),U),",",2)," ")_" "_$P($P(^(0),U),",")  ;ACR*2.1*19.02 IM16848
 ;S ACRINAM=$P($P($P(^VA(200,ACRINDV,0),U),",",2)," ")_" "_$P($P(^(0),U),",")  ;ACR*2.1*19.02 IM16848
 I ACRINDVA,ACRINDVA'=ACRINDV S ACRIANAM=$$NAME3^ACRFUTL1(ACRINDVA)   ;ACR*2.1*19.02 IM16848
 S ACRINAM=$$NAME3^ACRFUTL1(ACRINDV)  ;ACR*2.1*19.02 IM16848
 S ACRNO=$P(ACRNO,U)
 W !?10
 I ACRNO="D" W $S($P(^ACRAPVS(ACRAPDA,0),U,11):"TRAVEL ADVANCE ",1:"")_"DISAPPROVED BY "
 E  W "SIGNED/REVIEWED BY: "
 I $D(ACRIANAM) W ACRIANAM," FOR "
 W ACRINAM
 I ACRNO="D" D
 .W " ON "
 .S Y=ACRDATE
 .X ^DD("DD")
 .W Y
 W !
 S (ACRI,ACRZ)=0
 F  S ACRZ=$O(^ACRAPVS(ACRAPDA,1,ACRZ)) Q:'ACRZ  D
 .S ACR0=$G(^ACRAPVS(ACRAPDA,1,ACRZ,0))
 .S:$G(^ACRAPVS(ACRAPDA,1,ACRZ,"CNG"))]"" ACRCNG=^("CNG")
 .S:$G(^ACRAPVS(ACRAPDA,1,ACRZ,"RSN"))]"" ACRRSN=^("RSN")
 .S ACRRESP=$G(^ACRAPVS(ACRAPDA,1,ACRZ,"RESP"))
 .D:ACRCNG]""!(ACRRSN]"")!(ACRRESP]"") MESS
 I '$D(^ACRAPVS(ACRAPDA,1)),ACRCNG]""!(ACRRSN]"")!(ACRRESP]"") D
 .S ACR0=$P(^ACRAPVS(ACRAPDA,"DT"),U,3)_U_$S($P(^("DT"),U,6):$P(^("DT"),U,6),1:$P(^("DT"),U,2))
 .D MESS
 S ACRZ=ACRI
 Q
MESS ;EP;TO PRINT MESSAGE
 S Y=$P(ACR0,U)
 X ^DD("DD")
 W !!?4,"MESSAGE NO.: ",ACRZ
 W !?4,"DATE: ",Y
 ;W:$P(ACR0,U,2) ?40,"FROM: ",$P(^VA(200,$P(ACR0,U,2),0),U)  ;ACR*2.1*19.02 IM16848
 W:$P(ACR0,U,2) ?40,"FROM: ",$$NAME2^ACRFUTL1($P(ACR0,U,2))  ;ACR*2.1*19.02 IM16848
 W !?10,"----------"
 W ?46,"------------------------------"
 F ACRX="ACRCNG","ACRRSN" D
 .F ACRI=1:1:5 W:$P(@ACRX,U,ACRI)]"" !?10,$P(@ACRX,U,ACRI)
 I ACRRESP]"" D
 .S Y=$P(ACR0,U,4)
 .X ^DD("DD")
 .W !!?4,"RESPONSE"
 .W !?4,"DATE: ",Y
 .;W:$P(ACR0,U,3) ?40,"FROM: ",$P(^VA(200,$P(ACR0,U,3),0),U)  ;ACR*2.1*19.02 IM16848
 .W:$P(ACR0,U,3) ?40,"FROM: ",$$NAME2^ACRFUTL1($P(ACR0,U,3))  ;ACR*2.1*19.02 IM16848
 .W !?10,"-------------------------------------------"
 .F ACRI=1:1:5 W:$P(ACRRESP,U,ACRI)]"" !?10,$P(ACRRESP,U,ACRI)
 D PAUSE^ACRFWARN
 S ACRI=ACRZ
 Q