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

TIUALFUN.m

Go to the documentation of this file.
  1. TIUALFUN ; SLC/AJB - TIU ALERT FUNCTIONS ;01/30/23 12:28
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**158,355**;Jun 20, 1997;Build 11
  1. ;
  1. Q
  1. ALRTDEL ;
  1. S TIU("DELETE")=1
  1. S TIU("MSG")=" Delete Alerts for the following documents:"
  1. D RESEND
  1. K TIU("DELETE"),TIU("MSG")
  1. Q
  1. ASKUSR ;
  1. N TIUTMP
  1. D I TIUTMP("ASK")=-1 S TIU("QUIT")=1 Q
  1. . N DIR,POP,TIUCONT,X,Y
  1. . S DIR(0)="SA^1:Browse Document;2:Combination Alerts;3:Delete Alerts;4:Detailed Display;5:Edit a Document;6:Identify Signers;7:Resend Alerts;8:Third Party Alerts"
  1. . S DIR("A")="Select ACTION: "
  1. . S DIR("B")="RESEND ALERTS"
  1. . S DIR("L",1)="1. Browse a Document 4. Detailed Display 7. Resend Alerts"
  1. . S DIR("L",2)="2. Combination Alerts 5. Edit a Document 8. Third Party Alerts"
  1. . S DIR("L",3)="3. Delete Alerts 6. Identify Signers"
  1. . S DIR("L",4)=""
  1. . S DIR("L")="Enter selection by typing the name, number, or abbreviation"
  1. . S DIR("?",1)="The following actions are available:"
  1. . S DIR("?",2)="Browse a Document - View a selected document (if authorized)"
  1. . S DIR("?",3)="Combination Alerts - Send alerts to expected signers and 3rd parties"
  1. . S DIR("?",4)="Delete Alerts - Delete a document's alerts"
  1. . S DIR("?",5)="Detailed Display - View detailed display of a document (if authorized)"
  1. . S DIR("?",6)="Edit a Document - Edit a selected document (if authorized)"
  1. . S DIR("?",7)="Identify Signers - Identify/Change Signers of a document (if authorized)"
  1. . S DIR("?",8)="Resend Alerts - Resend alerts to expected signers"
  1. . S DIR("?")="Third Party Alerts - Send alerts to one or more 3rd parties"
  1. . F D ^DIR D Q:$G(TIUCONT)!$D(DIRUT)
  1. . . I $D(TIUC(2)),+Y=1 W !,"You can only browse one document at a time. Select another action." Q
  1. . . I $D(TIUC(2)),+Y=4 W !,"You can only view the detailed display of one document at a time.",!,"Select another action." Q
  1. . . I $D(TIUC(2)),+Y=5 W !,"You can only edit one document at a time. Select another action." Q
  1. . . I $D(TIUC(2)),+Y=6 W !,"You can only identify signers one document at a time. Select another action." Q
  1. . . S TIUCONT=1
  1. . S TIUTMP("ASK")=$S(+Y=1:"BROWSE",+Y=2:"COMBO",+Y=3:"ALRTDEL",+Y=4:"DETDISP^TIUALSET",+Y=5:"EDIT^TIUAL1",+Y=6:"IDSIGNER",+Y=7:"RESEND",+Y=8:"THIRD",Y=U:-1,1:-1)
  1. D @TIUTMP("ASK")
  1. Q
  1. BROWSE ;
  1. N TEMP,TIUCNT,TIUSEL,TIUQUIK,TIUDA,TIUPRM0,TIUPRM1,TIUPRM3,RSTOK S TIUQUIK=1
  1. K TIUC
  1. D FULL^VALM1
  1. I TIU("CNT")=0 W !,"No documents to select." H 3 Q
  1. S TIUSEL=$P(XQORNOD(0),"=",2)
  1. I TIUSEL="" D Q:TIUSEL=U!($D(DIRUT))
  1. . N DIR,X,Y
  1. . S DIR("A")="Select Document: (1-"_VALMLST_") "
  1. . S DIR(0)="NA^1:"_VALMLST
  1. . D ^DIR S TIUSEL=Y
  1. I $A($E(TIUSEL,$L(TIUSEL)))<48!($A($E(TIUSEL,$L(TIUSEL)))>57) S TIUSEL=$E(TIUSEL,1,$L(TIUSEL)-1)
  1. F X=1:1 Q:$P(TIUSEL,",",X)="" S TIUC($P(TIUSEL,",",X))=$O(@VALMAR@("IDX",$P(TIUSEL,",",X),""))
  1. S TIUDA=TIUC(TIUSEL)
  1. S RSTOK=$$DOCCHK^TIULRR(TIUDA)
  1. I RSTOK'>0 D Q
  1. . W !!,$C(7),"Ok, no harm done...",! ; Echo denial message
  1. . I $$READ^TIUU("EA","RETURN to continue...") ; pause
  1. I $P(^TIU(8925,+TIUDA,0),U,5)'<7,'+$$ISSIGNR^TIUALRT(TIUDA,DUZ)
  1. D:'$D(TIUPRM0)!'$D(TIUPRM1) SETPARM^TIULE
  1. S TEMP("CNT")=TIU("CNT"),TEMP("P")=TIU("P"),TEMP("S")=TIU("S")
  1. S TEMP("D",1)=TIU("D",1),TEMP("D",2)=TIU("D",2)
  1. S TEMP=""
  1. F S TEMP=$O(TIU("C",TEMP)) Q:TEMP="" S TEMP("C",TEMP)=TIU("C",TEMP)
  1. F TIUCNT=1:1:TIU("S") S TEMP("S",TIUCNT)=TIU("S",TIUCNT) S $P(TEMP("S",TIUCNT),U)=$S(+TEMP("S",TIUCNT)=10:14,+TEMP("S",TIUCNT)=11:15,1:+TEMP("S",TIUCNT))
  1. K TIU D EN^VALM("TIU BROWSE FOR READ ONLY")
  1. S TIU("CNT")=TEMP("CNT"),TIU("P")=TEMP("P"),TIU("S")=TEMP("S")
  1. S TEMP=""
  1. F S TEMP=$O(TEMP("C",TEMP)) Q:TEMP="" S TIU("C",TEMP)=TEMP("C",TEMP)
  1. S TIU("D",1)=TEMP("D",1),TIU("D",2)=TEMP("D",2)
  1. F TIUCNT=1:1:TEMP("S") S TIU("S",TIUCNT)=TEMP("S",TIUCNT) S $P(TIU("S",TIUCNT),U)=$S(+TIU("S",TIUCNT)=10:14,+TIU("S",TIUCNT)=11:15,1:+TIU("S",TIUCNT))
  1. Q
  1. COMBO ;
  1. I TIU("CNT")=0 W !,"No documents to select." H 3 Q
  1. S TIUTMP("CMSG")=1,TIU("MSG")=" Send COMBINATION Alerts for the following documents:"
  1. S TIUTMP("THIRD PARTY ALERTS")="",TIUTMP("NODEL")=""
  1. D USERS
  1. K TIUTMP("CMSG"),TIU("MSG")
  1. Q
  1. RESEND ;
  1. I TIU("CNT")=0 W !,"No documents to select." H 3 Q
  1. N DIR,TIUCNT,TIUDA,TIUDIV1,TIUOD,TIUPRM0,TIUPRM1,TIUQUIT,X,Y
  1. ;
  1. I '$D(TIU("MSG")) S TIU("MSG")=" Resend Alerts for the following documents:"
  1. W @IOF,!,TIU("MSG"),!!
  1. S TIUCNT="",TIUCNT(1)=0,TIUCNT(2)=19
  1. F S TIUCNT(1)=TIUCNT(1)+1,TIUCNT=$O(TIUC(TIUCNT)) W:TIUCNT=""&($G(Y)'=0) ! Q:TIUCNT="" W $E(@VALMAR@(TIUCNT,0),1,80) D:TIUCNT(1)#TIUCNT(2)=0
  1. . S TIUCNT(2)=TIUCNT(2)+21
  1. . N DIR S DIR(0)="E" W ! D ^DIR W !! I Y=0 S TIUCNT="",TIUCNT=$O(TIUC(TIUCNT),-1)
  1. S DIR(0)="Y",DIR("A")=" Send these alerts as OVERDUE",DIR("B")="NO"
  1. I '$D(TIU("DELETE")) D ^DIR S TIUOD=+Y Q:TIUOD=U!($D(DIRUT)) W !
  1. S DIR(0)="Y",DIR("A")=" Is this correct",DIR("B")="YES"
  1. D ^DIR I +Y'=1 S TIUQUIT=1 Q
  1. I $G(TIUTMP("CMSG"))=1 F S TIUCNT=$O(TIUC(TIUCNT)) Q:TIUCNT="" D ALERTDEL^TIUALRT(TIUC(TIUCNT))
  1. I '$D(TIU("DELETE")) W !!," Sending Alerts..."
  1. I $D(TIU("DELETE")) W !!," Deleting Alerts..."
  1. S TIUCNT=""
  1. I '$D(TIU("DELETE")) D
  1. . S TIUXQA=$S($D(TIUTMP("CMSG")):0,'$D(TIUXQA):0,1:1)
  1. . F S TIUCNT=$O(TIUC(TIUCNT)) Q:TIUCNT="" W "." D SEND^TIUALRT(TIUC(TIUCNT),TIUOD,.TIUXQA) ; *355, pass recipients by reference
  1. I $D(TIU("DELETE")) F S TIUCNT=$O(TIUC(TIUCNT)) Q:TIUCNT="" W "." D ALERTDEL^TIUALRT(TIUC(TIUCNT))
  1. W !!," Finished.",!
  1. K DIR S DIR("A")=" Enter RETURN to continue or '^' to exit",DIR(0)="E" D ^DIR
  1. K TIUTMP("NODEL"),TIUXQA
  1. Q
  1. SELECT(TIUACT) ;
  1. N TIUSEL,X,Y
  1. K TIUC
  1. D FULL^VALM1
  1. I TIU("CNT")=0 W !,"No documents to select." H 3 Q
  1. S TIUSEL=$P(XQORNOD(0),"=",2)
  1. I TIUSEL="" D Q:Y=U
  1. . N DIR
  1. . S DIR("A")="Select Document(s): (1-"_VALMLST_") "
  1. . S DIR(0)="LAC^1:"_VALMLST
  1. . D ^DIR I $D(DIRUT)!(Y=U) S Y=U Q
  1. . S TIUSEL=Y(0)
  1. I $A($E(TIUSEL,$L(TIUSEL)))<48!($A($E(TIUSEL,$L(TIUSEL)))>57) S TIUSEL=$E(TIUSEL,1,$L(TIUSEL)-1)
  1. F X=1:1 Q:$P(TIUSEL,",",X)="" D
  1. . N TIUCNT
  1. . I $P(TIUSEL,",",X)["-" F TIUCNT=+$P(TIUSEL,",",X):1:$P($P(TIUSEL,",",X),"-",2) S TIUC(TIUCNT)=$O(@VALMAR@("IDX",TIUCNT,""))
  1. . E S TIUC($P(TIUSEL,",",X))=$O(@VALMAR@("IDX",$P(TIUSEL,",",X),""))
  1. D @TIUACT
  1. Q
  1. THIRD ;
  1. I TIU("CNT")=0 W !,"No documents to select." H 3 Q
  1. S TIU("MSG")=" Send 3rd Party Alerts for the following documents:"
  1. S TIUTMP("THIRD PARTY ALERTS")="",TIUTMP("NODEL")=""
  1. D USERS
  1. K TIU("MSG")
  1. Q
  1. USERS ;
  1. N TIUQUIT,TIUREM,TIUXQA
  1. K TIU("3RD"),TIU("CONTINUE")
  1. F D Q:$G(TIUQUIT)=1!($G(TIU("CONTINUE"))=1)
  1. . N DIC,DIR,POP,TIUCNT,X,Y
  1. . W @IOF,!
  1. . W " Enter the name(s) of individuals to receive an alert for the selected",!
  1. . W " document(s).",!!
  1. . W " Kernel will not send alerts to Inactive users; they cannot be",!
  1. . W " selected.",!!
  1. . W " Enter RETURN or '^' to finish selections.",!
  1. . S TIUCNT=0,DIC="^VA(200,",DIC("S")="I '$P(^(0),U,7)"
  1. . S DIC(0)="AEMQ",DIC("A")=" Enter 3RD PARTY RECIPIENT(S): "
  1. . F D ^DIC Q:Y=-1 D Q:$G(TIUQUIT)=1 K TIUREM
  1. . . N TIUDA,TIUASK S TIUDA="" F S TIUDA=$O(TIUC(TIUDA)) Q:TIUDA="" I '$G(TIUASK),'$$CANDO(TIUC(TIUDA),+Y) D
  1. . . . S TIUASK=1
  1. . . . W !!?5,"Because ",$E($$GET1^DIQ(200,+Y,.01),1,15)," may not be able to SIGN/COSIGN some or all of the"
  1. . . . W !?5,"selected documents, they may be unable to resolve the resulting alerts.",!
  1. . . . N DIR,X,Y S DIR(0)="Y",DIR("A")=" Remove",DIR("B")="YES"
  1. . . . D ^DIR I Y=U!($D(DIRUT)) S TIUQUIT=1 Q
  1. . . . I +Y S TIUREM=1 W !
  1. . . S:'$G(TIUREM) TIUCNT=TIUCNT+1,TIU("3RD",+Y)="" S:TIUCNT=1 DIC("A")=" and "
  1. . Q:$G(TIUQUIT)=1
  1. . I TIUCNT=0 W !!," No selections made.",! S DIR("A")=" Enter RETURN to continue or '^' to exit",DIR(0)="E" D ^DIR S TIUQUIT=1 Q
  1. . W !!,$S(TIUCNT>1:" Send 3rd Party Alerts to the following individuals: ",1:" Send 3rd Party Alerts to the following individual: "),!!
  1. . S X="" F S X=$O(TIU("3RD",X)) Q:X="" S TIUXQA(X)="" W ?5,$$GET1^DIQ(200,X_",",.01),!
  1. . S DIR(0)="Y",DIR("A")=" Is this correct",DIR("B")="YES"
  1. . D ^DIR I +Y'=1 W !! K TIU("3RD"),TIUXQA S:Y=U TIUQUIT=1 Q
  1. . S TIU("CONTINUE")=1
  1. Q:$G(TIUQUIT)=1
  1. D RESEND
  1. Q
  1. ;
  1. CANDO(TIUDA,PERSON) ;
  1. N TIUACT
  1. S TIUACT="SIGNATURE" I $$CANDO^TIULP(TIUDA,TIUACT,PERSON) Q 1
  1. S TIUACT="COSIGNATURE" I $$CANDO^TIULP(TIUDA,TIUACT,PERSON) Q 1
  1. Q 0
  1. IDSIGNER ;
  1. N D,DIC,TIUCHNG,TIUDA,TIUDCSNR,TIUDIV1,TIUFPRIV,TIUPRM0,TIUPRM1,TIUSEL,X,Y
  1. D FULL^VALM1
  1. I TIU("CNT")=0 W !,"No documents to select." H 3 Q
  1. S TIUSEL=$P(XQORNOD(0),"=",2)
  1. I TIUSEL="" D Q:TIUSEL=U!($D(DIRUT))
  1. . N DIR,X,Y
  1. . S DIR("A")="Select Document: (1-"_VALMLST_") "
  1. . S DIR(0)="NA^1:"_VALMLST
  1. . D ^DIR S TIUSEL=Y
  1. I $A($E(TIUSEL,$L(TIUSEL)))<48!($A($E(TIUSEL,$L(TIUSEL)))>57) S TIUSEL=$E(TIUSEL,1,$L(TIUSEL)-1)
  1. F X=1:1 Q:$P(TIUSEL,",",X)="" S TIUC($P(TIUSEL,",",X))=$O(@VALMAR@("IDX",$P(TIUSEL,",",X),""))
  1. S TIUDA=TIUC(TIUSEL)
  1. D SIGNER^TIURA1
  1. D UPDATE^TIUALSET
  1. Q