Changeset 122 for ccr/trunk/p/GPLVITAL.m


Ignore:
Timestamp:
Aug 30, 2008, 3:13:15 PM (16 years ago)
Author:
George Lilly
Message:

XINDEX fixes. almost clean except for long var names and big files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/GPLVITAL.m

    r121 r122  
    3939          N VSORT,VDATES,VCNT ; ARRAY FOR DATE SORTED VITALS INDEX
    4040          D VITDATES(.VDATES) ; PULL OUT THE DATES INTO AN ARRAY
    41           I DEBUG ZWR VDATES ;DEBUG
     41          ; I DEBUG ZWR VDATES ;DEBUG
    4242          S VCNT=$$SORTDT^CCRUTIL(.VSORT,.VDATES,-1) ; PUT VITALS IN REVERSE
    4343          ; DATE ORDER AND COUNT THEM. VSORT CONTAINS INDIRECT INDEXES ONLY
     
    175175          . . . D INSINNER^GPLXPATH(VITOUTXML,VITARYTMP)
    176176          ; ZWR ^TMP($J,"VITALS",*)
    177           ZWR ^TMP($J,"VITALARYTMP",*) ; SHOW THE RESULTS
     177          ; ZWR ^TMP($J,"VITALARYTMP",*) ; SHOW THE RESULTS
    178178          I DEBUG D PARY^GPLXPATH(VITOUTXML)
    179179          N VITTMP,I
     
    183183          . F I=1:1:VITTMP(0) W VITTMP(I),!
    184184          Q
    185           ;
    186 VITSORT(V1,V2) ; DEPRECATED USE $$RSORTDT^CCRUTIL
    187                ; DATE SORT VITALS ARRAY AND RETURN INDEX IN V1 AND COUNT
    188                ; AS EXTRINSIC
    189                ; BOTH V1 AND V2 ARE PASSED BY REFERENCE
    190           N VSRT ; TEMP FOR HASHING DATES
    191           N ZI,ZJ,ZTMP,ZCNT,ZP1,ZP2
    192           S ZCNT=0 ; COUNTING NUMBER OF VITALS
    193           S ZTMP="" ;
    194           F ZI=0:0 D  Q:$O(V2(ZTMP))=""  ; FOR EACH VITAL IN THE ARRAY
    195           . S ZCNT=ZCNT+1 ; INCREMENT THE COUNT
    196           . S ZTMP=$O(V2(ZTMP)) ; NEXT VITAL
    197           . I $D(V2(ZTMP)) D  ; IF THE RESULT EXISTS
    198           . . S ZP1=$P($P(V2(ZTMP),U,4),".",1) ; THE DATE PIECE
    199           . . S ZP2=$P($P(V2(ZTMP),U,4),".",2) ; THE TIME PIECE
    200           . . S VSRT(ZP1,ZP2_"00000"_ZCNT)=ZCNT ; HASH ON DATE AND TIME
    201           . . ; S VSRT($P(V2(ZTMP),U,4)_"000000"_ZCNT)=ZCNT ; PULL DATE
    202           . I DEBUG W "ZTMP=",ZTMP," "
    203           S V1(0)=ZCNT ; ARRAYS ARE THE SAME SIZE
    204           I DEBUG ZWR V2
    205           I DEBUG ZWR VSRT
    206           N ZD,ZT ; DATA AND TIME ITERATORS
    207           N ZDONE ; DONE FLAG
    208           S (ZD,ZT)=""
    209           S ZDONE=0
    210           N ZZCNT S ZZCNT=0 ; ANOTHER COUNTER
    211           F ZI=0:0 D  Q:ZDONE  ; VISIT THE ARRAY IN DATE ORDER
    212           . S ZD=$O(VSRT(ZD),-1) ; NEXT DATE
    213           . I ZD="" S ZDONE=1
    214           . I 'ZDONE D  ; MORE DATES
    215           . . S ZT="" ; WANT FIRST TIME FOR THIS DATE
    216           . . F ZJ=0:0 D  Q:$O(VSRT(ZD,ZT),-1)=""  ; LOOP THROUGH ALL TIMES
    217           . . . S ZT=$O(VSRT(ZD,ZT),-1) ; NEXT TIME
    218           . . . S ZZCNT=ZZCNT+1 ; INCREMENT COUNTER
    219           . . . S V1(ZZCNT)=VSRT(ZD,ZT) ; PULL OUT THE INDEX
    220           . ; S V1(ZI)=ZI ; PLUG FOR NOW, DATES NOT SORTED
    221           I DEBUG ZWR V1
    222           Q ZCNT
    223185          ;
    224186VITDATES(VDT) ; VDT IS PASSED BY REFERENCE AND WILL CONTAIN THE ARRAY
Note: See TracChangeset for help on using the changeset viewer.