beginning to write EXPAND^C0CRXN to validate 176.111

This commit is contained in:
george 2008-12-09 01:26:07 +00:00
parent e09a29dceb
commit 430bc594b4
1 changed files with 46 additions and 0 deletions

View File

@ -21,3 +21,49 @@ C0CRXN ; CCDCCR/GPL - CCR RXN utilities; 12/6/08
W !
Q
;
EXPAND ; MAIN ROUTINE TO CREATE THE C0C RXNORM VUID EXPANSION FILE (176.112)
; READ EACH RECORD FROM 176.111 AND USE THE VUID TO LOOK UP THE RXNORM
; CODE FROM 176.001 (RXNORM CONCEPTS)
; POPULATE ALL FIELDS IN 176.112 AND SET "NEW" TO "Y" IF 176.111 DOES NOT
; ALREADY HAVE AN RXNORM CODE.
; ADD THE RXNORM TEXT FIELD TO EVERY RECORD (NOT PRESENT IN 176.111)
; AND COMPARE THE RXNORM TEXT FIELD WITH THE VUID TEXT FIELD, SETTING THE
; "DIFFERENT TEXT" FIELD TO "Y" IF THERE ARE DIFFERENCES
; USES SUPPORT ROUTINES FROM C0CRNF.m
N C0CFDA,C0CA,C0CB,C0CZX ;FDA WORK ARRAY, RNF ARRAYS, AND IEN ITERATOR
N C0CFVA,C0CFRXN ; CLOSED ROOTS FOR SOURCE FILES
N C0CF ; CLOSED ROOT FOR DESTINATION FILE
S C0CVA=$$FILEREF^C0CRNF(176.111) ; C0C PHARMACY VA RXNORM MAPPING FILE
S C0CFRXN=$$FILEREF^C0CRNF(176.001) ; CLOSED ROOT FOR RXNORM CONCEPT FILE
S C0CF=$$FILEREF^C0CRNF(176.112) ; C0C RXNORM VUID MAPPING EXPANSION FILE
W C0CVA,C0CFRXN,C0CF,!
S C0CZX=""
; F S C0CZX=
Q
;
SETFDA(C0CSN,C0CSV) ; INTERNAL ROUTINE TO MAKE AN FDA ENTRY FOR FIELD C0CSN
; TO SET TO VALUE C0CSV.
; C0CFDA,C0CA,C0CZX ARE ASSUMED FROM THE CALLING ROUTINE
; C0CSN,C0CSV ARE PASSED BY VALUE
;
N C0CSI,C0CSJ
S C0CSI=$$ZFILE(C0CSN,"C0CA") ; FILE NUMBER
S C0CSJ=$$ZFIELD(C0CSN,"C0CA") ; FIELD NUMBER
S C0CFDA(C0CZX,C0CSI,C0CZX_",",C0CSJ)=C0CSV
Q
ZFILE(ZFN,ZTAB) ; EXTRINSIC TO RETURN FILE NUMBER FOR FIELD NAME PASSED
; BY VALUE IN ZFN. FILE NUMBER IS PIECE 1 OF C0CA(ZFN)
; IF ZTAB IS NULL, IT DEFAULTS TO C0CA
I '$D(ZTAB) S ZTAB="C0CA"
Q $P(@ZTAB@(ZFN),"^",1)
ZFIELD(ZFN,ZTAB) ;EXTRINSIC TO RETURN FIELD NUMBER FOR FIELD NAME PASSED
; BY VALUE IN ZFN. FILE NUMBER IS PIECE 2 OF C0CA(ZFN)
; IF ZTAB IS NULL, IT DEFAULTS TO C0CA
I '$D(ZTAB) S ZTAB="C0CA"
Q $P(@ZTAB@(ZFN),"^",2)
ZVALUE(ZFN,ZTAB) ;EXTRINSIC TO RETURN VALUE FOR FIELD NAME PASSED
; BY VALUE IN ZFN. FILE NUMBER IS PIECE 3 OF C0CA(ZFN)
; IF ZTAB IS NULL, IT DEFAULTS TO C0CA
I '$D(ZTAB) S ZTAB="C0CA"
Q $P(@ZTAB@(ZFN),"^",3)
;