PSDTRVR ;BIR/BJW-CS Transfer Between Vaults Report ; 12 Feb 98 ;;3.0; CONTROLLED SUBSTANCES ;**8,23**;13 Feb 97 ;**Y2K compliance**,"P" added to input date string ;Reference to ^PS(59.4 supported by DBIA #1043 I '$D(PSDSITE) D ^PSDSET Q:'$D(PSDSITE) I '$D(^XUSEC("PSJ RPHARM",DUZ))&('$D(^XUSEC("PSD TECH",DUZ))) W $C(7),!!,?9,"** Please contact your Pharmacy Coordinator for access to",!,?12,"print CS reports.",!!,"PSJ RPHARM or PSD TECH security key required.",! Q W !!,"CS Transfer Controlled Substances Between Vaults Report",! ASK K DA,DIR,DTOUT,DUOUT S DIR(0)="YO",DIR("A")="Do you wish to print a Transferred/Received By signature line",DIR("B")="NO" S DIR("?")="Answer YES to print the signature line, NO or to omit the signature line." D ^DIR K DIR I $D(DTOUT)!($D(DUOUT)) G END S ASK=+Y SITE ;sel one, some or all inp sites S CNT=0 F JJ=0:0 S JJ=$O(^PS(59.4,JJ)) Q:'JJ I $P($G(^PS(59.4,JJ,0)),"^",31) S SITE(JJ)="",CNT=CNT+1 I 'CNT W !!,"There are no Inpatient Sites defined for Controlled Substances use.",!,"Please contact your Pharmacy Coordinator for assistance.",! G END G:CNT=1 DATE K SITE W !!,?2,"You may display Dispensing Sites transfers from a single Inpatient Site, ",!,?2,"several Inpatient Sites, or enter ^ALL to select all Inpatient Sites.",!! F S DIC=59.4,DIC("A")="Select Inpatient Site: ",DIC(0)="QEA",DIC("S")="I $P(^(0),""^"",31)" D ^DIC K DIC Q:Y<0 S SITE(+Y)="" G END:$O(SITE(0))'>0 I '$D(SITE)&(X'="^ALL") G END I X="^ALL" F PSD=0:0 S PSD=$O(^PS(59.4,PSD)) Q:'PSD I $P($G(^PS(59.4,PSD,0)),"^",31) S SITE(PSD)="" DATE ;ask date range W ! K %DT S %DT="AEP",%DT("A")="Start with Date: " D ^%DT I Y<0 S PSDOUT=1 G END S PSDSD=Y D D^DIQ S PSDATE=Y,%DT("A")="End with Date: " D ^%DT I Y<0 S PSDOUT=1 G END I Y