1 | SPNLRQI ;ISC-SF/GB-SCD (SPECIFIC) IP/OP REPORT (PRINT IP) ;6/23/95 12:01
|
---|
2 | ;;2.0;Spinal Cord Dysfunction;;01/02/1997
|
---|
3 | P1(TITLE,PAGELEN,QLIST,ABORT) ;
|
---|
4 | ; BS Bed Section Array
|
---|
5 | ; BSNAME Bed Section Name
|
---|
6 | ; BSNR Bed Section Number
|
---|
7 | ; DAYS Number of days spent in a bed section
|
---|
8 | ; NPATS Number of patients
|
---|
9 | ; STAYS Number of stays in a bed section
|
---|
10 | N STAYS,BSNAME,NPATS,DAYS,BS,BSNR,PNAME,PSSN,PID,PDATA
|
---|
11 | S TITLE(5)=""
|
---|
12 | S BSNR="" ; create list in bed section name order
|
---|
13 | F S BSNR=$O(QLIST("BS",BSNR)) Q:BSNR="" D
|
---|
14 | . S BS(QLIST("BS",BSNR))=BSNR
|
---|
15 | S BSNAME=""
|
---|
16 | F S BSNAME=$O(BS(BSNAME)) Q:BSNAME="" D Q:ABORT
|
---|
17 | . S TITLE(6)=$$CENTER^SPNLRU(BSNAME)
|
---|
18 | . ; TITLE(8)=" 1 2 3 4 5 6 7 8"
|
---|
19 | . S TITLE(8)=""
|
---|
20 | . S TITLE(9)="Patient Name SSN Stays Days"
|
---|
21 | . S BSNR=BS(BSNAME)
|
---|
22 | . S NPATS=+$G(^TMP("SPN",$J,"IP","BS",BSNR))
|
---|
23 | . S STAYS=+$G(^TMP("SPN",$J,"IP","BS",BSNR,"STAYS"))
|
---|
24 | . S DAYS=+$G(^TMP("SPN",$J,"IP","BS",BSNR,"DAYS"))
|
---|
25 | . S TITLE(7)=$$PAD^SPNLRU("Totals: "_$FN(NPATS,",")_" patient"_$S(NPATS=1:"",1:"s"),45)_$J($FN(STAYS,","),13)_$J($FN(DAYS,","),13)
|
---|
26 | . D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
|
---|
27 | . K TITLE(7)
|
---|
28 | . S PID=""
|
---|
29 | . F S PID=$O(^TMP("SPN",$J,"IP","BS",BSNR,"PID",PID)) Q:PID="" D Q:ABORT
|
---|
30 | . . I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
|
---|
31 | . . S PNAME=$P(PID,U,1),PSSN=$P(PID,U,2)
|
---|
32 | . . S PDATA=^TMP("SPN",$J,"IP","BS",BSNR,"PID",PID)
|
---|
33 | . . S STAYS=$P(PDATA,U,1),DAYS=$P(PDATA,U,2)
|
---|
34 | . . W !,PNAME,?32,PSSN,?45,$J($FN(STAYS,","),12),$J($FN(DAYS,","),13)
|
---|
35 | K TITLE(5),TITLE(6),TITLE(8),TITLE(9)
|
---|
36 | Q
|
---|
37 | P2(TITLE,PAGELEN,QLIST,ABORT) ;
|
---|
38 | ; BS Bed Section Array
|
---|
39 | ; BSNAME Bed Section Name
|
---|
40 | ; BSNR Bed Section Number
|
---|
41 | ; DAYS Number of days spent in a bed section
|
---|
42 | ; NPATS Number of patients
|
---|
43 | ; STAYS Number of stays in a bed section
|
---|
44 | N STAYS,BSNAME,NPATS,DAYS,BS,BSNR
|
---|
45 | S TITLE(5)=""
|
---|
46 | S TITLE(6)="Specialty Patients Stays Days"
|
---|
47 | D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
|
---|
48 | S BSNR="" ; create list in bed section name order
|
---|
49 | F S BSNR=$O(QLIST("BS",BSNR)) Q:BSNR="" D
|
---|
50 | . S BS(QLIST("BS",BSNR))=BSNR
|
---|
51 | S BSNAME=""
|
---|
52 | F S BSNAME=$O(BS(BSNAME)) Q:BSNAME="" D Q:ABORT
|
---|
53 | . S BSNR=BS(BSNAME)
|
---|
54 | . S NPATS=+$G(^TMP("SPN",$J,"IP","BS",BSNR))
|
---|
55 | . S STAYS=+$G(^TMP("SPN",$J,"IP","BS",BSNR,"STAYS"))
|
---|
56 | . S DAYS=+$G(^TMP("SPN",$J,"IP","BS",BSNR,"DAYS"))
|
---|
57 | . I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
|
---|
58 | . W !,BSNAME,?33,$J($FN(NPATS,","),11),?45,$J($FN(STAYS,","),11),$J($FN(DAYS,","),12)
|
---|
59 | K TITLE(5),TITLE(6)
|
---|
60 | Q
|
---|