source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENEQNX4.m@ 1147

Last change on this file since 1147 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.9 KB
RevLine 
[613]1ENEQNX4 ;WCIOFO/DH,SAB-CMR Inventory Exception Listing ;10/12/1999
2 ;;7.0;ENGINEERING;**35,50,63**;AUG 17, 1993
3EN ;Print CMR items not found during inventory
4 K ENCMR
5 ; ask date of inventory
6 I '$D(DT) S X="T" D ^%DT S DT=+Y
7 S %DT("A")="Report equipment not inventoried since: "
8 S Y=$E(DT,1,5)_"01" X ^DD("DD") S %DT("B")=Y,%DT="AEPX"
9 D ^%DT K %DT G:Y'>0 EXIT S ENFR=Y
10 ; ask if all CMR's
11 S DIR(0)="Y",DIR("A")="For all CMR's",DIR("B")="NO"
12 D ^DIR K DIR G:$D(DIRUT) EXIT
13 I Y S ENCMR(0)="ALL"
14 ; if not all CMR's then ask CMR
15 I '$D(ENCMR(0)) S DIC="^ENG(6914.1,",DIC(0)="AQEM" D ^DIC G:Y'>0 EXIT
16 S ENCMR=+Y
17 ; ask if optionally accountable equipment included
18 S DIR(0)="Y",DIR("A")="Check All NX equipment",DIR("B")="YES"
19 S DIR("?",1)="Enter NO if you only want to check for physical inventory"
20 S DIR("?",2)="of accountable NX equipment. Accountable NX equipment"
21 S DIR("?",3)="is equipment with an INVESTMENT CATEGORY of either"
22 S DIR("?",4)="CAPITALIZED/ACCOUNTABLE or NOT CAPITALIZED/ACCOUNTABLE. "
23 S DIR("?",5)=" "
24 S DIR("?")="Enter YES to check all equipment for the specified CMR."
25 D ^DIR K DIR G:$D(DIRUT) EXIT
26 S ENALL=Y
27 ; ask device
28 S %ZIS="QM" D ^%ZIS G:POP EXIT
29 I $D(IO("Q")) D G EXIT
30 . S ZTRTN="CONT^ENEQNX4",ZTIO=ION,ZTDESC="NX Inventory Exception List"
31 . S ZTSAVE("EN*")=""
32 . D ^%ZTLOAD,HOME^%ZIS K ZTSK
33CONT ;Entry point for queued task
34 U IO
35 K ENDL S $P(ENDL,"-",IOM)=""
36 S ENFR("E")=$$FMTE^XLFDT(ENFR)
37 I '$D(DT) S X="T" D ^%DT S DT=+Y
38 S Y=DT X ^DD("DD") S ENDATE=Y,(END,ENPG)=0
39 I $D(ENCMR(0)) S ENCMR=0 F S ENCMR=$O(^ENG(6914,"AD",ENCMR)) Q:'ENCMR D CMR Q:END
40 I '$D(ENCMR(0)) D CMR
41 I 'END,$E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
42 D ^%ZISC
43EXIT ;
44 K ENCAT,ENCMR,ENCMRY0,END,ENDA,ENDATE,ENDL,ENALL,ENFR,ENI,ENINVDT
45 K ENPG,ENSVC,ENT,ENUSE,ENY
46 K DIC,DIROUT,DIRUT,DTOUT,DUOUT,X,Y,%,%ZIS
47 S:$D(ZTQUEUED) ZTREQ="@"
48 Q
49CMR ; print exception listing for one CMR
50 S ENCMRY0=$G(^ENG(6914.1,ENCMR,0))
51 S ENSVC=$$GET1^DIQ(6914.1,ENCMR,.5)
52 D HD Q:END
53 S ENT("EXCP")=0,ENT("CMR")=0
54 ; loop thru equipment on CMR
55 S ENDA=0 F S ENDA=$O(^ENG(6914,"AD",ENCMR,ENDA)) Q:'ENDA D Q:END
56 . F ENI=2,3,8 S ENY(ENI)=$G(^ENG(6914,ENDA,ENI))
57 . I $P(ENY(3),U)>3,$P(ENY(3),U)<6 Q ; use status turned-in or lost
58 . ; if user did not want all equipment then check accountablility
59 . I 'ENALL,"^1^A^"'[(U_$P(ENY(8),U,2)_U) Q
60 . S ENT("CMR")=ENT("CMR")+1 ; should have been inventoried
61 . I $P(ENY(2),U,13)'<ENFR Q ; inventoried since specified date
62 . ; completed checks - print item on exception listing
63 . I $Y+7>IOSL D HD Q:END
64 . S ENT("EXCP")=ENT("EXCP")+1
65 . F ENI=0,1 S ENY(ENI)=$G(^ENG(6914,ENDA,ENI))
66 . S ENUSE=$$GET1^DIQ(6914,ENDA,20)
67 . S ENINVDT=$P($$GET1^DIQ(6914,ENDA,23),"@")
68 . W !!,ENDA,?15,$P(ENY(3),U,6)
69 . S X=$P(ENY(3),U,5) I X=+X,$D(^ENG("SP",X,0)) S X=$P(^(0),U)
70 . 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:"")
71 . W !,?3,$E($P(ENY(0),U,2),1,55),?63,ENUSE
72 ; CMR footer
73 I 'END D
74 . W:ENT("EXCP")=0 !!,"NO EXCEPTIONS TO REPORT (out of ",ENT("CMR")," item",$S(ENT("CMR")'=1:"s",1:"")," that met selection criteria)."
75 . 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)."
76 Q
77HD ; page header
78 I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1,END=1 Q
79 I $E(IOST,1,2)="C-",ENPG S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
80 I $E(IOST,1,2)="C-"!ENPG W @IOF
81 S ENPG=ENPG+1
82 W "EXCEPTION LIST (NX INVENTORY)",?(IOM-25),ENDATE,?(IOM-8),"Page ",ENPG
83 W !," ",$S(ENALL:"All",1:"Accountable")
84 W " NX Equipment Not Inventoried Since ",ENFR("E")," for"
85 W !," CMR: ",$P(ENCMRY0,U)," ",ENSVC," ",$P(ENCMRY0,U,8)
86 W !!,"Equipment ID#",?15,"PM Number",?28,"Location",?43,"Previous Location",?63,"Last Inventoried" I IOM>120 W ?81,"Equipment Category"
87 W !,?3,"Manufacturer Equipment Name",?63,"Use Status"
88 W !,ENDL
89 Q
90 ;ENEQNX4
Note: See TracBrowser for help on using the repository browser.