Changeset 312 for ccr/trunk/p/CCRMEDS2.m


Ignore:
Timestamp:
Jan 4, 2009, 5:55:58 PM (16 years ago)
Author:
Sam Habiel
Message:

Updated all meds files to use RxNorm codes instead of NDCs.

File:
1 edited

Legend:

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

    r295 r312  
    8585 . ; with that
    8686 . N MEDIEN S MEDIEN=$P(MED(11),U)
    87  . I +MEDIEN>0 D
    88  . . S @MAP@("MEDPRODUCTNAMECODEVALUE")=$$GET1^DIQ(50,MEDIEN,31,"E")
    89  . . S @MAP@("MEDPRODUCTNAMECODINGINGSYSTEM")="NDC"
    90  . . S @MAP@("MEDPRODUCTNAMECODEVERSION")="none"
     87 . I +MEDIEN>0 D  ; start of if/else block
     88 . . ; 12/30/08: I will be using RxNorm for coding...
     89 . . ; 176.001 is the file for Concepts; 176.003 is the file for
     90 . . ; sources (i.e. for RxNorm Version)
     91 . . ;
     92 . . ; We need the VUID first for the National Drug File entry first
     93 . . ; We get the VUID of the drug, by looking up the VA Product entry
     94 . . ; (file 50.68) using the call NDF^PSS50, returned in node 22.
     95 . . ; Field 99.99 is the VUID.
     96 . . ;
     97 . . ; We use the VUID to look up the RxNorm in file 176.001; same idea.
     98 . . ; Get IEN first using $$FIND1^DIC, then get the RxNorm number by
     99 . . ; $$GET1^DIQ.
     100 . . ;
     101 . . ; I get the RxNorm name and version from the RxNorm Sources (file
     102 . . ; 176.003), by searching for "RXNORM", then get the data.
     103 . . D NDF^PSS50(MEDIEN,,,,,"NDF")
     104 . . N NDFDATA M NDFDATA=^TMP($J,"NDF",MEDIEN)
     105 . . N NDFIEN S NDFIEN=$P(NDFDATA(20),U)
     106 . . N VAPROD S VAPROD=$P(NDFDATA(22),U)
     107 . . ;
     108 . . ; NDFIEN is not necessarily defined; it won't be if the drug
     109 . . ; is not matched to the national drug file (e.g. if the drug is
     110 . . ; new on the market, compounded, or is a fake drug [blue pill].
     111 . . ; To protect against failure, I will put an if/else block
     112 . . N VUID,RXNIEN,RXNORM,SRCIEN,RXNNAME,RXNVER
     113 . . I NDFIEN D
     114 . . . S VUID=$$GET1^DIQ(50.68,VAPROD,99.99)
     115 . . . S RXNIEN=$$FIND1^DIC(176.001,,,VUID,"VUID")
     116 . . . S RXNORM=$$GET1^DIQ(176.001,RXNIEN,.01)
     117 . . . S SRCIEN=$$FIND1^DIC(176.003,,"B","RXNORM")
     118 . . . S RXNNAME=$$GET1^DIQ(176.003,SRCIEN,6)
     119 . . . S RXNVER=$$GET1^DIQ(176.003,SRCIEN,7)
     120 . . ;
     121 . . E  S (RXNORM,RXNNAME,RXNVER)=""
     122 . . ; End if/else block
     123 . . S @MAP@("MEDPRODUCTNAMECODEVALUE")=RXNORM
     124 . . S @MAP@("MEDPRODUCTNAMECODINGINGSYSTEM")=RXNNAME
     125 . . S @MAP@("MEDPRODUCTNAMECODEVERSION")=RXNVER
     126 . . ;
    91127 . . S @MAP@("MEDBRANDNAMETEXT")=""
    92128 . . D DOSE^PSS50(MEDIEN,,,,,"DOSE")
     
    99135 . . ; NDF Entry IEN, and VA Product Name
    100136 . . ; These can be obtained using NDF^PSS50 (IEN,,,,,"SUBSCRIPT")
    101  . . ; Documented in the same manual.
    102  . . D NDF^PSS50(MEDIEN,,,,,"CONC")
    103  . . N NDFDATA M NDFDATA=^TMP($J,"CONC",MEDIEN)
    104  . . N NDFIEN S NDFIEN=$P(NDFDATA(20),U)
    105  . . N VAPROD S VAPROD=$P(NDFDATA(22),U)
     137 . . ; Documented in the same manual; executed above.
    106138 . . N CONCDATA
    107139 . . ; If a drug was not matched to NDF, then the NDFIEN is gonna be ""
     
    134166 . . S @MAP@("MEDQUANTITYVALUE")=""
    135167 . . S @MAP@("MEDQUANTITYUNIT")=""
    136  . ;
     168 . ; end of if/else block
    137169 . ;
    138170 . ; --- START OF DIRECTIONS ---
Note: See TracChangeset for help on using the changeset viewer.