Changeset 304 for ccr


Ignore:
Timestamp:
Dec 10, 2008, 5:15:44 PM (16 years ago)
Author:
George Lilly
Message:

completed EXPANDC0CRXN to create file 176.112

Location:
ccr/trunk/p
Files:
2 edited

Legend:

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

    r303 r304  
    9090
    9191 S GF=$$FILEREF(GFILE) ;CLOSED FILE REFERENCE FOR FILE NUMBER GFILE
    92  I '$D(GNDX) S GIEN=GREF ; IF NO INDEX USED, GREF IS THE IEN
     92 I ('$D(GNDX))!(GNDX="") S GIEN=GREF ; IF NO INDEX USED, GREF IS THE IEN
    9393 E  D  ; WE ARE USING AN INDEX
    9494 . ;N ZG
  • ccr/trunk/p/C0CRXN.m

    r303 r304  
    3131 ; "DIFFERENT TEXT" FIELD TO "Y" IF THERE ARE DIFFERENCES
    3232 ; USES SUPPORT ROUTINES FROM C0CRNF.m
    33  N C0CFDA,C0CA,C0CB,C0CZX ;FDA WORK ARRAY, RNF ARRAYS, AND IEN ITERATOR
    34  N C0CFVA,C0CFRXN ; CLOSED ROOTS FOR SOURCE FILES
    35  N C0CF ; CLOSED ROOT FOR DESTINATION FILE
     33 ;N C0CFDA,C0CA,C0CB,C0CC,C0CZX ;FDA WORK ARRAY, RNF ARRAYS, AND IEN ITERATOR
     34 ;N C0CFVA,C0CFRXN ; CLOSED ROOTS FOR SOURCE FILES
     35 ;N C0CF ; CLOSED ROOT FOR DESTINATION FILE
    3636 S C0CVA=$$FILEREF^C0CRNF(176.111) ; C0C PHARMACY VA RXNORM MAPPING FILE
    37  ;S C0CFRXN=$$FILEREF^C0CRNF(176.001) ; CLOSED ROOT FOR RXNORM CONCEPT FILE
    38  ;S C0CF=$$FILEREF^C0CRNF(176.112) ; C0C RXNORM VUID MAPPING EXPANSION FILE
    39  ;W C0CVA,C0CFRXN,C0CF,!
     37 S C0CFRXN=$$FILEREF^C0CRNF(176.001) ; CLOSED ROOT FOR RXNORM CONCEPT FILE
     38 S C0CF=$$FILEREF^C0CRNF(176.112) ; C0C RXNORM VUID MAPPING EXPANSION FILE
     39 W C0CVA,C0CFRXN,C0CF,!
    4040 S C0CZX=0
    41  S (HASRXN,NORXN,NOVUID)=0 ; INITIALIZE COUNTERS
     41 S (HASRXN,NORXN,NOVUID,RXFOUND,RXMATCH,TXTMATCH)=0 ; INITIALIZE COUNTERS
    4242 F  S C0CZX=$O(^C0CCODES(176.111,C0CZX)) Q:+C0CZX=0  D  ; FOR EVERY RECORD
    43  . D GETN^C0CRNF("C0CA",176.111,C0CZX,"ALL") ;GET THE FIELDS
     43 . K C0CA,C0CB,C0CC ; CLEAR ARRAYS
     44 . D FIELDS^C0CRNF("C0CC",176.112) ;GET FIELD NAMES FOR OUTPUT FILE
     45 . D GETN2^C0CRNF("C0CA",176.111,C0CZX,"","ALL") ;GET THE FIELDS
    4446 . I $$ZVALUE("MEDIATION CODE")="" D
    4547 . . S NORXN=NORXN+1 ;
    46  . E  S HASRXN=HASRXN+1
     48 . E  D  ; PROCESS MEDIATION CODE
     49 . . S HASRXN=HASRXN+1
     50 . . D SETFDA("MEDIATION CODE",$$ZVALUE("MEDIATION CODE")) ;
    4751 . I $$ZVALUE("VUID")="" D  ; BAD RECORD
    4852 . . S NOVUID=NOVUID+1
    49  . . ZWR C0CA
     53 . . ;D SETFDA("VUID",$$ZVALUE("VUID"))
     54 . E  D SETFDA("VUID TEXT",$$ZVALUE("VUID TEXT"))
     55 . . ;ZWR C0CA
     56 . D GETN2^C0CRNF("C0CB",176.001,$$ZVALUE("VUID"),"VUID","ALL")
     57 . I $$ZVALUE("RXCUI","C0CB")'="" D  ; RXNORM FOUND
     58 . . S RXFOUND=RXFOUND+1
     59 . . I $$ZVALUE("MEDIATION CODE")="" D  ; THIS IS A NEW CODE
     60 . . . D SETFDA("MEDIATION CODE",$$ZVALUE("RXCUI","C0CB"))
     61 . . . D SETFDA("NEW","Y") ;FLAG RECORD HAS HAVING NEW RXNORM
     62 . . W "RXNORM=",$$ZVALUE("RXCUI","C0CB")," ",$$ZVALUE("STR","C0CB"),!
     63 . . W "VUID TEXT: ",$$ZVALUE("VUID TEXT"),!
     64 . . I $$ZVALUE("VUID TEXT")=$$ZVALUE("STR","C0CB") S TXTMATCH=TXTMATCH+1
     65 . . E  D  ;
     66 . . . D PUSH^GPLXPATH("NOMATCH",$$ZVALUE("VUID TEXT")_"^"_$$ZVALUE("STR","C0CB"))
     67 . . . D SETFDA("RXNORM TEXT",$$ZVALUE("STR","C0CB")) ;
     68 . . . D SETFDA("DIFFERENT TEXT","Y") ;FLAG RECORD FOR DIFFERENT TEXT
     69 . I $$ZVALUE("MEDIATION CODE")=$$ZVALUE("RXCUI","C0CB") D  ;
     70 . . S RXMATCH=RXMATCH+1
     71 . . W "VUID=",$$ZVALUE("VUID")," MATCH RXNORM=",$$ZVALUE("MEDIATION CODE"),!
     72 . D CLEAN^DILF ; MAKE SURE WE ARE CLEANED UP
     73 . S C0CFDA(176.112,"+"_C0CZX_",",.01)=$$ZVALUE("VUID") ; NEW VUID RECORD
     74 . D UPDATE^DIE("","C0CFDA")
     75 . I $D(^TMP("DIERR",$J)) U $P BREAK
    5076 W "HAS RXN=",HASRXN,!
    5177 W "NO RXN=",NORXN,!
    5278 W "NO VUID=",NOVUID,!
     79 W "RXNORM FOUND=",RXFOUND,!
     80 W "RXNORM MATCHES:",RXMATCH,!
     81 W "TEXT MATCHES:",TXTMATCH,!
    5382 Q
    5483 ;
     
    5988 ;
    6089 N C0CSI,C0CSJ
    61  S C0CSI=$$ZFILE(C0CSN,"C0CA") ; FILE NUMBER
    62  S C0CSJ=$$ZFIELD(C0CSN,"C0CA") ; FIELD NUMBER
    63  S C0CFDA(C0CZX,C0CSI,C0CZX_",",C0CSJ)=C0CSV
     90 S C0CSI=$$ZFILE(C0CSN,"C0CC") ; FILE NUMBER
     91 S C0CSJ=$$ZFIELD(C0CSN,"C0CC") ; FIELD NUMBER
     92 S C0CFDA(C0CSI,"+"_C0CZX_",",C0CSJ)=C0CSV
    6493 Q
    6594ZFILE(ZFN,ZTAB) ; EXTRINSIC TO RETURN FILE NUMBER FOR FIELD NAME PASSED
     
    6796 ; IF ZTAB IS NULL, IT DEFAULTS TO C0CA
    6897 I '$D(ZTAB) S ZTAB="C0CA"
    69  Q $P(@ZTAB@(ZFN),"^",1)
     98 N ZR
     99 I $D(@ZTAB@(ZFN)) S ZR=$P(@ZTAB@(ZFN),"^",1)
     100 E  S ZR=""
     101 Q ZR
    70102ZFIELD(ZFN,ZTAB) ;EXTRINSIC TO RETURN FIELD NUMBER FOR FIELD NAME PASSED
    71103 ; BY VALUE IN ZFN. FILE NUMBER IS PIECE 2 OF C0CA(ZFN)
    72104 ; IF ZTAB IS NULL, IT DEFAULTS TO C0CA
    73105 I '$D(ZTAB) S ZTAB="C0CA"
    74  Q $P(@ZTAB@(ZFN),"^",2)
     106 N ZR
     107 I $D(@ZTAB@(ZFN)) S ZR=$P(@ZTAB@(ZFN),"^",2)
     108 E  S ZR=""
     109 Q ZR
     110 ;
    75111ZVALUE(ZFN,ZTAB) ;EXTRINSIC TO RETURN VALUE FOR FIELD NAME PASSED
    76112 ; BY VALUE IN ZFN. FILE NUMBER IS PIECE 3 OF C0CA(ZFN)
    77113 ; IF ZTAB IS NULL, IT DEFAULTS TO C0CA
    78114 I '$D(ZTAB) S ZTAB="C0CA"
    79  Q $P(@ZTAB@(ZFN),"^",3)
     115 N ZR
     116 I $D(@ZTAB@(ZFN)) S ZR=$P(@ZTAB@(ZFN),"^",3)
     117 E  S ZR=""
     118 Q ZR
    80119 ;
Note: See TracChangeset for help on using the changeset viewer.