source: FOIAVistA/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNLRJO.m@ 1635

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

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1SPNLRJO ;ISC-SF/GB-SCD IP/OP REPORT (PRINT OP) ;4 JUNE 94 [ 08/08/94 12:37 PM ]
2 ;;2.0;Spinal Cord Dysfunction;;01/02/1997
3OUTPAT(TITLE,PAGELEN,HIUSERS,ABORT) ;
4 ; PAGELEN Number of lines per page
5 ; TITLE Array of header lines (titles)
6 S TITLE(3)=$$CENTER^SPNLRU("Outpatient Activity")
7 D POP1 Q:ABORT
8 D POP2 Q:ABORT
9 D:HIUSERS POP3
10 Q
11POP1 ;
12 ; VISITS Number of visits
13 N VISITS,OUT,LINE,STARTLIN,COL,STOPS,NPATS
14 S TITLE(5)=""
15 S NPATS=+$G(^TMP("SPN",$J,"OP","PAT"))
16 S VISITS=+$G(^TMP("SPN",$J,"OP","VISITS"))
17 S STOPS=+$G(^TMP("SPN",$J,"OP","STOPS"))
18 S TITLE(6)=$$CENTER^SPNLRU("Totals: "_$FN(NPATS,",")_" patient"_$S(NPATS=1:"",1:"s")_" for "_$FN(VISITS,",")_" visit"_$S(VISITS=1:"",1:"s")_" ("_$FN(STOPS,",")_" stop"_$S(STOPS=1:"",1:"s")_")")
19 S VISITS=+$O(^TMP("SPN",$J,"OP","VISITS",""))
20 F D Q:VISITS=""!(ABORT)
21 . D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
22 . K OUT,TITLE(5),TITLE(6)
23 . S STARTLIN=$Y
24 . S OUT(STARTLIN+1)=""
25 . F COL=1:1:3 D Q:VISITS=""
26 . . S OUT(STARTLIN)=$G(OUT(STARTLIN))_" Patients Visits "
27 . . F LINE=STARTLIN+2:1:PAGELEN D Q:VISITS=""
28 . . . S OUT(LINE)=$G(OUT(LINE))_$J($FN($G(^TMP("SPN",$J,"OP","VISITS",VISITS)),","),11)_$J($FN(-VISITS,","),10)_" "
29 . . . S VISITS=$O(^TMP("SPN",$J,"OP","VISITS",VISITS))
30 . S LINE=""
31 . F S LINE=$O(OUT(LINE)) Q:LINE="" D
32 . . W !,OUT(LINE)
33 Q
34POP2 ;
35 ; SCNUM Clinic Stop Code Number
36 ; SCNAME Clinic Stop Code Name
37 ; NPATS Number of patients who stopped at this stop code
38 ; VISITS Number of visits made to this stop code
39 ; STOPS Number of stops made at this stop code
40 N SCNUM,SCNAME,NPATS,STOPS,VISITS
41 S TITLE(5)=""
42 S TITLE(6)="Clinic Patients Visits Stops"
43 D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
44 S SCNUM=""
45 F S SCNUM=$O(^TMP("SPN",$J,"OP","SC",SCNUM)) Q:SCNUM="" D Q:ABORT
46 . I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
47 . S NPATS=^TMP("SPN",$J,"OP","SC",SCNUM)
48 . S STOPS=^TMP("SPN",$J,"OP","SC",SCNUM,"STOPS")
49 . S VISITS=^TMP("SPN",$J,"OP","SC",SCNUM,"VISITS")
50 . S SCNAME=^TMP("SPN",$J,"OP","SC",SCNUM,"NAME")
51 . W !,$J(SCNUM,3),". ",SCNAME,?40,$J($FN(NPATS,","),13),$J($FN(VISITS,",",2),13),$J($FN(STOPS,","),13)
52 K TITLE(5),TITLE(6)
53 Q
54POP3 ;
55 ; I High user counter
56 ; PID Patient ID
57 ; PNAME Patient Name
58 ; PSSN Patient SSN
59 ; VISITS Number of visits made to this stop code
60 ; NDSCNUMS Number of different stop codes
61 N VISITS,PID,PNAME,PSSN,I,NDSCNUMS
62 S TITLE(5)=""
63 S TITLE(6)=$$CENTER^SPNLRU("Highest Utilization of Visits")
64 S TITLE(7)=""
65 S TITLE(8)=" Different"
66 S TITLE(9)="Patient Name SSN Visits Stop Codes"
67 D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
68 S VISITS=""
69 F I=1:1:HIUSERS S VISITS=$O(^TMP("SPN",$J,"OP","HI","H1",VISITS)) Q:VISITS="" D Q:ABORT
70 . S NDSCNUMS=""
71 . F S NDSCNUMS=$O(^TMP("SPN",$J,"OP","HI","H1",VISITS,NDSCNUMS)) Q:NDSCNUMS="" D Q:ABORT
72 . . S PID=""
73 . . F S PID=$O(^TMP("SPN",$J,"OP","HI","H1",VISITS,NDSCNUMS,PID)) Q:PID="" D Q:ABORT
74 . . . I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
75 . . . D GETNAME^SPNLRU(PID,.PNAME,.PSSN)
76 . . . W !,PNAME,?32,PSSN,?53,$J($FN(-VISITS,","),6),?68,$J(-NDSCNUMS,5)
77 K TITLE(5),TITLE(6),TITLE(7),TITLE(8),TITLE(9)
78 Q
Note: See TracBrowser for help on using the repository browser.