| 1 | IBOCNC ;ALB/ARH - CPT USAGE IN CLINICS (USER) ; 1/23/92
 | 
|---|
| 2 |  ;;Version 2.0 ; INTEGRATED BILLING ;**31**; 21-MAR-94
 | 
|---|
| 3 |  ;
 | 
|---|
| 4 |  ;count of procedures used in clinics and bills
 | 
|---|
| 5 |  ;if the sort is by clinic or procedure:
 | 
|---|
| 6 |  ;loops through the Schduling Visits (409.5) file for 900 stop code entries ("AP" x-ref)
 | 
|---|
| 7 |  ;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
 | 
|---|
| 8 |  ;    - outpt visit DATE/TIME (405.9,.01) within the date range entered by the user
 | 
|---|
| 9 |  ;    - ASSOCIATED CLINIC (409.5,10,3), checks if chosen by user
 | 
|---|
| 10 |  ;    - for each clinic chosen, checks that the clinics DIVISION (44,3.5) was chosen
 | 
|---|
| 11 |  ;
 | 
|---|
| 12 |  ;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
 | 
|---|
| 13 |  ;
 | 
|---|
| 14 | EN ;get parameters (date and clinic) then run the report
 | 
|---|
| 15 |  ;I $D(XRT0) S:'$D(XRTN) XRTN="IBOCNC" D T1^%ZOSV ;stop rt clock
 | 
|---|
| 16 |  ;S XRTL=$ZU(0),XRTN="IBOCNC-1" D T0^%ZOSV ;start rt clock
 | 
|---|
| 17 |  D HOME^%ZIS S IBHDR="CLINIC CPT USAGE REPORT" W @IOF,?29,IBHDR,!!
 | 
|---|
| 18 |  S DIR("?",1)="For the choosen date range and clinics:"
 | 
|---|
| 19 |  S DIR("?",2)="""C"" - produces a count of procedures used, by clinic."
 | 
|---|
| 20 |  S DIR("?",3)="""P"" - provides a total count of all procedures used"
 | 
|---|
| 21 |  S DIR("?",4)="      including the total count used in billing."
 | 
|---|
| 22 |  S DIR("?")="""D"" - same report as ""P"" plus the full procedure description."
 | 
|---|
| 23 |  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)
 | 
|---|
| 24 |  D BDT^IBOUTL G:Y<0!(IBBDT="")!(IBEDT="") EXIT
 | 
|---|
| 25 |  ;find division then clinic - can select all or some clinics for all/some divisions
 | 
|---|
| 26 |  D DIVISION^VAUTOMA G:$D(VAUTD)<11&(VAUTD=0) EXIT
 | 
|---|
| 27 |  S VAUTNI=2 D CLINIC^VAUTOMA G:$D(VAUTC)<11&(VAUTC=0) EXIT
 | 
|---|
| 28 | DEV ;get the device
 | 
|---|
| 29 |  W !!,"This report requires 132 columns."
 | 
|---|
| 30 |  S %ZIS="QM",%ZIS("A")="OUTPUT DEVICE: " D ^%ZIS G:POP EXIT
 | 
|---|
| 31 |  I $D(IO("Q")) S ZTRTN="FIND^IBOCNC1",ZTDESC=IBHDR,ZTSAVE("IB*")="",ZTSAVE("VAU*")="" D ^%ZTLOAD K IO("Q"),ZTSK G EXIT
 | 
|---|
| 32 |  U IO D ^IBOCNC1 D ^%ZISC
 | 
|---|
| 33 |  ;
 | 
|---|
| 34 | EXIT ;clean up and quit
 | 
|---|
| 35 |  ;I $D(XRT0) S:'$D(XRTN) XRTN="IBOCNC" D T1^%ZOSV ;stop rt clock
 | 
|---|
| 36 |  D HOME^%ZIS
 | 
|---|
| 37 |  I $D(ZTQUEUED) S ZTREQ="@" Q
 | 
|---|
| 38 |  K IBBDT,IBEDT,IBSRT,IBHDR,VAUTC,VAUTD,VAUTNI,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
 | 
|---|
| 39 |  Q
 | 
|---|