Changeset 320
- Timestamp:
- Jan 11, 2009, 12:51:09 AM (16 years ago)
- Location:
- ccr/trunk/p
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CRXNRD.m
r312 r320 68 68 D CLOSE^%ZISH("FILE") 69 69 U $P ; reset back to principle device 70 Q71 ;72 READSRC(PATH) ; Open the read RxNorm Sources file: RXNSAB.RRF73 I PATH="" QUIT74 N FILENAME S FILENAME="RXNSAB.RRF"75 D OPEN^%ZISH("FILE",PATH,FILENAME,"R")76 IF POP W "Error reading file..., Please check...",! BREAK77 F I=1:1 Q:$$STATUS^%ZISH D78 . U IO79 . N LINE R LINE80 . IF $$STATUS^%ZISH QUIT81 . U $P W I,! U IO ; Write I to the screen, then go back to reading the file82 . N VCUI,RCUI,VSAB,RSAB,SON,SF,SVER,SCIT ; Fileman fields numbers below83 . S VCUI=$P(LINE,"|",1) ; .0184 . S RCUI=$P(LINE,"|",2) ; 285 . S VSAB=$P(LINE,"|",3) ; 386 . S RSAB=$P(LINE,"|",4) ; 487 . S SON=$P(LINE,"|",5) ; 588 . S SF=$P(LINE,"|",6) ; 689 . S SVER=$P(LINE,"|",7) ; 790 . S SCIT=$P(LINE,"|",25) ; 2591 . ; Remove embedded "^"92 . S SCIT=$TR(SCIT,"^")93 . ; Convert SCIT into an array of 80 characters on each line94 . ; In each line, chop 80 characters off, reset SCIT to be the rest95 . N SCITLINE S SCITLINE=$L(SCIT)\80+196 . F J=1:1:SCITLINE S SCIT(J)=$E(SCIT,1,80) S SCIT=$E(SCIT,81,$L(SCIT))97 . ; Now, construct the FDA array98 . N RXNFDA99 . S RXNFDA(176.003,"+"_I_",",.01)=VCUI100 . S RXNFDA(176.003,"+"_I_",",2)=RCUI101 . S RXNFDA(176.003,"+"_I_",",3)=VSAB102 . S RXNFDA(176.003,"+"_I_",",4)=RSAB103 . S RXNFDA(176.003,"+"_I_",",5)=SON104 . S RXNFDA(176.003,"+"_I_",",6)=SF105 . S RXNFDA(176.003,"+"_I_",",7)=SVER106 . D UPDATE^DIE("","RXNFDA")107 . I $D(^TMP("DIERR",$J)) U $P BREAK108 . ; Now, file WP field SCIT109 . D WP^DIE(176.003,I_",",25,,$NA(SCIT))110 D CLOSE^%ZISH("FILE")111 Q112 70 71
Note:
See TracChangeset
for help on using the changeset viewer.