source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENTIRC.m@ 701

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

initial load of WorldVistAEHR

File size: 3.7 KB
Line 
1ENTIRC ;WOIFO/LKG - Certify IT Acceptance ;2/5/08 14:48
2 ;;7.0;ENGINEERING;**87**;Aug 17, 1993;Build 16
3IN ;Entry point
4 N D,DIC,DTOUT,DUOUT,DIRUT,DIROUT,DIR,ENDA,ENDAC,ENNAME,ENI,ENJ,ENDATE,ENCNT,ENX,ENZ,X,X1,Y,L,DIC,FLDS,FR,TO,BY,IOP,DHD
5LOOPST ;
6 S:'$G(DT) DT=$$DT^XLFDT()
7 K D,DIC S DIC=200,DIC(0)="AEMQ",DIC("S")="I $D(^ENG(6916.3,""AOA"",Y))"
8 D ^DIC K DIC I $D(DTOUT)!$D(DUOUT)!(Y<1) G EX
9 S ENDA=+Y,ENNAME=$P(Y,U,2)
10 K D,^TMP($J,"ENITRC"),ENERR
11 D FIND^DIC(6916.3,"","@;.01;1;20","PQ",ENDA,"","AOA","I $P(^(0),U,8)="""",$S($P(^(0),U,5)="""":1,$$FMDIFF^XLFDT(DT,$P(^(0),U,5))>359:1,1:0)","","^TMP($J,""ENITRC"")","ENERR")
12 I $P($G(^TMP($J,"ENITRC","DILIST",0)),U)'>0 W !!,"There are no unaccepted IT responsibilities to be certified." K DIR S DIR(0)="E" D ^DIR K DIR K ^TMP($J,"ENITRC") G EX:'Y,LOOPST
13 K ^TMP($J,"SCR"),^TMP($J,"INDX"),ENACL W !
14 S ^TMP($J,"SCR")=$P(^TMP($J,"ENITRC","DILIST",0),U)_"^IT RESPONSIBILITIES TO CERTIFY FOR "_ENNAME
15 S ^TMP($J,"SCR",0)="5;9;ENTRY #^15;20;MFG EQUIP NAME^37;25;MODEL^65;14;SERIAL#"
16 S ENI=0
17 F S ENI=$O(^TMP($J,"ENITRC","DILIST",ENI)) Q:+ENI'>0 D
18 . N ENX,END,ENERR S ENX=$G(^TMP($J,"ENITRC","DILIST",ENI,0))
19 . S ENDAC=$P(ENX,U,2)_"," D GETS^DIQ(6914,ENDAC,"3;4;5","E","END","ENERR")
20 . S ^TMP($J,"SCR",ENI)=$P(ENX,U,2)_U_$E($G(END(6914,ENDAC,3,"E")),1,20)_U_$G(END(6914,ENDAC,4,"E"))_U_$G(END(6914,ENDAC,5,"E"))
21 . S ^TMP($J,"INDX",ENI)=$P(ENX,U)
22 K ^TMP($J,"ENITRC")
23 D EN2^ENPLS2(1) G:'$D(ENACL) EX
24 K DIR S DIR(0)="Y",DIR("A")="OK to continue",DIR("B")="NO" D ^DIR K DIR
25 G:'Y!$D(DIRUT) EX
26 S ENDA=$O(^ENG(6916.2,"@"),-1)
27 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
28 K L,DIC,FLDS,FR,TO,BY,IOP,DHD
29 S L=0,DIC=6916.2,FLDS=1,FR=ENDA,TO=ENDA,BY="@NUMBER",IOP="HOME",DHD="@"
30 D EN1^DIP K DIR S DIR(0)="Y",DIR("A")="Is this the text on the signed, printed hand receipt",DIR("B")="NO" D ^DIR K DIR
31 G:$D(DIRUT) EX I 'Y W !!,"Signed copy is not current.",!?5,"Please ask person to sign current version of hand receipt." K DIR S DIR(0)="E" D ^DIR K DIR G EX
32 K L,DIC,FLDS,FR,TO,BY,IOP,DHD
33 K DIR S DIR(0)="D^"_$$BEGDATE()_":"_DT_":EX",DIR("A")="Date person signed hard copy hand receipt" D ^DIR K DIR
34 I 'Y!$D(DIRUT) W !!,"Certification Aborted." G EX
35 S ENDATE=Y
36 K DIR S DIR(0)="Y",DIR("A")="OK to certify",DIR("B")="NO" D ^DIR K DIR
37 G:'Y!$D(DIRUT) EX
38 D SIG^XUSESIG I X1="" W !,"<Failed Electronic Signature> Certification Aborted." G EX
39 S ENCNT=0,ENX=""
40 F S ENX=$O(ENACL(ENX)) Q:ENX="" D
41 . N ENXSTR S ENXSTR=$G(ENACL(ENX)) Q:ENXSTR=""
42 . I $L(ENXSTR,",")>0 D
43 . . F ENJ=1:1 S ENI=$P(ENXSTR,",",ENJ) Q:+ENI'>0 D
44 . . . S ENDA=^TMP($J,"INDX",ENI) L +^ENG(6916.3,ENDA):$S($G(DILOCKTM)>5:DILOCKTM,1:5) E D MSG^ENTIRT(ENDA,"Certification") Q
45 . . . S ENZ=$$CERT^ENTIUTL1(ENDA,ENDATE)
46 . . . S:ENZ ENCNT=ENCNT+1 D:'ENZ MSG2(ENDA)
47 . . . L -^ENG(6916.3,ENDA)
48 W !!,ENCNT," assignment records were certified."
49 K DIR S DIR(0)="E" D ^DIR K DIR
50 G:Y LOOPST
51EX ;
52 K ^TMP($J,"SCR"),^TMP($J,"INDX"),ENACL
53 Q
54MSG2(ENDA) ;error message on certification failure
55 N END,ENERR,ENDAC S ENDAC=ENDA_","
56 D GETS^DIQ(6916.3,ENDAC,".01;1","E","END","ENERR")
57 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 certified."
58 Q
59BEGDATE() ;Earliest date for certification
60 N ENDA,ENDATE,ENI,ENJ,ENASGNDT,ENX,ENXSTR
61 S ENX="",ENDATE=$$FMADD^XLFDT(DT,-359)
62 F S ENX=$O(ENACL(ENX)) Q:ENX="" D
63 . S ENXSTR=$G(ENACL(ENX)) Q:ENXSTR=""
64 . I $L(ENXSTR,",")>0 D
65 . . F ENJ=1:1 S ENI=$P(ENXSTR,",",ENJ) Q:+ENI'>0 D
66 . . . S ENDA=^TMP($J,"INDX",ENI),ENASGNDT=$P($P($G(^ENG(6916.3,ENDA,0)),U,3),".")
67 . . . S:ENASGNDT>ENDATE ENDATE=ENASGNDT
68 Q ENDATE
69 ;
70 ;ENTIRC
Note: See TracBrowser for help on using the repository browser.