source: FOIAVistA/trunk/r/DRUG_ACCOUNTABILITY-PSA/PSAORDP2.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 2.9 KB
Line 
1PSAORDP2 ;BIR/JMB-Print Orders - CONT'D ;7/23/97
2 ;;3.0; DRUG ACCOUNTABILITY/INVENTORY INTERFACE;; 10/24/97
3 ;This routine prints the adjustment and header data on the invoices.
4 ;It is called from PSAORDP1
5 ;
6ADJD ;Print Adj Drug
7 I $G(PSADJD)'="" D Q:PSAOUT
8 .I ($G(PSADJDV)'=""&($Y+5>IOSL))!(($G(PSADJDP)'=""&($Y+4>IOSL))) D:$E(IOST,1,2)="C-" SCREEN Q:PSAOUT D HEADER,LINEHDR
9 .I $G(PSADJDV)'="" W !?9,$$DATE^PSAORDP1(PSADVDT)_" "_$P($G(^VA(200,+PSADVDUZ,0)),"^")_" (V)"
10 .I $G(PSADJDP)'="" W !?9,$$DATE^PSAORDP1(PSADPDT)_" "_$P($G(^VA(200,+PSADPDUZ,0)),"^")_" (P)"
11 ;
12ADJQ ;Print Adj Qty
13 I $G(PSADJQ)'="" D Q:PSAOUT
14 .I ($G(PSADJQV)'=""&($Y+8>IOSL))!(($G(PSADJQP)'=""&($Y+6>IOSL))) D:$E(IOST,1,2)="C-" SCREEN Q:PSAOUT D HEADER,LINEHDR
15 .W !!?9,"ADJUSTED QUANTITY: "_PSADJQ
16 .I $G(PSADJQV)'="" W !?9,$$DATE^PSAORDP1(PSAQVDT)_" "_$P($G(^VA(200,+PSAQVDUZ,0)),"^")_" (V) = "_PSADJQV,!?11,PSAQVREA
17 .I $G(PSADJQP)'="" W !?9,$$DATE^PSAORDP1(PSAQPDT)_" "_$P($G(^VA(200,+PSAQPDUZ,0)),"^")_" (P) = "_PSADJQP,!?11,PSAQPREA
18 ;
19ADJO ;Print Adj Order Unit
20 I $G(PSADJO)'="" D Q:PSAOUT
21 .I ($G(PSADJOV)'=""&($Y+6>IOSL))!(($G(PSADJOP)'=""&($Y+4>IOSL))) D:$E(IOST,1,2)="C-" SCREEN Q:PSAOUT D HEADER,LINEHDR
22 .W !!,?9,"ADJUSTED ORDER UNIT: "_$P($G(^DIC(51.5,+PSADJO,0)),"^")
23 .I $G(PSADJOV)'="" W !?9,$$DATE^PSAORDP1(PSAOVDT)_" "_$P($G(^VA(200,+PSAOVDUZ,0)),"^")_" (V) = "_$P($G(^DIC(51.5,+PSADJOV,0)),"^")
24 .I $G(PSADJOP)'="" W !?9,$$DATE^PSAORDP1(PSAOPDT)_" "_$P($G(^VA(200,+PSAOPDUZ,0)),"^")_" (P) = "_$P($G(^DIC(51.5,+PSADJOP,0)),"^")
25 ;
26ADJP ;Print Adj Price
27 I +$G(PSADJP) D Q:PSAOUT
28 .I ($G(PSADJPV)'=""&($Y+6>IOSL))!(($G(PSADJPP)'=""&($Y+4>IOSL))) D:$E(IOST,1,2)="C-" SCREEN Q:PSAOUT D HEADER,LINEHDR
29 .W !!,?9,"ADJUSTED PRICE PER ORDER UNIT: $"_$S($L($P(PSADJP,".",2))<2:$FN(PSADJP,",",2),1:PSADJP)
30 .I $G(PSADJPV)'="" W !?9,$$DATE^PSAORDP1(PSAPVDT)_" "_$P($G(^VA(200,+PSAPVDUZ,0)),"^")_" (V) = $"_$S($L($P(PSADJPV,".",2))<2:$FN(PSADJPV,",",2),1:PSADJPV)
31 .I $G(PSADJPP)'="" W !?9,$$DATE^PSAORDP1(PSAPPDT)_" "_$P($G(^VA(200,+PSAPPDUZ,0)),"^")_" (P) = $"_$S($L($P(PSADJPP,".",2))<2:$FN(PSADJPP,",",2),1:PSADJPP)
32 Q
33 ;
34LINEHDR ;item header
35 W !?50,"ORDER",?62,"COST/",?71,"EXTENDED"
36 W !,"LINE#",?9,"NDC",?25,"VSN",?43,"QTY",?51,"UNIT",?62,"UNIT",?75,"COST",!,PSADLN,!
37 Q
38 ;
39HEADER ;Page header
40 I PSAFPG&($E(IOST,1,2)="C-") W @IOF G HDR1
41 S PSAFPG=0
42 I 'PSAFPG W @IOF
43HDR1 W !?20,"DRUG ACCOUNTABILITY/INVENTORY INTERFACE"
44 W !?27,"PRIME VENDOR ORDER REPORT",!
45 W:PSAPAGE'=1 !,"ORDER#: "_PSAORDER_" INVOICE#: "_PSAINVN
46 I $E(IOST,1,2)="C-" W ?(74-$L(PSAPAGE)),"PAGE "_PSAPAGE,!,PSADLN
47 I $E(IOST)'="C" W !,"RUN: "_PSARUN,?(74-$L(PSAPAGE)),"PAGE "_PSAPAGE,!,PSADLN
48 S PSAPAGE=PSAPAGE+1
49 Q
50SCREEN ;Hold on screen
51 S PSAS=20-$Y I +PSAS F PSASS=1:1:PSAS W !
52 I PSADJDRG,PSAEND W " * THE DRUG WAS MATCHED TO THE DRUG FILE."
53 I PSADJSUP,PSAEND W !,"** THE ITEM IS A SUPPLY ITEM."
54 S DIR(0)="E" D ^DIR K DIR I $G(DIRUT) S PSAOUT=1
55 Q
Note: See TracBrowser for help on using the repository browser.