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

ACRFALT.m

Go to the documentation of this file.
ACRFALT ;IHS/OIRM/DSD/THL,AEF - PROCESS SIGNATURES AS ACTING;  [ 09/22/2005   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**19**;NOV 05, 2001
 ;;ROUTINE TO DISPLAY, SELECT AND PROCESS DOCUMENTS PENDING FOR
 ;;ALTERNATE'S SIGNATURE
EN ;EP;TO DISPLAY, SELECT AND PROCESS DOCUMENTS PENDING FOR ALTERNATES
 ;SIGNATURE
 F  D EN1 Q:$D(ACRQUIT)!$D(ACROUT)
EXIT K ACR,ACRALTY,ACRJ,ACRALTX,ACRQUIT
 Q
EN1 W @IOF
 W !,"Documents are pending for:"
 W !
 D DISP
 I ACRJ<2 D  Q
 .S ACRQUIT=""
 .W !,"You have no more documents to sign as an alternate."
 .H 2
 D SELECT
 Q
SELECT ;SELECT INDIVIDUAL FOR WHOM USER WILL SIGN AS ALTERNATE
 S DIR(0)="NO^1:"_(ACRJ-1)
 S DIR("A")="Which one"
 W !!,"Indicate number of the individual for whom you are an authorized"
 W !,"alternate and for whom you want to review/authorize for incumbent."
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)
 S ACRALTY=Y
 S ACRDUZ=ACRALTX(ACRALTY)
 D RELIST
 F  D SIGS Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT
 Q
DISP ;DISPLAYS LIST OF ALL INDIVIDUALS FOR WHOM CURRENT USER IS ALTERNATE
 I $D(^TMP("ACRALTDT",$J)) D R1
 S ACR=0
 F ACRJ=1:1 S ACR=$O(^TMP("ACRALT",$J,ACR)) Q:'ACR  D
 .I $D(^VA(200,ACR,0)) D
 ..N X
 ..;S X=$P(^VA(200,ACR,0),U)  ;ACR*2.1*19.02 IM16848
 ..S X=$$NAME2^ACRFUTL1(ACR)  ;ACR*2.1*19.02 IM16848
 ..S ACRNAM=$P($P(X,",",2)," ")_" "_$P(X,",")
 ..S ACRALTX(ACRJ)=ACR
 ..W !?10,ACRJ
 ..W ?15,ACRNAM
 Q
SIGS ;PROCESS DOCUMENTS PENDING FOR USER TO SIGN AS ALTERNATE
 S ACRDUZ=ACRALTX(ACRALTY)
 S ACRI=0
 D LIST2^ACRFPRCS
 D EN21^ACRFPRCS:'$D(ACRQUIT)
 D RELIST:'$D(ACRQUIT)
 Q
XY ;SETS LOCAL ARRAY 'ACRDATA'
 S %X="^TMP(""ACRALT"","_$J_","_ACRDUZ_","
 S %Y="^TMP(""ACRDATA"","_$J_","_ACRDUZ_","
 D %XY^%RCR
 K %X,%Y
 Q
RELIST ;RELISTS DOCUMENTS WHICH CURRENT USER NEEDS TO SIGN
 I $D(^TMP("ACRALTDT",$J)) D  Q
 .D R1
 .D XY
 K ACR
 S ACR=0
 F ACRJ=1:1 S ACR=$O(^TMP("ACRALT",$J,ACRDUZ,ACR)) Q:'ACR!($L(ACR)>8)  I ACRJ<ACR D
 .S ^TMP("ACRALT",$J,ACRDUZ,ACRJ)=^TMP("ACRALT",$J,ACRDUZ,ACR)
 .N ACRDOC
 .S ACRDOC=$P(^TMP("ACRALT",$J,ACRDUZ,ACR),U,5)
 .S ^TMP("ACRALT",$J,ACRDUZ,ACRDOC)=^TMP("ACRALT",$J,ACRDUZ,ACR)
 .S $P(^TMP("ACRALT",$J,ACRDUZ,ACRDOC),U,10)=ACRJ
 .K ^TMP("ACRALT",$J,ACRDUZ,ACR),^TMP("ACRDATA",$J,ACRDUZ,ACR)
 D XY
 Q
R1 ;CHANGE DATE ORDER ARRAY OF DOCS TO BE SIGNED TO NUMERIC ORDERED ARRAY
 N ACRDUZ,ACR,ACRI,ACR1
 S ACRDUZ=0
 F  S ACRDUZ=$O(^TMP("ACRALTDT",$J,ACRDUZ)) Q:'ACRDUZ  D
 .S (ACR,ACRI)=0
 .F  S ACR=$O(^TMP("ACRALTDT",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