Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSAORDP2

PSAORDP2.m

Go to the documentation of this file.
PSAORDP2 ;BIR/JMB-Print Orders - CONT'D ;7/23/97
 ;;3.0; DRUG ACCOUNTABILITY/INVENTORY INTERFACE;; 10/24/97
 ;This routine prints the adjustment and header data on the invoices.
 ;It is called from PSAORDP1
 ;
ADJD ;Print Adj Drug
 I $G(PSADJD)'="" D  Q:PSAOUT
 .I ($G(PSADJDV)'=""&($Y+5>IOSL))!(($G(PSADJDP)'=""&($Y+4>IOSL))) D:$E(IOST,1,2)="C-" SCREEN Q:PSAOUT  D HEADER,LINEHDR
 .I $G(PSADJDV)'="" W !?9,$$DATE^PSAORDP1(PSADVDT)_" "_$P($G(^VA(200,+PSADVDUZ,0)),"^")_" (V)"
 .I $G(PSADJDP)'="" W !?9,$$DATE^PSAORDP1(PSADPDT)_" "_$P($G(^VA(200,+PSADPDUZ,0)),"^")_" (P)"
 ;
ADJQ ;Print Adj Qty
 I $G(PSADJQ)'="" D  Q:PSAOUT
 .I ($G(PSADJQV)'=""&($Y+8>IOSL))!(($G(PSADJQP)'=""&($Y+6>IOSL))) D:$E(IOST,1,2)="C-" SCREEN Q:PSAOUT  D HEADER,LINEHDR
 .W !!?9,"ADJUSTED QUANTITY: "_PSADJQ
 .I $G(PSADJQV)'="" W !?9,$$DATE^PSAORDP1(PSAQVDT)_" "_$P($G(^VA(200,+PSAQVDUZ,0)),"^")_" (V) = "_PSADJQV,!?11,PSAQVREA
 .I $G(PSADJQP)'="" W !?9,$$DATE^PSAORDP1(PSAQPDT)_" "_$P($G(^VA(200,+PSAQPDUZ,0)),"^")_" (P) = "_PSADJQP,!?11,PSAQPREA
 ;
ADJO ;Print Adj Order Unit
 I $G(PSADJO)'="" D  Q:PSAOUT
 .I ($G(PSADJOV)'=""&($Y+6>IOSL))!(($G(PSADJOP)'=""&($Y+4>IOSL))) D:$E(IOST,1,2)="C-" SCREEN Q:PSAOUT  D HEADER,LINEHDR
 .W !!,?9,"ADJUSTED ORDER UNIT: "_$P($G(^DIC(51.5,+PSADJO,0)),"^")
 .I $G(PSADJOV)'="" W !?9,$$DATE^PSAORDP1(PSAOVDT)_" "_$P($G(^VA(200,+PSAOVDUZ,0)),"^")_" (V) = "_$P($G(^DIC(51.5,+PSADJOV,0)),"^")
 .I $G(PSADJOP)'="" W !?9,$$DATE^PSAORDP1(PSAOPDT)_" "_$P($G(^VA(200,+PSAOPDUZ,0)),"^")_" (P) = "_$P($G(^DIC(51.5,+PSADJOP,0)),"^")
 ;
ADJP ;Print Adj Price
 I +$G(PSADJP) D  Q:PSAOUT
 .I ($G(PSADJPV)'=""&($Y+6>IOSL))!(($G(PSADJPP)'=""&($Y+4>IOSL))) D:$E(IOST,1,2)="C-" SCREEN Q:PSAOUT  D HEADER,LINEHDR
 .W !!,?9,"ADJUSTED PRICE PER ORDER UNIT: $"_$S($L($P(PSADJP,".",2))<2:$FN(PSADJP,",",2),1:PSADJP)
 .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)
 .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)
 Q
 ;
LINEHDR ;item header
 W !?50,"ORDER",?62,"COST/",?71,"EXTENDED"
 W !,"LINE#",?9,"NDC",?25,"VSN",?43,"QTY",?51,"UNIT",?62,"UNIT",?75,"COST",!,PSADLN,!
 Q
 ;
 I PSAFPG&($E(IOST,1,2)="C-") W @IOF G HDR1
 S PSAFPG=0
 I 'PSAFPG W @IOF
HDR1 W !?20,"DRUG ACCOUNTABILITY/INVENTORY INTERFACE"
 W !?27,"PRIME VENDOR ORDER REPORT",!
 W:PSAPAGE'=1 !,"ORDER#: "_PSAORDER_"  INVOICE#: "_PSAINVN
 I $E(IOST,1,2)="C-" W ?(74-$L(PSAPAGE)),"PAGE "_PSAPAGE,!,PSADLN
 I $E(IOST)'="C" W !,"RUN: "_PSARUN,?(74-$L(PSAPAGE)),"PAGE "_PSAPAGE,!,PSADLN
 S PSAPAGE=PSAPAGE+1
 Q
SCREEN ;Hold on screen
 S PSAS=20-$Y I +PSAS F PSASS=1:1:PSAS W !
 I PSADJDRG,PSAEND W " * THE DRUG WAS MATCHED TO THE DRUG FILE."
 I PSADJSUP,PSAEND W !,"** THE ITEM IS A SUPPLY ITEM."
 S DIR(0)="E" D ^DIR K DIR I $G(DIRUT) S PSAOUT=1
 Q