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

AZQ2RXP.m

Go to the documentation of this file.
AZQ2RXP ;IHS/ASU/RPL;SEARCH PRESCRIPTION FILE BY FILL DATE RANGE AND PVT INS. ELIGIBLE;8/18/89 ; 8/22/89  10:25 AM
 ;Version 1.1
START ;
 W !!,"This Option will search the prescription file for all prescriptions with",!,"fill dates within the range you specify that were ordered for Private Insurance",!,"Eligible patients.",!!
SD S %DT("A")="Starting Fill Date: ",%DT="AEPX" D ^%DT
 G:Y=-1 QUIT S AZQ2SD=Y
 W !
ED S %DT("A")="Ending Fill Date: " D ^%DT
 G:Y=-1 SD S AZQ2FD=Y
 I AZQ2FD<AZQ2SD W !,"Ending Date cannot be before Starting Date! Please redo.",! G SD
ZIS W !! S %IS="Q" D ^%ZIS G:POP QUIT I '$D(IO("Q")) U IO G DQUE
QUE K IO("Q"),IO("S") I IO=IO(0) W !,"Cannot Queue to Screen or Slave Printer!",! G ZIS
 S ZTRTN="DQUE^AZQ2RXP",ZTDESC="PRESCRIPTION FILE SEARCH BY DATE AND PRIV INS EL" F AZQ2="ZTRTN","ZTDESC","AZQ2SD","AZQ2FD" S ZTSAVE(AZQ2)=""
 D ^%ZTLOAD G QUIT
DQUE ;Entry point from Taskmanager
 K ^UTILITY($J)
 S AZQ2S=AZQ2SD-.0001 F I=0:0 S AZQ2S=$O(^PSRX("AD",AZQ2S)) G PRINT:AZQ2S=""!(AZQ2S>AZQ2FD) D C1
 G QUIT2
C1 S AZQ2PDFN="" F J=0:0 S AZQ2PDFN=$O(^PSRX("AD",AZQ2S,AZQ2PDFN)) Q:AZQ2PDFN=""  D C2
 Q
C2 Q:'$D(^PSRX(AZQ2PDFN,0))
 S DFN=$P(^PSRX(AZQ2PDFN,0),"^",2) Q:DFN']""
 Q:'$D(^AUPNPRVT(DFN,11))
 S AZQ2DRG=$P(^PSRX(AZQ2PDFN,0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