source: FOIAVistA/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHPNT2.m@ 794

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

initial load of FOIAVistA 6/30/08 version

File size: 4.7 KB
Line 
1PRCHPNT2 ;ID/RSD/RHD-CONT. OF PRINT ;5/4/98 14:17
2V ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4ITEM S DIWL=1,DIWR=33,DIWF="",PRCHD=0 K ^UTILITY($J,"W")
5 F K=0:0 S PRCHD=$O(^PRC(442,D0,2,PRCH,1,PRCHD)) Q:PRCHD=""!(PRCHD<0) S X=$G(^(PRCHD,0)) D DIWP^PRCUTL($G(DA))
6 S PRCHCNT=$G(^UTILITY($J,"W",1)),PRCHL=PRCHL+PRCHCNT+1 W !?2,$J($P(PRCHI2,U,5)_+$P(PRCHI0,U,1),3),?8,$G(^(1,1,0))
7 W ?48,$J($P(PRCHI0,U,2),7),?57,$P($G(^PRCD(420.5,+$P(PRCHI0,U,3),0)),U,1)
8 S X=$P($P(PRCHI0,U,9),".",2) W ?59,$S($L(X)>3:$J($P(PRCHI0,U,9),8,4),$L(X)>2:$J($P(PRCHI0,U,9),8,3),$P(PRCHI0,U,9)="N/C":" N/C",1:$J($P(PRCHI0,U,9),8,2)) S PRCHC=1 I $P(PRCHI2,U,1)<10000 D AMT
9 I PRCHCNT>1 F K=2:1:$P(^TMP($J,"P",P,PRCH),U,2) W:$D(^TMP($J,"W",1,K,0)) !?8,^(0) D:PRCHC AMT
10 W ! S PRCHL=PRCHL+1 I $P(PRCHI0,U,6)]"" W ?8,"STK#: ",$P(PRCHI0,U,6),! S PRCHL=PRCHL+1
11 I $P(PRCHI0,U,13)]"" W ?8,"NSN: ",$P(PRCHI0,U,13) D:$D(PRCHNRQ) PSNO^PRCHFPNT W ! S PRCHL=PRCHL+1
12 I $P($G(^PRC(442,D0,2,PRCH,4)),U,12)]"" W ?8,"FOOD GROUP: ",$P(^(4),U,12),! S PRCHL=PRCHL+1
13 D EDISTAT^PRCHUTL(D0,PRCH,.PRCHL)
14 I $P(PRCHI0,U,12) W ?8,"Items per ",$P($G(^PRCD(420.5,+$P(PRCHI0,U,3),0)),U,1),": ",$P(PRCHI0,U,12),! S PRCHL=PRCHL+1
15 D:PRCHC AMT Q
16 ;
17AMT W ?67,$J($P(PRCHI2,U,1),8,2) S PRCHC=0,PRCHPT=PRCHPT+$P(PRCHI2,U,1)
18 Q
19 ;
20FOB ;
21 I $P($G(^PRC(442,D0,0)),U,2)=25 D G FA
22 . N PRCA,PRCB,PRCC
23 . S PRCHINV(1)="** No Purchase Card Info",PRCHINV(2)="",PRCHINV(3)="",PRCHINV(4)="",PRCHINV(5)=""
24 . S PRCA=$P($G(^PRC(442,D0,23)),U,8) Q:PRCA'>0
25 . S PRCB=$G(^PRC(440.5,PRCA,0)) Q:PRCB=""
26 . S PRCC=$P(PRCB,U,8) S:PRCC>0 PRCC=$P($G(^VA(200,PRCC,0)),U)
27 . S PRCA=$P(PRCB,U,11),PRCHINV(1)="PURCHASE CARD HOLDER"
28 . S PRCHINV(2)=" "_$E(PRCC,1,25),PRCHINV(3)="PURCHASE CARD NAME"
29 . S PRCHINV(4)=" "_$E(PRCA,1,25),PRCHINV(5)=""
30 S PRCHINV(1)=$P(PRCHINV,U,1),PRCHINV(2)=$P(PRCHINV,U,2),X=3 S:$P(PRCHINV,U,3)]"" PRCHINV(X)=$P(PRCHINV,U,3),X=X+1 S:$P(PRCHINV,U,4)]"" PRCHINV(X)=$P(PRCHINV,U,4),X=X+1
31 S PRCHINV(X)=$P(PRCHINV,U,5)_", "_$P($G(^DIC(5,+$P(PRCHINV,U,6),0)),U,2)_" "_$P(PRCHINV,U,7) F X=X+1:1:5 S PRCHINV(X)=""
32FA S PRCHSC=$P($G(^PRCD(420.8,+$P(PRCH1,U,7),0)),U,1) W !!?2,$S("O"=$E($P(PRCH1,U,6)):"ORIGIN","D"=$E($P(PRCH1,U,6)):"DESTINATION",1:""),?30,$J($P(PRCH1,U,14),3),?33,$S("2B"[PRCHSC:"X",1:"")
33 S DIWL=1,DIWR=16,DIWF="",X=$P(PRCH1,U,8) K ^UTILITY($J,"W") D DIWP^PRCUTL($G(DA))
34 W ?48,$G(^UTILITY($J,"W",1,1,0)),?69,PRCHINV(1),!?48,$G(^UTILITY($J,"W",1,2,0)),?69,PRCHINV(2)
35 W !?2,$P(PRCH12,U,7),?48,$G(^UTILITY($J,"W",1,3,0)),?69,PRCHINV(3)
36 ;
37DIS W !?24,"ON OR",?33,$S(PRCHSC]""&(PRCHSC'=2):"X",1:""),?69,PRCHINV(4),!?2
38 S PRCH=0 I $D(^PRC(442,D0,5,0)) F I=1:1:2 S PRCH=$O(^PRC(442,D0,5,PRCH)) Q:PRCH=""!(PRCH'>0) W $P(^(PRCH,0),U,4),$P(^(0),U,1) W:$P(^(0),U,1)=+$P(^(0),U,1) "%" W $P(^(0),U,2)," "
39 W ?14,"BEFORE",?23 S Y=$P(PRCH0,U,10) D DT S PRCH=0
40 ;
41CON F I=0:1:3 S PRCH=$O(^PRC(442,D0,2,"AC",PRCH)) Q:PRCH="" W:I=2 ?2,$P(PRCH12,U,8) S Y=$O(^(PRCH,0)) W:^(Y)]"" ?45,$J(^(Y),3) W ?49,PRCH W:I=0 ?69,PRCHINV(5) W !
42 F Y=I:1:4 W:Y=0 ?69,PRCHINV(5) W:Y=2 ?2,$P(PRCH12,U,8) W !
43 K PRCHHSP,PRCHINV,PRCHSHP,PRCHST,S,V S PRCHL=18,P=1,PRCH=0
44 ;
45CNTI S PRCH=$O(^PRC(442,D0,2,PRCH)) G:PRCH=""!(PRCH'>0) CNTD S PRCHLB=1,PRCHL1=$P(^(PRCH,2),U,4) S:$P(^(0),U,6)]"" PRCHL1=PRCHL1+1 S:$P(^(0),U,13)]"" PRCHL1=PRCHL1+1 S:$P(^(0),U,9) PRCHL1=PRCHL1+1 S:$P(^(0),U,11) PRCHL1=PRCHL1+1
46 S:$P(^PRC(442,D0,2,PRCH,0),U,9)!($P(^(0),U,11)) PRCHL1=PRCHL1+2
47 D P:PRCHL-1<PRCHL1 S ^TMP($J,"P",P,PRCH)=PRCHLB_U_PRCHL1,PRCHL=PRCHL-PRCHL1-1
48 G CNTI
49 ;
50CNTD S (PRCHLE,PRCHLB,PRCH)=0 F J=0:0 S PRCH=$O(^PRC(442,D0,3,PRCH)) Q:PRCH=""!(PRCH'>0) S:PRCHLB=0 PRCHLB=PRCH S PRCHLE=PRCH D P1:PRCHL-2<1 S ^TMP($J,"P",P,"D")=PRCHLB_U_PRCHLE,PRCHL=PRCHL-2
51 I $P(PRCH0,U,13)>0!($P(PRCH0,U,18)>0) D:PRCHL-2<1 P1 S ^TMP($J,"P",P,"E")=$P(PRCH0,U,13),PRCHL=PRCHL-2
52 I $D(^PRC(442,D0,15)) F J=0:0 S J=$O(^PRC(442,D0,15,J)) Q:'J S PRCHJ=^(J,0),PRCH="F"_J_U_+PRCHJ,PRCHLB=1,PRCHL1=$P(PRCHJ,U,2) D P:PRCHL-1<PRCHL1 S ^TMP($J,"P",P,PRCH)=PRCHLB_U_PRCHL1,PRCHL=PRCHL-PRCHL1-1
53 G REQ:'$D(^PRC(442,D0,4,0)) K ^UTILITY($J,"W") S DIWL=1,DIWR=54,DIWF="",PRCH="W",PRCHJ=0 F S PRCHJ=$O(^PRC(442,D0,4,PRCHJ)) Q:PRCHJ=""!(PRCHJ<0) S X=^(PRCHJ,0) D DIWP^PRCUTL($G(DA))
54 S PRCHL1=+^UTILITY($J,"W",1),PRCHLB=1 D P:PRCHL-1<PRCHL1 S ^TMP($J,"P",P,"W")=PRCHLB_U_PRCHL1,PRCHL=PRCHL-PRCHL1-1
55 ;
56REQ I $D(^PRC(442,D0,13,0)) S (PRCHLE,PRCHLB,PRCH)=0 F J=0:0 S PRCH=$O(^PRC(442,D0,13,PRCH)) Q:'PRCH S:PRCHLB=0 I=3,PRCHLB=PRCH S PRCHLE=PRCH D P1:PRCHL-I<1 S ^TMP($J,"P",P,"X")=PRCHLB_U_PRCHLE,PRCHL=PRCHL-1,I=2
57 G ^PRCHPNT1
58 ;
59P I PRCHL<5 S PRCHL=45,P=P+1 Q
60 S PRCHLE=PRCHL-2,^TMP($J,"P",P,PRCH)=PRCHLB_U_PRCHLE,P=P+1,PRCHLB=PRCHLE+1,PRCHL=45
61 Q
62 ;
63P1 S PRCHLB=PRCHLE,PRCHL=45,P=P+1
64 Q
65 ;
66DT I Y W Y\100#100,"/",Y#100\1,"/",Y\10000+1700
67 Q
Note: See TracBrowser for help on using the repository browser.