Changeset 581
- Timestamp:
- Oct 21, 2009, 2:13:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CRXNRD.m
r369 r581 68 68 U $P ; reset back to principle device 69 69 QUIT 70 READSRC(PATH) ; Open the read RxNorm Sources file: RXNSAB.RRF 71 I PATH="" QUIT 72 N FILENAME S FILENAME="RXNSAB.RRF" 73 D OPEN^%ZISH("FILE",PATH,FILENAME,"R") 74 IF POP W "Error reading file..., Please check...",! BREAK 75 F I=1:1 Q:$$STATUS^%ZISH D 76 . U IO 77 . N LINE R LINE 78 . IF $$STATUS^%ZISH QUIT 79 . U $P W I,! U IO ; Write I to the screen, then go back to reading the file 80 . N VCUI,RCUI,VSAB,RSAB,SON,SF,SVER,SCIT ; Fileman fields numbers below 81 . S VCUI=$P(LINE,"|",1) ; .01 82 . S RCUI=$P(LINE,"|",2) ; 2 83 . S VSAB=$P(LINE,"|",3) ; 3 84 . S RSAB=$P(LINE,"|",4) ; 4 85 . S SON=$P(LINE,"|",5) ; 5 86 . S SF=$P(LINE,"|",6) ; 6 87 . S SVER=$P(LINE,"|",7) ; 7 88 . S SCIT=$P(LINE,"|",25) ; 25 89 . ; Remove embedded "^" 90 . S SCIT=$TR(SCIT,"^") 91 . ; Convert SCIT into an array of 80 characters on each line 92 . ; In each line, chop 80 characters off, reset SCIT to be the rest 93 . N SCITLINE S SCITLINE=$L(SCIT)\80+1 94 . F J=1:1:SCITLINE S SCIT(J)=$E(SCIT,1,80) S SCIT=$E(SCIT,81,$L(SCIT)) 95 . ; Now, construct the FDA array 96 . N RXNFDA 97 . S RXNFDA(176.003,"+"_I_",",.01)=VCUI 98 . S RXNFDA(176.003,"+"_I_",",2)=RCUI 99 . S RXNFDA(176.003,"+"_I_",",3)=VSAB 100 . S RXNFDA(176.003,"+"_I_",",4)=RSAB 101 . S RXNFDA(176.003,"+"_I_",",5)=SON 102 . S RXNFDA(176.003,"+"_I_",",6)=SF 103 . S RXNFDA(176.003,"+"_I_",",7)=SVER 104 . D UPDATE^DIE("","RXNFDA") 105 . I $D(^TMP("DIERR",$J)) U $P BREAK 106 . ; Now, file WP field SCIT 107 . D WP^DIE(176.003,I_",",25,,$NA(SCIT)) 108 D CLOSE^%ZISH("FILE") 109 Q 110
Note:
See TracChangeset
for help on using the changeset viewer.