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


Ignore:
Timestamp:
Jan 4, 2009, 5:55:58 PM (15 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/CCRMEDS1.m

    r204 r312  
    6969 . S @MAP@("MEDSOURCEACTORID")="ACTORPROVIDER_"_$P(MED(4),U)
    7070 . S @MAP@("MEDPRODUCTNAMETEXT")=$P(MED(6),U,2)
    71  . S @MAP@("MEDPRODUCTNAMECODEVALUE")=MED(27)
    72  . S @MAP@("MEDPRODUCTNAMECODINGINGSYSTEM")="NDC"
    73  . S @MAP@("MEDPRODUCTNAMECODEVERSION")="none"
     71 . ; 12/30/08: I will be using RxNorm for coding...
     72 . ; 176.001 is the file for Concepts; 176.003 is the file for
     73 . ; sources (i.e. for RxNorm Version)
     74 . ;
     75 . ; We need the VUID first for the National Drug File entry first
     76 . ; We get the VUID of the drug, by looking up the VA Product entry
     77 . ; (file 50.68) using the call NDF^PSS50, returned in node 22.
     78 . ; Field 99.99 is the VUID.
     79 . ;
     80 . ; We use the VUID to look up the RxNorm in file 176.001; same idea.
     81 . ; Get IEN first using $$FIND1^DIC, then get the RxNorm number by
     82 . ; $$GET1^DIQ.
     83 . ;
     84 . ; I get the RxNorm name and version from the RxNorm Sources (file
     85 . ; 176.003), by searching for "RXNORM", then get the data.
     86 . N MEDIEN S MEDIEN=$P(MED(6),U)
     87 . D NDF^PSS50(MEDIEN,,,,,"NDF")
     88 . N NDFDATA M NDFDATA=^TMP($J,"NDF",MEDIEN)
     89 . N NDFIEN S NDFIEN=$P(NDFDATA(20),U)
     90 . N VAPROD S VAPROD=$P(NDFDATA(22),U)
     91 . ;
     92 . ; NDFIEN is not necessarily defined; it won't be if the drug
     93 . ; is not matched to the national drug file (e.g. if the drug is
     94 . ; new on the market, compounded, or is a fake drug [blue pill].
     95 . ; To protect against failure, I will put an if/else block
     96 . ;
     97 . N VUID,RXNIEN,RXNORM,SRCIEN,RXNNAME,RXNVER
     98 . I NDFIEN D
     99 . . S VUID=$$GET1^DIQ(50.68,VAPROD,99.99)
     100 . . S RXNIEN=$$FIND1^DIC(176.001,,,VUID,"VUID")
     101 . . S RXNORM=$$GET1^DIQ(176.001,RXNIEN,.01)
     102 . . S SRCIEN=$$FIND1^DIC(176.003,,"B","RXNORM")
     103 . . S RXNNAME=$$GET1^DIQ(176.003,SRCIEN,6)
     104 . . S RXNVER=$$GET1^DIQ(176.003,SRCIEN,7)
     105 . ;
     106 . E  S (RXNORM,RXNNAME,RXNVER)=""
     107 . ; End if/else block
     108 . S @MAP@("MEDPRODUCTNAMECODEVALUE")=RXNORM
     109 . S @MAP@("MEDPRODUCTNAMECODINGINGSYSTEM")=RXNNAME
     110 . S @MAP@("MEDPRODUCTNAMECODEVERSION")=RXNVER
     111 . ;
    74112 . S @MAP@("MEDBRANDNAMETEXT")=MED(6.5)
    75  . N MEDIEN S MEDIEN=$P(MED(6),U)
    76113 . D DOSE^PSS50(MEDIEN,,,,,"DOSE")
    77114 . N DOSEDATA M DOSEDATA=^TMP($J,"DOSE",MEDIEN)
     
    81118 . ; $$CPRS^PSNAPIS which returns dosage-form^va class^strengh^unit
    82119 . ; This call takes nodes 1 and 3 of ^PSDRUG(D0,"ND") as parameters
    83  . ; NDF Entry IEN, and VA Product Name
     120 . ; NDF Entry IEN, and VA Product IEN
    84121 . ; These can be obtained using NDF^PSS50 (IEN,,,,,"SUBSCRIPT")
    85  . ; Documented in the same manual.
    86  . D NDF^PSS50(MEDIEN,,,,,"CONC")
    87  . N NDFDATA M NDFDATA=^TMP($J,"CONC",MEDIEN)
    88  . N NDFIEN S NDFIEN=$P(NDFDATA(20),U)
    89  . N VAPROD S VAPROD=$P(NDFDATA(22),U)
     122 . ; These have been collected above.
    90123 . N CONCDATA
    91124 . ; If a drug was not matched to NDF, then the NDFIEN is gonna be ""
Note: See TracChangeset for help on using the changeset viewer.