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

ENTIRRI.m

Go to the documentation of this file.
  1. ENTIRRI ;WOIFO/SAB - Individual Responsibility Report ;2/4/2008
  1. ;;7.0;ENGINEERING;**87**;Aug 17, 1993;Build 16
  1. ;
  1. ; if routine is called from the IT menu, variable ENITMENU is defined
  1. ;
  1. N ENOWN
  1. ;
  1. ; determine IT owner to report
  1. S ENOWN=""
  1. I $D(ENITMENU) D Q:ENOWN=""
  1. . ; ask person
  1. . S DIC="^VA(200,"
  1. . S DIC(0)="AQEM"
  1. . S DIC("S")="I $D(^ENG(6916.3,""C"",Y))" ; screen on assignment owner
  1. . D ^DIC K DIC
  1. . I Y>0 S ENOWN=+Y
  1. E S ENOWN=DUZ
  1. ;
  1. ; ask about ended assignments
  1. S DIR(0)="Y"
  1. S DIR("A")="Include ended assignments"
  1. S DIR("B")="NO"
  1. S DIR("?",1)="The report shows information on all active assignments"
  1. S DIR("?",2)="of responsibility for the individual."
  1. S DIR("?",3)="Enter YES at this prompt to also include information"
  1. S DIR("?",4)="on assignments that have ended."
  1. S DIR("?",5)=" "
  1. S DIR("?")="Enter either 'Y' or 'N'."
  1. D ^DIR K DIR G:$D(DIRUT) EXIT
  1. S ENIEA=Y
  1. ;
  1. ; ask device
  1. S %ZIS="Q" D ^%ZIS G:POP EXIT
  1. I $D(IO("Q")) D G EXIT
  1. . S ZTRTN="QEN^ENTIRRI",ZTDESC="Individual Responsibility Report"
  1. . S ZTSAVE("ENOWN")="",ZTSAVE("ENIEA")=""
  1. . D ^%ZTLOAD,HOME^%ZIS K ZTSK,IO("Q")
  1. ;
  1. QEN ; queued entry
  1. U IO
  1. ;
  1. ; generate output
  1. K ENT S ENT=0
  1. S (END,ENPG)=0 D NOW^%DTC S Y=% D DD^%DT S ENDT=Y
  1. S ENOWNE=$$GET1^DIQ(200,ENOWN,.01)
  1. D HD
  1. ;
  1. ; gather and sort data
  1. ; loop thru assignments for owner
  1. S ENDA=0 F S ENDA=$O(^ENG(6916.3,"C",ENOWN,ENDA)) Q:'ENDA D
  1. . S ENY=$G(^ENG(6916.3,ENDA,0))
  1. . I 'ENIEA,$P(ENY,U,8)]"" Q ; didn't chose to include ended assignment
  1. . S ENEQ=$P(ENY,U) ; equipment ien
  1. . S ENLOC=$$GET1^DIQ(6914,ENEQ,24) ; equipment location
  1. . I ENLOC="" S ENLOC=" "
  1. . S ^TMP($J,"ENIT",ENLOC,ENEQ,ENDA)=""
  1. ;
  1. ; print data
  1. ; loop thru locations
  1. S ENLOC="" F S ENLOC=$O(^TMP($J,"ENIT",ENLOC)) Q:ENLOC="" D Q:END
  1. . ; loop thru equipment
  1. . S ENEQ=0
  1. . F S ENEQ=$O(^TMP($J,"ENIT",ENLOC,ENEQ)) Q:'ENEQ D Q:END
  1. . . ; display equipment data
  1. . . I $Y+7>IOSL D HD Q:END
  1. . . D CAPEQ^ENTIUTL(ENEQ,"HD^ENTIRRI",1,.END) Q:END
  1. . . S ENT=ENT+1
  1. . . ; loop thru assignments
  1. . . S ENDA=0
  1. . . F S ENDA=$O(^TMP($J,"ENIT",ENLOC,ENEQ,ENDA)) Q:'ENDA D Q:END
  1. . . . ; display assignment data
  1. . . . I $Y+3>IOSL D HD Q:END W !,"Entry #: ",ENEQ," (continued)"
  1. . . . W !,?2,"Assign Date: ",$P($$GET1^DIQ(6916.3,ENDA,2),"@")
  1. . . . W ?29,"Status: ",$$GET1^DIQ(6916.3,ENDA,20)
  1. . . . W ?47,"Status Date: ",$$GET1^DIQ(6916.3,ENDA,21)
  1. ;
  1. I 'END D
  1. . ; report footer
  1. . I $Y+4>IOSL D HD Q:END
  1. . W !!,"Count of IT equipment items on report = ",ENT
  1. . I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
  1. ;
  1. D ^%ZISC
  1. ;
  1. EXIT I $D(ZTQUEUED) S ZTREQ="@"
  1. K ^TMP($J,"ENIT")
  1. K DIR,DIROUT,DIRUT,DTOUT,DUOUT,POP,X,Y
  1. K ENDA,ENEQ,ENIEA,ENLOC,ENOWN,ENOWNE,ENT,ENY
  1. K END,ENDT,ENPG
  1. Q
  1. ;
  1. HD ; header
  1. I $E(IOST,1,2)="C-",ENPG S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
  1. I $E(IOST,1,2)="C-"!ENPG W @IOF
  1. S ENPG=ENPG+1
  1. W "INDIVIDUAL RESPONSIBILITY REPORT",?48,ENDT,?72,"page ",ENPG,!
  1. W " for ",ENOWNE," sorted by location"
  1. I ENIEA W " (including ended assignments)"
  1. W !
  1. Q
  1. ;
  1. ;ENTIRRI