- Timestamp:
- Apr 10, 2013, 9:52:03 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/rxnorm/trunk/routines/C0CRXNLK.m
r1615 r1617 1 C0CRXNLK ; VEN/SMH - RxNorm Lookup Utilities ;2013-04- 08 5:00PM1 C0CRXNLK ; VEN/SMH - RxNorm Lookup Utilities ;2013-04-10 7:01 PM 2 2 ;;1.0;RX NORM;;Apr 25, 2012;Build 99 3 3 ;(c) Sam Habiel 2013 … … 9 9 D EN^XTMUNIT($T(+0),1) 10 10 QUIT 11 ; 12 EXIST(RXN) ; $$ Public - Does this RxNorm CUI exist? 13 ; Input: RxNorm CUI by value 14 ; Output: Extrinsic 15 Q ''$D(^C0CRXN(176.001,"B",RXN)) 11 16 ; 12 17 GCN2RXN(GCN) ; $$ Public - Get RxNorm CUI using GCN … … 62 67 ; 63 68 ; 64 VUI2VAP(VUID) ; $$ Public - Get VA Product IEN from VUID69 VUI2VAP(VUID) ; $$ Public - Get VA Product IEN(s) from VUID 65 70 ; Input VUID by Value 66 71 ; Output: Extrinsic 67 Q $$FIND1^DIC(50.68,"","QX",VUID,"AVUID") 72 D FIND^DIC(50.68,,"@","QP",VUID,,"AVUID") ; Find all in VUID index 73 N O S O="" ; Output 74 N I F I=0:0 S I=$O(^TMP("DILIST",$J,I)) Q:'I S O=O_^(I,0)_U ; Concat results together 75 S O=$E(O,1,$L(O)-1) ; remove trailing ^ 76 Q O 68 77 ; 69 78 VUI2VAPT ; @TEST - Get VA Product IEN from VUID … … 80 89 ;;4003335;2756 81 90 ;;4002469;1884 91 ;;4009488;9046^10090 82 92 ;;<<END>> 83 93 ; … … 106 116 ; Output; Caret delimited extrinsic 107 117 ; Un-unit testable 108 N VUIDS S VUIDS=$$RXN2VUI(RXNCUI) ; Get VUID from RXNCUI 109 ; TODO: Decide which VUID to use! 110 N VAPROD S VAPROD=$$VUI2VAP(VUIDS) ; Get VA Product from VUID 111 N MEDS S MEDS=$$VAP2MED(VAPROD) ; Get Meds from VA Product 118 N VUIDS S VUIDS=$$RXN2VUI(RXNCUI) ; Get VUID from RXNCUI (multiple VUIDs per CUI) 119 Q:'VUIDS "" 120 N MEDS S MEDS="" 121 N DONE S DONE=0 122 N I F I=1:1:$L(VUIDS,U) D Q:DONE 123 . N VUID S VUID=$P(VUIDS,U,I) 124 . N VAPRODS S VAPRODS=$$VUI2VAP(VUID) ; Get VA Product from VUID (multiple products per VUID) 125 . I '$L(VAPRODS) S ^SAM(RXNCUI)="TELL SAM",DONE=1 QUIT ; MUST EXIST. Every VUID must have a product to go with it. 126 . N J F J=1:1:$L(VAPRODS,U) D Q:DONE 127 . . N VAPROD S VAPROD=$P(VAPRODS,U,J) 128 . . S MEDS=$$VAP2MED(VAPROD) ; Get Meds from VA Product 129 . . I $L(MEDS) S DONE=1 112 130 QUIT MEDS 113 131 ; … … 271 289 I $$ISBRAND(RXN) S RXN=$$BR2GEN(RXN) 272 290 N ALLBN S ALLBN=$$GEN2BR(RXN) 291 Q:ALLBN="" "" 273 292 N BNNO F BNNO=1:1:$L(ALLBN,U) D 274 293 . N EACHBN S EACHBN=$P(ALLBN,U,BNNO)
Note:
See TracChangeset
for help on using the changeset viewer.