source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENTIRRX.m@ 1800

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

initial load of WorldVistAEHR

File size: 2.6 KB
RevLine 
[613]1ENTIRRX ;WOIFO/SAB - Signature Exception Report ;2/4/2008
2 ;;7.0;ENGINEERING;**87**;Aug 17, 1993;Build 16
3 ;
4 N DIR,DIROUT,DIRUT,DTOUT,DUOUT,ENADT,ENTYP,X,Y
5 ;
6 ; ask type
7 S DIR(0)="S^E:ELECTRONICALLY SIGNED;C:CERTIFIED HARD COPY SIGNATURE;B:BOTH"
8 S DIR("A")="Select type of signature to check"
9 S DIR("B")="BOTH"
10 D ^DIR K DIR Q:$D(DIRUT)
11 S ENTYP=Y
12 ;
13 ; ask anniversary date
14 S DIR(0)="D"
15 S DIR("A")="Report signatures at least 1 year old as of "
16 S DIR("B")=$$FMTE^XLFDT($$FMADD^XLFDT(DT,-1))
17 D ^DIR K DIR Q:$D(DIRUT)
18 S ENADT=Y
19 ;
20 ; ask device
21 S %ZIS="Q" D ^%ZIS G:POP EXIT
22 I $D(IO("Q")) D G EXIT
23 . S ZTRTN="QEN^ENTIRRX",ZTDESC="Signature Exception Report"
24 . S ZTSAVE("ENTYP")="",ZTSAVE("ENADT")=""
25 . D ^%ZTLOAD,HOME^%ZIS K ZTSK,IO("Q")
26 ;
27QEN ; queued entry
28 U IO
29 ;
30 ; generate output
31 K ENT S ENT=0
32 S (END,ENPG)=0 D NOW^%DTC S Y=% D DD^%DT S ENDT=Y
33 S ENCDT=($E(ENADT,1,3)-1)_$E(ENADT,4,7) ; computed date (1 year before)
34 S ENADTE=$$FMTE^XLFDT(ENADT) ; external format for anniversary date
35 D HD
36 ;
37 ; print data
38 ; loop thru active assignments by owner and equipment
39 S ENOWN=0 F S ENOWN=$O(^ENG(6916.3,"AOA",ENOWN)) Q:'ENOWN D Q:END
40 . S ENEQ=0 F S ENEQ=$O(^ENG(6916.3,"AOA",ENOWN,ENEQ)) Q:'ENEQ D Q:END
41 . . S ENDA=0
42 . . F S ENDA=$O(^ENG(6916.3,"AOA",ENOWN,ENEQ,ENDA)) Q:'ENDA D Q:END
43 . . . S ENY=$G(^ENG(6916.3,ENDA,0))
44 . . . Q:$P(ENY,U,5)="" ; not signed
45 . . . I ENTYP="E",$P(ENY,U,7)'="" Q ; only check e-sigs
46 . . . I ENTYP="C",$P(ENY,U,7)="" Q ; only check certified sigs
47 . . . Q:$P($P(ENY,U,5),".")>ENCDT ; was signed after computed date
48 . . . ;
49 . . . ; report assignment
50 . . . S ENT=ENT+1
51 . . . ;
52 . . . ; display assignment data
53 . . . I $Y+6>IOSL D HD Q:END
54 . . . W !,$$GET1^DIQ(6916.3,ENDA,1)
55 . . . W ?32,ENEQ
56 . . . W ?44,$$GET1^DIQ(6916.3,ENDA,20)
57 . . . W ?55,$$GET1^DIQ(6916.3,ENDA,21)
58 . . . W !," ",$E($$GET1^DIQ(6914,ENEQ,3),1,76)
59 ;
60 I 'END D
61 . ; report footer
62 . I $Y+4>IOSL D HD Q:END
63 . W !!,"Count of signatures on report = ",ENT
64 . I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
65 ;
66 D ^%ZISC
67 ;
68EXIT I $D(ZTQUEUED) S ZTREQ="@"
69 K DIR,DIROUT,DIRUT,DIWF,DIWL,DTOUT,DUOUT,POP,X,Y
70 K ENADT,ENADTE,ENCDT,ENDA,ENEQ,ENOWN,ENT,ENTYP,ENY
71 K END,ENDT,ENPG
72 Q
73 ;
74HD ; header
75 I $E(IOST,1,2)="C-",ENPG S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
76 I $E(IOST,1,2)="C-"!ENPG W @IOF
77 S ENPG=ENPG+1
78 W "SIGNATURE EXCEPTION REPORT",?48,ENDT,?72,"page ",ENPG,!
79 W " for "
80 I ENTYP="E" W "electronic "
81 I ENTYP="C" W "hard copy "
82 W "signatures at least one year old as of ",ENADTE,!!
83 W "Owner",?32,"Entry #",?44,"Status",?55,"Status Date",!
84 W "------------------------------",?32,"----------"
85 W ?44,"---------",?55,"-----------"
86 Q
87 ;
88 ;ENTIRRX
Note: See TracBrowser for help on using the repository browser.