Changeset 304
- Timestamp:
- Dec 10, 2008, 5:15:44 PM (16 years ago)
- Location:
- ccr/trunk/p
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CRNF.m
r303 r304 90 90 91 91 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 IEN92 I ('$D(GNDX))!(GNDX="") S GIEN=GREF ; IF NO INDEX USED, GREF IS THE IEN 93 93 E D ; WE ARE USING AN INDEX 94 94 . ;N ZG -
ccr/trunk/p/C0CRXN.m
r303 r304 31 31 ; "DIFFERENT TEXT" FIELD TO "Y" IF THERE ARE DIFFERENCES 32 32 ; USES SUPPORT ROUTINES FROM C0CRNF.m 33 N C0CFDA,C0CA,C0CB,C0CZX ;FDA WORK ARRAY, RNF ARRAYS, AND IEN ITERATOR34 N C0CFVA,C0CFRXN ; CLOSED ROOTS FOR SOURCE FILES35 N C0CF ; CLOSED ROOT FOR DESTINATION FILE33 ;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 36 36 S C0CVA=$$FILEREF^C0CRNF(176.111) ; C0C PHARMACY VA RXNORM MAPPING FILE 37 ;S C0CFRXN=$$FILEREF^C0CRNF(176.001) ; CLOSED ROOT FOR RXNORM CONCEPT FILE38 ;S C0CF=$$FILEREF^C0CRNF(176.112) ; C0C RXNORM VUID MAPPING EXPANSION FILE39 ;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,! 40 40 S C0CZX=0 41 S (HASRXN,NORXN,NOVUID )=0 ; INITIALIZE COUNTERS41 S (HASRXN,NORXN,NOVUID,RXFOUND,RXMATCH,TXTMATCH)=0 ; INITIALIZE COUNTERS 42 42 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 44 46 . I $$ZVALUE("MEDIATION CODE")="" D 45 47 . . 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")) ; 47 51 . I $$ZVALUE("VUID")="" D ; BAD RECORD 48 52 . . 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 50 76 W "HAS RXN=",HASRXN,! 51 77 W "NO RXN=",NORXN,! 52 78 W "NO VUID=",NOVUID,! 79 W "RXNORM FOUND=",RXFOUND,! 80 W "RXNORM MATCHES:",RXMATCH,! 81 W "TEXT MATCHES:",TXTMATCH,! 53 82 Q 54 83 ; … … 59 88 ; 60 89 N C0CSI,C0CSJ 61 S C0CSI=$$ZFILE(C0CSN,"C0C A") ; FILE NUMBER62 S C0CSJ=$$ZFIELD(C0CSN,"C0C A") ; FIELD NUMBER63 S C0CFDA(C0C ZX,C0CSI,C0CZX_",",C0CSJ)=C0CSV90 S C0CSI=$$ZFILE(C0CSN,"C0CC") ; FILE NUMBER 91 S C0CSJ=$$ZFIELD(C0CSN,"C0CC") ; FIELD NUMBER 92 S C0CFDA(C0CSI,"+"_C0CZX_",",C0CSJ)=C0CSV 64 93 Q 65 94 ZFILE(ZFN,ZTAB) ; EXTRINSIC TO RETURN FILE NUMBER FOR FIELD NAME PASSED … … 67 96 ; IF ZTAB IS NULL, IT DEFAULTS TO C0CA 68 97 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 70 102 ZFIELD(ZFN,ZTAB) ;EXTRINSIC TO RETURN FIELD NUMBER FOR FIELD NAME PASSED 71 103 ; BY VALUE IN ZFN. FILE NUMBER IS PIECE 2 OF C0CA(ZFN) 72 104 ; IF ZTAB IS NULL, IT DEFAULTS TO C0CA 73 105 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 ; 75 111 ZVALUE(ZFN,ZTAB) ;EXTRINSIC TO RETURN VALUE FOR FIELD NAME PASSED 76 112 ; BY VALUE IN ZFN. FILE NUMBER IS PIECE 3 OF C0CA(ZFN) 77 113 ; IF ZTAB IS NULL, IT DEFAULTS TO C0CA 78 114 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 80 119 ;
Note:
See TracChangeset
for help on using the changeset viewer.