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

ENTIUTL.m

Go to the documentation of this file.
  1. ENTIUTL ;WOIFO/SAB - Engineering Utilities ;2/14/2008
  1. ;;7.0;ENGINEERING;**87,89**;Aug 17, 1993;Build 20
  1. ;
  1. DISEQ(ENDA) ; Display Equipment
  1. N ENCMR,ENLOC,ENMFGR,ENMOD,ENNAM,ENSER,ENSVC
  1. ; display equipment data
  1. S ENCMR=$$GET1^DIQ(6914,ENDA,19)
  1. S ENLOC=$$GET1^DIQ(6914,ENDA,24)
  1. S ENSVC=$$GET1^DIQ(6914,ENDA,21)
  1. S ENNAM=$$GET1^DIQ(6914,ENDA,3)
  1. S ENMFGR=$$GET1^DIQ(6914,ENDA,1)
  1. S ENMOD=$$GET1^DIQ(6914,ENDA,4)
  1. S ENSER=$$GET1^DIQ(6914,ENDA,5)
  1. W !,"Entry #",?12,"CMR",?19,"Location",?41,"Using Service"
  1. W !,"---------",?12,"-----",?19,"--------------------"
  1. W ?41,"------------------------------"
  1. W !,ENDA,?12,ENCMR,?19,ENLOC,?41,ENSVC
  1. W !,ENNAM
  1. W !!,"Mfgr: ",ENMFGR
  1. W !,"Model: ",ENMOD,?39,"Serial #: ",ENSER
  1. Q
  1. ;
  1. CAPEQ(ENDA,ENTAG,SITC,END) ; Captioned Equipment Display
  1. ; input
  1. ; ENDA = equipment ien (file 6914)
  1. ; ENTAG = (optional) line tag to call at page break
  1. ; this utility expects there to be at least 5 lines to display
  1. ; the normal data and will only issue page breaks during the
  1. ; IT REMOTE LOCATION or IT COMMENTS output.
  1. ; SITC = (optional) flag, true to suppress IT comments from printing
  1. ; output
  1. ; END = true if user enter "^" or timed-out, passed by reference
  1. N ENCMR,ENI,ENITRL,ENLOC,ENLOCS,ENMFGR,ENMOD,ENNAM,ENSER,ENSVC,X
  1. S ENTAG=$G(ENTAG,"CAPEQHD^ENTIUTL")
  1. S END=$G(END)
  1. ; display equipment data
  1. S ENCMR=$$GET1^DIQ(6914,ENDA,19)
  1. S ENLOC=$$GET1^DIQ(6914,ENDA,24)
  1. S ENLOCS=$$GET1^DIQ(6914,ENDA,"24:1.5")
  1. S ENSVC=$$GET1^DIQ(6914,ENDA,21)
  1. S ENNAM=$$GET1^DIQ(6914,ENDA,3)
  1. S ENMFGR=$$GET1^DIQ(6914,ENDA,1)
  1. S ENMOD=$$GET1^DIQ(6914,ENDA,4)
  1. S ENSER=$$GET1^DIQ(6914,ENDA,5)
  1. W !,"Entry #: ",ENDA,?21,"CMR: ",ENCMR,?33,"Using Service: ",ENSVC
  1. W !,?2,"Location: ",ENLOC,?34,"Svc of Location: ",ENLOCS
  1. W !,?2,"Mfgr Name: ",$E(ENNAM,1,65) W:$E(ENNAM,66,80)]"" "*"
  1. W !,?2,"Mfgr: ",ENMFGR
  1. W !,?2,"Model: ",ENMOD,?41,"Ser. #: ",ENSER
  1. S ENITRL=$$GET1^DIQ(6914,ENDA,91)
  1. I ENITRL]"" D Q:END
  1. . I $Y+3>IOSL D @ENTAG Q:END D CAPEQHD1
  1. . N DIWF,DIWL,DIWR,X
  1. . K ^UTILITY($J,"W")
  1. . S DIWL=3,DIWR=79,DIWF="W|"
  1. . S X="IT Remote Location: " D ^DIWP
  1. . S X=ENITRL D ^DIWP
  1. . D ^DIWW
  1. I '$G(SITC),$O(^ENG(6914,ENDA,"ITC",0)) D
  1. . N DIWF,DIWL,DIWR,X
  1. . K ^UTILITY($J,"W")
  1. . S DIWL=3,DIWR=79,DIWF="W|"
  1. . S X="IT Comments: " D ^DIWP
  1. . S ENI=0 F S ENI=$O(^ENG(6914,ENDA,"ITC",ENI)) Q:'ENI D Q:END
  1. . . I $Y+3>IOSL D @ENTAG Q:END D CAPEQHD1
  1. . . S X=$G(^ENG(6914,ENDA,"ITC",ENI,0)) D ^DIWP
  1. . I END K ^UTILITY($J,"W") Q
  1. . I $Y+3>IOSL D @ENTAG I END K ^UTILITY($J,"W") Q
  1. . D ^DIWW
  1. Q
  1. ;
  1. CAPEQHD ; Captioned Equipment Display Default Header
  1. I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
  1. W @IOF
  1. Q
  1. CAPEQHD1 ; Captioned Equipment Display Second Header
  1. W "Equipment Entry #: ",ENDA," (continued)"
  1. Q
  1. ;
  1. DISASGN(ENDA) ; Display Active Assignments for Equipment to Screen
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,ENADA,END,ENSTAT,X,Y
  1. ; display assignment data
  1. S END=0
  1. D DISASGNH
  1. I '$D(^ENG(6916.3,"AEA",ENDA)) W !," no active assignments" Q
  1. S ENADA=0
  1. F S ENADA=$O(^ENG(6916.3,"AEA",ENDA,ENADA)) Q:'ENADA D Q:END
  1. . I $Y+4>IOSL D Q:END
  1. . . S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
  1. . . W @(IOF) D DISASGNH W !," Entry #: ",ENDA," (continued)"
  1. . W !,$$GET1^DIQ(6916.3,ENADA,1)
  1. . W ?32,$P($$GET1^DIQ(6916.3,ENADA,2),"@")
  1. . S ENSTAT=$$GET1^DIQ(6916.3,ENADA,20)
  1. . W ?46,ENSTAT
  1. . I ENSTAT'="ASSIGNED" W ?57,$$GET1^DIQ(6916.3,ENADA,21)
  1. Q
  1. DISASGNH ; Display Assignments Header
  1. W !!,"Responsible Person",?32,"Assigned DT",?46,"Status",?57,"Status DT"
  1. W !,"------------------------------",?32,"------------"
  1. W ?46,"---------",?57,"------------"
  1. Q
  1. ;
  1. BLDHL2(ENSM,ENSMV,ENSRT) ; Build Header Line 2 String for Reports
  1. ; input
  1. ; ENSM = equipment selection method code
  1. ; ENSMV = selection method ien value (for applicable methods)
  1. ; ENSRT = sort by code
  1. ; returns string for page header second line
  1. N ENHL2
  1. ;
  1. S ENHL2=" for "
  1. S:ENSM="A" ENHL2=ENHL2_"All tracked IT equipment"
  1. S:ENSM="E" ENHL2=ENHL2_"selected equipment"
  1. S:ENSM="C" ENHL2=ENHL2_"CMR: "_$$GET1^DIQ(6914.1,ENSMV,.01)
  1. S:ENSM="U" ENHL2=ENHL2_"Using Service: "_$$GET1^DIQ(49,ENSMV,.01)
  1. S:ENSM="L" ENHL2=ENHL2_"Location: "_$$GET1^DIQ(6928,ENSMV,.01)
  1. S:ENSM="S" ENHL2=ENHL2_"Service of Loc: "_$$GET1^DIQ(49,ENSMV,.01)
  1. S ENHL2=ENHL2_" sorted by "
  1. S:ENSRT="E" ENHL2=ENHL2_"Entry #"
  1. S:ENSRT="C" ENHL2=ENHL2_"CMR"
  1. S:ENSRT="U" ENHL2=ENHL2_"Using Service"
  1. S:ENSRT="L" ENHL2=ENHL2_"Location"
  1. S:ENSRT="S" ENHL2=ENHL2_"Service of Loc."
  1. ;
  1. Q ENHL2
  1. ;
  1. ADDNP ; Add New Person
  1. ; called by option ENIT ADD NEW PERSON
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,ENX,X,Y
  1. W !!,"This option should only be used to add a person to the NEW PERSON"
  1. W !,"(#200) file when that person will be assigned responsibility for"
  1. W !,"IT equipment but is not already in the file and will NOT be given"
  1. W !,"a user account to sign on the computer.",!
  1. ;
  1. S DIR(0)="Y"
  1. S DIR("A")="Do you want to add an entry to the NEW PERSON file"
  1. S DIR("B")="NO"
  1. D ^DIR K DIR Q:$D(DIRUT)
  1. ;
  1. I Y W ! S ENX=$$ADD^XUSERNEW()
  1. I $P($G(ENX),U)>0,'$P(ENX,U,3) D
  1. . W !!,$P(ENX,U,2)," already exists with internal number ",$P(ENX,U),"."
  1. . W !,"If you want to enter a new record with that name, enter the"
  1. . W !,"name within quotes (e.g. ""Last,First"")",!
  1. Q
  1. ;
  1. USRTRM ;Send MailMan message when user with active assignments is terminated
  1. Q:'$D(^ENG(6916.3,"AOA",XUIFN))
  1. N ENDA,ENERR,ENI,ENL,ENMFGNM,ENNAME,ENSPACE,ENTX,ENNBR,ENSTATUS,ENDATE,ENX,XMDUZ,XMMG,XMROU,XMSTRIP,XMSUB,XMTEXT,XMY,XMYBLOB,XMZ
  1. K ^TMP($J,"ENITUTL") S ENDA=XUIFN,$P(ENSPACE," ",41)=""
  1. D FIND^DIC(6916.3,"","@;.01;1;20;21","PQX",ENDA,"","AOA2","","","^TMP($J,""ENITUTL"")","ENERR")
  1. I $P($G(^TMP($J,"ENITUTL","DILIST",0)),U)'>0 K ^TMP($J,"ENITUTL") Q
  1. S ENNAME=$$GET1^DIQ(200,ENDA_",",".01","","","ENERR")
  1. S ENTX(1)="Owner: "_ENNAME_" ("_ENDA_")"
  1. S ENTX(2)="was terminated while having the following active IT responsibility assignments:"
  1. S ENTX(3)=" ",ENTX(4)="Entry#"_$E(ENSPACE,1,6)_"Mfg Equip Name"_$E(ENSPACE,1,11)_"Assignment Status"_$E(ENSPACE,1,3)_"Status Date",ENL=4
  1. S ENI=0
  1. F S ENI=$O(^TMP($J,"ENITUTL","DILIST",ENI)) Q:+ENI'=ENI D
  1. . S ENX=$G(^TMP($J,"ENITUTL","DILIST",ENI,0)) Q:ENX=""
  1. . S ENNBR=$P(ENX,U,2),ENSTATUS=$P(ENX,U,4),ENDATE=$P(ENX,U,5)
  1. . S ENMFGNM=$E($$GET1^DIQ(6914,ENNBR_",","3","","","ENERR"),1,20)
  1. . S ENL=ENL+1,ENTX(ENL)=ENNBR_$E(ENSPACE,$L(ENNBR)+1,12)_ENMFGNM_$E(ENSPACE,$L(ENMFGNM)+1,25)_ENSTATUS_$E(ENSPACE,$L(ENSTATUS)+1,20)_ENDATE
  1. S ENL=ENL+1,ENTX(ENL)=" ",ENL=ENL+1,ENTX(ENL)=" Number of Items= "_($P($G(^TMP($J,"ENITUTL","DILIST",0)),U)+0)
  1. S ENL=ENL+1,ENTX(ENL)=" ",ENL=ENL+1,ENTX(ENL)="These IT assignments are still active for "_ENNAME_".",ENL=ENL+1,ENTX(ENL)="If appropriate, use the transfer or terminate option to make changes."
  1. S XMDUZ="AEMS/MERS",XMSUB="Assigned Equipment of Terminated Owner: "_ENNAME
  1. S XMY("G.EN IT EQUIPMENT")="",XMTEXT="ENTX("
  1. D ^XMD
  1. K ^TMP($J,"ENITUTL")
  1. Q
  1. ;
  1. ;ENITUTL