Changeset 570


Ignore:
Timestamp:
Oct 6, 2009, 5:41:09 PM (15 years ago)
Author:
George Lilly
Message:

update for eRx

File:
1 edited

Legend:

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

    r561 r570  
    5757 Q
    5858 ;
    59 MKMDX(STK,RTN)   ; MAKES A MUMPS INDEX FROM THE ARRAY STK
     59MKMDX(STK,RTN,INREDUX)   ; MAKES A MUMPS INDEX FROM THE ARRAY STK
    6060 ; RTN IS SET TO //FIRST/SECOND/THIRD FOR THREE ARRAY ELEMENTS
     61 ; REDUX IS A STRING TO REMOVE FROM THE RESULT
    6162 S RTN=""
    6263 N I
     
    6667 . I @STK@(0)>1  D  ; SUBSEQUENT ELEMENTS NEED A SEMICOLON
    6768 . . F I=2:1:@STK@(0) S RTN=RTN_"/"_@STK@(I)
     69 I $G(INREDUX)'="" S RTN=$P(RTN,INREDUX,1)_$P(RTN,INREDUX,2)
    6870 Q
    6971 ;
     
    200202 Q
    201203 ;
    202 INDEX(IZXML,VDX,NOINX,TEMPLATE) ; parse XML in IZXML and produce an XPATH index
     204INDEX(IZXML,VDX,NOINX,TEMPLATE,REDUX) ; parse XML in IZXML and produce
     205 ; an XPATH index; REDUX is a string to be removed from each xpath
    203206 ; GPL 7/14/09 OPTIONALLY GENERATE AN XML TEMPLATE IF PASSED BY NAME
    204207 ; TEMPLATE IS IDENTICAL TO THE PARSED XML LINE BY LINE
     
    213216 N I,LINE,FIRST,LAST,CUR,TMP,MDX,FOUND,CURVAL,DVDX,LCNT
    214217 N C0CSTK ; LEAVE OUT FOR DEBUGGING
     218 I '$D(REDUX) S REDUX=""
    215219 I '$D(NOINX) S NOINX=0 ; IF NOT PASSED, GENERATE AN INDEX
    216220 N ZXML
     
    244248 . . . S CUR=CUR_$G(LKASD(CUR,I)) ; HANDLE MULTIPLES
    245249 . . . D PUSH("C0CSTK",CUR) ; ADD TO THE STACK
    246  . . . D MKMDX("C0CSTK",.MDX) ; GENERATE THE M INDEX
     250 . . . D MKMDX("C0CSTK",.MDX,REDUX) ; GENERATE THE M INDEX
    247251 . . . ; W "MDX=",MDX,!
    248252 . . . I $D(@ZXML@(MDX))  D  ; IN THE INDEX, IS A MULTIPLE
     
    393397QUEUE(BLST,ARRAY,FIRST,LAST)       ; ADD AN ENTRY TO A BLIST
    394398 ;
    395  I DEBUG W "QUEUEING ",BLST,!
     399 I $G(DEBUG) W "QUEUEING ",BLST,!
    396400 D PUSH(BLST,ARRAY_";"_FIRST_";"_LAST)
    397401 Q
Note: See TracChangeset for help on using the changeset viewer.