source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHCRD3.m@ 691

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

initial load of WorldVistAEHR

File size: 3.3 KB
RevLine 
[613]1PRCHCRD3 ;WISC/DJM-LINK REPETITIVE ITEM DATA TO P.O.ITEM DATA-AFTER AMENDMENT ;6/24/94 9:28 AM
2V ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4EN3 ; Move Repetitive Item data to file 442, adds FCP to file 441.
5 ; Called from OTHER^PRCHAMYD.
6 ;
7 ; PRCHCCP=FUND CONTROL POINT
8 ; PRCHCV=VENDOR
9 ; PRCHCPD=P.O. DATE
10 ; PRCHCI=ITEM MASTER FILE NUMBER
11 ; PRCHPO=P.O. RECORD NUMBER
12 ; ITEM0=ITEM NODE 0 DATA
13 ; ITEM2=ITEM NODE 2 DATA
14 ; ITVEN0=VENDOR NODE 0 FROM FILE 441-VENDOR MULTIPLE
15 ;
16 N PO0,PO1,PRCHCPD,PRCHCCP,PRCHCI,PRCHCV,PRCHCX,ITEM0,ITEM2,ITVEN0,X,Z
17 S PO0=$G(^PRC(442,PRCHPO,0)),PO1=$G(^PRC(442,PRCHPO,1)),PRCHCPD=+$P(PO1,U,15),PRCHCCP=$P($P(PO0,U,3)," ",1),PRCHCV=$P(PO1,U)
18 S PRCHCI=$P($G(^PRC(442,PRCHPO,2,IMF1,0)),U,5)
19 ;
20 S PRCHCX=PRC("SITE")_PRCHCCP D I $G(^PRC(441,PRCHCI,4,PRCHCX,1,0))="" S ^PRC(441,PRCHCI,4,PRCHCX,1,0)="^"_$P(^DD(441.03,1,0),U,2)_"^0^0"
21 .I '$D(^PRC(441,PRCHCI,4)) S ^PRC(441,PRCHCI,4,0)="^"_$P(^DD(441,1,0),U,2)_"^0^0"
22 .I '$D(^PRC(441,PRCHCI,4,PRCHCX,0)) S ^(0)=PRCHCX,^PRC(441,PRCHCI,4,"B",PRCHCX,PRCHCX)="",$P(^(0),U,3,4)=PRCHCX_U_($P(^PRC(441,PRCHCI,4,0),U,4)+1)
23 ;
24 S:'$D(^PRC(441,PRCHCI,4,PRCHCX,1,PRCHPO,0)) ^(0)=PRCHPO,^PRC(441,PRCHCI,4,PRCHCX,1,"AC",9999999-PRCHCPD,PRCHPO)="",$P(^(0),U,3,4)=PRCHPO_U_($P(^PRC(441,PRCHCI,4,PRCHCX,1,0),U,4)+1)
25 ;
26 I '$D(^PRC(441,PRCHCI,2)) S ^PRC(441,PRCHCI,2,0)="^"_$P(^DD(441,6,0),U,2)_"^0^0"
27 I '$D(^PRC(441,PRCHCI,2,PRCHCV,0)) S ^(0)=PRCHCV,^PRC(441,PRCHCI,2,"B",PRCHCV,PRCHCV)="",$P(^(0),U,3,4)=PRCHCV_U_($P(^PRC(441,PRCHCI,2,0),U,4)+1)
28 L +^PRC(441,PRCHCI,2,PRCHCV):5 I '$T Q
29 S $P(^PRC(441,PRCHCI,0),U,4)=PRCHCV
30 ;
31 S ITEM0=$G(^PRC(442,PRCHPO,2,IMF1,0))
32 S ITEM2=$G(^PRC(442,PRCHPO,2,IMF1,2))
33 S ITVEN0=$G(^PRC(441,+PRCHCI,2,PRCHCV,0))
34 ;
35 ; UNIT OF PURCHASE
36 S X=$P(ITEM0,U,3) I X]"" S $P(ITVEN0,U,7)=X
37 ;
38 ;ACTUAL UNIT COST and DATE OF UNIT PRICE
39 S X=$P(ITEM0,U,9) I X]"" S $P(ITVEN0,U,2)=X,$P(ITVEN0,U,6)=$G(DT)
40 ;
41 ; NATIONAL STOCK NUMBER
42 S X=$P(ITEM0,U,13) D:X]""
43 .I $P(^PRC(441,+PRCHCI,0),U,5)]"" S Z=$P(^(0),U,5),Z(1)=$P(Z,"-",3,4),Z(2)=$E(Z,4)_$P(Z,"-",2)_$P(Z,"-",3)_$P(Z,"-",4) K ^PRC(441,"BB",Z,+PRCHCI) K:Z(1)]"" ^PRC(441,"BA",Z(1),+PRCHCI) K:Z(2)]"" ^PRC(441,"G",Z(2),+PRCHCI)
44 .S Z(1)=$P(X,"-",3,4),Z(2)=$E(X,4)_$P(X,"-",2)_$P(X,"-",3)_$P(X,"-",4)
45 .S ^PRC(441,"BB",X,+PRCHCI)="" S:Z(1)]"" ^PRC(441,"BA",Z(1),+PRCHCI)=""
46 .S:Z(2)]"" ^PRC(441,"G",Z(2),+PRCHCI)=""
47 .S $P(^PRC(441,+PRCHCI,0),U,5)=X
48 ;
49 ; VENDOR STOCK NUMBER
50 S X=$P(ITEM0,U,6) D:X]""
51 .I $P(ITVEN0,U,4)]"" K ^PRC(441,"D",$P(ITVEN0,U,4),+PRCHCI,PRCHCV)
52 .S $P(ITVEN0,U,4)=X,^PRC(441,"D",X,+PRCHCI,PRCHCV)=""
53 ;
54 ; CONTRACT NUMBER
55 S X=$P(ITEM2,U,2) I X]"" S X=$O(^PRC(440,PRCHCV,4,"B",X,0)) S:X>0 $P(ITVEN0,U,3)=X
56 ;
57 ; PACKAGING MULTIPLE
58 S X=$P(ITEM0,U,12) S:X]"" $P(ITVEN0,U,8)=X
59 ;
60 ; FEDERAL SUPPLY CLASSIFICATION
61 S X=$P(ITEM2,U,3) S:X]"" $P(^PRC(441,+PRCHCI,0),U,3)=X
62 ;
63 ; MAXIMUM ORDER QUANTITY
64 S X=$P(ITEM0,U,14) S:X]"" $P(ITVEN0,U,9)=X
65 ;
66 ; STOCK KEEPING UNIT
67 S X=$P(ITEM0,U,16) S:X]"" $P(^PRC(441,+PRCHCI,3),U,8)=X
68 ;
69 ; UNIT CONVERSION FACTOR
70 S X=$P(ITEM0,U,17) S:X]"" $P(ITVEN0,U,10)=X
71 ;
72 ; NATIONAL DRUG CODE
73 S X=$P(ITEM0,U,15) S:X]"" $P(ITVEN0,U,5)=X
74 ;
75 ; BOC
76 ;S X=+$P(ITEM0,U,4) S:X]"" $P(^PRC(441,PRCHCI,0),U,10)=X
77 ;
78 ; NOW SAVE ITVEN0
79 S ^PRC(441,+PRCHCI,2,PRCHCV,0)=ITVEN0
80 L -^PRC(441,PRCHCI,2,PRCHCV)
81 Q
Note: See TracBrowser for help on using the repository browser.