Changeset 594 for ccr


Ignore:
Timestamp:
Nov 3, 2009, 4:50:44 PM (15 years ago)
Author:
Sam Habiel
Message:

Not quite working RxNorm updater--intermediate version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/C0CRXNRD.m

    r593 r594  
    11C0CRXNRD ; WV/SMH - CCR/CCD PROJECT: Routine to Read RxNorm files;11/15/08
    2  ;;0.1;CCDCCR;nopatch;noreleasedate
     2 ;;0.1;C0C;nopatch;noreleasedate
    33 W "No entry from top" Q
     4IMPORT(PATH)
     5 I PATH="" QUIT
     6 D READSRC(PATH),READCON(PATH),READNDC(PATH)
     7 QUIT
    48 ;
    59DELFILED(FN) ; Delete file data; PEP procedure; only for RxNorm files
     
    2024 D CLOSE^%ZISH("FILE")
    2125 Q I-1
    22 READCON(PATH) ; Open and read concepts file: RXNCONSO.RRF
     26READCON(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
    2329 I PATH="" QUIT
     30 S INCRES=+$G(INCRES) ; if not passed, becomes zero.
    2431 N FILENAME S FILENAME="RXNCONSO.RRF"
    2532 D DELFILED(176.001) ; delete data
     
    3744 . S RXAUI=$P(LINE,"|",8)       ; 1
    3845 . 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
    3952 . S TTY=$P(LINE,"|",13)        ; 3
    4053 . S CODE=$P(LINE,"|",14)       ; 4
     
    5366 . S RXNFDA(176.001,"+"_C0CCOUNT_",",3)=TTY
    5467 . 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")
    5670 . I $D(^TMP("DIERR",$J)) D EN^DDIOL("ERROR") G EX
    5771 . ; Now, file WP field STR
     
    95109 . IF $$STATUS^%ZISH QUIT
    96110 . 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,SCIT ; Fileman fields numbers below
     111 . N VCUI,RCUI,VSAB,RSAB,SON,SF,SVER,SRL,SCIT ; Fileman fields numbers below
    98112 . S VCUI=$P(LINE,"|",1)        ; .01
    99113 . S RCUI=$P(LINE,"|",2)        ; 2
     
    103117 . S SF=$P(LINE,"|",6)          ; 6
    104118 . S SVER=$P(LINE,"|",7)        ; 7
     119 . S SRL=$P(LINE,"|",14)                ; 14
    105120 . S SCIT=$P(LINE,"|",25)       ; 25
    106121 . ; Remove embedded "^"
     
    119134 . S RXNFDA(176.003,"+"_I_",",6)=SF
    120135 . S RXNFDA(176.003,"+"_I_",",7)=SVER
     136 . S RXNFDA(176.003,"+"_I_",",14)=SRL
    121137 . D UPDATE^DIE("","RXNFDA")
    122138 . I $D(^TMP("DIERR",$J)) U $P W "ERR" G EX
Note: See TracChangeset for help on using the changeset viewer.