Changeset 134


Ignore:
Timestamp:
Sep 3, 2008, 6:26:54 PM (16 years ago)
Author:
George Lilly
Message:

cleaning up needless writes - make conditional on DEBUG

Location:
ccr/trunk/p
Files:
3 edited

Legend:

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

    r123 r134  
    2525       I Y<1 Q  ; EXIT
    2626       S DFN=$P(Y,U,1) ; SET THE PATIENT
     27       D XPAT(DFN,"","") ; EXPORT TO A FILE
     28       Q
     29       ;
     30XPAT(DFN,DIR,FN) ; EXPORT ONE PATIENT TO A FILE
     31       ; DIR IS THE DIRECTORY, DEFAULTS IF NULL TO ^TMP("GPLCCR","ODIR")
     32       ; FN IS FILE NAME, DEFAULTS IF NULL
    2733       ; N CCDGLO
    2834       D CCDRPC(.CCDGLO,DFN,"CCD","","","")
    2935       S OARY=$NA(^TMP("GPLCCR",$J,DFN,"CCD",1))
    30        S ONAM="PAT_"_DFN_"_CCD_V1.xml"
     36       S ONAM=FN
     37       I FN="" S ONAM="PAT_"_DFN_"_CCD_V1.xml"
    3138       S ODIRGLB=$NA(^TMP("GPLCCR","ODIR"))
    3239       I '$D(@ODIRGLB) D  ; IF NOT ODIR HAS BEEN SET
     
    3441       . ;S @ODIRGLB="/home/cedwards/"
    3542       . ;S @ODIRGLB="/opt/wv/p/"
    36        S ODIR=@ODIRGLB
    37        D OUTPUT^GPLXPATH(OARY,ONAM,ODIR)
     43       S ODIR=DIR
     44       I DIR="" S ODIR=@ODIRGLB
     45       N ZY
     46       S ZY=$$OUTPUT^GPLXPATH(OARY,ONAM,ODIR)
     47       W $P(ZY,U,2)
    3848       Q
    3949       ;
     
    4959    ;    "TO" VARIABLES
    5060    ;    IF NULL WILL DEFAULT TO "FROM" ORGANIZATION AND "TO" DFN
    51     S DEBUG=0
     61    I '$D(DEBUG) S DEBUG=0
    5262    N CCD S CCD=0 ; FLAG FOR PROCESSING A CCD
    5363    I CCRPART="CCD" S CCD=1 ; WE ARE PROCESSING A CCD
  • ccr/trunk/p/GPLCCR.m

    r111 r134  
    4343       S ODIR=DIR
    4444       I DIR="" S ODIR=@ODIRGLB
    45        D OUTPUT^GPLXPATH(OARY,ONAM,ODIR)
     45       N ZY
     46       S ZY=$$OUTPUT^GPLXPATH(OARY,ONAM,ODIR)
     47       W $P(ZY,U,2)
    4648       Q
    4749       ;
  • ccr/trunk/p/GPLXPATH.m

    r125 r134  
    2626          N Y
    2727          S Y=$$GTF^%ZISH(OUTARY,$QL(OUTARY),OUTDIR,OUTNAME)
    28           I Y W "WROTE FILE: ",OUTNAME," TO ",OUTDIR,!
    29           ; $NA(^TMP(14216,"FILE",0)),3,"/home/wvehr3","test.xml")
     28          I Y Q 1_U_"WROTE FILE: "_OUTNAME_" TO "_OUTDIR
     29          I 'Y Q 0_U_"ERROR WRITING FILE"_OUTNAME_" TO "_OUTDIR
    3030          Q
    3131          ;
     
    366366         . . S @OXML@(I)=TSTR ; COPY LINE WITH MAPPED VALUES
    367367         . . I DEBUG W TSTR
    368          W "MAPPED",!
     368         I DEBUG W "MAPPED",!
    369369         Q
    370370         ;
     
    374374       S FOUND=0
    375375       S INTXT=0
    376        W "DELETING EMPTY ELEMENTS",!
     376       I DEBUG W "DELETING EMPTY ELEMENTS",!
    377377       F I=1:1:(@THEXML@(0)-1) D  ; LOOP THROUGH ENTIRE ARRAY
    378378       . S J=@THEXML@(I)
    379379       . I J["<text>" D
    380380       . . S INTXT=1 ; IN HTML SECTION, DON'T TRIM
    381        . . W "IN HTML SECTION",!
     381       . . I DEBUG W "IN HTML SECTION",!
    382382       . N JM,JP,JPX ; JMINUS AND JPLUS
    383383       . S JM=@THEXML@(I-1) ; LINE BEFORE
     
    387387       . . S JPX=$TR(JP,"/","") ; REMOVE THE SLASH
    388388       . . I J=JPX D  ; AN EMPTY ELEMENT ON TWO LINES
    389        . . . W I,J,JP,!
     389       . . . I DEBUG W I,J,JP,!
    390390       . . . S FOUND=1 ; FOUND SOMETHING TO BE DELETED
    391391       . . . S DEL(I)="" ; SET LINE TO DELETE
    392392       . . . S DEL(I+1)="" ; SET NEXT LINE TO DELETE
    393393       . . I J["><" D  ; AN EMPTY ELEMENT ON ONE LINE
    394        . . . W I,J,!
     394       . . . I DEBUG W I,J,!
    395395       . . . S FOUND=1 ; FOUND SOMETHING TO BE DELETED
    396396       . . . S DEL(I)="" ; SET THE EMPTY LINE UP TO BE DELETED
    397397       . . . I JM=JPX D  ;
    398        . . . . W I,JM_J_JPX,!
     398       . . . . I DEBUG W I,JM_J_JPX,!
    399399       . . . . S DEL(I-1)=""
    400400       . . . . S DEL(I+1)="" ; SET THE SURROUNDING LINES FOR DEL
Note: See TracChangeset for help on using the changeset viewer.