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

ENTIRS.m

Go to the documentation of this file.
  1. ENTIRS ;WOIFO/LKG - SIGN RESPONSIBILITIES ;2/5/08 14:57
  1. ;;7.0;ENGINEERING;**87**;Aug 17, 1993;Build 16
  1. IN ;Entry point
  1. K ^TMP($J,"SCR"),^TMP($J,"INDX"),ENACL S:'$G(DT) DT=$$DT^XLFDT()
  1. S ENJ="",ENC=0
  1. F S ENJ=$O(^ENG(6916.3,"AOA",DUZ,ENJ)) Q:ENJ="" D
  1. . S ENI=""
  1. . F S ENI=$O(^ENG(6916.3,"AOA",DUZ,ENJ,ENI)) Q:ENI="" D
  1. . . S ENNOD0=$G(^ENG(6916.3,ENI,0)) Q:ENNOD0=""
  1. . . Q:$P(ENNOD0,U,8)'=""
  1. . . I $P(ENNOD0,U,5),$$FMDIFF^XLFDT(DT,$P(ENNOD0,U,5))<360 Q
  1. . . S ENIC=ENI_"," K END,ENERR D GETS^DIQ(6916.3,ENIC,".01;1;20","E","END","ENERR")
  1. . . S ENDAC=$P(ENNOD0,U)_"," D GETS^DIQ(6914,ENDAC,"3;4;5","E","END","ENERR")
  1. . . S ENC=ENC+1
  1. . . S ^TMP($J,"SCR",ENC)=$G(END(6916.3,ENIC,.01,"E"))_U_$E($G(END(6914,ENDAC,3,"E")),1,20)_U_$G(END(6914,ENDAC,4,"E"))_U_$G(END(6914,ENDAC,5,"E"))
  1. . . S ^TMP($J,"INDX",ENC)=ENI
  1. I 'ENC W !!,"There are no assignment to sign." K DIR S DIR(0)="E" D ^DIR K DIR G EX
  1. S ^TMP($J,"SCR")=ENC_"^IT RESPONSIBILITIES REQUIRING SIGNATURE BY "_$G(END(6916.3,ENIC,1,"E"))
  1. S ^TMP($J,"SCR",0)="5;9;ENTRY #^15;20;MFG EQUIP NAME^37;25;MODEL^65;14;SERIAL#"
  1. D EN2^ENPLS2(1) G:'$D(ENACL) EX
  1. K DIR S DIR(0)="Y",DIR("A")="OK to continue",DIR("B")="NO" D ^DIR K DIR
  1. G:'Y!$D(DIRUT) EX
  1. N L,DIC,FLDS,FR,TO,BY,IOP,DHD
  1. S ENDA=$O(^ENG(6916.2,"@"),-1)
  1. I '$$CMP^XUSESIG1($P($G(^ENG(6916.2,ENDA,0)),U,3),$NAME(^ENG(6916.2,ENDA,1))) W !!,"Hand receipt text is corrupted - Please contact EPS AEMS/MERS support" G EX
  1. S L=0,DIC=6916.2,FLDS=1,FR=ENDA,TO=ENDA,BY="@NUMBER",IOP="HOME",DHD="@"
  1. D EN1^DIP
  1. K DIR S DIR(0)="Y",DIR("A")="OK to sign",DIR("B")="NO" D ^DIR K DIR
  1. G:'Y!$D(DIRUT) EX
  1. D SIG^XUSESIG I X1="" W !,"<Invalid Electronic Signature> Signing Aborted." G EX
  1. S ENCNT=0,ENX=""
  1. F S ENX=$O(ENACL(ENX)) Q:ENX="" D
  1. . N ENXSTR S ENXSTR=$G(ENACL(ENX)) Q:ENXSTR=""
  1. . I $L(ENXSTR,",")>0 D
  1. . . F ENJ=1:1 S ENI=$P(ENXSTR,",",ENJ) Q:+ENI'>0 D
  1. . . . S ENDA=^TMP($J,"INDX",ENI) L +^ENG(6916.3,ENDA):$S($G(DILOCKTM)>5:DILOCKTM,1:5) E D MSG^ENTIRT(ENDA,"Signature") Q
  1. . . . S ENZ=$$SIGN^ENTIUTL1(ENDA)
  1. . . . S:ENZ ENCNT=ENCNT+1 D:'ENZ MSG2(ENDA)
  1. . . . L -^ENG(6916.3,ENDA)
  1. W !!,ENCNT," assignment records were signed."
  1. EX ;
  1. K ^TMP($J,"SCR"),^TMP($J,"INDX"),DIROUT,DIRUT,DTOUT,DUOUT,ENACL,ENCNT,ENDA,ENDAC,ENI,ENIC,ENJ,ENC,END,ENERR,ENNOD0,ENX,ENZ,X,X1,Y
  1. Q
  1. MSG2(ENDA) ;error message on signing failure
  1. N END,ENERR,ENDAC S ENDAC=ENDA_","
  1. D GETS^DIQ(6916.3,ENDAC,".01;1","E","END","ENERR")
  1. W !,"Assignment Equip Entry# ",$G(END(6916.3,ENDAC,.01,"E"))," for ",$G(END(6916.3,ENDAC,1,"E"))," is not active ",!?5,"and was not signed."
  1. Q
  1. ;
  1. ;ENTIRS