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

ACRFDRCL.m

Go to the documentation of this file.
ACRFDRCL ;IHS/OIRM/DSD/THL,AEF - REQUEST TYPE SEQUENCE CONTROL; [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;ROUTINE USED TO ESTABLISH AND CHANGE REQUEST TYPE APPROVAL
 ;;SEQUENCE CONTROL
EN S DIC(0)="AEMQZ"
 D AREA^ACRFAS
 Q:$D(ACRQUIT)!'$G(ACRADA)
 D:'$D(^ACRDOCA("AC",ACRADA)) NEWSU
 F  D EN1 Q:$D(ACRQUIT)!$D(ACROUT)
EXIT K ACRDATA,ACRDATA1,ACRQUIT,ACRSET,ACRJ,ACRMAX,ACRREFC,ACRTT,ACRCAT,ACRI,ACRJJ,ACRORDR,ACRTX,ACRTXNAM,ACRJJJ
 Q
EN1 D SELECT,LOCATION:'$D(ACRQUIT)
 Q
SELECT S ACRXDRCL="ESTABLISH APPROVAL SEQUENCE FOR: "_$P(^AUTTAREA(+^ACRSYS(ACRADA,0),0),U)
 S ACRSET=""
 D DISPLAY^ACRFTXTP
 K ACRXDRCL
 S DIR(0)="NOA^1:"_ACRJ_"^K:X'?1N.2N!(X<1)!(X>ACRJ) X"
 S DIR("A")="Which one ==> "
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)
 S (ACRRCDA,DA)=+ACRTX(X)
 S ACRCAT=$P(ACRTX(X),U,6)
 S ACRREFC=$P(^ACRTXTYP(DA,0),U)
 Q
LOCATION F  D DISPLAY,SET Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT
 Q
DISPLAY W @IOF
 W !!?9,"APPROVAL SEQUENCE FOR: ",@ACRON,ACRREFC,@ACROF
 W !!,"NO. SEQ"
 W ?9,"APPROVAL CATEGORY"
 W ?40,"NO. SEQ"
 W ?49,"APPROVAL CATEGORY"
 W !,"--- ---  -------------------------"
 W ?40,"--- ---  -------------------------"
 N ACRY
 S ACRY=0
 K ACRDATA
 F ACRJ=1:1 S ACRY=$O(^ACRAPVT("C",ACRCAT,ACRY)) Q:'ACRY  D
 .S ACRORDR=$P(^ACRAPVT(ACRY,0),U,4)
 .S ACRDATA(100+ACRORDR)=ACRRCDA_U_ACRY_U
 .S (ACRMAX,ACRSET)=ACRJ
 S ACRDATA(100+ACRJ)=ACRRCDA_U_(19)_U
 S ACRDATA(100+ACRJ+1)=ACRRCDA_U_15_U
 S ACRSET=ACRJ+1
 D DD1
 S ACRJ=0
 S ACRMAX=ACRMAX+(ACRMAX#2)
 F  S ACRJ=$O(ACRDATA(ACRJ)) Q:ACRJ>12!('ACRJ)  D DISP1
 K ACRX,ACRSEQ,ACRAPDA
 Q
DD1 S ACRJ=100
 S ACRMAX=0
 F  S ACRJ=$O(ACRDATA(ACRJ)) Q:'ACRJ  D
 .S ACRAPDA=$P(ACRDATA(ACRJ),U,2)
 .I '$D(ACRDATA1),$D(^ACRDOCA("AC",ACRADA,ACRRCDA,ACRAPDA)) S ACRSEQ=$O(^(ACRAPDA,"")),ACRSEQX=$O(^(ACRSEQ,0)) S:$P(^ACRDOCA(ACRSEQX,0),U,4)]"" ACRDATA(ACRSEQ,$P(^(0),U,4))=""
 .E  S ACRSEQ=$P($G(ACRDATA1(ACRJ)),U,3)
 .I ACRSEQ D
 ..S ACRDATA(ACRSEQ)=ACRDATA(ACRJ)_ACRSEQ D
 ..K ACRDATA(ACRJ)
 ..S ACRMAX=$S(ACRSEQ>ACRMAX:ACRSEQ,1:ACRMAX)
 S ACRJ=100
 F  S ACRJ=$O(ACRDATA(ACRJ)) Q:'ACRJ  D
 .S ACRMAX=ACRMAX+1
 .S ACRDATA(ACRMAX)=ACRDATA(ACRJ)
 .K ACRDATA(ACRJ)
 Q
DISP1 S ACRAPDA=$P(ACRDATA(ACRJ),U,2)
 S ACRSEQ=$P(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 S (ACRMAX,ACRSET)=ACRJ
 Q
S1 S ACRXX=$P(ACRX,",",ACRJ)
 S ACRDATA(ACRXX)=ACRDATA(ACRXX)_ACRJ
 S ACRDATA1(ACRXX)=ACRDATA(ACRXX)
 Q
S2 S DA=ACRX
 S DIK="^ACRDOCA("
 D DIK^ACRFDIC
 Q
S3 S DIC="^ACRDOCA("
 S DIC(0)="L"
 S X=+ACRDATA1(ACRX)
 S DIC("DR")=".02////"_$P(ACRDATA1(ACRX),U,2)_";.03////"_$P(ACRDATA1(ACRX),U,3)_";.06////"_ACRADA
 S:$P(ACRDATA1(ACRX),U,4)="Y" DIC("DR")=DIC("DR")_";.04////Y"
 D FILE^ACRFDIC
 Q
ACRTT ;EP;
 S ACRTT=""
 D EN
 K ACRTT
 Q
NEWSU ;COPY APPROVALS FROM EACRDAISTING PATTERN
 W *7,*7
 W !!,"There don't appear to be any signature sequences on file for this Area Setup."
 W !,"Signature sequences from the primary system will now be duplicte."
 D WAIT^DICD
 N Y
 S ACRDA=0
 F  S ACRDA=$O(^ACRDOCA(ACRDA)) Q:'ACRDA  I $D(^ACRDOCA(ACRDA,0)),$P(^(0),U,6)=1 S Y=^(0) D
 .S X=+Y
 .S DIC="^ACRDOCA("
 .S DIC(0)="L"
 .S DIC("DR")=".02////"_$P(Y,U,2)_";.03////"_$P(Y,U,3)_";.04////"_$P(Y,U,4)_";30////"_$P(Y,U,5)_";.06////"_ACRADA
 .D FILE^ACRFDIC
 Q