ENTIEQE ;WOIFO/SAB - Edit Equipment Records (IT) ;2/4/2008
;;7.0;ENGINEERING;**87**;Aug 17, 1993;Build 16
;
SELEQ ; select (and process) equipment for edit
S END=0
S ENSCR="N ENCMR S ENCMR=$P($G(^(2)),U,9) I ENCMR,$D(^ENG(6914.1,""AIT"",1,ENCMR))"
;
; select and process equipment
F S DIC("S")=ENSCR D GETEQ^ENUTL Q:Y<1 S ENDA=+Y D EQP Q:END
; clean up
K DIC,END,ENDA,ENEQ,ENSCR,Y
Q
;
EQP ; process one equipment item (edit)
; input
; ENDA - ien of equipment item
; output
; END - flag, true when entire process should stop
;
N DA,DDSFILE,DIROUT,DIRUT,DR,DTOUT,DUOUT
; lock equipment
L +^ENG(6914,ENDA):$S($D(DILOCKTM):DILOCKTM,1:5) I '$T D G EQPX
. W $C(7),!,"Record being edited by someone else. Try later."
. S DIR(0)="E" D ^DIR K DIR S:$D(DTOUT) END=1
;
; call fileman screen handler
S DDSFILE=6914,DR="[ENIT EDIT]",DA=ENDA
D ^DDS
I $D(DTOUT) S END=1 ; user timed out
;
; unlock equip
L -^ENG(6914,ENDA)
;
EQPX ; clean up
Q
;
;ENTIEQE
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENTIEQE 1016 printed Dec 13, 2024@01:55:46 Page 2
ENTIEQE ;WOIFO/SAB - Edit Equipment Records (IT) ;2/4/2008
+1 ;;7.0;ENGINEERING;**87**;Aug 17, 1993;Build 16
+2 ;
SELEQ ; select (and process) equipment for edit
+1 SET END=0
+2 SET ENSCR="N ENCMR S ENCMR=$P($G(^(2)),U,9) I ENCMR,$D(^ENG(6914.1,""AIT"",1,ENCMR))"
+3 ;
+4 ; select and process equipment
+5 FOR
SET DIC("S")=ENSCR
DO GETEQ^ENUTL
if Y<1
QUIT
SET ENDA=+Y
DO EQP
if END
QUIT
+6 ; clean up
+7 KILL DIC,END,ENDA,ENEQ,ENSCR,Y
+8 QUIT
+9 ;
EQP ; process one equipment item (edit)
+1 ; input
+2 ; ENDA - ien of equipment item
+3 ; output
+4 ; END - flag, true when entire process should stop
+5 ;
+6 NEW DA,DDSFILE,DIROUT,DIRUT,DR,DTOUT,DUOUT
+7 ; lock equipment
+8 LOCK +^ENG(6914,ENDA):$SELECT($DATA(DILOCKTM):DILOCKTM,1:5)
IF '$TEST
Begin DoDot:1
+9 WRITE $CHAR(7),!,"Record being edited by someone else. Try later."
+10 SET DIR(0)="E"
DO ^DIR
KILL DIR
if $DATA(DTOUT)
SET END=1
End DoDot:1
GOTO EQPX
+11 ;
+12 ; call fileman screen handler
+13 SET DDSFILE=6914
SET DR="[ENIT EDIT]"
SET DA=ENDA
+14 DO ^DDS
+15 ; user timed out
IF $DATA(DTOUT)
SET END=1
+16 ;
+17 ; unlock equip
+18 LOCK -^ENG(6914,ENDA)
+19 ;
EQPX ; clean up
+1 QUIT
+2 ;
+3 ;ENTIEQE