Changeset 122 for ccr/trunk/p/GPLVITAL.m
- Timestamp:
- Aug 30, 2008, 3:13:15 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/GPLVITAL.m
r121 r122 39 39 N VSORT,VDATES,VCNT ; ARRAY FOR DATE SORTED VITALS INDEX 40 40 D VITDATES(.VDATES) ; PULL OUT THE DATES INTO AN ARRAY 41 I DEBUG ZWR VDATES ;DEBUG41 ; I DEBUG ZWR VDATES ;DEBUG 42 42 S VCNT=$$SORTDT^CCRUTIL(.VSORT,.VDATES,-1) ; PUT VITALS IN REVERSE 43 43 ; DATE ORDER AND COUNT THEM. VSORT CONTAINS INDIRECT INDEXES ONLY … … 175 175 . . . D INSINNER^GPLXPATH(VITOUTXML,VITARYTMP) 176 176 ; ZWR ^TMP($J,"VITALS",*) 177 ZWR ^TMP($J,"VITALARYTMP",*) ; SHOW THE RESULTS177 ; ZWR ^TMP($J,"VITALARYTMP",*) ; SHOW THE RESULTS 178 178 I DEBUG D PARY^GPLXPATH(VITOUTXML) 179 179 N VITTMP,I … … 183 183 . F I=1:1:VITTMP(0) W VITTMP(I),! 184 184 Q 185 ;186 VITSORT(V1,V2) ; DEPRECATED USE $$RSORTDT^CCRUTIL187 ; DATE SORT VITALS ARRAY AND RETURN INDEX IN V1 AND COUNT188 ; AS EXTRINSIC189 ; BOTH V1 AND V2 ARE PASSED BY REFERENCE190 N VSRT ; TEMP FOR HASHING DATES191 N ZI,ZJ,ZTMP,ZCNT,ZP1,ZP2192 S ZCNT=0 ; COUNTING NUMBER OF VITALS193 S ZTMP="" ;194 F ZI=0:0 D Q:$O(V2(ZTMP))="" ; FOR EACH VITAL IN THE ARRAY195 . S ZCNT=ZCNT+1 ; INCREMENT THE COUNT196 . S ZTMP=$O(V2(ZTMP)) ; NEXT VITAL197 . I $D(V2(ZTMP)) D ; IF THE RESULT EXISTS198 . . S ZP1=$P($P(V2(ZTMP),U,4),".",1) ; THE DATE PIECE199 . . S ZP2=$P($P(V2(ZTMP),U,4),".",2) ; THE TIME PIECE200 . . S VSRT(ZP1,ZP2_"00000"_ZCNT)=ZCNT ; HASH ON DATE AND TIME201 . . ; S VSRT($P(V2(ZTMP),U,4)_"000000"_ZCNT)=ZCNT ; PULL DATE202 . I DEBUG W "ZTMP=",ZTMP," "203 S V1(0)=ZCNT ; ARRAYS ARE THE SAME SIZE204 I DEBUG ZWR V2205 I DEBUG ZWR VSRT206 N ZD,ZT ; DATA AND TIME ITERATORS207 N ZDONE ; DONE FLAG208 S (ZD,ZT)=""209 S ZDONE=0210 N ZZCNT S ZZCNT=0 ; ANOTHER COUNTER211 F ZI=0:0 D Q:ZDONE ; VISIT THE ARRAY IN DATE ORDER212 . S ZD=$O(VSRT(ZD),-1) ; NEXT DATE213 . I ZD="" S ZDONE=1214 . I 'ZDONE D ; MORE DATES215 . . S ZT="" ; WANT FIRST TIME FOR THIS DATE216 . . F ZJ=0:0 D Q:$O(VSRT(ZD,ZT),-1)="" ; LOOP THROUGH ALL TIMES217 . . . S ZT=$O(VSRT(ZD,ZT),-1) ; NEXT TIME218 . . . S ZZCNT=ZZCNT+1 ; INCREMENT COUNTER219 . . . S V1(ZZCNT)=VSRT(ZD,ZT) ; PULL OUT THE INDEX220 . ; S V1(ZI)=ZI ; PLUG FOR NOW, DATES NOT SORTED221 I DEBUG ZWR V1222 Q ZCNT223 185 ; 224 186 VITDATES(VDT) ; VDT IS PASSED BY REFERENCE AND WILL CONTAIN THE ARRAY
Note:
See TracChangeset
for help on using the changeset viewer.