PSOBORP0 ;ALBANY/BLD - TRICARE-CHAMPVA BYPASS/OVERRIDE AUDIT REPORT ; 10/15/12 4:26pm
;;7.0;OUTPATIENT PHARMACY;**358,385,415,528**;DEC 1997;Build 10
;
;***********copied from routine BPSRPT0************
;
Q
;
; Front End for ECME Reports
;
;
;The following local variables and arrays are passed around the PSOBORP* routines
;and are not passed as parameters but are assumed to be defined:
; variables - PSOATYP,PSOBEGDT,PSOENDDT,PSONOW,PSOPHARM,PSOPHMST,PSOPROV,PSOREJCD,
; PSORPTNM,PSOQ,PSORTYPE,PSOSCR,PSOTOTAL
; arrays - PSOEXCEL,PSOSEL / PSOAUD is passed between PSOBORP2 and PSOBORP3
;
EN(PSORTYPE) ;
N %,ACTDT,AMT,BPQ,CODE,IO,PSOACREJ,PSOATYP,PSOAUTREV,PSOBEGDT,PSOCCRSN,PSODRGCL,PSODRUG,PSOENDDT,PSOEXCEL,PSONOW
N PSOPHARM,PSOINSINF,PSOMWC,PSOQ,PSOUT,PSOPROV,PSOQSTDRG,PSOREJCD,PSORLNRL,PSORPTNAM,PSORTBCK
N PSOSEL,PSOSCR,PSOSMDET,PSOSEL,PSOTOTAL,POS,PSOINS,PSOARR,PSOELIG,PSOOPCL,PSOPHMST,PSORPTNM,STAT,X,Y
;
K PSOSEL
;
S PSORPTNM="TRICARE-CHAMPVA OVERRIDE REPORT"
;
;Verify that a valid report has been requested
I PSORTYPE'=1 W "<Invalid Menu Definition - Report Undefined>" H 3 Q
;
;Get current Date/Time
S PSONOW=$$FMTE^XLFDT($$NOW^XLFDT)
;
;Prompt for ECME Pharmacy Division(s) (No Default)
;Sets up PSOPHARM variable and array, PSOPHARM="A" ALL or PSOPHARM="D",PSOPHARM(ptr) for list
S X=$$SELPHARM^PSOBORP1(.PSOSEL) I X="^" Q
;
;Prompt to Display TRICARE or CHAMPVA or ALL entries (Default to ALL)
;Returns T for TRICARE, C for CHAMPVA, A for ALL
S PSOATYP=$$SELATYP^PSOBORP1("A")
I PSOATYP="^" Q
;
;Prompt to Display Summary or Detail Format (Default to Detail)
;Returns "S" for Summary, "D" for Detail
S PSOSMDET=$$SELSMDET^PSOBORP1(2) I PSOSMDET="^" Q
S PSOSEL("SUM_DETAIL")=PSOSMDET
;
;Prompt to select Date Range
;Returns (Start Date^End Date)
S PSOBEGDT=$$SELDATE^PSOBORP1("TRANSACTION") D I PSOBEGDT="^" Q
.I PSOBEGDT="^" Q
.S PSOENDDT=$P(PSOBEGDT,U,2)
.S PSOBEGDT=$P(PSOBEGDT,U)
S PSOSEL("BEGIN DATE")=PSOBEGDT
S PSOSEL("END DATE")=PSOENDDT
;
;Prompt to Include (S)pecific TC Code or (A)LL (Default to ALL)
S PSOREJCD=$$SELTCCD^PSOBORP1(.PSOSEL)
I PSOREJCD="^" Q
;
;Prompt to select One of the following: Specific Pharmacist or ALL Pharmacist
S PSOPHMST=$$SELPHMST^PSOBORP1(.PSOSEL)
I PSOPHMST="^" Q
;
;Prompt to select one of the following: Specific Provider or ALL Providers
S PSOPROV=$$SELPROV^PSOBORP1(.PSOSEL)
I PSOPROV="^" Q
;
;Prompt to Include Group/Subtotal Report by (R) Pharmacy or (P)rovider/Prescriber Name
;Returns ()
S PSOTOTAL=$$PSOTOTAL^PSOBORP1()
I PSOTOTAL="^" Q
S PSOSEL("TOTALS BY")=PSOTOTAL
;
;Prompt for Excel Capture (Detail Only)
S PSOEXCEL=0 I PSOSEL("SUM_DETAIL")="D" D I PSOEXCEL="^" Q
.S PSOEXCEL=$$SELEXCEL^PSOBORP1() I PSOEXCEL="^" Q
.S PSOSEL("EXCEL")=PSOEXCEL
;
;Prompt for the Device
I 'PSOEXCEL D
.W !!,"WARNING - THIS REPORT REQUIRES THAT A DEVICE WITH 132 COLUMN WIDTH BE USED."
.W !,"IT WILL NOT DISPLAY CORRECTLY USING 80 COLUMN WIDTH DEVICES",!
N PSOSCR S PSOSCR=0
S PSOQ=0 D DEVICE(PSORPTNM) I PSOQ D ^%ZISC QUIT
;
;Compile and Run the Report
D RUN(.PSOSEL)
I '$G(PSOUT) D PAUSE^PSOBORP1
;
Q
;
;Compile and Run the Report
;
RUN(PSOEXCEL,PSORPTNAM,PSOSMDET) ;
N PSOPAGE,PSOTMP
;
D RUNRPT^PSOBORP2(.PSOSEL)
D ^%ZISC
Q
;
;Prompt For the Device
;
; Returns Device variables and PSOSCR
;
DEVICE(PSORPTNAM) N %ZIS,ZTSK,ZTRTN,ZTIO,ZTDESC,ZTSAVE,POP
S %ZIS="QM"
D ^%ZIS
I POP S PSOQ=1
;
;Check for exit
I $G(PSOQ) G XDEV
I IO=IO(0) S PSOSCR=1 ;User wants to print to the screen
;
S PSOSCR=$S($E($G(IOST),1,2)="C-":1,1:0)
I $D(IO("Q")) D S PSOQ=1
. S ZTRTN="RUN^PSOBORP0(PSOEXCEL,PSORPTNAM,PSOSMDET)"
. S ZTIO=ION
. S ZTSAVE("*")=""
. S ZTDESC="PSO REPORT: "_PSORPTNM
. D ^%ZTLOAD
. W !,$S($D(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED")
. D HOME^%ZIS
U IO
XDEV ;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSOBORP0 4008 printed Nov 22, 2024@17:34:52 Page 2
PSOBORP0 ;ALBANY/BLD - TRICARE-CHAMPVA BYPASS/OVERRIDE AUDIT REPORT ; 10/15/12 4:26pm
+1 ;;7.0;OUTPATIENT PHARMACY;**358,385,415,528**;DEC 1997;Build 10
+2 ;
+3 ;***********copied from routine BPSRPT0************
+4 ;
+5 QUIT
+6 ;
+7 ; Front End for ECME Reports
+8 ;
+9 ;
+10 ;The following local variables and arrays are passed around the PSOBORP* routines
+11 ;and are not passed as parameters but are assumed to be defined:
+12 ; variables - PSOATYP,PSOBEGDT,PSOENDDT,PSONOW,PSOPHARM,PSOPHMST,PSOPROV,PSOREJCD,
+13 ; PSORPTNM,PSOQ,PSORTYPE,PSOSCR,PSOTOTAL
+14 ; arrays - PSOEXCEL,PSOSEL / PSOAUD is passed between PSOBORP2 and PSOBORP3
+15 ;
EN(PSORTYPE) ;
+1 NEW %,ACTDT,AMT,BPQ,CODE,IO,PSOACREJ,PSOATYP,PSOAUTREV,PSOBEGDT,PSOCCRSN,PSODRGCL,PSODRUG,PSOENDDT,PSOEXCEL,PSONOW
+2 NEW PSOPHARM,PSOINSINF,PSOMWC,PSOQ,PSOUT,PSOPROV,PSOQSTDRG,PSOREJCD,PSORLNRL,PSORPTNAM,PSORTBCK
+3 NEW PSOSEL,PSOSCR,PSOSMDET,PSOSEL,PSOTOTAL,POS,PSOINS,PSOARR,PSOELIG,PSOOPCL,PSOPHMST,PSORPTNM,STAT,X,Y
+4 ;
+5 KILL PSOSEL
+6 ;
+7 SET PSORPTNM="TRICARE-CHAMPVA OVERRIDE REPORT"
+8 ;
+9 ;Verify that a valid report has been requested
+10 IF PSORTYPE'=1
WRITE "<Invalid Menu Definition - Report Undefined>"
HANG 3
QUIT
+11 ;
+12 ;Get current Date/Time
+13 SET PSONOW=$$FMTE^XLFDT($$NOW^XLFDT)
+14 ;
+15 ;Prompt for ECME Pharmacy Division(s) (No Default)
+16 ;Sets up PSOPHARM variable and array, PSOPHARM="A" ALL or PSOPHARM="D",PSOPHARM(ptr) for list
+17 SET X=$$SELPHARM^PSOBORP1(.PSOSEL)
IF X="^"
QUIT
+18 ;
+19 ;Prompt to Display TRICARE or CHAMPVA or ALL entries (Default to ALL)
+20 ;Returns T for TRICARE, C for CHAMPVA, A for ALL
+21 SET PSOATYP=$$SELATYP^PSOBORP1("A")
+22 IF PSOATYP="^"
QUIT
+23 ;
+24 ;Prompt to Display Summary or Detail Format (Default to Detail)
+25 ;Returns "S" for Summary, "D" for Detail
+26 SET PSOSMDET=$$SELSMDET^PSOBORP1(2)
IF PSOSMDET="^"
QUIT
+27 SET PSOSEL("SUM_DETAIL")=PSOSMDET
+28 ;
+29 ;Prompt to select Date Range
+30 ;Returns (Start Date^End Date)
+31 SET PSOBEGDT=$$SELDATE^PSOBORP1("TRANSACTION")
Begin DoDot:1
+32 IF PSOBEGDT="^"
QUIT
+33 SET PSOENDDT=$PIECE(PSOBEGDT,U,2)
+34 SET PSOBEGDT=$PIECE(PSOBEGDT,U)
End DoDot:1
IF PSOBEGDT="^"
QUIT
+35 SET PSOSEL("BEGIN DATE")=PSOBEGDT
+36 SET PSOSEL("END DATE")=PSOENDDT
+37 ;
+38 ;Prompt to Include (S)pecific TC Code or (A)LL (Default to ALL)
+39 SET PSOREJCD=$$SELTCCD^PSOBORP1(.PSOSEL)
+40 IF PSOREJCD="^"
QUIT
+41 ;
+42 ;Prompt to select One of the following: Specific Pharmacist or ALL Pharmacist
+43 SET PSOPHMST=$$SELPHMST^PSOBORP1(.PSOSEL)
+44 IF PSOPHMST="^"
QUIT
+45 ;
+46 ;Prompt to select one of the following: Specific Provider or ALL Providers
+47 SET PSOPROV=$$SELPROV^PSOBORP1(.PSOSEL)
+48 IF PSOPROV="^"
QUIT
+49 ;
+50 ;Prompt to Include Group/Subtotal Report by (R) Pharmacy or (P)rovider/Prescriber Name
+51 ;Returns ()
+52 SET PSOTOTAL=$$PSOTOTAL^PSOBORP1()
+53 IF PSOTOTAL="^"
QUIT
+54 SET PSOSEL("TOTALS BY")=PSOTOTAL
+55 ;
+56 ;Prompt for Excel Capture (Detail Only)
+57 SET PSOEXCEL=0
IF PSOSEL("SUM_DETAIL")="D"
Begin DoDot:1
+58 SET PSOEXCEL=$$SELEXCEL^PSOBORP1()
IF PSOEXCEL="^"
QUIT
+59 SET PSOSEL("EXCEL")=PSOEXCEL
End DoDot:1
IF PSOEXCEL="^"
QUIT
+60 ;
+61 ;Prompt for the Device
+62 IF 'PSOEXCEL
Begin DoDot:1
+63 WRITE !!,"WARNING - THIS REPORT REQUIRES THAT A DEVICE WITH 132 COLUMN WIDTH BE USED."
+64 WRITE !,"IT WILL NOT DISPLAY CORRECTLY USING 80 COLUMN WIDTH DEVICES",!
End DoDot:1
+65 NEW PSOSCR
SET PSOSCR=0
+66 SET PSOQ=0
DO DEVICE(PSORPTNM)
IF PSOQ
DO ^%ZISC
QUIT
+67 ;
+68 ;Compile and Run the Report
+69 DO RUN(.PSOSEL)
+70 IF '$GET(PSOUT)
DO PAUSE^PSOBORP1
+71 ;
+72 QUIT
+73 ;
+74 ;Compile and Run the Report
+75 ;
RUN(PSOEXCEL,PSORPTNAM,PSOSMDET) ;
+1 NEW PSOPAGE,PSOTMP
+2 ;
+3 DO RUNRPT^PSOBORP2(.PSOSEL)
+4 DO ^%ZISC
+5 QUIT
+6 ;
+7 ;Prompt For the Device
+8 ;
+9 ; Returns Device variables and PSOSCR
+10 ;
DEVICE(PSORPTNAM) NEW %ZIS,ZTSK,ZTRTN,ZTIO,ZTDESC,ZTSAVE,POP
+1 SET %ZIS="QM"
+2 DO ^%ZIS
+3 IF POP
SET PSOQ=1
+4 ;
+5 ;Check for exit
+6 IF $GET(PSOQ)
GOTO XDEV
+7 ;User wants to print to the screen
IF IO=IO(0)
SET PSOSCR=1
+8 ;
+9 SET PSOSCR=$SELECT($EXTRACT($GET(IOST),1,2)="C-":1,1:0)
+10 IF $DATA(IO("Q"))
Begin DoDot:1
+11 SET ZTRTN="RUN^PSOBORP0(PSOEXCEL,PSORPTNAM,PSOSMDET)"
+12 SET ZTIO=ION
+13 SET ZTSAVE("*")=""
+14 SET ZTDESC="PSO REPORT: "_PSORPTNM
+15 DO ^%ZTLOAD
+16 WRITE !,$SELECT($DATA(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED")
+17 DO HOME^%ZIS
End DoDot:1
SET PSOQ=1
+18 USE IO
XDEV ;
+1 QUIT