- ENWOCOMP ;(WIRMFO)/DLM/JED/DH-TEST FOR COMPLETED WORK ORDER ;5/11/1998
- ;;7.0;ENGINEERING;**35,53**;Aug 17, 1993
- ; Called by x-refs in File 6920 and by various engineering work
- ; order routines.
- ; Expects DA as IEN to File 6920.
- ; Principal tasks are to maintain incomplete work order list and
- ; to call for posting of equipment repair history.
- TEST ;Is work order complete?
- Q:$D(^ENG(6920,DA,0))=0
- N ENDCOMP,ENINV,ENSH,ENTEC
- S ENSH=$P($G(^ENG(6920,DA,2)),U)
- S ENTEC=$P($G(^ENG(6920,DA,2)),U,2)
- S ENDCOMP=$P($G(^ENG(6920,DA,5)),U,2)
- I ENDCOMP]"" G COMP
- ;
- UNCOMP ;Work order is incomplete
- S:ENSH]"" ^ENG(6920,"AINC",ENSH,9999999999-DA)=""
- Q
- COMP ;Work order is complete
- K:ENSH]"" ^ENG(6920,"AINC",ENSH,9999999999-DA)
- I '$D(DIU(0)) S ENINV=$P($G(^ENG(6920,DA,3)),U,8) D:ENINV]"" W^ENEQHS
- Q
- ;
- DEL ;Remove from INCOMPLETE WORK ORDER list
- ;Expects DA
- Q:'$D(DA)
- N ENSHKEY
- S ENSHKEY=$P($G(^ENG(6920,DA,2)),U)
- Q:ENSHKEY=""
- K ^ENG(6920,"AINC",ENSHKEY,9999999999-DA)
- Q
- ;
- ;ENWOCOMP
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENWOCOMP 1040 printed Mar 13, 2025@21:00:52 Page 2
- ENWOCOMP ;(WIRMFO)/DLM/JED/DH-TEST FOR COMPLETED WORK ORDER ;5/11/1998
- +1 ;;7.0;ENGINEERING;**35,53**;Aug 17, 1993
- +2 ; Called by x-refs in File 6920 and by various engineering work
- +3 ; order routines.
- +4 ; Expects DA as IEN to File 6920.
- +5 ; Principal tasks are to maintain incomplete work order list and
- +6 ; to call for posting of equipment repair history.
- TEST ;Is work order complete?
- +1 if $DATA(^ENG(6920,DA,0))=0
- QUIT
- +2 NEW ENDCOMP,ENINV,ENSH,ENTEC
- +3 SET ENSH=$PIECE($GET(^ENG(6920,DA,2)),U)
- +4 SET ENTEC=$PIECE($GET(^ENG(6920,DA,2)),U,2)
- +5 SET ENDCOMP=$PIECE($GET(^ENG(6920,DA,5)),U,2)
- +6 IF ENDCOMP]""
- GOTO COMP
- +7 ;
- UNCOMP ;Work order is incomplete
- +1 if ENSH]""
- SET ^ENG(6920,"AINC",ENSH,9999999999-DA)=""
- +2 QUIT
- COMP ;Work order is complete
- +1 if ENSH]""
- KILL ^ENG(6920,"AINC",ENSH,9999999999-DA)
- +2 IF '$DATA(DIU(0))
- SET ENINV=$PIECE($GET(^ENG(6920,DA,3)),U,8)
- if ENINV]""
- DO W^ENEQHS
- +3 QUIT
- +4 ;
- DEL ;Remove from INCOMPLETE WORK ORDER list
- +1 ;Expects DA
- +2 if '$DATA(DA)
- QUIT
- +3 NEW ENSHKEY
- +4 SET ENSHKEY=$PIECE($GET(^ENG(6920,DA,2)),U)
- +5 if ENSHKEY=""
- QUIT
- +6 KILL ^ENG(6920,"AINC",ENSHKEY,9999999999-DA)
- +7 QUIT
- +8 ;
- +9 ;ENWOCOMP