| 1 | SPNLRL ;ISC-SF/GB-SCD PHARMACY UTILIZATION REPORT CONTROLLER ;6/23/95  12:00
 | 
|---|
| 2 |  ;;2.0;Spinal Cord Dysfunction;;01/02/1997
 | 
|---|
| 3 | ASK(QLIST,ABORT) ; Report-specific questions
 | 
|---|
| 4 |  N DIR,Y,DIRUT
 | 
|---|
| 5 |  S DIR(0)="NO^1:999999" ; Number, Optional
 | 
|---|
| 6 |  S DIR("A")="Minimum number of fills to display"
 | 
|---|
| 7 |  S DIR("B")=2
 | 
|---|
| 8 |  S DIR("?")="This determines the minimum number of fills for which a drug will be displayed in the listing by order of number of fills"
 | 
|---|
| 9 |  D ^DIR I $D(DIRUT) S ABORT=1 Q
 | 
|---|
| 10 |  S QLIST("MINFILL")=Y
 | 
|---|
| 11 |  K DIR
 | 
|---|
| 12 |  S DIR(0)="NO^0:9999999" ; Number, Optional
 | 
|---|
| 13 |  S DIR("A")="Minimum dollar cost of dispensed fills to display"
 | 
|---|
| 14 |  S DIR("B")=10
 | 
|---|
| 15 |  S DIR("?")="This determines the minimum cost of fills for which a drug will be displayed in the listing by order of cost of drugs dispensed"
 | 
|---|
| 16 |  D ^DIR I $D(DIRUT) S ABORT=1 Q
 | 
|---|
| 17 |  S QLIST("MINCOST")=Y
 | 
|---|
| 18 |  K DIR
 | 
|---|
| 19 |  S DIR(0)="SO^1:Actual cost at the time;2:Current cost today"
 | 
|---|
| 20 |  S DIR("A")="How should dollar costs of prescription drugs be reported?"
 | 
|---|
| 21 |  S DIR("?")="Do you want to see what actual costs were or do you want to see what it would cost today?"
 | 
|---|
| 22 |  D ^DIR I $D(DIRUT) S ABORT=1 Q
 | 
|---|
| 23 |  S QLIST("COST")=$S(Y=1:"ACTUAL",1:"CURRENT")
 | 
|---|
| 24 |  Q
 | 
|---|
| 25 | GATHER(DFN,FDATE,TDATE,HIUSERS,QLIST) ;
 | 
|---|
| 26 |  D ROLLUP^SPNLGRRX(DFN,FDATE,TDATE,HIUSERS) ; gather pharmacy data
 | 
|---|
| 27 |  Q
 | 
|---|
| 28 | PRINT(FACNAME,XFDATE,XTDATE,HIUSERS,QLIST,ABORT) ;
 | 
|---|
| 29 |  ; PAGELEN   Number of lines per page
 | 
|---|
| 30 |  ; TITLE     Array of header lines (titles)
 | 
|---|
| 31 |  N TITLE,PAGELEN
 | 
|---|
| 32 |  D NAMEIT^SPNLGRRX ; name the drugs and price 'em
 | 
|---|
| 33 |  S PAGELEN=IOSL-3
 | 
|---|
| 34 |  S TITLE(1)=$$CENTER^SPNLRU("SCD - Pharmacy Prescription Utilization")
 | 
|---|
| 35 |  S TITLE(2)=$$CENTER^SPNLRU(FACNAME)
 | 
|---|
| 36 |         I $D(SPNLTRM1) S TITLE(2.5)=$$CENTER^SPNLRU(SPNLTRM1)
 | 
|---|
| 37 |  S TITLE(3)=$$CENTER^SPNLRU("For the Period "_XFDATE_" to "_XTDATE)
 | 
|---|
| 38 |  K ^TMP("SPN",$J,"RX","OUT") ; used for temporary data shuffling
 | 
|---|
| 39 |  D P1^SPNLRL1(.TITLE,PAGELEN,.ABORT) Q:ABORT
 | 
|---|
| 40 |  D P2^SPNLRL1(.TITLE,PAGELEN,.QLIST,.ABORT) Q:ABORT
 | 
|---|
| 41 |  D P3^SPNLRL2(.TITLE,PAGELEN,.QLIST,.ABORT) Q:ABORT
 | 
|---|
| 42 |  D P4^SPNLRL2(.TITLE,PAGELEN,.QLIST,.ABORT) Q:ABORT
 | 
|---|
| 43 |  I HIUSERS D  Q:ABORT
 | 
|---|
| 44 |  . D P5^SPNLRL3(.TITLE,PAGELEN,.QLIST,HIUSERS,.ABORT) Q:ABORT
 | 
|---|
| 45 |  . D P6^SPNLRL3(.TITLE,PAGELEN,.QLIST,HIUSERS,.ABORT) Q:ABORT
 | 
|---|
| 46 |  Q
 | 
|---|