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

AZFMCM1.m

Go to the documentation of this file.
AZFMCM1 ;IHS/OHPRD/JCM;COMMON DRUG PRINT[ 02/03/95  2:25 PM ]
 ;;5.06;PS;;JUL 12, 1990
 ;THIS ROUTINE PRINTS THE PHARMACY DRUG LISTING
 ;IT IS CALLED BY AZFMCM
 ;
 ;INPUT VARIABLES: BD,ED,PSZCNT,^TMP("PSOZCOM2",$J)
 ;VARIABLES: I,X,NUM,UTL,DRGNAME
 ;
 ;EXTERNAL CALLS: NOW^%DTC,^%ZIS
 ;
START ;INITIALIZE
 S (DX,DY)=1 X:$D(^%ZOSF("XY"))#2 ^("XY")
 U IO
 S PSOZCOM1("PAGE")=0,APSPO=""
 D HEADER
 ;
 ;START LOOP
 ;F NUM=0:0 S NUM=$O(^TMP("PSOZCOM2",$J,NUM)) Q:NUM=""!(NUM>PSZCNT)  D DRUG
 D DRUG
 ;
EXIT ;
 I $E(IOST,1,2)="P-" W !,@IOF
 X ^%ZIS("C")
 K NUM,DRGNAME,I,X,BD,ED,PSZCNT,UTL,PSOZCOM1,DX,DY
 Q
PRINT ;
 I $Y+4>IOSL W @IOF D HEADER
 S UTL=^TMP("PSOZCOM1",$J,DRGNAME,APSPO)
 W !,DRGNAME ;DRUG NAME
 W ?40,$P(UTL,U,3) ;TOTAL FILLS
 W ?47,$P(UTL,U,1) ;NEW RXS
 W ?52,$P(UTL,U,2) ;REFILLS
 W ?60,APSPO,?70,$P(UTL,U,4)
 Q
DRUG ;
 S DRGNAME=0
 F I=0:0 S DRGNAME=$O(^TMP("PSOZCOM1",$J,DRGNAME)) Q:DRGNAME=""  F  S APSPO=$O(^TMP("PSOZCOM1",$J,DRGNAME,APSPO)) Q:APSPO=""  D PRINT
 Q
 S PSOZCOM1("PAGE")=PSOZCOM1("PAGE")+1
 I $D(DUZ(2)) W !!,$P(^DIC(4,DUZ(2),0),"^",1)," DISPENSED DRUG LIST"
 I '$D(DUZ(2)) W !!,"DISPENSED DRUG LIST"
 W ?73,"Page ",PSOZCOM1("PAGE")
 W !,"DATE OF LISTING: "
 D NOW^%DTC W $E(X,4,5)_"-"_$E(X,6,7)_"-"_$E(X,2,3)
 W !!,"This list includes all prescriptions from "
 W $E(BD,4,5)_"-"_$E(BD,6,7)_"-"_$E(BD,2,3)," through "
 W $E(ED,4,5)_"-"_$E(ED,6,7)_"-"_$E(ED,2,3)_"."
 ;W !,"The drug must have been issued a minimum of * "
 ;W 9999999-PSZCNT," * times to appear on listing.",!!
 W !!,"DRUG",?40,"TOTAL",?47,"NEW",?52,"REFILL",?60,"DISPENSE",?70,"QTY",!,?60,"UNIT"
 W ! F I=1:1:IOM W "-"
 ;I '$D(^TMP("PSOZCOM2",$J)) W !!?20,"NO RXS FOR A DRUG THAT TOTALS OVER COUNT SPECIFIED" ;G EXIT ;IHS/OHPRD/JCM 11/28/89
 W !
 Q