Changeset 22


Ignore:
Timestamp:
Jun 26, 2008, 1:51:24 PM (16 years ago)
Author:
George Lilly
Message:

Minor code cleanup -- some test case bugs fixed

Location:
ccr/trunk/p
Files:
5 edited

Legend:

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

    r16 r22  
    4848        . X CALL
    4949        . ; NOW INSERT THE RESULTS IN THE CCR BUFFER
    50         . ; D INSERT^GPLXPATH(CCRGLO,OXML,"//ContinuityOfCareRecord/Body")
     50        . D INSERT^GPLXPATH(CCRGLO,OXML,"//ContinuityOfCareRecord/Body")
    5151        . I DEBUG F GPLI=1:1:@OXML@(0) W @OXML@(GPLI),!
    52         . D QOPEN^GPLXPATH("CCRBLD",CCRGLO,"//ContinuityOfCareRecord/Body")
    53         . D QUEUE^GPLXPATH("CCRBLD",OXML,1,@OXML@(0))
    54         . D QCLOSE^GPLXPATH("CCRBLD",CCRGLO,"//ContinuityOfCareRecord/Body")
    55         . I DEBUG W "GOING TO BUILD CCR",!
    56         . N CCRTMP
    57         . D BUILD^GPLXPATH("CCRBLD","CCRTMP")
    58         . I DEBUG F GPLI=1:1:CCRTMP(0) W CCRTMP(GPLI),!
    59         . D CP^GPLXPATH("CCRTMP",CCRGLO)
     52        . ; D QOPEN^GPLXPATH("CCRBLD",CCRGLO,"//ContinuityOfCareRecord/Body")
     53        . ; D QUEUE^GPLXPATH("CCRBLD",OXML,1,@OXML@(0))
     54        . ; D QCLOSE^GPLXPATH("CCRBLD",CCRGLO,"//ContinuityOfCareRecord/Body")
     55        . ; I DEBUG W "GOING TO BUILD CCR",!
     56        . ; N CCRTMP
     57        . ; D BUILD^GPLXPATH("CCRBLD","CCRTMP")
     58        . ; I DEBUG F GPLI=1:1:CCRTMP(0) W CCRTMP(GPLI),!
     59        . ; D CP^GPLXPATH("CCRTMP",CCRGLO)
    6060        Q
    6161        ;
  • ccr/trunk/p/GPLCCR0.m

    r16 r22  
    9191;;<Code>
    9292;;<Value>@@PROBLEMCODEVALUE@@</Value>
    93 ;;<CodingSystem>@@PROBLEMCODINGSYSTEM@@ICD9CM</CodingSystem>
    94 ;;<Version>@@PROBLEMCODINGVERSION@@2007</Version>
     93;;<CodingSystem>ICD9CM</CodingSystem>
     94;;<Version>@@PROBLEMCODINGVERSION@@</Version>
    9595;;</Code>
    9696;;</Description>
  • ccr/trunk/p/GPLPROBS.m

    r3 r22  
    1515    D LIST^ORQQPL3(.RPCRSLT,DFN,"") ; CALL THE PROBLEM LIST RPC
    1616    I '$D(RPCRSLT(0)) W "ERROR CALLING LIST^ORQQPL3 ",! Q
    17     I DEBUG ZWR RPCRSLT
     17    ZWR RPCRSLT
    1818    S TVMAP=$NA(^TMP($J,"PROBVALS"))
    1919    S TARYTMP=$NA(^TMP($J,"PROBARYTMP"))
  • ccr/trunk/p/GPLUNIT.m

    r3 r22  
    1717        S ZARY(CNT)=TST ; put the test in the array
    1818        I $D(ZARY(BAT))  D  ; NOT THE FIRST TEST IN BATTERY
    19         . N II ; TEMP FOR ENDING TEST IN BATTERY
     19        . N II,TN ; TEMP FOR ENDING TEST IN BATTERY
    2020        . S II=$P(ZARY(BAT),"^",2)
    2121        . S $P(ZARY(BAT),"^",2)=II+1
    2222        I '$D(ZARY(BAT))  D  ; FIRST TEST IN THIS BATTERY
    2323        . S ZARY(BAT)=CNT_"^"_CNT ; FIRST AND LAST TESTS IN BATTERY
    24         . S ZARY("TESTS",BAT)="" ; PUT THE BATTERY IN THE TESTS INDEX
     24        . ; S ZARY("TESTS",BAT)="" ; PUT THE BATTERY IN THE TESTS INDEX
     25        . S TN=$NA(ZARY("TESTS"))
     26        . D PUSH^GPLXPATH(TN,BAT)
    2527        S ZARY(0)=CNT ; update the array counter
    2628        Q
     
    4648       . . I LINE?." "1";;>>".E  D  ; test case found
    4749       . . . D ZT(.@ZARY,SECTION,$P(LINE,";;>>",2)) ; put the test in the array
    48        S @ZARY@("ALL")="1"_"^"_@ZARY@(0) ; MAKE A BATTERY FOR ALL
     50       ; S @ZARY@("ALL")="1"_"^"_@ZARY@(0) ; MAKE A BATTERY FOR ALL
    4951       Q
    5052       ;
    5153ZTEST(ZARY,WHICH)   ; try out the tests using a passed array ZTEST
    52        N I,ZX,ZR,ZP
    53        S DEBUG=0
    54        I '$D(ZARY(WHICH))  D  ; TEST SECTION DOESN'T EXIST
    55        . W "ERROR -- TEST SECTION DOESN'T EXIST -> ",WHICH,!
    56        . Q ; EXIT
    57        N FIRST,LAST
    58        S FIRST=$P(ZARY(WHICH),"^",1)
    59        S LAST=$P(ZARY(WHICH),"^",2)
    60        F I=FIRST:1:LAST  D
    61        . I ZARY(I)?1">"1.E  D  ; NOT A TEST, JUST RUN THE STATEMENT
    62        . . S ZP=$E(ZARY(I),2,$L(ZARY(I)))
    63        . . ;  W ZP,!
    64        . . S ZX=ZP
    65        . . W "RUNNING: "_ZP
    66        . . X ZX
    67        . . W "..SUCCESS: ",WHICH,!
    68        . I ZARY(I)?1"?"1.E  D  ; THIS IS A TEST
    69        . . S ZP=$E(ZARY(I),2,$L(ZARY(I)))
    70        . . S ZX="S ZR="_ZP
    71        . . W "TRYING: "_ZP
    72        . . X ZX
    73        . . W $S(ZR=1:"..PASSED ",1:"..FAILED "),!
    74        . . I '$D(TPASSED) D  ; NOT INITIALIZED YET
    75        . . . S TPASSED=0 S TFAILED=0
    76        . . I ZR S TPASSED=TPASSED+1
    77        . . I 'ZR S TFAILED=TFAILED+1
    78        Q
    79        ;
     54        N I,ZX,ZR,ZP
     55        S DEBUG=0
     56        I WHICH="ALL" D  Q ; RUN ALL THE TESTS
     57        . W "DOING ALL",!
     58        . N J,NT
     59        . S NT=$NA(ZARY("TESTS"))
     60        . W NT,@NT@(0),!
     61        . F J=1:1:@NT@(0) D  ;
     62        . . W @NT@(J),!
     63        . . D ZTEST^GPLUNIT(@ZARY,@NT@(J))
     64        I '$D(ZARY(WHICH))  D  ; TEST SECTION DOESN'T EXIST
     65        . W "ERROR -- TEST SECTION DOESN'T EXIST -> ",WHICH,!
     66        . Q ; EXIT
     67        N FIRST,LAST
     68        S FIRST=$P(ZARY(WHICH),"^",1)
     69        S LAST=$P(ZARY(WHICH),"^",2)
     70        F I=FIRST:1:LAST  D
     71        . I ZARY(I)?1">"1.E  D  ; NOT A TEST, JUST RUN THE STATEMENT
     72        . . S ZP=$E(ZARY(I),2,$L(ZARY(I)))
     73        . . ;  W ZP,!
     74        . . S ZX=ZP
     75        . . W "RUNNING: "_ZP
     76        . . X ZX
     77        . . W "..SUCCESS: ",WHICH,!
     78        . I ZARY(I)?1"?"1.E  D  ; THIS IS A TEST
     79        . . S ZP=$E(ZARY(I),2,$L(ZARY(I)))
     80        . . S ZX="S ZR="_ZP
     81        . . W "TRYING: "_ZP
     82        . . X ZX
     83        . . W $S(ZR=1:"..PASSED ",1:"..FAILED "),!
     84        . . I '$D(TPASSED) D  ; NOT INITIALIZED YET
     85        . . . S TPASSED=0 S TFAILED=0
     86        . . I ZR S TPASSED=TPASSED+1
     87        . . I 'ZR S TFAILED=TFAILED+1
     88        Q
     89        ;
    8090TEST   ; RUN ALL THE TEST CASES
    8191      N ZTMP
  • ccr/trunk/p/GPLXPATH.m

    r3 r22  
    189189       . W "ERROR IN COPY BAD SOURCE LENGTH: ",CPSRC,!
    190190       . Q
     191       ; I '$D(@CPDEST@(0)) S @CPDEST@(0)=0 ; IF THE DEST IS EMPTY, INITIALIZE
    191192       D QUEUE("CPINSTR",CPSRC,1,@CPSRC@(0)) ; BLIST FOR ENTIRE ARRAY
    192193       D BUILD("CPINSTR",CPDEST)
     
    238239       ; XML AT THE END OF THE XPATH POINT
    239240       ; INSXML AND INSNEW ARE PASSED BY NAME INSXPATH IS A VALUE
    240        ; N INSBLD,INSTMP
     241       N INSBLD,INSTMP
    241242       I DEBUG W "DOING INSERT ",INSXML,INSNEW,INSXPATH,!
    242243       I DEBUG F G1=1:1:@INSXML@(0) W @INSXML@(G1),!
    243        I '$D(@INSXML@(0)) D  ; INSERT INTO AN EMPTY ARRAY
    244        . W "DOING A BAD COPY",!
    245        . D CP^GPLXPATH(INSNEW,INXML) ; JUST COPY INTO THE OUTPUT
     244       I '$D(@INSXML@(0)) D  Q ; INSERT INTO AN EMPTY ARRAY
     245       . D CP^GPLXPATH(INSNEW,INSXML) ; JUST COPY INTO THE OUTPUT
    246246       I $D(@INSXML@(0)) D  ; IF ORIGINAL ARRAY IS NOT EMPTY
    247        . W "GOT HERE",!
    248247       . I $D(INSXPATH) D  ; XPATH PROVIDED
    249248       . . D QOPEN("INSBLD",INSXML,INSXPATH) ; COPY THE BEFORE
     
    256255       . I '$D(INSXPATH) D  ; NO XPATH PROVIDED, CLOSE AT ROOT
    257256       . . D QCLOSE("INSBLD",INSXML,"//") ; CLOSE WITH ROOT XPATH
    258        . D BUILD("INSBLD",INSTMP) ; PUT RESULTS IN INDEST
    259        . D CP^GPLXPATH(INSTMP,INSXML) ; COPY BUFFER TO SOURCE
     257       . D BUILD("INSBLD","INSTMP") ; PUT RESULTS IN INDEST
     258       . D CP^GPLXPATH("INSTMP",INSXML) ; COPY BUFFER TO SOURCE
    260259       Q
    261260       ;
     
    335334      ;
    336335TEST   ; RUN ALL THE TEST CASES
    337       N ZTMP
    338       D ZLOAD^GPLUNIT("ZTMP","GPLXPATH")
    339       D ZTEST^GPLUNIT(.ZTMP,"ALL")
    340       W "PASSED: ",TPASSED,!
    341       W "FAILED: ",TFAILED,!
    342       W !
    343       ; W "THE TESTS!",!
    344       ; ZWR ZTMP
    345       Q
    346       ;
     336        N ZTMP
     337        D ZLOAD^GPLUNIT("ZTMP","GPLXPATH")
     338        D ZTEST^GPLUNIT(.ZTMP,"ALL")
     339        W "PASSED: ",TPASSED,!
     340        W "FAILED: ",TFAILED,!
     341        W !
     342        ; W "THE TESTS!",!
     343        ; ZWR ZTMP
     344        Q
     345        ;
    347346ZTEST(WHICH) ; RUN ONE SET OF TESTS
    348       N ZTMP
    349       D ZLOAD^GPLUNIT("ZTMP","GPLXPATH")
    350       D ZTEST^GPLUNIT(.ZTMP,WHICH)
    351       Q
    352       ;
     347        N ZTMP
     348        S DEBUG=1
     349        D ZLOAD^GPLUNIT("ZTMP","GPLXPATH")
     350        D ZTEST^GPLUNIT(.ZTMP,WHICH)
     351        Q
     352        ;
    353353TLIST ; LIST THE TESTS
    354354      N ZTMP
     
    494494;;>>>D ZTEST^GPLXPATH("INITXML")
    495495;;>>>D QUERY^GPLXPATH("GXML","//FIRST/SECOND/THIRD/FIFTH","G2")
    496 ;;>>>D INSERT^GPLXPATH("GXML","G2","G3","//FIRST/SECOND/THIRD")
    497 ;;>>>D INSERT^GPLXPATH("G3","G2","G4","//FIRST/SECOND/THIRD")
    498 ;;>>?G2(1)=G3(9)
     496;;>>>D INSERT^GPLXPATH("GXML","G2","//FIRST/SECOND/THIRD")
     497;;>>>D INSERT^GPLXPATH("G3","G2","//")
     498;;>>?G2(1)=GXML(9)
    499499;;><REPLACE>
    500500;;>>>K G2,GBL,G3
Note: See TracChangeset for help on using the changeset viewer.