IBOCNC ;ALB/ARH - CPT USAGE IN CLINICS (USER) ; 1/23/92
;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
;
;count of procedures used in clinics and bills
;if the sort is by clinic or procedure:
;loops through the Schduling Visits (409.5) file for 900 stop code entries ("AP" x-ref)
;for every 900 stop code entry, if each of the following conditions are ment then adds the stop code's procedures (409.5,10,21-25) to the report
; - outpt visit DATE/TIME (405.9,.01) within the date range entered by the user
; - ASSOCIATED CLINIC (409.5,10,3), checks if chosen by user
; - for each clinic chosen, checks that the clinics DIVISION (44,3.5) was chosen
;
;if the report is sorted by procedure the count of procedures found on bills (399,304 and 399,51-53,57-59) within the date range given by the user are also added to the report
;
EN ;get parameters (date and clinic) then run the report
;I $D(XRT0) S:'$D(XRTN) XRTN="IBOCNC" D T1^%ZOSV ;stop rt clock
;S XRTL=$ZU(0),XRTN="IBOCNC-1" D T0^%ZOSV ;start rt clock
D HOME^%ZIS S IBHDR="CLINIC CPT USAGE REPORT" W @IOF,?29,IBHDR,!!
S DIR("?",1)="For the choosen date range and clinics:"
S DIR("?",2)="""C"" - produces a count of procedures used, by clinic."
S DIR("?",3)="""P"" - provides a total count of all procedures used"
S DIR("?",4)=" including the total count used in billing."
S DIR("?")="""D"" - same report as ""P"" plus the full procedure description."
S DIR("0")="SO^C:CLINIC;P:PROCEDURE;D:PROCEDURE WITH EXTENDED DESCRIPTION;",DIR("A")="Sort report by" D ^DIR K DIR G:$D(DIRUT) EXIT S IBSRT=$S(Y="C":0,Y="P":1,1:2)
D BDT^IBOUTL G:Y<0!(IBBDT="")!(IBEDT="") EXIT
;find division then clinic - can select all or some clinics for all/some divisions
D DIVISION^VAUTOMA G:$D(VAUTD)<11&(VAUTD=0) EXIT
S VAUTNI=2 D CLINIC^VAUTOMA G:$D(VAUTC)<11&(VAUTC=0) EXIT
DEV ;get the device
W !!,"This report requires 132 columns."
S %ZIS="QM",%ZIS("A")="OUTPUT DEVICE: " D ^%ZIS G:POP EXIT
I $D(IO("Q")) S ZTRTN="FIND^IBOCNC1",ZTDESC=IBHDR,ZTSAVE("IB*")="",ZTSAVE("VAU*")="" D ^%ZTLOAD K IO("Q"),ZTSK G EXIT
U IO D ^IBOCNC1 D ^%ZISC
;
EXIT ;clean up and quit
;I $D(XRT0) S:'$D(XRTN) XRTN="IBOCNC" D T1^%ZOSV ;stop rt clock
I $D(ZTQUEUED) S ZTREQ="@" Q
K IBBDT,IBEDT,IBSRT,IBHDR,VAUTC,VAUTD,VAUTNI,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
Q
IBOCNC ;ALB/ARH - CPT USAGE IN CLINICS (USER) ; 1/23/92
+1 ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
+2 ;
+3 ;count of procedures used in clinics and bills
+4 ;if the sort is by clinic or procedure:
+5 ;loops through the Schduling Visits (409.5) file for 900 stop code entries ("AP" x-ref)
+6 ;for every 900 stop code entry, if each of the following conditions are ment then adds the stop code's procedures (409.5,10,21-25) to the report
+7 ; - outpt visit DATE/TIME (405.9,.01) within the date range entered by the user
+8 ; - ASSOCIATED CLINIC (409.5,10,3), checks if chosen by user
+9 ; - for each clinic chosen, checks that the clinics DIVISION (44,3.5) was chosen
+10 ;
+11 ;if the report is sorted by procedure the count of procedures found on bills (399,304 and 399,51-53,57-59) within the date range given by the user are also added to the report
+12 ;
EN ;get parameters (date and clinic) then run the report
+1 ;I $D(XRT0) S:'$D(XRTN) XRTN="IBOCNC" D T1^%ZOSV ;stop rt clock
+2 ;S XRTL=$ZU(0),XRTN="IBOCNC-1" D T0^%ZOSV ;start rt clock
+3 DO HOME^%ZIS
SET IBHDR="CLINIC CPT USAGE REPORT"
WRITE @IOF,?29,IBHDR,!!
+4 SET DIR("?",1)="For the choosen date range and clinics:"
+5 SET DIR("?",2)="""C"" - produces a count of procedures used, by clinic."
+6 SET DIR("?",3)="""P"" - provides a total count of all procedures used"
+7 SET DIR("?",4)=" including the total count used in billing."
+8 SET DIR("?")="""D"" - same report as ""P"" plus the full procedure description."
+9 SET DIR("0")="SO^C:CLINIC;P:PROCEDURE;D:PROCEDURE WITH EXTENDED DESCRIPTION;"
SET DIR("A")="Sort report by"
DO ^DIR
KILL DIR
IF $DATA(DIRUT)
GOTO EXIT
SET IBSRT=$SELECT(Y="C":0,Y="P":1,1:2)
+10 DO BDT^IBOUTL
IF Y<0!(IBBDT="")!(IBEDT="")
GOTO EXIT
+11 ;find division then clinic - can select all or some clinics for all/some divisions
+12 DO DIVISION^VAUTOMA
IF $DATA(VAUTD)<11&(VAUTD=0)
GOTO EXIT
+13 SET VAUTNI=2
DO CLINIC^VAUTOMA
IF $DATA(VAUTC)<11&(VAUTC=0)
GOTO EXIT
DEV ;get the device
+1 WRITE !!,"This report requires 132 columns."
+2 SET %ZIS="QM"
SET %ZIS("A")="OUTPUT DEVICE: "
DO ^%ZIS
IF POP
GOTO EXIT
+3 IF $DATA(IO("Q"))
SET ZTRTN="FIND^IBOCNC1"
SET ZTDESC=IBHDR
SET ZTSAVE("IB*")=""
SET ZTSAVE("VAU*")=""
DO ^%ZTLOAD
KILL IO("Q"),ZTSK
GOTO EXIT
+4 USE IO
DO ^IBOCNC1
DO ^%ZISC
+5 ;
EXIT ;clean up and quit
+1 ;I $D(XRT0) S:'$D(XRTN) XRTN="IBOCNC" D T1^%ZOSV ;stop rt clock
+2 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
QUIT
+3 KILL IBBDT,IBEDT,IBSRT,IBHDR,VAUTC,VAUTD,VAUTNI,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
+4 QUIT