Changeset 312 for ccr/trunk/p/CCRMEDS3.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/CCRMEDS3.m

    r295 r312  
    2121 Q
    2222 ;
    23 EXTRACT(MINXML,DFN,OUTXML)           ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE
     23EXTRACT(MINXML,DFN,OUTXML) ; Extract medications into provided xml template
    2424 ;
    2525 ; MINXML is the Input XML Template, passed by name
     
    7878 . ; It' node 1, internal form.
    7979 . N MEDIEN S MEDIEN=MED(1,"I")
    80  . I +MEDIEN D
    81  . . S @MAP@("MEDPRODUCTNAMECODEVALUE")=$$GET1^DIQ(50,MEDIEN,31,"E")
    82  . . S @MAP@("MEDPRODUCTNAMECODINGINGSYSTEM")="NDC"
    83  . . S @MAP@("MEDPRODUCTNAMECODEVERSION")="none"
     80 . I +MEDIEN D  ; start of if/else block
     81 . . ; 12/30/08: I will be using RxNorm for coding...
     82 . . ; 176.001 is the file for Concepts; 176.003 is the file for
     83 . . ; sources (i.e. for RxNorm Version)
     84 . . ;
     85 . . ; We need the VUID first for the National Drug File entry first
     86 . . ; We get the VUID of the drug, by looking up the VA Product entry
     87 . . ; (file 50.68) using the call NDF^PSS50, returned in node 22.
     88 . . ; Field 99.99 is the VUID.
     89 . . ;
     90 . . ; We use the VUID to look up the RxNorm in file 176.001; same idea.
     91 . . ; Get IEN first using $$FIND1^DIC, then get the RxNorm number by
     92 . . ; $$GET1^DIQ.
     93 . . ;
     94 . . ; I get the RxNorm name and version from the RxNorm Sources (file
     95 . . ; 176.003), by searching for "RXNORM", then get the data.
     96 . . D NDF^PSS50(MEDIEN,,,,,"NDF")
     97 . . N NDFDATA M NDFDATA=^TMP($J,"NDF",MEDIEN)
     98 . . N NDFIEN S NDFIEN=$P(NDFDATA(20),U)
     99 . . N VAPROD S VAPROD=$P(NDFDATA(22),U)
     100 . . ;
     101 . . ; NDFIEN is not necessarily defined; it won't be if the drug
     102 . . ; is not matched to the national drug file (e.g. if the drug is
     103 . . ; new on the market, compounded, or is a fake drug [blue pill].
     104 . . ; To protect against failure, I will put an if/else block
     105 . . N VUID,RXNIEN,RXNORM,SRCIEN,RXNNAME,RXNVER
     106 . . I NDFIEN D
     107 . . . S VUID=$$GET1^DIQ(50.68,VAPROD,99.99)
     108 . . . S RXNIEN=$$FIND1^DIC(176.001,,,VUID,"VUID")
     109 . . . S RXNORM=$$GET1^DIQ(176.001,RXNIEN,.01)
     110 . . . S SRCIEN=$$FIND1^DIC(176.003,,"B","RXNORM")
     111 . . . S RXNNAME=$$GET1^DIQ(176.003,SRCIEN,6)
     112 . . . S RXNVER=$$GET1^DIQ(176.003,SRCIEN,7)
     113 . . ;
     114 . . E  S (RXNORM,RXNNAME,RXNVER)=""
     115 . . ; End if/else block
     116 . . S @MAP@("MEDPRODUCTNAMECODEVALUE")=RXNORM
     117 . . S @MAP@("MEDPRODUCTNAMECODINGINGSYSTEM")=RXNNAME
     118 . . S @MAP@("MEDPRODUCTNAMECODEVERSION")=RXNVER
     119 . . ;
    84120 . . S @MAP@("MEDBRANDNAMETEXT")=""
    85121 . . D DOSE^PSS50(MEDIEN,,,,,"DOSE")
     
    92128 . . ; NDF Entry IEN, and VA Product Name
    93129 . . ; These can be obtained using NDF^PSS50 (IEN,,,,,"SUBSCRIPT")
    94  . . ; Documented in the same manual.
     130 . . ; Documented in the same manual; executed above.
    95131 . . ;
    96  . . ; If the drug is not matched to the National Drug File
    97  . . ; there will be no NDF Data.
    98  . . N NDFDATA,CONCDATA
    99  . . D NDF^PSS50(MEDIEN,,,,,"CONC")
    100  . . M NDFDATA=^TMP($J,"CONC",MEDIEN)
    101  . . N NDFIEN S NDFIEN=$P(NDFDATA(20),U)
    102  . . N VAPROD S VAPROD=$P(NDFDATA(22),U)
    103132 . . ; If a drug was not matched to NDF, then the NDFIEN is gonna be ""
    104133 . . ; and this will crash the call. So...
     
    130159 . . S @MAP@("MEDQUANTITYVALUE")=""
    131160 . . S @MAP@("MEDQUANTITYUNIT")=""
    132  . ;
     161 . ; End If/Else
    133162 . ; --- START OF DIRECTIONS ---
    134163 . ; Dosage is field 2, route is 3, schedule is 4
Note: See TracChangeset for help on using the changeset viewer.