- Timestamp:
- Aug 25, 2008, 12:06:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/GPLRIMA.m
r100 r102 151 151 S CPATLIST=$NA(@CBASE@(CTBL,"PATS",CATRTN)) ; BASE OF PAT LIST FOR THIS CAT 152 152 W "PATS BASE: ",CPATLIST,! 153 D PUSH^GPLXPATH(CPATLIST,CDFN) ; ADD THIS PATIENT TO THE CAT PAT LIST 154 ; 155 Q 153 S @CPATLIST@(CDFN)="" ; ADD THIS PATIENT TO THE CAT PAT LIST 154 ; 155 Q 156 ; 157 CCOUNT ; RECOUNT THE CATEGORIES.. USE IN CASE OF RESTART OF ANALYZE 158 ; 159 I '$D(RIMBASE) D ASETUP ; FOR COMMAND LINE CALLS 160 N ZI,ZJ,ZCNT,ZIDX,ZCAT,ZATR,ZTOT 161 S ZCBASE=$NA(@RIMBASE@("RIMTBL","CATS")) ; BASE OF CATEGORIES 162 S ZPBASE=$NA(@RIMBASE@("RIMTBL","PATS")) ; BASE OF PATIENTS 163 S ZTOT=0 ; INITIALIZE OVERALL TOTAL 164 F ZI=1:1:@ZCBASE@(0) D ; FOR ALL CATS 165 . S ZCNT=0 166 . S ZATR=@ZCBASE@(ZI) ; THE ATTRIBUTE OF THE CATEGORY 167 . S ZCAT=$P(@ZCBASE@(ZATR),"^",1) ; USE IT TO LOOK UP THE CATEGORY NAME 168 . ; S ZIDX=$O(@ZPBASE@(ZCAT,"")) ; FIRST PATIENT IN LIST 169 . ; F ZJ=0:0 D Q:$O(@ZPBASE@(ZCAT,ZIDX))="" ; ALL PATIENTS IN THE LISTS 170 . ; . S ZCNT=ZCNT+1 ; INCREMENT THE COUNT 171 . ; . W ZCAT," DFN:",ZIDX," COUNT:",ZCNT,! 172 . ; . S ZIDX=$O(@ZPBASE@(ZCAT,ZIDX)) 173 . S ZCNT=$$CNTLST($NA(@ZPBASE@(ZCAT))) 174 . S $P(@ZCBASE@(ZATR),"^",2)=ZCNT ; UPDATE THE COUNT IN THE CAT RECORD 175 . S ZTOT=ZTOT+ZCNT 176 W "TOTAL: ",ZTOT,! 177 Q 178 ; 179 CNTLST(INLST) ; RETURNS THE NUMBER OF ELEMENTS IN THE LIST 180 ; INLST IS PASSED BY NAME 181 N ZI,ZDX,ZCOUNT 182 W INLST,! 183 S ZCOUNT=0 184 S ZDX="" 185 F ZI=$O(@INLST@(ZDX)):0 D Q:$O(@INLST@(ZDX))="" ; LOOP UNTIL THE END 186 . S ZCOUNT=ZCOUNT+1 187 . S ZDX=$O(@INLST@(ZDX)) 188 . W "ZDX:",ZDX," ZCNT:",ZCOUNT,! 189 Q ZCOUNT 156 190 ; 157 191 APUSH(AMAP,AVAL) ; ADD AVAL TO ATTRIBUTE MAP AMAP (AMAP PASSED BY NAME)
Note:
See TracChangeset
for help on using the changeset viewer.