source: FOIAVistA/tag/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCPCASR.m@ 1158

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

initial load of FOIAVistA 6/30/08 version

File size: 2.8 KB
Line 
1PRCPCASR ;WISC/RFJ-assemble cc or ik (print list of items) ;01 Sep 93
2 ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 Q
5 ;
6 ;
7PRINT(QUANTITY) ; print list of items in cc or ik
8 ; quantity=qty to assemble
9 ; returns variable notinvpt=1 if items not stored in inventory point
10 ; returns variable negative=1 if new item qty drops below zero
11 ; returns variable prcpflag=1 if user ^ during display
12 ; returns ^tmp($j,"prcpcasr",itemda)=qty needed ^ inventory value
13 N %,DATA,INVVAL,ITEMDA,ITEMDATA,NEWQTY,REUSABLE,SCREEN
14 K ^TMP($J,"PRCPCASR"),NEGATIVE,NOTINVPT,PRCPFLAG
15 W ! D H
16 S SCREEN=1,ITEMDA=0 F S ITEMDA=$O(^TMP($J,"PRCPLIST",ITEMDA)) Q:'ITEMDA!($G(PRCPFLAG)) S DATA=^(ITEMDA)*QUANTITY D
17 . S ITEMDATA=$G(^PRCP(445,PRCP("I"),1,ITEMDA,0))
18 . I ITEMDATA'="",$P(ITEMDATA,"^",7)="" S $P(ITEMDATA,"^",7)=0
19 . I ITEMDATA="" S $P(ITEMDATA,"^",7)="Not in InvPt" S NOTINVPT=1
20 . S INVVAL=$J($S('$P(ITEMDATA,"^",7):0,1:$P(ITEMDATA,"^",27)/$P(ITEMDATA,"^",7))*DATA,0,3)
21 . S NEWQTY=$P(ITEMDATA,"^",7)-DATA
22 . S REUSABLE=$$REUSABLE^PRCPU441(ITEMDA)
23 . I REUSABLE S NEWQTY=$P(ITEMDATA,"^",7)
24 . I 'REUSABLE,NEWQTY<0 S NEGATIVE=1
25 . W !,ITEMDA,?7,$E($$DESCR^PRCPUX1(PRCP("I"),ITEMDA),1,22),?30,$S(REUSABLE=1:"Reusable",1:"Disposable"),?44,$J($P(ITEMDATA,"^",7),13),$J(DATA,10),$J(NEWQTY,13)
26 . I 'REUSABLE,DATA S ^TMP($J,"PRCPCASR",ITEMDA)=DATA_"^"_INVVAL
27 . S SCREEN=SCREEN+1
28 . I SCREEN'<IOSL D P^PRCPUREP Q:$D(PRCPFLAG) D H S SCREEN=1
29 Q
30 ;
31 ;
32H ; display header on display
33 W !?44,$J("CURRENT",13),$J("QTY",10),$J("** NEW **",13),!,"IM#",?7,"DESCRIPTION",?30,"ITEM TYPE",?44,$J("QTY ON-HAND",13),$J("NEEDED",10),$J("QTY ON-HAND",13)
34 S %="",$P(%,"-",81)="" W !,%
35 Q
36 ;
37 ;
38CHECK(TYPE) ; called from prcpcasc,prcpcask to check the ik or cc definition
39 ; before assembly
40 ; type=c for case cart or =i for instrument kit
41 S TYPE=$S(TYPE="C":"case cart",1:"instrument kit")
42 N CCIKITEM,PRCPITEM,X
43 S CCIKITEM=0,PRCPITEM=0
44 F S CCIKITEM=$O(^TMP($J,"PRCPLIST-DISP",CCIKITEM)),PRCPITEM=$O(^PRCP(445,PRCP("I"),1,ITEMDA,8,PRCPITEM)) Q:'CCIKITEM&('PRCPITEM) D Q:$G(PRCPFLAG)
45 . I CCIKITEM'=PRCPITEM S PRCPFLAG=1 Q
46 . I $G(^TMP($J,"PRCPLIST-DISP",CCIKITEM))'=+$P($G(^PRCP(445,PRCP("I"),1,ITEMDA,8,PRCPITEM,0)),"^",2) S PRCPFLAG=1 Q
47 I '$G(PRCPFLAG) Q
48 K X S X(1)="WARNING -- This "_TYPE_" is assembled in the inventory point (quantity on-hand equals "_$P($G(^PRCP(445,PRCP("I"),1,ITEMDA,0)),"^",7)_"). Since being assembled, the "_TYPE_" definition has been changed."
49 S X(2)="Assembling another "_TYPE_" under the new definition will cause quantity differences with items stored under the "_TYPE_"."
50 S X(3)="Please disassemble the "_TYPE_" item, leaving 0 quantity on-hand, before assembling additional "_TYPE_"s for this item."
51 D DISPLAY^PRCPUX2(20,60,.X)
52 Q
Note: See TracBrowser for help on using the repository browser.