source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCPRCFP.m@ 1524

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

initial load of WorldVistAEHR

File size: 4.0 KB
Line 
1PRCPRCFP ;WISC/RFJ/DST-conversion factor report (primary, secondary) ;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 ; conversion factor report for primary and secondary
8 N GROUPALL,X
9 K X S X(1)="The Conversion Factor Report will display the inventory point items with procurement sources and conversion factors."
10 S X(2)="This report will sort the Primary and Secondary inventory items by the Group Category, Description, and Procurement Source."
11 D DISPLAY^PRCPUX2(40,79,.X)
12 K X S X(1)="Select the Group Categories to display" D DISPLAY^PRCPUX2(2,40,.X)
13 D GROUPSEL^PRCPURS1(PRCP("I"))
14 I '$G(GROUPALL),'$O(^TMP($J,"PRCPURS1","YES",0)) W !,"*** NO GROUP CATEGORIES SELECTED !" D Q Q
15 W !,"NOTE: The report will",$S('$G(GROUPALL):" NOT",1:"")," include items not stored in a group category."
16 ; Prompt for On-Demand Item selection, if not warehouse
17 N ODIS
18 S ODIS=$$ODIPROM^PRCPUX2(0)
19 I 'ODIS D Q Q
20 ;
21 W ! S %ZIS="Q" D ^%ZIS Q:POP I $D(IO("Q")) D D ^%ZTLOAD K IO("Q"),ZTSK Q
22 . S ZTDESC="Conversion Factor Report",ZTRTN="DQ^PRCPRCFP"
23 . S ZTSAVE("PRCP*")="",ZTSAVE("GROUPALL")="",ZTSAVE("ODIS")="",ZTSAVE("^TMP($J,""PRCPURS1"",")="",ZTSAVE("ZTREQ")="@"
24 W !!,"<*> please wait <*>"
25DQ ; queue starts here
26 N %,%H,%I,DESCR,GROUP,GROUPNM,ITEMDA,ITEMDATA,NOW,NSN,PAGE,PRCPFLAG,SCREEN,VENDATA,VENNM,X,Y
27 N ODI ; On-Demand Item flag
28 K ^TMP($J,"PRCPRCFP")
29 S ITEMDA=0 F S ITEMDA=$O(^PRCP(445,PRCP("I"),1,ITEMDA)) Q:'ITEMDA D
30 . S ITEMDATA=$G(^PRCP(445,PRCP("I"),1,ITEMDA,0))
31 . S GROUP=+$P(ITEMDATA,"^",21)
32 . I 'GROUP,'$G(GROUPALL) Q
33 . I $G(GROUPALL),$D(^TMP($J,"PRCPURS1","NO",GROUP)) Q
34 . I '$G(GROUPALL),'$D(^TMP($J,"PRCPURS1","YES",GROUP)) Q
35 . S GROUPNM=$$GROUPNM^PRCPEGRP(GROUP)
36 . I GROUPNM'="" S GROUPNM=$E(GROUPNM,1,20)_" (#"_GROUP_")"
37 . S:GROUPNM="" GROUPNM=" "
38 . S DESCR=$$DESCR^PRCPUX1(PRCP("I"),ITEMDA) S:DESCR="" DESCR=" "
39 . S X=0 F S X=$O(^PRCP(445,PRCP("I"),1,ITEMDA,5,X)) Q:'X S VENDATA=$G(^(X,0)) I VENDATA'="" D
40 . . S VENNM=$$VENNAME^PRCPUX1($P(VENDATA,"^")) S:VENNM="" VENNM=" "
41 . . S ^TMP($J,"PRCPRCFP",GROUPNM,$E(DESCR,1,30),ITEMDA,$E(VENNM,1,20))=VENDATA
42 ; print report
43 D NOW^%DTC S Y=% D DD^%DT S NOW=Y,PAGE=1,SCREEN=$$SCRPAUSE^PRCPUREP U IO D H
44 S GROUP="" F S GROUP=$O(^TMP($J,"PRCPRCFP",GROUP)) Q:GROUP=""!($G(PRCPFLAG)) D
45 . I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
46 . W !!?5,"GROUP: ",$S(GROUP=" ":"<<NONE>>",1:GROUP)
47 . S DESCR="" F S DESCR=$O(^TMP($J,"PRCPRCFP",GROUP,DESCR)) Q:DESCR=""!($G(PRCPFLAG)) S ITEMDA=0 F S ITEMDA=$O(^TMP($J,"PRCPRCFP",GROUP,DESCR,ITEMDA)) Q:'ITEMDA!($G(PRCPFLAG)) D
48 . . I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
49 . . S ITEMDATA=$G(^PRCP(445,PRCP("I"),1,ITEMDA,0))
50 . . ; On-Demand Item flag check and display
51 . . S ODI=$$ODITEM^PRCPUX2(PRCP("I"),ITEMDA)
52 . . Q:(ODIS=1)&(ODI="Y")
53 . . Q:(ODIS=2)&(ODI'="Y")
54 . . ;
55 . . W !,DESCR,?32,$S(ODI="Y":"D",1:""),?46,ITEMDA,?53,$J(+$P(ITEMDATA,"^",7),8),$J($$UNIT^PRCPUX1(PRCP("I"),ITEMDA,"/"),10)
56 . . S VENNM="" F S VENNM=$O(^TMP($J,"PRCPRCFP",GROUP,DESCR,ITEMDA,VENNM)) Q:VENNM=""!($G(PRCPFLAG)) S VENDATA=^(VENNM) D
57 . . . I $Y>(IOSL-6) D:SCREEN P^PRCPUREP Q:$D(PRCPFLAG) D H
58 . . . S %=$S($P(VENDATA,"^")["PRCP(445":"I#",1:"V#")_+VENDATA
59 . . . W !?29,VENNM,?51,$J(%,8),?61,$J($$UNITVAL^PRCPUX1($P(VENDATA,"^",3),$P(VENDATA,"^",2),"/"),10),$J($P(VENDATA,"^",4),9)
60 . I $G(ZTQUEUED),$$S^%ZTLOAD S PRCPFLAG=1 W !?10,"<<< TASKMANAGER JOB TERMINATED BY USER >>>"
61 I '$G(PRCPFLAG) D END^PRCPUREP
62Q D ^%ZISC K ^TMP($J,"PRCPRCFP"),^TMP($J,"PRCPURS1")
63 Q
64 ;
65H S %=NOW_" PAGE "_PAGE,PAGE=PAGE+1 I PAGE'=2!(SCREEN) W @IOF
66 W $C(13),"CONVERSION FACTOR REPORT FOR: ",$E(PRCP("IN"),1,20),?(80-$L(%)),%
67 W !,$S(ODIS=2:"ON-DEMAND ITEMS ONLY",ODIS=3:"ALL ITEMS (STANDARD AND ON-DEMAND)",1:"STANDARD ITEMS ONLY")
68 S %="",$P(%,"-",81)=""
69 W !,"DESCRIPTION",?32,"OD",?46,"IM",$J("QTY OH",13),$J("UNIT/IS",10)
70 W !?29,"PROCUREMENT SOURCE",?55,"IV#",?61,$J("UNIT/RE",10),$J("CF",9),!,%
71 Q
Note: See TracBrowser for help on using the repository browser.