- Timestamp:
- Aug 30, 2008, 1:29:46 PM (16 years ago)
- Location:
- ccr/trunk/p
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/CCRUTIL.m
r120 r121 18 18 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 19 ; 20 W "No Entry at Top!" Q 21 20 W "No Entry at Top!" 21 Q 22 ; 22 23 FMDTOUTC(DATE,FORMAT) ; Convert Fileman Date to UTC Date Format; PUBLIC; Extrinsic 23 24 ; FORMAT is Format of Date. Can be either D (Day) or DT (Date and Time) … … 47 48 E Q $P(UTC,"T") 48 49 ; 50 SORTDT(V1,V2,ORDR) ; DATE SORT ARRAY AND RETURN INDEX IN V1 AND COUNT 51 ; AS EXTRINSIC ORDR IS 1 OR -1 FOR FORWARD OR REVERSE 52 ; DATE AND TIME ORDER. DEFAULT IS FORWARD 53 ; V2 IS AN ARRAY OF DATES IN FILEMAN FORMAT 54 ; V1 IS RETURNS INDIRECT INDEXES OF V2 IN REVERSE DATE ORDER 55 ; SO V2(V1(X)) WILL RETURN THE DATES IN DATE/TIME ORDER 56 ; THE COUNT OF THE DATES IS RETURNED AS AN EXTRINSIC 57 ; BOTH V1 AND V2 ARE PASSED BY REFERENCE 58 N VSRT ; TEMP FOR HASHING DATES 59 N ZI,ZJ,ZTMP,ZCNT,ZP1,ZP2 60 S ZCNT=0 ; COUNTING NUMBER OF DATES 61 S ZTMP="" ; 62 F ZI=0:0 D Q:$O(V2(ZTMP))="" ; FOR EACH DATE IN THE ARRAY 63 . S ZCNT=ZCNT+1 ; INCREMENT THE COUNT 64 . S ZTMP=$O(V2(ZTMP)) ; NEXT DATE 65 . I $D(V2(ZTMP)) D ; IF THE DATE EXISTS 66 . . S ZP1=$P(V2(ZTMP),".",1) ; THE DATE PIECE 67 . . S ZP2=$P(V2(ZTMP),".",2) ; THE TIME PIECE 68 . . S VSRT(ZP1,ZP2_"00000"_ZCNT)=ZCNT ; HASH ON DATE AND TIME 69 . . ; S VSRT($P(V2(ZTMP),U,4)_"000000"_ZCNT)=ZCNT ; PULL DATE 70 . I DEBUG W "ZTMP=",ZTMP," " 71 S V1(0)=ZCNT ; ARRAYS ARE THE SAME SIZE 72 I DEBUG ZWR V2 73 I DEBUG ZWR VSRT 74 N ZD,ZT ; DATA AND TIME ITERATORS 75 N ZDONE ; DONE FLAG 76 S (ZD,ZT)="" 77 S ZDONE=0 78 N UORDR ; ORDER TO USE 1=FORWARD -1=REVERSE 79 S UORDR=ORDR ; DIRECTION TO SORT 80 I ORDR="" S UORDR=1 81 N ZZCNT S ZZCNT=0 ; ANOTHER COUNTER 82 F ZI=0:0 D Q:ZDONE ; VISIT THE ARRAY IN DATE ORDER 83 . S ZD=$O(VSRT(ZD),UORDR) ; NEXT DATE 84 . I ZD="" S ZDONE=1 85 . I 'ZDONE D ; MORE DATES 86 . . S ZT="" ; WANT FIRST TIME FOR THIS DATE 87 . . F ZJ=0:0 D Q:$O(VSRT(ZD,ZT),UORDR)="" ; LOOP THROUGH ALL TIMES 88 . . . S ZT=$O(VSRT(ZD,ZT),UORDR) ; NEXT TIME 89 . . . S ZZCNT=ZZCNT+1 ; INCREMENT COUNTER 90 . . . S V1(ZZCNT)=VSRT(ZD,ZT) ; PULL OUT THE INDEX 91 Q ZCNT 92 ; -
ccr/trunk/p/GPLCCD.m
r111 r121 205 205 . . ; TO GET RID OF DUPLICATES 206 206 S I="" ; GOING TO $O THROUGH THE HASH 207 F J=0:0 D Q:$O(K(I))="" 207 F J=0:0 D Q:$O(K(I))="" ; 208 208 . S I=$O(K(I)) ; WALK THROUGH THE HASH OF ACTORS 209 209 . S $P(L,U,1)=I ; FIRST PIECE IS THE OBJECT ID -
ccr/trunk/p/GPLPROBS.m
r104 r121 34 34 K @TVMAP,@TARYTMP ; KILL OLD ARRAY VALUES 35 35 D LIST^ORQQPL3(.RPCRSLT,DFN,"") ; CALL THE PROBLEM LIST RPC 36 I '$D(RPCRSLT(1)) D Q ; RPC RETURNS NULL36 I '$D(RPCRSLT(1)) D Q ; RPC RETURNS NULL 37 37 . W "NULL RESULT FROM LIST^ORQQPL3 ",! 38 38 . S @OUTXML@(0)=0 -
ccr/trunk/p/GPLUNIT.m
r86 r121 81 81 I '$D(ZARY(WHICH)) D ; TEST SECTION DOESN'T EXIST 82 82 . W "ERROR -- TEST SECTION DOESN'T EXIST -> ",WHICH,! 83 . Q ; EXIT83 . Q ; EXIT 84 84 N FIRST,LAST 85 85 S FIRST=$P(ZARY(WHICH),"^",1) … … 113 113 W ! 114 114 W "THE TESTS!",! 115 ZWR ZTMP115 I DEBUG ZWR ZTMP 116 116 Q 117 117 ; -
ccr/trunk/p/GPLVITAL.m
r120 r121 37 37 S VITTARYTMP=$NA(^TMP("GPLCCR",$J,"VITALARYTMP")) 38 38 K @VITTVMAP,@VITTARYTMP ; KILL OLD ARRAY VALUES 39 N VSORT,VCNT ; ARRAY FOR DATE SORTED VITALS INDEX 40 S VCNT=$$VITSORT(.VSORT,.VITRSLT) ; PUT VITALS IN DATE ORDER 41 ; AND COUNT THEM VSORT CONTAINS INDEXES ONLY 39 N VSORT,VDATES,VCNT ; ARRAY FOR DATE SORTED VITALS INDEX 40 D VITDATES(.VDATES) ; PULL OUT THE DATES INTO AN ARRAY 41 I DEBUG ZWR VDATES ;DEBUG 42 S VCNT=$$SORTDT^CCRUTIL(.VSORT,.VDATES,-1) ; PUT VITALS IN REVERSE 43 ; DATE ORDER AND COUNT THEM. VSORT CONTAINS INDIRECT INDEXES ONLY 42 44 F J=1:1:VCNT D ; FOR EACH VITAL IN THE LIST 43 45 . I $D(VITRSLT(VSORT(J))) D … … 182 184 Q 183 185 ; 184 VITSORT(V1,V2) ; DATE SORT VITALS ARRAY AND RETURN INDEX IN V1 AND COUNT 186 VITSORT(V1,V2) ; DEPRECATED USE $$RSORTDT^CCRUTIL 187 ; DATE SORT VITALS ARRAY AND RETURN INDEX IN V1 AND COUNT 185 188 ; AS EXTRINSIC 186 189 ; BOTH V1 AND V2 ARE PASSED BY REFERENCE … … 189 192 S ZCNT=0 ; COUNTING NUMBER OF VITALS 190 193 S ZTMP="" ; 191 F ZI=0:0 D Q:$O(V2(ZTMP))="" ; FOR EACH VITAL IN THE ARRAY194 F ZI=0:0 D Q:$O(V2(ZTMP))="" ; FOR EACH VITAL IN THE ARRAY 192 195 . S ZCNT=ZCNT+1 ; INCREMENT THE COUNT 193 196 . S ZTMP=$O(V2(ZTMP)) ; NEXT VITAL … … 206 209 S ZDONE=0 207 210 N ZZCNT S ZZCNT=0 ; ANOTHER COUNTER 208 F ZI=0:0 D Q:ZDONE ; VISIT THE ARRAY IN DATE ORDER211 F ZI=0:0 D Q:ZDONE ; VISIT THE ARRAY IN DATE ORDER 209 212 . S ZD=$O(VSRT(ZD),-1) ; NEXT DATE 210 213 . I ZD="" S ZDONE=1 … … 219 222 Q ZCNT 220 223 ; 224 VITDATES(VDT) ; VDT IS PASSED BY REFERENCE AND WILL CONTAIN THE ARRAY 225 ; OF DATES IN THE VITALS RESULTS 226 N VDTI,VDTJ,VTDCNT 227 S VTDCNT=0 ; COUNT TO BUILD ARRAY 228 S VDTJ="" ; USED TO VISIT THE RESULTS 229 F VDTI=0:0 D Q:$O(VITRSLT(VDTJ))="" ; VISIT ALL RESULTS 230 . S VDTJ=$O(VITRSLT(VDTJ)) ; NEXT RESULT 231 . S VTDCNT=VTDCNT+1 ; INCREMENT COUNTER 232 . S VDT(VTDCNT)=$P(VITRSLT(VDTJ),U,4) ; PULL OUT THE DATE 233 Q 234 ;
Note:
See TracChangeset
for help on using the changeset viewer.