70 lines
2.2 KiB
Mathematica
70 lines
2.2 KiB
Mathematica
SPNLRB1 ;ISC-SF/GB,SD/AB-SCD PATIENT BREAKDOWN REPORT (PART 1 OF 1) ;5/1/98
|
|
;;2.0;Spinal Cord Dysfunction;**6**;01/02/1997
|
|
P1(TITLE,PAGELEN,SEXLIST,QLIST,ABORT) ;
|
|
D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
|
|
I QLIST("INCLUDE DEAD") D
|
|
. W !,"Living (or Unknown)" D LISTEM("STAT","LIVE")
|
|
. W !,"Deceased (Date of Death in Patient file)" D LISTEM("STAT","DEAD")
|
|
E W !,"Total" D LISTEM("STAT","LIVE")
|
|
Q
|
|
LISTEM(TYPE,SUB) ;
|
|
N SEX,TOTLSEX,I,NUM
|
|
S SEX="",TOTLSEX=0
|
|
F I=0:1 S SEX=$O(SEXLIST(SEX)) Q:SEX="" D
|
|
. S NUM=+$G(^TMP("SPN",$J,"PS",TYPE,SUB,SEX))
|
|
. Q:NUM=0
|
|
. S TOTLSEX=TOTLSEX+NUM
|
|
. W ?(I*10+40),$J($FN(NUM,","),10)
|
|
Q:I=1 ; We want to print the total only if there's more than one sex
|
|
W ?(I*10+40),$J($FN(TOTLSEX,","),10)
|
|
Q
|
|
P2(TITLE,PAGELEN,SEXLIST,QLIST,ABORT) ;
|
|
N AGE
|
|
W !
|
|
S AGE=""
|
|
F S AGE=$O(^TMP("SPN",$J,"PS","AGE",AGE)) Q:AGE="" D Q:ABORT
|
|
. I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
|
|
. W !,AGE,"-",AGE+4," years" D LISTEM("AGE",AGE)
|
|
Q
|
|
P3(TITLE,PAGELEN,SEXLIST,QLIST,ABORT) ;
|
|
N RACE
|
|
W !
|
|
S RACE=""
|
|
F S RACE=$O(^TMP("SPN",$J,"PS","RACE",RACE)) Q:RACE="" D Q:ABORT
|
|
. I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
|
|
. W !,RACE D LISTEM("RACE",RACE)
|
|
Q
|
|
P4(TITLE,PAGELEN,SEXLIST,QLIST,ABORT) ;
|
|
N MEANS
|
|
W !
|
|
S MEANS=""
|
|
F S MEANS=$O(^TMP("SPN",$J,"PS","MEANS",MEANS)) Q:MEANS="" D Q:ABORT
|
|
. I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
|
|
. W !,"Means Test ",MEANS D LISTEM("MEANS",MEANS)
|
|
Q
|
|
P5(TITLE,PAGELEN,SEXLIST,QLIST,ABORT) ;
|
|
N ELIG
|
|
W !
|
|
S ELIG=""
|
|
F S ELIG=$O(^TMP("SPN",$J,"PS","ELIG",ELIG)) Q:ELIG="" D Q:ABORT
|
|
. I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
|
|
. W !,ELIG D LISTEM("ELIG",ELIG)
|
|
Q
|
|
P6(TITLE,PAGELEN,SEXLIST,QLIST,ABORT) ;
|
|
N POS
|
|
W !
|
|
S POS=""
|
|
F S POS=$O(^TMP("SPN",$J,"PS","POS",POS)) Q:POS="" D Q:ABORT
|
|
. I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
|
|
. W !,POS D LISTEM("POS",POS)
|
|
Q
|
|
P7(TITLE,PAGELEN,SEXLIST,QLIST,ABORT) ;
|
|
N SEEN
|
|
W !
|
|
S SEEN=""
|
|
F S SEEN=$O(^TMP("SPN",$J,"PS","SEEN",SEEN)) Q:SEEN="" D Q:ABORT
|
|
. I $Y>PAGELEN D HEADER^SPNLRU(.TITLE,.ABORT) Q:ABORT
|
|
. 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")
|
|
. D LISTEM("SEEN",SEEN)
|
|
Q
|