source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCPRAIP.m@ 619

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

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1PRCPRAIP ;WISC/RFJ/DST-abbreviated item report (primary, second) ;09 Jun 93
2 ;;5.1;IFCAP;**98**;Oct 20, 2000;Build 37
3 ;Per VHA Directive 2004-038, this routine should not be modified.
4 Q
5 ;
6 ;
7PRIMARY ; abbreviated item report for primary and secondary
8 N GROUPALL,X
9 N ODI,ODIS ; for On-Demand Item
10 K X S X(1)="The Abbreviated Item Report will sort the Primary or Secondary inventory items by the group category code and description." D DISPLAY^PRCPUX2(40,79,.X)
11 K X S X(1)="Select the Group Categories to display" D DISPLAY^PRCPUX2(2,40,.X)
12 D GROUPSEL^PRCPURS1(PRCP("I"))
13 I '$G(GROUPALL),'$O(^TMP($J,"PRCPURS1","YES",0)) W !,"*** NO GROUP CATEGORIES SELECTED !" D Q Q
14 W !,"NOTE: The report will",$S('$G(GROUPALL):" NOT",1:"")," include items not stored in a group category."
15 ; Prompt for On-Demand Item selection
16 S ODIS=$$ODIPROM^PRCPUX2(0)
17 I 'ODIS D Q Q
18 ;
19 W ! S %ZIS="Q" D ^%ZIS Q:POP I $D(IO("Q")) D D ^%ZTLOAD K IO("Q"),ZTSK Q
20 . S ZTDESC="Abbreviated Item Report",ZTRTN="DQ^PRCPRAIP"
21 . S ZTSAVE("PRCP*")="",ZTSAVE("GROUPALL")="",ZTSAVE("ODIS")="",ZTSAVE("^TMP($J,""PRCPURS1"",")="",ZTSAVE("ZTREQ")="@"
22 W !!,"<*> please wait <*>"
23DQ ; queue starts here
24 N %,%H,%I,GROUP,GROUPNM,DESCR,ITEMDA,ITEMDATA,NOW,PAGE,PRCPFLAG,SCREEN,X,Y
25 K ^TMP($J,"PRCPRAIP")
26 S ITEMDA=0 F S ITEMDA=$O(^PRCP(445,PRCP("I"),1,ITEMDA)) Q:'ITEMDA D
27 . S ITEMDATA=$G(^PRCP(445,PRCP("I"),1,ITEMDA,0))
28 . S GROUP=+$P(ITEMDATA,"^",21)
29 . I 'GROUP,'$G(GROUPALL) Q
30 . I $G(GROUPALL),$D(^TMP($J,"PRCPURS1","NO",GROUP)) Q
31 . I '$G(GROUPALL),'$D(^TMP($J,"PRCPURS1","YES",GROUP)) Q
32 . S GROUPNM=$$GROUPNM^PRCPEGRP(GROUP)
33 . I GROUPNM'="" S GROUPNM=$E(GROUPNM,1,20)_" (#"_GROUP_")"
34 . S:GROUPNM="" GROUPNM=" "
35 . S DESCR=$$DESCR^PRCPUX1(PRCP("I"),ITEMDA) S:DESCR="" DESCR=" "
36 . S ^TMP($J,"PRCPRAIP",GROUPNM,$E(DESCR,1,15),ITEMDA)=DESCR
37 ; print report
38 D NOW^%DTC S Y=% D DD^%DT S NOW=Y,PAGE=1,SCREEN=$$SCRPAUSE^PRCPUREP U IO D H
39 S GROUP="" F S GROUP=$O(^TMP($J,"PRCPRAIP",GROUP)) Q:GROUP=""!($G(PRCPFLAG)) D
40 . I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
41 . W !!?5,"GROUP: ",$S(GROUP=" ":"<<NONE>>",1:GROUP)
42 . S DESCR="" F S DESCR=$O(^TMP($J,"PRCPRAIP",GROUP,DESCR)) Q:DESCR=""!($G(PRCPFLAG)) S ITEMDA=0 F S ITEMDA=$O(^TMP($J,"PRCPRAIP",GROUP,DESCR,ITEMDA)) Q:'ITEMDA!($G(PRCPFLAG)) S X=^(ITEMDA) D
43 . . ; Check ODI flag for this item
44 . . S ODI=$$ODITEM^PRCPUX2(PRCP("I"),ITEMDA)
45 . . ; If On-Demand Item display not selected, and is ODI, Quit
46 . . Q:(ODIS=1)&(ODI="Y")
47 . . ; If only On-Demand Item display selected, and not ODI, Quit
48 . . Q:(ODIS=2)&(ODI'="Y")
49 . . ;
50 . . I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
51 . . S ITEMDATA=$G(^PRCP(445,PRCP("I"),1,ITEMDA,0))
52 . . W !,$E(X,1,23),?24,ITEMDA,?31,$S(ODI="Y":"D",1:""),?46,$J(+$P(ITEMDATA,"^",7),8),$J($$UNIT^PRCPUX1(PRCP("I"),ITEMDA,"/"),10),$J($$STORAGE^PRCPESTO(PRCP("I"),ITEMDA),16)
53 . . S %=0 F S %=$O(^PRCP(445,PRCP("I"),1,ITEMDA,1,%)) Q:'%!($G(PRCPFLAG)) D
54 . . . I $X>60 W !
55 . . . S X=$E($$STORELOC^PRCPESTO(%),1,15),X=" "_X_$E(" ",$L(X)+1,15)
56 . . . W X
57 . . . I $X>60,$Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
58 . I $G(ZTQUEUED),$$S^%ZTLOAD S PRCPFLAG=1 W !?10,"<<< TASKMANAGER JOB TERMINATED BY USER >>>"
59 I '$G(PRCPFLAG) D END^PRCPUREP
60Q D ^%ZISC K ^TMP($J,"PRCPRAIP"),^TMP($J,"PRCPURS1")
61 Q
62 ;
63H S %=NOW_" PAGE "_PAGE,PAGE=PAGE+1 I PAGE'=2!(SCREEN) W @IOF
64 W $C(13),"ABBREVIATED ITEM REPORT FOR: ",$E(PRCP("IN"),1,20),?(80-$L(%)),%
65 S %="",$P(%,"-",81)=""
66 W !,$S(ODIS=2:"ON-DEMAND ITEMS ONLY",ODIS=3:"ALL ITEMS (STANDARD AND ON-DEMAND)",1:"STANDARD ITEMS ONLY")
67 W !,"DESCRIPTION",?24,"IM",?31,$S(ODIS>1:"OD",1:""),?41,$J("QTY OH",13),$J("UNIT/IS",10),$J("MAIN STORAGE",16),!?5,"ADD STORAGE",?26,"ADD STORAGE",?46,"ADD STORAGE",?66,"ADD STORAGE",!,%
68 Q
Note: See TracBrowser for help on using the repository browser.