source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENTIRS.m@ 931

Last change on this file since 931 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.5 KB
Line 
1ENTIRS ;WOIFO/LKG - SIGN RESPONSIBILITIES ;2/5/08 14:57
2 ;;7.0;ENGINEERING;**87**;Aug 17, 1993;Build 16
3IN ;Entry point
4 K ^TMP($J,"SCR"),^TMP($J,"INDX"),ENACL S:'$G(DT) DT=$$DT^XLFDT()
5 S ENJ="",ENC=0
6 F S ENJ=$O(^ENG(6916.3,"AOA",DUZ,ENJ)) Q:ENJ="" D
7 . S ENI=""
8 . F S ENI=$O(^ENG(6916.3,"AOA",DUZ,ENJ,ENI)) Q:ENI="" D
9 . . S ENNOD0=$G(^ENG(6916.3,ENI,0)) Q:ENNOD0=""
10 . . Q:$P(ENNOD0,U,8)'=""
11 . . I $P(ENNOD0,U,5),$$FMDIFF^XLFDT(DT,$P(ENNOD0,U,5))<360 Q
12 . . S ENIC=ENI_"," K END,ENERR D GETS^DIQ(6916.3,ENIC,".01;1;20","E","END","ENERR")
13 . . S ENDAC=$P(ENNOD0,U)_"," D GETS^DIQ(6914,ENDAC,"3;4;5","E","END","ENERR")
14 . . S ENC=ENC+1
15 . . 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"))
16 . . S ^TMP($J,"INDX",ENC)=ENI
17 I 'ENC W !!,"There are no assignment to sign." K DIR S DIR(0)="E" D ^DIR K DIR G EX
18 S ^TMP($J,"SCR")=ENC_"^IT RESPONSIBILITIES REQUIRING SIGNATURE BY "_$G(END(6916.3,ENIC,1,"E"))
19 S ^TMP($J,"SCR",0)="5;9;ENTRY #^15;20;MFG EQUIP NAME^37;25;MODEL^65;14;SERIAL#"
20 D EN2^ENPLS2(1) G:'$D(ENACL) EX
21 K DIR S DIR(0)="Y",DIR("A")="OK to continue",DIR("B")="NO" D ^DIR K DIR
22 G:'Y!$D(DIRUT) EX
23 N L,DIC,FLDS,FR,TO,BY,IOP,DHD
24 S ENDA=$O(^ENG(6916.2,"@"),-1)
25 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
26 S L=0,DIC=6916.2,FLDS=1,FR=ENDA,TO=ENDA,BY="@NUMBER",IOP="HOME",DHD="@"
27 D EN1^DIP
28 K DIR S DIR(0)="Y",DIR("A")="OK to sign",DIR("B")="NO" D ^DIR K DIR
29 G:'Y!$D(DIRUT) EX
30 D SIG^XUSESIG I X1="" W !,"<Invalid Electronic Signature> Signing Aborted." G EX
31 S ENCNT=0,ENX=""
32 F S ENX=$O(ENACL(ENX)) Q:ENX="" D
33 . N ENXSTR S ENXSTR=$G(ENACL(ENX)) Q:ENXSTR=""
34 . I $L(ENXSTR,",")>0 D
35 . . F ENJ=1:1 S ENI=$P(ENXSTR,",",ENJ) Q:+ENI'>0 D
36 . . . 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
37 . . . S ENZ=$$SIGN^ENTIUTL1(ENDA)
38 . . . S:ENZ ENCNT=ENCNT+1 D:'ENZ MSG2(ENDA)
39 . . . L -^ENG(6916.3,ENDA)
40 W !!,ENCNT," assignment records were signed."
41EX ;
42 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
43 Q
44MSG2(ENDA) ;error message on signing failure
45 N END,ENERR,ENDAC S ENDAC=ENDA_","
46 D GETS^DIQ(6916.3,ENDAC,".01;1","E","END","ENERR")
47 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."
48 Q
49 ;
50 ;ENTIRS
Note: See TracBrowser for help on using the repository browser.