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

APSPLIS.m

Go to the documentation of this file.
APSPLIS ; IHS/DSD/ENM - OUTPATIENT PHARMACY INVENTORY LIST ;  [ 02/26/2003  9:48 AM ]
 ;;6.0;IHS PHARMACY MODIFICATIONS;**4**;09/03/97
EN ;EP
 K ^TMP("APSPI",$J)
 W @IOF,!!,"Outpatient Pharmacy Inventory Listing!",!!
DIV ;SELECT DIVISION
 ;S DIR(0)="Y",DIR("A")="Would you like all divisions",DIR("B")="YES",DIR("?")="Enter 'Yes' or 'No'" D ^DIR K DIR Q:$D(DTOUT)
 ;I X="YES" S APSPDAN="A" G DRU
 ;S DIR(0)="PO^59:EMZ",DIR("A")="Select Division",DIR("?")="Enter the Division Name or Number "
 ;D ^DIR G:$D(DTOUT)!$D(DUOUT) ZAP K DIR
 S APSPDAN=PSOSITE
DRU S DIR(0)="S^1:All Drugs;2:Controlled Drugs Only;",DIR("A")="Select: (1) or (2)" D ^DIR K DIR
 G:$D(DUOUT)!$D(DIRUT) ZAP S APSPANS=Y,APSPTYPE=Y(0)
DEV S %ZIS="QM",%ZIS("A")="Select Printer: "
 D ^%ZIS K %ZIS
 I POP G ZAP
 I $D(IO("Q")),IO=0 W !,"QUEUEING TO YOUR SCREEN IS NOT ALLOW! " K IO("Q") G DEV
 I IO=IO(0)!('$D(IO("Q"))) G AUS
 S ZTRTN="AUS^APSPLIS"
 S ZTDESC="Drug Inventory List"
 F X="ZTDESC","APSPANS","APSPTYPE","APSPDAN" S ZTSAVE(X)=""
 D ^%ZTLOAD
 G ZAP
AUS S APSPA=0,APSPA1=0,APSP("PAGE")=0
 U IO
 ;I +APSPDAN S APSPA1=APSPDAN G LOOP
 ;I APSPDAN="A" S APSPA1=0 G LOOP2
 ;Q
LOOP ;GET DRUGS FOR ONE DIVISION
 F  S APSPA=$O(^PSDRUG(APSPA)) Q:'APSPA  S APSPSH=$P($G(^PSDRUG(APSPA,0)),U,3),APSPCI=$P($G(^PSDRUG(APSPA,660.1)),U) D LIST
CON S APSPDN=""
 D SHOW
 D ^%ZISC  ;IHS/ITSC/ENM 02/26/03
 D ZAP
 Q
HDR ;
 S APSPDIV=$P($G(^PS(59,APSPDAN,0)),U)
 D NOW^%DTC S Y=X X ^DD("DD") S APSP("PAGE")=APSP("PAGE")+1
 W @IOF
 W !,"Outpatient Pharmacy Inventory Listing",?50,"Page ",APSP("PAGE"),?65,Y,!,"For """,APSPTYPE,"""",!,"Division: ",APSPDIV,!
 W ?40,"Dispense",?65,"Current",!,"Drug Name",?40,"Unit",?65,"Inventory",!,"---------",?40,"---------",?65,"---------",!
 Q
LIST ;
 Q:$D(^PSDRUG(APSPA,"I"))
 S APSPZ=2
 I APSPANS=2&("2345"[+APSPSH) D SAV Q
 I APSPANS=1 D SAV
 Q
SHOW ;
 S APSPDN=0,APZ=0
 ;F  S APSPDAN=$O(^TMP("APSPLIS",$J,APSPDAN)) Q:'APSPDAN  D HDR,SHOW1
 D HDR,SHOW1
 Q
SHOW1 F  S APZ=$O(^TMP("APSPLIS",$J,APZ)) Q:'APZ  F  S APSPDN=$O(^TMP("APSPLIS",$J,APZ,APSPDN)) Q:APSPDN=""  D LIST1 Q:$D(DUOUT)!($D(DTOUT))
 Q
LIST1 ;
 S APSPDU=$P(^TMP("APSPLIS",$J,APZ,APSPDN),U),APSPCI=$P(^TMP("APSPLIS",$J,APZ,APSPDN),U,2)
 I $Y+4>IOSL,IOST["C" D FZZ Q:$D(DUOUT)!($D(DTOUT))
 I $Y+4>IOSL D HDR
 W !,APSPDN,?40,APSPDU,?65,$J($FN(APSPCI,","),8)
 Q
SAV ;
 I "2"[+APSPSH S APSPZ=1
 S APSPDN=$P(^PSDRUG(APSPA,0),U),APSPDU=$P($G(^PSDRUG(APSPA,660)),U,8)
 S ^TMP("APSPLIS",$J,APSPZ,APSPDN)=APSPDU_"^"_APSPCI
 Q
FZZ ;IHS/DSD/ENM 10/95
 K DTOUT,DUOUT,DIR S DIR("?")="Enter '^' to Halt or Press Return to Continue",DIR(0)="FO",DIR("A")="Press 'RETURN' to Continue or '^' to 'HALT'" D ^DIR
 Q
ZAP K APSPANS,APSPA,APSPCI,APSPDN,APSPDU,APSP("PAGE"),APSPTYPE,^TMP("APSPLIS",$J),APSPDL,APSPBS,APSPDAN,APSP("IOF"),APSPDIV,APSPSH,APSPA1,APSPZ,APZ
 Q