source: FOIAVistA/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNLRB1.m@ 1540

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

initial load of FOIAVistA 6/30/08 version

File size: 2.2 KB
Line 
1SPNLRB1 ;ISC-SF/GB,SD/AB-SCD PATIENT BREAKDOWN REPORT (PART 1 OF 1) ;5/1/98
2 ;;2.0;Spinal Cord Dysfunction;**6**;01/02/1997
3P1(TITLE,PAGELEN,SEXLIST,QLIST,ABORT) ;
4 D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
5 I QLIST("INCLUDE DEAD") D
6 . W !,"Living (or Unknown)" D LISTEM("STAT","LIVE")
7 . W !,"Deceased (Date of Death in Patient file)" D LISTEM("STAT","DEAD")
8 E W !,"Total" D LISTEM("STAT","LIVE")
9 Q
10LISTEM(TYPE,SUB) ;
11 N SEX,TOTLSEX,I,NUM
12 S SEX="",TOTLSEX=0
13 F I=0:1 S SEX=$O(SEXLIST(SEX)) Q:SEX="" D
14 . S NUM=+$G(^TMP("SPN",$J,"PS",TYPE,SUB,SEX))
15 . Q:NUM=0
16 . S TOTLSEX=TOTLSEX+NUM
17 . W ?(I*10+40),$J($FN(NUM,","),10)
18 Q:I=1 ; We want to print the total only if there's more than one sex
19 W ?(I*10+40),$J($FN(TOTLSEX,","),10)
20 Q
21P2(TITLE,PAGELEN,SEXLIST,QLIST,ABORT) ;
22 N AGE
23 W !
24 S AGE=""
25 F S AGE=$O(^TMP("SPN",$J,"PS","AGE",AGE)) Q:AGE="" D Q:ABORT
26 . I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
27 . W !,AGE,"-",AGE+4," years" D LISTEM("AGE",AGE)
28 Q
29P3(TITLE,PAGELEN,SEXLIST,QLIST,ABORT) ;
30 N RACE
31 W !
32 S RACE=""
33 F S RACE=$O(^TMP("SPN",$J,"PS","RACE",RACE)) Q:RACE="" D Q:ABORT
34 . I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
35 . W !,RACE D LISTEM("RACE",RACE)
36 Q
37P4(TITLE,PAGELEN,SEXLIST,QLIST,ABORT) ;
38 N MEANS
39 W !
40 S MEANS=""
41 F S MEANS=$O(^TMP("SPN",$J,"PS","MEANS",MEANS)) Q:MEANS="" D Q:ABORT
42 . I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
43 . W !,"Means Test ",MEANS D LISTEM("MEANS",MEANS)
44 Q
45P5(TITLE,PAGELEN,SEXLIST,QLIST,ABORT) ;
46 N ELIG
47 W !
48 S ELIG=""
49 F S ELIG=$O(^TMP("SPN",$J,"PS","ELIG",ELIG)) Q:ELIG="" D Q:ABORT
50 . I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
51 . W !,ELIG D LISTEM("ELIG",ELIG)
52 Q
53P6(TITLE,PAGELEN,SEXLIST,QLIST,ABORT) ;
54 N POS
55 W !
56 S POS=""
57 F S POS=$O(^TMP("SPN",$J,"PS","POS",POS)) Q:POS="" D Q:ABORT
58 . I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
59 . W !,POS D LISTEM("POS",POS)
60 Q
61P7(TITLE,PAGELEN,SEXLIST,QLIST,ABORT) ;
62 N SEEN
63 W !
64 S SEEN=""
65 F S SEEN=$O(^TMP("SPN",$J,"PS","SEEN",SEEN)) Q:SEEN="" D Q:ABORT
66 . I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
67 . W !,"Seen ",$S(SEEN="IP":"as Inpatient",SEEN="OP":"as Outpatient",SEEN="CH":"in Laboratory",SEEN="RX":"in Pharmacy",SEEN="RA":"in Radiology",1:"Somewhere")
68 . D LISTEM("SEEN",SEEN)
69 Q
Note: See TracBrowser for help on using the repository browser.