| 1 | ENTIRRI ;WOIFO/SAB - Individual Responsibility Report ;2/4/2008 | 
|---|
| 2 | ;;7.0;ENGINEERING;**87**;Aug 17, 1993;Build 16 | 
|---|
| 3 | ; | 
|---|
| 4 | ; if routine is called from the IT menu, variable ENITMENU is defined | 
|---|
| 5 | ; | 
|---|
| 6 | N ENOWN | 
|---|
| 7 | ; | 
|---|
| 8 | ; determine IT owner to report | 
|---|
| 9 | S ENOWN="" | 
|---|
| 10 | I $D(ENITMENU) D  Q:ENOWN="" | 
|---|
| 11 | . ; ask person | 
|---|
| 12 | . S DIC="^VA(200," | 
|---|
| 13 | . S DIC(0)="AQEM" | 
|---|
| 14 | . S DIC("S")="I $D(^ENG(6916.3,""C"",Y))" ; screen on assignment owner | 
|---|
| 15 | . D ^DIC K DIC | 
|---|
| 16 | . I Y>0 S ENOWN=+Y | 
|---|
| 17 | E  S ENOWN=DUZ | 
|---|
| 18 | ; | 
|---|
| 19 | ; ask about ended assignments | 
|---|
| 20 | S DIR(0)="Y" | 
|---|
| 21 | S DIR("A")="Include ended assignments" | 
|---|
| 22 | S DIR("B")="NO" | 
|---|
| 23 | S DIR("?",1)="The report shows information on all active assignments" | 
|---|
| 24 | S DIR("?",2)="of responsibility for the individual." | 
|---|
| 25 | S DIR("?",3)="Enter YES at this prompt to also include information" | 
|---|
| 26 | S DIR("?",4)="on assignments that have ended." | 
|---|
| 27 | S DIR("?",5)=" " | 
|---|
| 28 | S DIR("?")="Enter either 'Y' or 'N'." | 
|---|
| 29 | D ^DIR K DIR G:$D(DIRUT) EXIT | 
|---|
| 30 | S ENIEA=Y | 
|---|
| 31 | ; | 
|---|
| 32 | ; ask device | 
|---|
| 33 | S %ZIS="Q" D ^%ZIS G:POP EXIT | 
|---|
| 34 | I $D(IO("Q")) D  G EXIT | 
|---|
| 35 | . S ZTRTN="QEN^ENTIRRI",ZTDESC="Individual Responsibility Report" | 
|---|
| 36 | . S ZTSAVE("ENOWN")="",ZTSAVE("ENIEA")="" | 
|---|
| 37 | . D ^%ZTLOAD,HOME^%ZIS K ZTSK,IO("Q") | 
|---|
| 38 | ; | 
|---|
| 39 | QEN ; queued entry | 
|---|
| 40 | U IO | 
|---|
| 41 | ; | 
|---|
| 42 | ; generate output | 
|---|
| 43 | K ENT S ENT=0 | 
|---|
| 44 | S (END,ENPG)=0 D NOW^%DTC S Y=% D DD^%DT S ENDT=Y | 
|---|
| 45 | S ENOWNE=$$GET1^DIQ(200,ENOWN,.01) | 
|---|
| 46 | D HD | 
|---|
| 47 | ; | 
|---|
| 48 | ; gather and sort data | 
|---|
| 49 | ; loop thru assignments for owner | 
|---|
| 50 | S ENDA=0 F  S ENDA=$O(^ENG(6916.3,"C",ENOWN,ENDA)) Q:'ENDA  D | 
|---|
| 51 | . S ENY=$G(^ENG(6916.3,ENDA,0)) | 
|---|
| 52 | . I 'ENIEA,$P(ENY,U,8)]"" Q  ; didn't chose to include ended assignment | 
|---|
| 53 | . S ENEQ=$P(ENY,U) ; equipment ien | 
|---|
| 54 | . S ENLOC=$$GET1^DIQ(6914,ENEQ,24) ; equipment location | 
|---|
| 55 | . I ENLOC="" S ENLOC=" " | 
|---|
| 56 | . S ^TMP($J,"ENIT",ENLOC,ENEQ,ENDA)="" | 
|---|
| 57 | ; | 
|---|
| 58 | ; print data | 
|---|
| 59 | ; loop thru locations | 
|---|
| 60 | S ENLOC="" F  S ENLOC=$O(^TMP($J,"ENIT",ENLOC)) Q:ENLOC=""  D  Q:END | 
|---|
| 61 | . ; loop thru equipment | 
|---|
| 62 | . S ENEQ=0 | 
|---|
| 63 | . F  S ENEQ=$O(^TMP($J,"ENIT",ENLOC,ENEQ)) Q:'ENEQ  D  Q:END | 
|---|
| 64 | . . ; display equipment data | 
|---|
| 65 | . . I $Y+7>IOSL D HD Q:END | 
|---|
| 66 | . . D CAPEQ^ENTIUTL(ENEQ,"HD^ENTIRRI",1,.END) Q:END | 
|---|
| 67 | . . S ENT=ENT+1 | 
|---|
| 68 | . . ; loop thru assignments | 
|---|
| 69 | . . S ENDA=0 | 
|---|
| 70 | . . F  S ENDA=$O(^TMP($J,"ENIT",ENLOC,ENEQ,ENDA)) Q:'ENDA  D  Q:END | 
|---|
| 71 | . . . ; display assignment data | 
|---|
| 72 | . . . I $Y+3>IOSL D HD Q:END  W !,"Entry #: ",ENEQ," (continued)" | 
|---|
| 73 | . . . W !,?2,"Assign Date: ",$P($$GET1^DIQ(6916.3,ENDA,2),"@") | 
|---|
| 74 | . . . W ?29,"Status: ",$$GET1^DIQ(6916.3,ENDA,20) | 
|---|
| 75 | . . . W ?47,"Status Date: ",$$GET1^DIQ(6916.3,ENDA,21) | 
|---|
| 76 | ; | 
|---|
| 77 | I 'END D | 
|---|
| 78 | . ; report footer | 
|---|
| 79 | . I $Y+4>IOSL D HD Q:END | 
|---|
| 80 | . W !!,"Count of IT equipment items on report = ",ENT | 
|---|
| 81 | . I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR | 
|---|
| 82 | ; | 
|---|
| 83 | D ^%ZISC | 
|---|
| 84 | ; | 
|---|
| 85 | EXIT I $D(ZTQUEUED) S ZTREQ="@" | 
|---|
| 86 | K ^TMP($J,"ENIT") | 
|---|
| 87 | K DIR,DIROUT,DIRUT,DTOUT,DUOUT,POP,X,Y | 
|---|
| 88 | K ENDA,ENEQ,ENIEA,ENLOC,ENOWN,ENOWNE,ENT,ENY | 
|---|
| 89 | K END,ENDT,ENPG | 
|---|
| 90 | Q | 
|---|
| 91 | ; | 
|---|
| 92 | HD ; header | 
|---|
| 93 | I $E(IOST,1,2)="C-",ENPG S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q | 
|---|
| 94 | I $E(IOST,1,2)="C-"!ENPG W @IOF | 
|---|
| 95 | S ENPG=ENPG+1 | 
|---|
| 96 | W "INDIVIDUAL RESPONSIBILITY REPORT",?48,ENDT,?72,"page ",ENPG,! | 
|---|
| 97 | W "  for ",ENOWNE," sorted by location" | 
|---|
| 98 | I ENIEA W " (including ended assignments)" | 
|---|
| 99 | W ! | 
|---|
| 100 | Q | 
|---|
| 101 | ; | 
|---|
| 102 | ;ENTIRRI | 
|---|