- Timestamp:
- Nov 3, 2009, 4:50:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CRXNRD.m
r593 r594 1 1 C0CRXNRD ; WV/SMH - CCR/CCD PROJECT: Routine to Read RxNorm files;11/15/08 2 ;;0.1;C CDCCR;nopatch;noreleasedate2 ;;0.1;C0C;nopatch;noreleasedate 3 3 W "No entry from top" Q 4 IMPORT(PATH) 5 I PATH="" QUIT 6 D READSRC(PATH),READCON(PATH),READNDC(PATH) 7 QUIT 4 8 ; 5 9 DELFILED(FN) ; Delete file data; PEP procedure; only for RxNorm files … … 20 24 D CLOSE^%ZISH("FILE") 21 25 Q I-1 22 READCON(PATH) ; Open and read concepts file: RXNCONSO.RRF 26 READCON(PATH,INCRES) ; Open and read concepts file: RXNCONSO.RRF; EP 27 ; PATH ByVal, path of RxNorm files 28 ; INCRES ByVal, include restricted sources. 1 for yes, 0 for no 23 29 I PATH="" QUIT 30 S INCRES=+$G(INCRES) ; if not passed, becomes zero. 24 31 N FILENAME S FILENAME="RXNCONSO.RRF" 25 32 D DELFILED(176.001) ; delete data … … 37 44 . S RXAUI=$P(LINE,"|",8) ; 1 38 45 . S SAB=$P(LINE,"|",12) ; 2 46 . ; If the source is a restricted source, decide what to do based on what's asked. 47 . N SRCIEN S SRCIEN=$$FIND1^DIC(176.003,"","QX",SAB,"B") ; SrcIEN in RXNORM SOURCES file 48 . N RESTRIC S RESTRIC=$$GET1^DIQ(176.003,SRCIEN,14,"I") ; 14 is restriction field; values 0-4 49 . ; If RESTRIC is zero, then it's unrestricted. Everything else is restricted. 50 . ; If user didn't ask to include restricted sources, and the source is restricted, then quit 51 . I 'INCRES,RESTRIC QUIT 39 52 . S TTY=$P(LINE,"|",13) ; 3 40 53 . S CODE=$P(LINE,"|",14) ; 4 … … 53 66 . S RXNFDA(176.001,"+"_C0CCOUNT_",",3)=TTY 54 67 . S RXNFDA(176.001,"+"_C0CCOUNT_",",4)=CODE 55 . D UPDATE^DIE("","RXNFDA") 68 . N RXNIEN S RXNIEN(1)=C0CCOUNT 69 . D UPDATE^DIE("","RXNFDA","RXNIEN") 56 70 . I $D(^TMP("DIERR",$J)) D EN^DDIOL("ERROR") G EX 57 71 . ; Now, file WP field STR … … 95 109 . IF $$STATUS^%ZISH QUIT 96 110 . U $P W I,! U IO ; Write I to the screen, then go back to reading the file 97 . N VCUI,RCUI,VSAB,RSAB,SON,SF,SVER,S CIT ; Fileman fields numbers below111 . N VCUI,RCUI,VSAB,RSAB,SON,SF,SVER,SRL,SCIT ; Fileman fields numbers below 98 112 . S VCUI=$P(LINE,"|",1) ; .01 99 113 . S RCUI=$P(LINE,"|",2) ; 2 … … 103 117 . S SF=$P(LINE,"|",6) ; 6 104 118 . S SVER=$P(LINE,"|",7) ; 7 119 . S SRL=$P(LINE,"|",14) ; 14 105 120 . S SCIT=$P(LINE,"|",25) ; 25 106 121 . ; Remove embedded "^" … … 119 134 . S RXNFDA(176.003,"+"_I_",",6)=SF 120 135 . S RXNFDA(176.003,"+"_I_",",7)=SVER 136 . S RXNFDA(176.003,"+"_I_",",14)=SRL 121 137 . D UPDATE^DIE("","RXNFDA") 122 138 . I $D(^TMP("DIERR",$J)) U $P W "ERR" G EX
Note:
See TracChangeset
for help on using the changeset viewer.