Extra NDC resolution functions

This commit is contained in:
sam 2015-03-05 19:22:22 +00:00
parent 1c26e77311
commit 6e277d3a84
1 changed files with 360 additions and 353 deletions

View File

@ -1,5 +1,5 @@
C0CRXNLK ; VEN/SMH - RxNorm Lookup Utilities ;2014-07-22 2:27 PM
;;2.3;RXNORM FOR VISTA;;Jul 22, 2014;Build 10
;;2.3;RXNORM FOR VISTA;;Jul 22, 2014;Build 16
;(c) Sam Habiel 2013
; See accompanying license. Don't use otherwise.
;
@ -82,7 +82,7 @@ RXN2VUIT ; @TEST - Get VUIDs given RxNorm values
N L F L=1:1 N LN S LN=$T(RXN2VUID+L) Q:LN["<<END>>" Q:LN="" D
. N RXN S RXN=$P(LN,";",3)
. N VUIDS S VUIDS=$P(LN,";",4)
. D CHKEQ^XTMUNIT($$RXN2VUI(RXN),VUIDS,"Translation from RXNCUI to VUID failed")
. D CHKEQ^XTMUNIT($P($$RXN2VUI(RXN),U),$P(VUIDS,U),"Translation from RXNCUI to VUID failed")
QUIT
;
RXN2VUID ; @DATA - Data items for previous test
@ -286,10 +286,17 @@ NDC2RXN(NDC) ; $$ Public - Get RxCUI given the NDC
S NDC=$TR(NDC,"-")
N IEN S IEN=$O(^C0CRXN(176.002,"ASAA","RXNORM","NDC",NDC,"")) Q ^(IEN)
;
NDC2RXNT ; @TEST - Test Get RxCUI given the NDC
NDC2RXNT ; @TEST - Test Get RxCUI given the NDC & Get RxCUI given the 50.67 NDC
D CHKEQ^XTMUNIT($$NDC2RXN("30142-0917-71"),198439,"$$NDC2RXN failed")
D CHKEQ^XTMUNIT($$NDC2RXN2("000031868518","VANDF"),996520,"$$NDC2RXN2 failed")
QUIT
;
NDC2RXN2(NDC,SOURCE) ; $$ Public - Get RxCUI given the source
; Input: NDC in any format according to source
; Output: RxNorm Code
I SOURCE="" QUIT ""
N IEN S IEN=$O(^C0CRXN(176.002,"ASAA",SOURCE,"NDC",NDC,"")) Q:IEN ^(IEN) Q ""
QUIT
; ---
;
ISBRAND(RXN) ; $$ Public - Is this RxCUI for a brand drug?