source: WorldVistAEHR/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNLRQO.m@ 1806

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

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1SPNLRQO ;ISC-SF/GB-SCD (SPECIFIC) IP/OP REPORT (PRINT OP) ;6/23/95 12:01
2 ;;2.0;Spinal Cord Dysfunction;;01/02/1997
3P1(TITLE,PAGELEN,QLIST,ABORT) ;
4 ; SCNAME Clinic Stop Name
5 ; SCNUM Clinic Stop Number
6 ; STOPS Number of stops at a Clinic Stop
7 ; NPATS Number of patients
8 ; VISITS Number of visits to a Clinic Stop
9 N VISITS,SCNAME,NPATS,STOPS,SCNUM,PNAME,PSSN,PID,PDATA
10 S TITLE(5)=""
11 S SCNUM="" ; list clinics in stop code number order
12 F S SCNUM=$O(QLIST("SC",SCNUM)) Q:SCNUM="" D Q:ABORT
13 . S SCNAME=QLIST("SC",SCNUM)
14 . S TITLE(6)=$$CENTER^SPNLRU(SCNUM_". "_SCNAME)
15 . ; TITLE(8)=" 1 2 3 4 5 6 7 8"
16 . S TITLE(8)=""
17 . S TITLE(9)="Patient Name SSN Visits Stops"
18 . S NPATS=+$G(^TMP("SPN",$J,"OP","SC",SCNUM))
19 . S VISITS=+$G(^TMP("SPN",$J,"OP","SC",SCNUM,"VISITS"))
20 . S STOPS=+$G(^TMP("SPN",$J,"OP","SC",SCNUM,"STOPS"))
21 . S TITLE(7)=$$PAD^SPNLRU("Totals: "_$FN(NPATS,",")_" patient"_$S(NPATS=1:"",1:"s"),45)_$J($FN(VISITS,",",2),14)_$J($FN(STOPS,","),14)
22 . D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
23 . K TITLE(7)
24 . S PID=""
25 . F S PID=$O(^TMP("SPN",$J,"OP","SC",SCNUM,"PID",PID)) Q:PID="" D Q:ABORT
26 . . I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
27 . . S PNAME=$P(PID,U,1),PSSN=$P(PID,U,2)
28 . . S PDATA=^TMP("SPN",$J,"OP","SC",SCNUM,"PID",PID)
29 . . S VISITS=+$P(PDATA,U,1),STOPS=+$P(PDATA,U,2)
30 . . W !,PNAME,?32,PSSN,?45,$J($FN(VISITS,",",2),13),$J($FN(STOPS,","),14)
31 K TITLE(5),TITLE(6),TITLE(8),TITLE(9)
32 Q
33P2(TITLE,PAGELEN,QLIST,ABORT) ;
34 ; SCNAME Clinic Stop Name
35 ; SCNUM Clinic Stop Number
36 ; STOPS Number of stops at a Clinic Stop
37 ; NPATS Number of patients
38 ; VISITS Number of visits to a Clinic Stop
39 N VISITS,SCNAME,NPATS,STOPS,SC,SCNUM
40 S TITLE(5)=""
41 S TITLE(6)="Clinic Patients Visits Stops"
42 D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
43 S SCNUM="" ; list clinics in stop code number order
44 F S SCNUM=$O(QLIST("SC",SCNUM)) Q:SCNUM="" D Q:ABORT
45 . S SCNAME=QLIST("SC",SCNUM)
46 . S NPATS=+$G(^TMP("SPN",$J,"OP","SC",SCNUM))
47 . S VISITS=+$G(^TMP("SPN",$J,"OP","SC",SCNUM,"VISITS"))
48 . S STOPS=+$G(^TMP("SPN",$J,"OP","SC",SCNUM,"STOPS"))
49 . I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
50 . W !,$J(SCNUM,3),". ",SCNAME,?38,$J($FN(NPATS,","),11),?50,$J($FN(VISITS,",",2),12),$J($FN(STOPS,","),12)
51 K TITLE(5),TITLE(6)
52 Q
Note: See TracBrowser for help on using the repository browser.