Changeset 322 for ccr/trunk


Ignore:
Timestamp:
Jan 11, 2009, 2:14:30 AM (15 years ago)
Author:
George Lilly
Message:

More work on CCRMED6 (RPMS Med Processing)

Location:
ccr/trunk/p
Files:
4 edited

Legend:

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

    r321 r322  
    9797 . ;
    9898 . N VUID,RXNIEN,RXNORM,SRCIEN,RXNNAME,RXNVER
    99  . I NDFIEN D
     99 . I NDFIEN,$D(^C0CRXN) D  ; $Data is for Systems that don't have our RxNorm file yet.
    100100 . . S VUID=$$GET1^DIQ(50.68,VAPROD,99.99)
    101101 . . S RXNIEN=$$FIND1^DIC(176.001,,,VUID,"VUID")
  • ccr/trunk/p/CCRMEDS2.m

    r321 r322  
    112112 . . ; To protect against failure, I will put an if/else block
    113113 . . N VUID,RXNIEN,RXNORM,SRCIEN,RXNNAME,RXNVER
    114  . . I NDFIEN D
     114 . . I NDFIEN,$D(^C0CRXN) D  ; $Data is for Systems that don't have our RxNorm file yet.
    115115 . . . S VUID=$$GET1^DIQ(50.68,VAPROD,99.99)
    116116 . . . S RXNIEN=$$FIND1^DIC(176.001,,,VUID,"VUID")
  • ccr/trunk/p/CCRMEDS3.m

    r321 r322  
    105105 . . ; To protect against failure, I will put an if/else block
    106106 . . N VUID,RXNIEN,RXNORM,SRCIEN,RXNNAME,RXNVER
    107  . . I NDFIEN D
     107 . . I NDFIEN,$D(^C0CRXN) D  ; $Data is for Systems that don't have our RxNorm file yet.
    108108 . . . S VUID=$$GET1^DIQ(50.68,VAPROD,99.99)
    109109 . . . S RXNIEN=$$FIND1^DIC(176.001,,,VUID,"VUID")
  • ccr/trunk/p/CCRMEDS6.m

    r320 r322  
    7676 . ; We need to get DUZ from filman file 52 (Prescription)
    7777 . ; Field 4;; IEN is Piece 1 of Meds stripped of trailing characters.
    78  . S @MAP@("MEDSOURCEACTORID")="ACTORPROVIDER_"_$$GET1^DIQ(52,+$P(MEDS(MEDCNT),U),4,"I")
     78 . N RXIEN S RXIEN=+$P(MEDS(MEDCNT),U)
     79 . S @MAP@("MEDSOURCEACTORID")="ACTORPROVIDER_"_$$GET1^DIQ(52,RXIEN,4,"I")
    7980 . S @MAP@("MEDPRODUCTNAMETEXT")=$P(MEDS(MEDCNT),U,3)
    80  . ; Here we get the RxNorm information
    81  . S @MAP@("MEDPRODUCTNAMECODEVALUE")=MED(27)
    82  . S @MAP@("MEDPRODUCTNAMECODINGINGSYSTEM")="NDC"
    83  . S @MAP@("MEDPRODUCTNAMECODEVERSION")="none"
    84  . S @MAP@("MEDBRANDNAMETEXT")=MED(6.5)
     81 . ; --- RxNorm Stuff
     82 . ; 176.001 is the file for Concepts; 176.003 is the file for
     83 . ; sources (i.e. for RxNorm Version)
     84 . ;
     85 . ; I use 176.001 for the Vista version of this routine (files 1-3)
     86 . ; Since IHS does not have VUID's, I will be getting RxNorm codes
     87 . ; using NDCs. My specially crafted index (sounds evil) named "NDC"
     88 . ; is in file 176.002. The file is called RxNorm NDC to VUID.
     89 . ; Except that I don't need the VUID, but it's there if I need it.
     90 . ;
     91 . ; We obviously need the NDC. That is easily obtained from the prescription.
     92 . ; Field 27 in file 52
     93 . ; N NDC S NDC=$$GET1^DIQ(52,RXIEN,27,"I")
     94 . ; S NDC=$TR(NDC,"-")  ; Remove dashes
     95 . ; NDC="0"_NDC  ; Add an extra zero to front; don't ask, that's how RxNorm has it
     96 . N NDC S NDC=0 ; TODO:Remove this line after I fix the RxNorm 176.002 file.
     97 . N RXNIEN,RXNORM,SRCIEN,RXNNAME,RXNVER
     98 . I +NDC,$D(^C0CRXN) D  ; $Data is for Systems that don't have our RxNorm file yet.
     99 . . S RXNIEN=$$FIND1^DIC(176.002,,,NDC,"NDC")
     100 . . S RXNORM=$$GET1^DIQ(176.002,RXNIEN,.01)
     101 . . S SRCIEN=$$FIND1^DIC(176.003,,"B","RXNORM")
     102 . . S RXNNAME=$$GET1^DIQ(176.003,SRCIEN,6)
     103 . . S RXNVER=$$GET1^DIQ(176.003,SRCIEN,7)
     104 . ;
     105 . E  S (RXNORM,RXNNAME,RXNVER)=""
     106 . ; End if/else block
     107 . S @MAP@("MEDPRODUCTNAMECODEVALUE")=RXNORM
     108 . S @MAP@("MEDPRODUCTNAMECODINGINGSYSTEM")=RXNNAME
     109 . S @MAP@("MEDPRODUCTNAMECODEVERSION")=RXNVER
     110 . ; --- End RxNorm section
     111 . ;
     112 . ; Brand name is 52 field 6.5
     113 . S @MAP@("MEDBRANDNAMETEXT")=$$GET1^DIQ(52,RXIEN,6.5,"I")
     114 . ;
     115 . ; Next I need Med Form (tab, cap etc), strength (250mg)
     116 . ; concentration for liquids (250mg/mL)
     117 . ; Since IHS does not have any of the new calls that
     118 . ; Vista has, I will be doing a crosswalk:
     119 . ; File 52, field 6 is Drug IEN in file 50
     120 . ; File 50, field 22 is VA Product IEN in file 50.68
     121 . ; In file 50.68, I will get the following:
     122 . ; -- 1: Dosage Form
     123 . ; -- 2: Strength
     124 . ; -- 3: Units
     125 . ; -- 8: Dispense Units
     126 . ; -- Conc is 2 concatenated with 3
     127 . ;
    85128 . N MEDIEN S MEDIEN=$P(MED(6),U)
    86129 . D DOSE^PSS50(MEDIEN,,,,,"DOSE")
     
    106149 . S @MAP@("MEDCONCVALUE")=$P(CONCDATA,U,3)
    107150 . S @MAP@("MEDCONCUNIT")=$P(CONCDATA,U,4)
    108  . S @MAP@("MEDSIZETEXT")=$P(NDFDATA(23),U,2)_" "_$P(NDFDATA(24),U,2)
    109151 . S @MAP@("MEDQUANTITYVALUE")=MED(7)
    110152 . ; Oddly, there is no easy place to find the dispense unit.
Note: See TracChangeset for help on using the changeset viewer.