source: WorldVistAEHR/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNLRL3.m@ 1732

Last change on this file since 1732 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1SPNLRL3 ;ISC-SF/GB-SCD PHARMACY UTILIZATION REPORT (PRINT PART 3 OF 3) ;5 JUN 94
2 ;;2.0;Spinal Cord Dysfunction;;01/02/1997
3 ; PAGELEN Number of lines per page
4 ; TITLE Array of header lines (titles)
5P5(TITLE,PAGELEN,QLIST,HIUSERS,ABORT) ;
6 ; I High user counter
7 ; COST Cost of the drugs
8 ; NDDRUGS Number of different drugs
9 ; FILLS Number of fills
10 ; PID Patient ID (Coded SSN)
11 ; PNAME Patient Name
12 ; PSSN Patient SSN
13 N FILLS,NDDRUGS,COST,PID,PNAME,PSSN,I,HINODE,COSTITLE
14 I QLIST("COST")="ACTUAL" D
15 . S HINODE="H1"
16 . S COSTITLE=" Cost"
17 E D
18 . S HINODE="H3"
19 . S COSTITLE="Value"
20 S TITLE(4)=""
21 S TITLE(5)=$$CENTER^SPNLRU("Highest Utilization Patients Based on Fills")
22 ; TITLE(5)=" 1 2 3 4 5 6 7 8"
23 S TITLE(6)=""
24 S TITLE(7)=" Total Different Total"
25 S TITLE(8)="Patient Name SSN Fills Drugs "_COSTITLE
26 D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
27 S FILLS=""
28 F I=1:1:HIUSERS S FILLS=$O(^TMP("SPN",$J,"RX","HI",HINODE,FILLS)) Q:FILLS="" D Q:ABORT
29 . S NDDRUGS=""
30 . F S NDDRUGS=$O(^TMP("SPN",$J,"RX","HI",HINODE,FILLS,NDDRUGS)) Q:NDDRUGS="" D Q:ABORT
31 . . S COST=""
32 . . F S COST=$O(^TMP("SPN",$J,"RX","HI",HINODE,FILLS,NDDRUGS,COST)) Q:COST="" D Q:ABORT
33 . . . S PID=""
34 . . . F S PID=$O(^TMP("SPN",$J,"RX","HI",HINODE,FILLS,NDDRUGS,COST,PID)) Q:PID="" D Q:ABORT
35 . . . . I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
36 . . . . D GETNAME^SPNLRU(PID,.PNAME,.PSSN)
37 . . . . W !,PNAME,?32,PSSN,?45,$J($FN(-FILLS,","),10),?58,$J(-NDDRUGS,8),?68,$J($FN(-COST,",",2),12)
38 Q
39P6(TITLE,PAGELEN,QLIST,HIUSERS,ABORT) ;
40 ; I High user counter
41 ; COST Cost of the drugs
42 ; NDDRUGS Number of different drugs
43 ; FILLS Number of fills
44 ; PID Patient ID (Coded SSN)
45 ; PNAME Patient Name
46 ; PSSN Patient SSN
47 N FILLS,NDDRUGS,COST,PID,PNAME,PSSN,I,HINODE
48 I QLIST("COST")="ACTUAL" D
49 . S HINODE="H2"
50 . S TITLE(5)=$$CENTER^SPNLRU("Highest Utilization Patients Based on Cost")
51 E D
52 . S HINODE="H4"
53 . S TITLE(5)=$$CENTER^SPNLRU("Highest Utilization Patients Based on Value")
54 D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
55 S COST=""
56 F I=1:1:HIUSERS S COST=$O(^TMP("SPN",$J,"RX","HI",HINODE,COST)) Q:COST="" D Q:ABORT
57 . S FILLS=""
58 . F S FILLS=$O(^TMP("SPN",$J,"RX","HI",HINODE,COST,FILLS)) Q:FILLS="" D Q:ABORT
59 . . S NDDRUGS=""
60 . . F S NDDRUGS=$O(^TMP("SPN",$J,"RX","HI",HINODE,COST,FILLS,NDDRUGS)) Q:NDDRUGS="" D Q:ABORT
61 . . . S PID=""
62 . . . F S PID=$O(^TMP("SPN",$J,"RX","HI",HINODE,COST,FILLS,NDDRUGS,PID)) Q:PID="" D Q:ABORT
63 . . . . I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
64 . . . . D GETNAME^SPNLRU(PID,.PNAME,.PSSN)
65 . . . . W !,PNAME,?32,PSSN,?45,$J($FN(-FILLS,","),10),?58,$J(-NDDRUGS,8),?68,$J($FN(-COST,",",2),12)
66 K TITLE(4),TITLE(5),TITLE(6),TITLE(7),TITLE(8)
67 Q
Note: See TracBrowser for help on using the repository browser.