source: FOIAVistA/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNAGGU.m@ 1654

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

initial load of FOIAVistA 6/30/08 version

File size: 7.4 KB
Line 
1SPNAGGU ;SD/CM- AGGREGATE OUTCOME REPORT UTILITIES; 2-21-2003
2 ;;2.0;Spinal Cord Dysfunction;**20,21**;01/02/97
3 ;
4INPT ;SPNLSTDT=Last date of ASIA HIGHEST NEURO LEVEL (most recent)
5 ;SPNSEVC =Count of unique pts in diag category of 'severe'
6 ;SPNMODC = " " " " " " " " 'moderate'
7 ;SPNPARC = " " " " " " " " 'para'
8 ;SPNLOWC = " " " " " " " " 'low'
9 ;SPNDIAGC=Total count of unique pts over all diag categories
10 ;SPNDCS =Set to 1 if diag category criteria for 'severe' are met
11 ;SPNDCM =Set to 1 if diag category criteria for 'moderate' are met
12 ;SPNDCP =Set to 1 if diag category criteria for 'para' are met
13 ;SPNDCL =Set to 1 if diag category criteria for 'low' are met
14 ;SPNAGES =Cumulative Age in Severe, SPNAGEM=Cum. Age in Moderate, etc
15 ;BMAS =Base Minimum Age Severe, BMAM=Base Minimum Age Moderate, etc
16 ;AGESC =Age Range Severe Count, AGEMC=Age Range Moderate Count, etc
17 ;MINAGES =Minimum Age Severe, MINAGEM=Minimum Age Moderate, etc
18 ;BHAS =Base Maximum Age Severe, BHAM=Base Maximum Age Moderate, etc
19 ;MAXAGES =Maximum Age Severe, MAXAGEM=Maximum Age Moderate, etc
20 ;AGEL =Low value of Age range, AGEH=High value of Age range
21 ;SPNSEXS =No. of Male pts in Severe, SPNSEXM=No. Male in Moderate, etc
22 ;SPNLORS =Cumulative Length of Rehab Severe, SPNLORM=Cum. LOR Mod, etc
23 ;BMLS =Base Minimum LOR Severe, BMLM=Base Minimum LOR Moderate, etc
24 ;LORSC =Length of Rehab Severe Count, LORMC=LOR Moderate Count, etc
25 ;MINLORS =Minimum LOR Severe, MINLORM=Minimum LOR Moderate, etc
26 ;BHLS =Base Maximum LOR Severe, BHLM=Base Maximum LOR Moderate, etc
27 ;MAXLORS =Maximum LOR Severe, MAXLORM=Maximum LOR Moderate, etc
28 ;LORRN =Length of Rehab record number (node w/ Rehab Finish data)
29 ;LORL =Low value of LOR range, LORH=High value of LOR range
30 ;TFSRN =Total FIM Start record number
31 ;TFS =Total FIM Start score, TFF=Total FIM Finish score
32 ;TFCUMS =Total FIM cumulative change Severe, TFCUMM=Tot FIM ch Mod,etc
33 ;TFCS =Total FIM Count Severe, TFCM=Total FIM Count Moderate, etc
34 ;TFGRN =Total FIM Goal record number
35 ;TFG =Total FIM Goal score
36 ;TFGCUMS =Total FIM Goal cumul change Severe,TFGCUMM=TF Goal ch Mod,etc
37 ;TFGCS =Total FIM Goal Count Severe,TFGCM=Tot FIM Goal Count Mod, etc
38 ;COMDISS =No. of Severe pts w/ DISPOSITION<5, COMDISM=No. Mod pts, etc
39 ;TFURN =Total FIM Follow-Up record number
40 ;TFU =Total FIM Follow-Up score
41 ;TFUCUMS =Total FIM F/U cumul change Severe,TFUCUMM=TF F/U ch Mod, etc
42 ;TFUCS =Total FIM F/U Count Severe,TFUCM=Tot FIM F/U Count Mod, etc
43 ;SLSRN =SWLS Start record number, SLFRN=SWLS Finish record number
44 ;SLS =SWLS Start score
45 ;SLF =SWLS Finish score
46 ;SLCUMS =SWLS cumul change Severe,SLCUMM=SWLS cumul change Mod, etc
47 ;SLCS =SWLS Count Severe,SLCM=Count Moderate, etc
48 ;SLURN =SWLS Follow-Up record number
49 ;SLU =SWLS Follow-Up score
50 ;SLUCUMS =SWLS F/U cumul change Severe,SLUCUMM=SWLS F/U Chng Mod, etc
51 ;SLUCS =SWLS F/U Count Severe,SLUCM=SWLS F/U Count Mod, etc
52 S U="^"
53 S SPNDIAGC=0,SPNSEVC=0,SPNMODC=0,SPNPARC=0,SPNLOWC=0
54 S SPNLSTDT="",SPNNODUP=""
55 S SPNSDATE=0,SPNMDATE=0,SPNPDATE=0,SPNLDATE=0
56 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UCL=0
79 Q
80PARAMS ;
81CT ;Care Type
82CED ;date range for Care End Date
83OIEN ;
84DIAGCAT ;
85 ;
86MINLORS(SPNPD1) ;
87 S MAX1=LORCALL
88 S X=0 F S X=$O(^TMP($J,"SPNLRNS",X)) Q:'+X D
89 .Q:'$D(^TMP($J,"SPNLRNS",X))
90 .S MAX2=$P(^TMP($J,"SPNLRNS",X),U,1)
91 .I MAX2<MAX1 S MAX1=MAX2
92 .Q
93 Q MAX1
94MAXLORS(SPNPD1) ;
95 S MAX1=0
96 S X=0 F S X=$O(^TMP($J,"SPNLRXS",X)) Q:'+X D
97 .Q:'$D(^TMP($J,"SPNLRXS",X))
98 .S MAX2=$P(^TMP($J,"SPNLRXS",X),U,1)
99 .I MAX2>MAX1 S MAX1=MAX2
100 .Q
101 Q MAX1
102MINLORM(SPNPD1) ;
103 S MAX1=LORCALL
104 S X=0 F S X=$O(^TMP($J,"SPNLRNM",X)) Q:'+X D
105 .Q:'$D(^TMP($J,"SPNLRNM",X))
106 .S MAX2=$P(^TMP($J,"SPNLRNM",X),U,1)
107 .I MAX2<MAX1 S MAX1=MAX2
108 .Q
109 Q MAX1
110MAXLORM(SPNPD1) ;
111 S MAX1=0
112 S X=0 F S X=$O(^TMP($J,"SPNLRXM",X)) Q:'+X D
113 .Q:'$D(^TMP($J,"SPNLRXM",X))
114 .S MAX2=$P(^TMP($J,"SPNLRXM",X),U,1)
115 .I MAX2>MAX1 S MAX1=MAX2
116 .Q
117 Q MAX1
118MINLORP(SPNPD1) ;
119 S MAX1=LORCALL
120 S X=0 F S X=$O(^TMP($J,"SPNLRNP",X)) Q:'+X D
121 .Q:'$D(^TMP($J,"SPNLRNP",X))
122 .S MAX2=$P(^TMP($J,"SPNLRNP",X),U,1)
123 .I MAX2<MAX1 S MAX1=MAX2
124 .Q
125 Q MAX1
126MAXLORP(SPNPD1) ;
127 S MAX1=0
128 S X=0 F S X=$O(^TMP($J,"SPNLRXP",X)) Q:'+X D
129 .Q:'$D(^TMP($J,"SPNLRXP",X))
130 .S MAX2=$P(^TMP($J,"SPNLRXP",X),U,1)
131 .I MAX2>MAX1 S MAX1=MAX2
132 .Q
133 Q MAX1
134MINLORL(SPNPD1) ;
135 S MAX1=LORCALL
136 S X=0 F S X=$O(^TMP($J,"SPNLRNL",X)) Q:'+X D
137 .Q:'$D(^TMP($J,"SPNLRNL",X))
138 .S MAX2=$P(^TMP($J,"SPNLRNL",X),U,1)
139 .I MAX2<MAX1 S MAX1=MAX2
140 .Q
141 Q MAX1
142MAXLORL(SPNPD1) ;
143 S MAX1=0
144 S X=0 F S X=$O(^TMP($J,"SPNLRXL",X)) Q:'+X D
145 .Q:'$D(^TMP($J,"SPNLRXL",X))
146 .S MAX2=$P(^TMP($J,"SPNLRXL",X),U,1)
147 .I MAX2>MAX1 S MAX1=MAX2
148 .Q
149 Q MAX1
150STATS ;finds record with Rehab Finish, so Length of Rehab can be obtained
151 S LORRN=0,TFSRN=0,TFGRN=0
152 S V=SPNPD1 F S V=$O(^SPNL(154.1,"B",SPNPD0,V)) Q:'+V D GETLOR
153 Q
154GETLOR ;gets Rec No. for LOR, TFS (TFF is same rec no. as LOR), and TFG
155 Q:'$D(^SPNL(154.1,V,0))
156 Q:'+$P(^SPNL(154.1,V,2),U,17)
157 Q:$P($G(^SPNL(154.1,V,8)),U,3)'=CARETYP
158 ;Q:$P($G(^SPNL(154.1,V,8)),U,2)<BDATE!($P($G(^SPNL(154.1,V,8)),U,2)>EDATE)
159 I $P(^SPNL(154.1,V,2),U,17)=1,($P(^SPNL(154.1,V,0),U,2)=2) S TFSRN=V
160 I $P(^SPNL(154.1,V,2),U,17)=2,($P(^SPNL(154.1,V,0),U,2)=2) S TFGRN=V
161 I $P($G(^SPNL(154.1,V,8)),U,4)'="" S LORRN=V
162 Q
163EXIT ;
164 K BDATE,EDATE,I,SPNLEXIT,SPNPD0,SPNPD1,SPNLSTDT,SPNDIAGC,SPNSEVC,SPNMODC,SPNPARC,SPNLOWC,SPNSDATE,SPNMDATE,SPNPDATE,SPNLDATE,SPNNODUP,SPNSEXS,SPNSEXM,SPNSEXP,SPNSEXL
165 K SPNT1,SPNT2,SPNT3,SPNT4,SPNT5,SPNDCS,SPNDCM,SPNDCP,SPNDCL,SPNAGROU
166 K SPNAGES,SPNAGEM,SPNAGEP,SPNAGEL
167 K BMAS,BMAM,BMAP,BMAL,BHAS,BHAM,BHAP,BHAL
168 K AGESC,AGEMC,AGEPC,AGELC,MINAGES,MINAGEM,MINAGEP,MINAGEL
169 K MAXAGES,MAXAGEM,MAXAGEP,MAXAGEL,CARETYP,LINE
170 K SPNLORS,SPNLORM,SPNLORP,SPNLORL
171 K BMLS,BMLM,BMLP,BMLL,BHLS,BHLM,BHLP,BHLL
172 K LORSC,LORMC,LORPC,LORLC,MINLORS,MINLORM,MINLORP,MINLORL
173 K MAXLORS,MAXLORM,MAXLORP,MAXLORL,LORRN,V,LORL,LORH,AGEL,AGEH
174 K TFSRN,TFS,TFF,TFCUMS,TFCUMM,TFCUMP,TFCUML,TFCS,TFCM,TFCP,TFCL
175 K TFGRN,TFG,TFGCUMS,TFGCUMM,TFGCUMP,TFGCUML,TFGCS,TFGCM,TFGCP,TFGCL
176 K COMDISS,COMDISM,COMDISP,COMDISL,ZTSAVE
177 K TFURN,TFU,TFUCUMS,TFUCUMM,TFUCUMP,TFUCUML,TFUCS,TFUCM,TFUCP,TFUCL
178 K SLSRN,SLFRN,SLS,SLF,SLCUMS,SLCUMM,SLCUMP,SLCUML,SLCS,SLCM,SLCP,SLCL
179 K SLURN,SLU,SLUCUMS,SLUCUMM,SLUCUMP,SLUCUML,SLUCS,SLUCM,SLUCP,SLUCL
180 K AGECALL,ASIAONE,ASIAFRTN,SEXCALL,LORCALL,LOR5CALL
181 K TFSCALL,TFGCALL,TFUCALL,SLSCALL,SLFCALL,SLUCALL
182 Q
Note: See TracBrowser for help on using the repository browser.