Changeset 785 for ccr/trunk


Ignore:
Timestamp:
May 25, 2010, 1:45:29 PM (15 years ago)
Author:
George Lilly
Message:

encoutners

Location:
ccr/trunk/p
Files:
3 edited

Legend:

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

    r784 r785  
    4646 . D MAP^C0CXPATH("ZINNER",ZVAR,ZTMP) ; MAP THE PROCEDURE
    4747 . N ZNOTE,ZN
     48 . D CLEAN($NA(@C0CNTE@(ZI,"TEXT"))) ;REMOVE CONTROL CHARS AND XML RESERVED
    4849 . M ZNOTE=@C0CNTE@(ZI,"TEXT") ;THE NOTE TO ADD TO THE BUILD
    4950 . S ZNOTE(0)=$O(ZNOTE(""),-1) ;LENGTH OF THE NOTE
     
    5657 Q
    5758 ; 
     59CLEAN(INARY) ; INARY IS PASSED BY NAME
     60 ; REMOVE CONTROL CHARACTERS AND XML RESERVED SYMBOLS FROM THE ARRAY
     61 N ZI,ZJ S ZI=""
     62 F  S ZI=$O(@INARY@(ZI)) Q:ZI=""  D  ;
     63 . S @INARY@(ZI)=$$CLEAN^C0CXPATH(@INARY@(ZI)) ; CONTROL CHARS
     64 . S @INARY@(ZI)=$$SYMENC^MXMLUTL(@INARY@(ZI)) ; XML RESERVED SYMBOLS
     65 Q
     66 ;
  • ccr/trunk/p/C0CENC.m

    r783 r785  
    2626 ;
    2727 D SETVARS^C0CPROC ; SET UP VARIABLES FOR PROCEDUCRES, ENCOUNTERS, AND NOTES
    28  I '$D(@C0CENC) D TIUGET(DFN,C0CENC,C0CPRC,C0CNTE) ; GET VARS IF NOT THERE
     28 ;I '$D(@C0CENC) D TIUGET(DFN,C0CENC,C0CPRC,C0CNTE) ; GET VARS IF NOT THERE
     29 K @C0CENC
     30 D TIUGET(DFN,C0CENC,C0CPRC,C0CNTE) ; GET ENCOUNTERS
    2931 D MAP(ENCXML,C0CENC,ENCOUT) ;MAP RESULTS FOR ENCOUNTERS
    3032 Q
     
    109111 ; INSTEAD OF JUST THE FIRST ONE IN THE LIST - GPL 1/23/10
    110112 N ZS,ZC
    111  S ZC=$O(@ZARY@("CPT","")) ; FIRST CPT IN THE VISIT
    112  S ZS=$G(@ZARY@("CPT",ZC)) ; PIECES OF THE FIRST CPT
    113  I ZS="" Q 0 ; OOPS NO TEXT FOR THE TYPE QUIT
    114  S ZTXT=$P(ZS,U,3) ; TEXT OF THE FIRST CPT
    115  I ZTXT="" Q 0 ; NO ENCOUNTER TYPE FOUND
    116  S ZCDE=$P($$CPT^C0CPROC(ZS),U,1) ; CPT CODE FOR ENCOUTER
    117  S ZSYS=""
    118  I ZCDE'="" S ZSYS="CPT-4" ; ONLY HAVE A CODING SYSTEM IF THERE IS A CODE
     113 S ZC="" S ZS=""
     114 S ZTXT=""
     115 F  S ZC=$O(@ZARY@("CPT",ZC)) Q:ZC=""  D  ; TRY AND FIND A "99" CPT CODE
     116 . N ZT
     117 . S ZT=$$CPT^C0CPROC(@ZARY@("CPT",ZC)) ; VALUES IN A CPT MULTIPLE
     118 . I $E($P(ZT,U,1),1,2)="99" S ZS=ZT ; IS IT AN ADMIN CPT CODE?
     119 I ZS'="" D  ; CODED ENCOUNTER TYPE FOUND
     120 . S ZTXT=$P(ZS,U,2)_" "_$P(ZS,U,3) ; USE BOTH PIECES FOR THE TYPE
     121 . S ZCDE=$P($$CPT^C0CPROC(ZS),U,1) ; CPT CODE FOR ENCOUTER
     122 . S ZSYS=""
     123 . I ZCDE'="" S ZSYS="CPT-4" ; ONLY HAVE A CODING SYSTEM IF THERE IS A CODE
     124 I ZS="" S ZTXT=$$ANYTXT(ZARY) ; TRY AND GET FREE FORM TEXT FROM CPT MULTIPLES
     125 I ZTXT="" Q 0 ; FAILED
     126 W !,ZTXT
    119127 Q 1 ; SUCCESS
     128 ;
     129ANYTXT(ZVST) ; EXTRINSIC WHICH RETURNS TEXT FROM THE CPT MULTIPLE
     130 ; OF A VISIT ARRAY WITHOUT CHECKING THE CPT CODE (THAT HAVING FAILED)
     131 ; ZVST IS THE VISIT ARRAY AND IS PASSED BY NAME
     132 ; RETURNS TEXT TO USE AS ENCOUNTER TYPE IF ANY
     133 N ZI,ZJ
     134 S ZI="" S ZJ=""
     135 F  S ZI=$O(@ZVST@("CPT",ZI)) Q:ZI=""  D  ; LOOK FOR SOME TEXT TO USE
     136 . N ZT
     137 . S ZT=$G(@ZVST@("CPT",ZI)) ; LOOK AT THIS CPT MULTIPLE
     138 . I $P(ZT,U,2)_" "_$P(ZT,U,3)'=" " S ZJ=$P(ZT,U,2)_" "_$P(ZT,U,3)
     139 . ; CONCATENATE PIECE 2 AND 3 OF THE CPT MULTIPLE FOR A TYPE
     140 I ZJ="" S ZJ=$G(@ZVST@("CLASS")) ; USE THE NOTE DOCUMENT CLASS FOR ENCOUTNER TYPE
     141 Q ZJ
    120142 ;
    121143PRV(IARY) ; RETURNS THE PRIMARY PROVIDER FROM THE "PRV" ARRAY PASSED BY NAME
  • ccr/trunk/p/C0CXPATH.m

    r728 r785  
    324324 Q
    325325 ;
    326 CLEAN(STR) ; extrinsic function; returns string
     326CLEAN(STR,TR) ; extrinsic function; returns string
    327327 ;; Removes all non printable characters from a string.
    328328 ;; STR by Value
     329 ;; TR IS OPTIONAL TO IMPROVE PERFORMANCE
    329330 N TR,I
    330  F I=0:1:31 S TR=$G(TR)_$C(I)
    331  S TR=TR_$C(127)
     331 I '$D(TR) D  ;
     332 . F I=0:1:31 S TR=$G(TR)_$C(I)
     333 . S TR=TR_$C(127)
    332334 QUIT $TR(STR,TR)
    333335 ;
Note: See TracChangeset for help on using the changeset viewer.