source: WorldVistAEHR/trunk/r/DRUG_ACCOUNTABILITY-PSA/PSALOG.m@ 1605

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1PSALOG ;BIR/LTL,JMB-Unposted Procurement History ;7/23/97
2 ;;3.0; DRUG ACCOUNTABILITY/INVENTORY INTERFACE;**15**; 10/24/97
3 ;This routine gets the user specifications to print the Unposted
4 ;Procurement History report for a specific month, the Item Total report,
5 ;and High Dollar report. It calls PSALOG0 and PSALOG1.
6 ;
7 ;Get month
8 D DT^DICRW S %DT="AEP",%DT("A")="Select month: ",%DT("B")="T-1M"
9 D ^%DT S PSAYRMO=$E(Y,1,5)*100,PSAMO=$E(PSAYRMO,4,5) G:Y<0 EXIT
10 X ^DD("DD") S PSAMOYR=$E(Y,1,3)_" '"_$E(PSAYRMO,2,3)
11 ;
12 S DIR(0)="Y",DIR("A")="Print item totals",DIR("B")="Yes",DIR("?",1)="Enter yes to print a report of the items ordered during the selected month.",DIR("?")="Enter no if you do not want to print the report."
13 S DIR("??")="^D HELPTOT^PSALOG" W ! D ^DIR K DIR G:$G(DIRUT) EXIT S PSATOTAL=Y
14 ;
15 S DIR(0)="Y",DIR("A")="Print a high dollar items report",DIR("B")="Yes",DIR("?",1)="Enter yes to print a list of purchased items that cost a high",DIR("?")="dollar amount. Enter no if you do not want to print the report."
16 S DIR("??")="^D HELPHIGH^PSALOG" W ! D ^DIR K DIR G:$G(DIRUT) EXIT G:'Y DEVICE S PSAHIGH=Y
17 ;
18 S DIR(0)="N",DIR("A")="Enter the lowest dollar amount to print $",DIR("B")=1000,DIR("?",1)="Enter the lowest dollar amount to be printed.",DIR("?")="Do not enter the dollar sign($).",DIR("??")="^D HELPLOW^PSALOG"
19 W ! D ^DIR K DIR G:$G(DIRUT) EXIT S:Y PSALOW=Y
20 ;
21DEVICE W ! K IO("Q") S %ZIS="Q" D ^%ZIS
22 I POP W !,"No device selected or report printed!" G EXIT
23 I $D(IO("Q")) S ZTRTN="QUE^PSALOG",ZTDESC="Drug Accountability - Unposted Pharmacy Procurement Reports",ZTSAVE("PSA*")="" D ^%ZTLOAD
24 I G:$D(ZTSK) EXIT I '$D(ZTSK) W !,"The report was not sent to the printer." G EXIT
25QUE ;Calls routines to print the 3 reports.
26 U IO K ^TMP("PSA",$J),^TMP("PSAB",$J),^TMP("PSAC",$J)
27 S PSASTART=1
28 D ^PSALOG0 G:PSAOUT EXIT
29 I $G(PSATOTAL) D ^PSALOG1 G:PSAOUT EXIT
30 D:$G(PSAHIGH) ^PSALOG1H
31EXIT W:$G(PSASTART) @IOF
32 D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
33 K IO("Q"),^TMP("PSA",$J),^TMP("PSAB",$J),^TMP("PSAC",$J)
34 K %DT,%ZIS,DIR,DIRUT,PSAC,PSACP,PSADATE,PSADLN,PSADT,PSAFCP,PSAHIGH,PSAIEN,PSAINVO,PSAITEM,PSAKK,PSALOW,PSAMO,PSAMORE,PSAMOYR,PSAN0,PSAN1,PSAOUT,PSAPG
35 K PSAQTYO,PSAQTYP,PSARPDT,PSASLN,PSASTART,PSATMP,PSATOT,PSATOTAL,PSATOTO,PSATOTP,PSATOTR,PSATQTYO,PSAUNIT,PSAYRMO,PSASS,X,X2,X3,Y,ZTDESC,ZTQUEUED,ZTREQ,ZTRTN,ZTSAVE
36 Q
37HELPTOT ;Extended help for "Print item totals?"
38 W !!,"Enter yes to print a report of the items purchased during the selected",!,"month. The report contains the total dollar amount per item per purchase"
39 W !,"order. The report lists the purchase order number, date ordered quantity,",!,"ordered, quantity received, dollar amount per dispensed unit, dispensed"
40 W !,"unit, total order cost, and total cost of items received."
41 W !!,"Enter no if you do not want to print the report."
42 Q
43HELPHIGH ;Extended help for "Print a high dollar items report?"
44 W !!,"Enter yes to choose a cut-off dollar amount and print the report.",!,"The report lists the items from highest to lowest dollar amounts."
45 Q
46HELPLOW ;Extended help for "Enter the lowest dollar amount to print $"
47 W !!,"Enter the lowest dollar amount paid for an order of an item. The",!,"dollar amount is the total amount paid for the item on a purchase order."
48 W !,"For example, if a drug cost $500 per unit and 3 units were ordered, the",!,"total dollar amount is $1500. In order to print this item on the report,",!,"the lowest dollar amount to print must be $1500 or less."
49 Q
Note: See TracBrowser for help on using the repository browser.