ENEQNX4 ;WCIOFO/DH,SAB-CMR Inventory Exception Listing ;10/12/1999
;;7.0;ENGINEERING;**35,50,63**;AUG 17, 1993
EN ;Print CMR items not found during inventory
K ENCMR
; ask date of inventory
I '$D(DT) S X="T" D ^%DT S DT=+Y
S %DT("A")="Report equipment not inventoried since: "
S Y=$E(DT,1,5)_"01" X ^DD("DD") S %DT("B")=Y,%DT="AEPX"
D ^%DT K %DT G:Y'>0 EXIT S ENFR=Y
; ask if all CMR's
S DIR(0)="Y",DIR("A")="For all CMR's",DIR("B")="NO"
D ^DIR K DIR G:$D(DIRUT) EXIT
I Y S ENCMR(0)="ALL"
; if not all CMR's then ask CMR
I '$D(ENCMR(0)) S DIC="^ENG(6914.1,",DIC(0)="AQEM" D ^DIC G:Y'>0 EXIT
S ENCMR=+Y
; ask if optionally accountable equipment included
S DIR(0)="Y",DIR("A")="Check All NX equipment",DIR("B")="YES"
S DIR("?",1)="Enter NO if you only want to check for physical inventory"
S DIR("?",2)="of accountable NX equipment. Accountable NX equipment"
S DIR("?",3)="is equipment with an INVESTMENT CATEGORY of either"
S DIR("?",4)="CAPITALIZED/ACCOUNTABLE or NOT CAPITALIZED/ACCOUNTABLE. "
S DIR("?",5)=" "
S DIR("?")="Enter YES to check all equipment for the specified CMR."
D ^DIR K DIR G:$D(DIRUT) EXIT
S ENALL=Y
; ask device
S %ZIS="QM" D ^%ZIS G:POP EXIT
I $D(IO("Q")) D G EXIT
. S ZTRTN="CONT^ENEQNX4",ZTIO=ION,ZTDESC="NX Inventory Exception List"
. S ZTSAVE("EN*")=""
. D ^%ZTLOAD,HOME^%ZIS K ZTSK
CONT ;Entry point for queued task
U IO
K ENDL S $P(ENDL,"-",IOM)=""
S ENFR("E")=$$FMTE^XLFDT(ENFR)
I '$D(DT) S X="T" D ^%DT S DT=+Y
S Y=DT X ^DD("DD") S ENDATE=Y,(END,ENPG)=0
I $D(ENCMR(0)) S ENCMR=0 F S ENCMR=$O(^ENG(6914,"AD",ENCMR)) Q:'ENCMR D CMR Q:END
I '$D(ENCMR(0)) D CMR
I 'END,$E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
D ^%ZISC
EXIT ;
K ENCAT,ENCMR,ENCMRY0,END,ENDA,ENDATE,ENDL,ENALL,ENFR,ENI,ENINVDT
K ENPG,ENSVC,ENT,ENUSE,ENY
K DIC,DIROUT,DIRUT,DTOUT,DUOUT,X,Y,%,%ZIS
S:$D(ZTQUEUED) ZTREQ="@"
Q
CMR ; print exception listing for one CMR
S ENCMRY0=$G(^ENG(6914.1,ENCMR,0))
S ENSVC=$$GET1^DIQ(6914.1,ENCMR,.5)
D HD Q:END
S ENT("EXCP")=0,ENT("CMR")=0
; loop thru equipment on CMR
S ENDA=0 F S ENDA=$O(^ENG(6914,"AD",ENCMR,ENDA)) Q:'ENDA D Q:END
. F ENI=2,3,8 S ENY(ENI)=$G(^ENG(6914,ENDA,ENI))
. I $P(ENY(3),U)>3,$P(ENY(3),U)<6 Q ; use status turned-in or lost
. ; if user did not want all equipment then check accountablility
. I 'ENALL,"^1^A^"'[(U_$P(ENY(8),U,2)_U) Q
. S ENT("CMR")=ENT("CMR")+1 ; should have been inventoried
. I $P(ENY(2),U,13)'<ENFR Q ; inventoried since specified date
. ; completed checks - print item on exception listing
. I $Y+7>IOSL D HD Q:END
. S ENT("EXCP")=ENT("EXCP")+1
. F ENI=0,1 S ENY(ENI)=$G(^ENG(6914,ENDA,ENI))
. S ENUSE=$$GET1^DIQ(6914,ENDA,20)
. S ENINVDT=$P($$GET1^DIQ(6914,ENDA,23),"@")
. W !!,ENDA,?15,$P(ENY(3),U,6)
. S X=$P(ENY(3),U,5) I X=+X,$D(^ENG("SP",X,0)) S X=$P(^(0),U)
. W ?28,X,?43,$P(ENY(3),U,8),?63,ENINVDT I IOM>120 S ENCAT=$P(ENY(1),U,1) W:ENCAT]"" ?81,$S($D(^ENG(6911,ENCAT,0)):^(0),1:"")
. W !,?3,$E($P(ENY(0),U,2),1,55),?63,ENUSE
; CMR footer
I 'END D
. W:ENT("EXCP")=0 !!,"NO EXCEPTIONS TO REPORT (out of ",ENT("CMR")," item",$S(ENT("CMR")'=1:"s",1:"")," that met selection criteria)."
. W:ENT("EXCP")>0 !!,ENT("EXCP")," Item",$S(ENT("EXCP")'=1:"s",1:"")," Not Inventoried (out of ",ENT("CMR")," item",$S(ENT("CMR")'=1:"s",1:"")," that met selection criteria)."
Q
HD ; page header
I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1,END=1 Q
I $E(IOST,1,2)="C-",ENPG S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
I $E(IOST,1,2)="C-"!ENPG W @IOF
S ENPG=ENPG+1
W "EXCEPTION LIST (NX INVENTORY)",?(IOM-25),ENDATE,?(IOM-8),"Page ",ENPG
W !," ",$S(ENALL:"All",1:"Accountable")
W " NX Equipment Not Inventoried Since ",ENFR("E")," for"
W !," CMR: ",$P(ENCMRY0,U)," ",ENSVC," ",$P(ENCMRY0,U,8)
W !!,"Equipment ID#",?15,"PM Number",?28,"Location",?43,"Previous Location",?63,"Last Inventoried" I IOM>120 W ?81,"Equipment Category"
W !,?3,"Manufacturer Equipment Name",?63,"Use Status"
W !,ENDL
Q
;ENEQNX4
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENEQNX4 4049 printed Dec 13, 2024@01:52:38 Page 2
ENEQNX4 ;WCIOFO/DH,SAB-CMR Inventory Exception Listing ;10/12/1999
+1 ;;7.0;ENGINEERING;**35,50,63**;AUG 17, 1993
EN ;Print CMR items not found during inventory
+1 KILL ENCMR
+2 ; ask date of inventory
+3 IF '$DATA(DT)
SET X="T"
DO ^%DT
SET DT=+Y
+4 SET %DT("A")="Report equipment not inventoried since: "
+5 SET Y=$EXTRACT(DT,1,5)_"01"
XECUTE ^DD("DD")
SET %DT("B")=Y
SET %DT="AEPX"
+6 DO ^%DT
KILL %DT
if Y'>0
GOTO EXIT
SET ENFR=Y
+7 ; ask if all CMR's
+8 SET DIR(0)="Y"
SET DIR("A")="For all CMR's"
SET DIR("B")="NO"
+9 DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO EXIT
+10 IF Y
SET ENCMR(0)="ALL"
+11 ; if not all CMR's then ask CMR
+12 IF '$DATA(ENCMR(0))
SET DIC="^ENG(6914.1,"
SET DIC(0)="AQEM"
DO ^DIC
if Y'>0
GOTO EXIT
+13 SET ENCMR=+Y
+14 ; ask if optionally accountable equipment included
+15 SET DIR(0)="Y"
SET DIR("A")="Check All NX equipment"
SET DIR("B")="YES"
+16 SET DIR("?",1)="Enter NO if you only want to check for physical inventory"
+17 SET DIR("?",2)="of accountable NX equipment. Accountable NX equipment"
+18 SET DIR("?",3)="is equipment with an INVESTMENT CATEGORY of either"
+19 SET DIR("?",4)="CAPITALIZED/ACCOUNTABLE or NOT CAPITALIZED/ACCOUNTABLE. "
+20 SET DIR("?",5)=" "
+21 SET DIR("?")="Enter YES to check all equipment for the specified CMR."
+22 DO ^DIR
KILL DIR
if $DATA(DIRUT)
GOTO EXIT
+23 SET ENALL=Y
+24 ; ask device
+25 SET %ZIS="QM"
DO ^%ZIS
if POP
GOTO EXIT
+26 IF $DATA(IO("Q"))
Begin DoDot:1
+27 SET ZTRTN="CONT^ENEQNX4"
SET ZTIO=ION
SET ZTDESC="NX Inventory Exception List"
+28 SET ZTSAVE("EN*")=""
+29 DO ^%ZTLOAD
DO HOME^%ZIS
KILL ZTSK
End DoDot:1
GOTO EXIT
CONT ;Entry point for queued task
+1 USE IO
+2 KILL ENDL
SET $PIECE(ENDL,"-",IOM)=""
+3 SET ENFR("E")=$$FMTE^XLFDT(ENFR)
+4 IF '$DATA(DT)
SET X="T"
DO ^%DT
SET DT=+Y
+5 SET Y=DT
XECUTE ^DD("DD")
SET ENDATE=Y
SET (END,ENPG)=0
+6 IF $DATA(ENCMR(0))
SET ENCMR=0
FOR
SET ENCMR=$ORDER(^ENG(6914,"AD",ENCMR))
if 'ENCMR
QUIT
DO CMR
if END
QUIT
+7 IF '$DATA(ENCMR(0))
DO CMR
+8 IF 'END
IF $EXTRACT(IOST,1,2)="C-"
SET DIR(0)="E"
DO ^DIR
KILL DIR
+9 DO ^%ZISC
EXIT ;
+1 KILL ENCAT,ENCMR,ENCMRY0,END,ENDA,ENDATE,ENDL,ENALL,ENFR,ENI,ENINVDT
+2 KILL ENPG,ENSVC,ENT,ENUSE,ENY
+3 KILL DIC,DIROUT,DIRUT,DTOUT,DUOUT,X,Y,%,%ZIS
+4 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+5 QUIT
CMR ; print exception listing for one CMR
+1 SET ENCMRY0=$GET(^ENG(6914.1,ENCMR,0))
+2 SET ENSVC=$$GET1^DIQ(6914.1,ENCMR,.5)
+3 DO HD
if END
QUIT
+4 SET ENT("EXCP")=0
SET ENT("CMR")=0
+5 ; loop thru equipment on CMR
+6 SET ENDA=0
FOR
SET ENDA=$ORDER(^ENG(6914,"AD",ENCMR,ENDA))
if 'ENDA
QUIT
Begin DoDot:1
+7 FOR ENI=2,3,8
SET ENY(ENI)=$GET(^ENG(6914,ENDA,ENI))
+8 ; use status turned-in or lost
IF $PIECE(ENY(3),U)>3
IF $PIECE(ENY(3),U)<6
QUIT
+9 ; if user did not want all equipment then check accountablility
+10 IF 'ENALL
IF "^1^A^"'[(U_$PIECE(ENY(8),U,2)_U)
QUIT
+11 ; should have been inventoried
SET ENT("CMR")=ENT("CMR")+1
+12 ; inventoried since specified date
IF $PIECE(ENY(2),U,13)'<ENFR
QUIT
+13 ; completed checks - print item on exception listing
+14 IF $Y+7>IOSL
DO HD
if END
QUIT
+15 SET ENT("EXCP")=ENT("EXCP")+1
+16 FOR ENI=0,1
SET ENY(ENI)=$GET(^ENG(6914,ENDA,ENI))
+17 SET ENUSE=$$GET1^DIQ(6914,ENDA,20)
+18 SET ENINVDT=$PIECE($$GET1^DIQ(6914,ENDA,23),"@")
+19 WRITE !!,ENDA,?15,$PIECE(ENY(3),U,6)
+20 SET X=$PIECE(ENY(3),U,5)
IF X=+X
IF $DATA(^ENG("SP",X,0))
SET X=$PIECE(^(0),U)
+21 WRITE ?28,X,?43,$PIECE(ENY(3),U,8),?63,ENINVDT
IF IOM>120
SET ENCAT=$PIECE(ENY(1),U,1)
if ENCAT]""
WRITE ?81,$SELECT($DATA(^ENG(6911,ENCAT,0)):^(0),1:"")
+22 WRITE !,?3,$EXTRACT($PIECE(ENY(0),U,2),1,55),?63,ENUSE
End DoDot:1
if END
QUIT
+23 ; CMR footer
+24 IF 'END
Begin DoDot:1
+25 if ENT("EXCP")=0
WRITE !!,"NO EXCEPTIONS TO REPORT (out of ",ENT("CMR")," item",$SELECT(ENT("CMR")'=1:"s",1:"")," that met selection criteria)."
+26 if ENT("EXCP")>0
WRITE !!,ENT("EXCP")," Item",$SELECT(ENT("EXCP")'=1:"s",1:"")," Not Inventoried (out of ",ENT("CMR")," item",$SELECT(ENT("CMR")'=1:"s",1:"")," that met selection criteria)."
End DoDot:1
+27 QUIT
HD ; page header
+1 IF $DATA(ZTQUEUED)
IF $$S^%ZTLOAD
SET ZTSTOP=1
SET END=1
QUIT
+2 IF $EXTRACT(IOST,1,2)="C-"
IF ENPG
SET DIR(0)="E"
DO ^DIR
KILL DIR
IF 'Y
SET END=1
QUIT
+3 IF $EXTRACT(IOST,1,2)="C-"!ENPG
WRITE @IOF
+4 SET ENPG=ENPG+1
+5 WRITE "EXCEPTION LIST (NX INVENTORY)",?(IOM-25),ENDATE,?(IOM-8),"Page ",ENPG
+6 WRITE !," ",$SELECT(ENALL:"All",1:"Accountable")
+7 WRITE " NX Equipment Not Inventoried Since ",ENFR("E")," for"
+8 WRITE !," CMR: ",$PIECE(ENCMRY0,U)," ",ENSVC," ",$PIECE(ENCMRY0,U,8)
+9 WRITE !!,"Equipment ID#",?15,"PM Number",?28,"Location",?43,"Previous Location",?63,"Last Inventoried"
IF IOM>120
WRITE ?81,"Equipment Category"
+10 WRITE !,?3,"Manufacturer Equipment Name",?63,"Use Status"
+11 WRITE !,ENDL
+12 QUIT
+13 ;ENEQNX4