Print Page as PDF
ETSRXN ICR (6758)

ETSRXN    ICR (6758)

Name Value
NUMBER 6758
IA # 6758
DATE CREATED 2017/04/26
CUSTODIAL PACKAGE ENTERPRISE TERMINOLOGY SERVICE
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE ETSRXN
NAME ETSRXN
GENERAL DESCRIPTION
These API(s) allow access to the RxNorm data that is
contained in the RxNorm files in the Enterprise Terminology Services (ETS)
package.
STATUS Active
ID ETSRXN
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
$$CSDATA(CODE,SYS,CDT,RESULT)
This API allows a user to retrieve information for a
given RXCUI.  Note that this API was modeled after a Lexicon API with a
similar name, and the input and output value match the format of that API as
much as possible.

Example:

>W $$CSDATA^ETSRXN(749151,"RXN",,.ARY) 1

>ZW ARY ARY("LEX",1)="271798^TRI-NORINYL 28 Day Pack" ARY("LEX",1,"N")="IEN ^
Text (STR)" ARY("LEX",2)="1^3170306" ARY("LEX",2,"N")="Status ^ Effective
Date" ARY("LEX",8)="" ARY("LEX",8,"N")="Deactivated Concept"
ARY("RXN",1)="PSN^N^4096" ARY("RXN",1,"N")="Term Type (TTY) ^ Suppression Flag
(Suppress)
^ Content View Flag (CVF)"
VARIABLES TYPE VARIABLES DESCRIPTION
CODE Input
RXCUI (#.01) field from the RxNorm Concept Names and
Sources File (#129.2).
SYS Input
This optional parameter is the coding System to
perform the lookup on. For RxNorm, "RXN" is the only valid value to send. If
not passed in, defaults to "RXN".
CDT Input
This optional parameter is the date in Fileman Format
used to evaluate the status. If not passed in, defaults to TODAY.
.RESULT Both
This is a pass-by-reference parameter used to
indicate the array to return the output results.

The output is returned as:

RESULT("LEX",1)    : Two pieces of data - IEN^ STR RESULT("LEX",1,"N"): "IEN ^
Text (STR)" RESULT("LEX",2)    : Two pieces of data - Activation Status
(1:Active,
2:Inactive)^Activation Effective Date
RESULT("LEX",2,"N"): "Status ^ Effective Date" RESULT("LEX",8)    : Either
Null (Active) or 1 (Inactive) RESULT("LEX",8,"N"): "Deactivated Concept"
RESULT("RXN",1)    : Three pieces of data  - TTY^SUPPRESS^CVF
RESULT("RXN",1,"N"): "Term Type (TTY) ^ Suppression Flag (Suppress)
^ Content View Flag (CVF)" *Note that the "N" values are
the description of the output
$$CSDATA Output
One of three values:
1 - Successful (code exists in LOINC dictionary)
0 - Unsuccessful
or
-1^<message> - Error
$$CSYS(SYS)
This API returns coding system information for
RXNORM. Note that this API was modeled after a Lexicon API with a similar
name, and the input and output value match the format of that API as much as
possible.

Example: >W $$CSYS^ETSRXN("RXN") ^RXN^RXN^RxNorm^RxNorm^National Library of
Medicine^^^^^^^^
VARIABLES TYPE VARIABLES DESCRIPTION
SYS Input
This optional parameter has the coding system to
perform the Lookup on.  For RXNORM, the only valid value is "RXN". If not
passed in, defaults to "RXN".
$$CSYS Output
A delimited string of code system information
1. Not used
2. Three-character Source Abbreviation
3. Source Abbreviation
4. Nomenclature
5. Source Title
6. Source
7. Not used
8. Not used
9. Not used
10. Not used
11. Not used
12. Version ID
13. Implementation Date - Not Used
14. Lookup Threshold - Not Used
$$GETDATA(RXCUI,SUB)
This API retrieves all of the information for the
specified RxNorm Unique ID from the RxNorm Concept Names and Sources (129.2),
RxNorm Simple Concept and Atom Attribites (129.21), RxNorm Related Concepts
(129.22), and RxNorm Semantic Type (129.23) files.

If the RXCUI is valid the RXCUI related data are returned as:

^TMP(SUB,$J,RXCUI,"RXNCONSO")=Count ^TMP(SUB,$J,RXCUI,"RXNCONSO",RXNCONSO
count,0)=IEN^RXCUI^SAB^TTY^CODE^SUPPRESS^CVF
^TMP(SUB,$J,RXCUI,"RXNCONSO",RXNCONSO count,1)=STR

^TMP(SUB,$J,RXCUI,"RXNREL")=Count ^TMP(SUB,$J,RXCUI,"RXNREL",RXNREL
count,0)=IEN^RXCUI1^REL^RXCUI2^RELA^SAB^SUPPRESS^CVF

^TMP(SUB,$J,RXCUI,"RXNSAT")=Count ^TMP(SUB,$J,RXCUI,"RXNSAT",RXNSAT
count,0)=IEN^RXCUI^CODE^SAB^SUPPRESS^CVF ^TMP(SUB,$J,RXCUI,"RXNSAT",RXNSAT
count,1)=ATN ^TMP(SUB,$J,RXCUI,"RXNSAT",RXNSAT count,2)=ATV

^TMP(SUB,$J,RXCUI,"RXNSTY")=Count ^TMP(SUB,$J,RXCUI,"RXNSTY",RXNSTY
count,0)=IEN^RXCUI^STY^CVF

Example: >W $$GETDATA^ETSRXN(29115,"OUT") 1

^TMP("OUT",27627,29115,"RXCONSO")=3
^TMP("OUT",27627,29115,"RXCONSO",1,0)="12004^29115^RXNORM^BN^29115^N^"
1)="Maalox"
^TMP("OUT",27627,29115,"RXCONSO",2,0)="12005^29115^MMSL^BN^47069^N^"
1)="Maalox"
^TMP("OUT",27627,29115,"RXCONSO",3,0)="12006^29115^MMSL^BN^5604^O^"
1)="Maalox (obsolete)"
^TMP("OUT",27627,29115,"RXNREL")=18
^TMP("OUT",27627,29115,"RXNREL",1,0)="86149^29115^RB^612^has_tradename^RXN
ORM^^"
^TMP("OUT",27627,29115,"RXNREL",2,0)="86150^29115^RB^6581^has_tradename^RX
NORM^^"
^TMP("OUT",27627,29115,"RXNREL",3,0)="86151^29115^RO^210836^has_ingredient
^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",4,0)="86152^29115^RO^210847^has_ingredient
^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",5,0)="86153^29115^RO^210850^has_ingredient
^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",6,0)="86154^29115^RO^210852^has_ingredient
^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",7,0)="86155^29115^RO^366011^has_ingredient
^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",8,0)="86156^29115^RO^367863^has_ingredient
^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",9,0)="86157^29115^RO^571316^has_ingredient
^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",10,0)="86158^29115^RO^571327^has_ingredien
t^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",11,0)="86159^29115^RO^571329^has_ingredien
t^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",12,0)="86160^29115^RO^571331^has_ingredien
t^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",13,0)="86161^29115^RO^1176865^has_ingredie
nt^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",14,0)="86162^29115^RO^1176866^has_ingredie
nt^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",15,0)="86163^29115^RO^1176867^has_ingredie
nt^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",16,0)="86164^29115^RO^1302338^has_ingredie
nt^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",17,0)="86165^29115^RO^1302339^has_ingredie
nt^RXNORM^^"
^TMP("OUT",27627,29115,"RXNREL",18,0)="86166^29115^RO^1302340^has_ingredie
nt^RXNORM^^" ^TMP("OUT",27627,29115,"RXNSAT")=3
^TMP("OUT",27627,29115,"RXNSAT",1,0)="4257^29115^29115^RXNORM^N^"
1)="RXN_ACTIVATED"
2)="01/28/2010"
^TMP("OUT",27627,29115,"RXNSAT",2,0)="4258^29115^29115^RXNORM^N^"
1)="RXN_BN_CARDINALITY"
2)="multi"
^TMP("OUT",27627,29115,"RXNSAT",3,0)="4259^29115^29115^RXNORM^N^"
1)="RXN_OBSOLETED"
2)="12/04/2009"
^TMP("OUT",27627,29115,"RXNSTY")=2
^TMP("OUT",27627,29115,"RXNSTY",1,0)="15479^29115^Inorganic Chemical^"
^TMP("OUT",27627,29115,"RXNSTY",2,0)="15480^29115^Pharmacologic Substance^"
VARIABLES TYPE VARIABLES DESCRIPTION
RXCUI Input
This parameter is the RxNorm Unique ID for every
concept in the RxNorm databases.
SUB Input
Optional parameter that indicates the subscript for
the Temporary Deprecated List Array.  If not passed in, defaults to "ETSDATA".

$$GETDATA Output
Output value to the function.  Either:
1 - successful check
0 - does not exist
or
-1^<error message> - error occurred
$$HIST(CODE,SYS,.RESULT)
This API allows a user to extract the Activation
History for a given RXCUI.

Example: >W $$HIST^ETSRXN(749151,"RXN",.ARY) 1

>ZW ARY ARY(0)=1 ARY(0,0)="271798^RXN^RXNORM^PSN" ARY(0,1)="TRI-NORINYL 28 Day
Pack" ARY(3170306,1)="Activated"
VARIABLES TYPE VARIABLES DESCRIPTION
CODE Input
RXCUI (#.01) field from the RxNorm Concept Names and
Sources File (#129.2).
SYS Input
This optional parameter is the coding System to
perform the lookup on. For RxNorm, "RXN" is the only valid value to send. If
not passed in, defaults to "RXN".
.RESULT Both
Pass by reference parameter that returns the
Activation History information.

RESULT(0)       : Number of Histories Found RESULT(0,0)     : A four-piece "^"
delimited string
1. IEN from RXNCONSO
2. Source Abbreviation - "RXN"
3. Nomenclature - "RXNORM"
4. TTY from RXNCONSO RESULT(0,1):    STR RESULT(<date>,<status>):
Comment
where: date is the date in FileMan internal date format of the
last Activation Status

status is 1 (Active) or 0 (Inactive)

Comment is further information ("Activated", "Inactivated",
"Re-activated", "Revised").  The comment is dependent on
the current and previous statuses.
$$HIST Output
This is the return value of the function.  It can
have one of the following values:
Number of activation history entries found
or
-1 ^ error message
$$NDC2RXN(NDC,SUB)
This API extracts the RxNorm Concept number if a
valid NDC code is provided.

If a NDC code is found in the RxNorm Simple Concept and Atom Attributes Table
(129.21), the results are returned as:

^TMP(SUB,$J,RXCUI Count,0)=IEN^RXCUI^SAB^SUPPRESS

Example:

W $$NDC2RXN^ETSRXN("13668004529","OUT") 1

>D ^%G Global ^TMP("OUT",$J

^TMP("OUT",4471,1,0)="554600^751139^RXNORM^N""
VARIABLES TYPE VARIABLES DESCRIPTION
NDC Input
NDC Code (in the Code field, #.05) field from the
RxNorm Simple Concept and Aton Attributes file (#129.21).
SUB Input
Optional parameter used to specify the subscript used
to store the data in.  If not passed in, the default is "ETSNDC".
$$NDC2RXN Output
One of the following three values:
0 - Component not used
1 - Success, results returned
or
-1^<error message> - Error
$$PERIOD(CODE,SYS,.RESULT)
This API allows a user to view the activation periods
of a given RXCUI.

Example: >W $$PERIOD^ETSRXN(749151,"RXN",.ARY) 1^PSN^RXN^RXNORM^RXNORM

>ZW ARY ARY(0)="1^PSN^RXN^RXNORM^RXNORM" ARY(3170306)="^^271798;ETSRXN(129.2^"
ARY(3170306,0)="TRI-NORINYL 28 Day Pack"
VARIABLES TYPE VARIABLES DESCRIPTION
CODE Input
RXCUI (#.01) field from the RxNorm Concept Names and
Sources File (#129.2).
SYS Input
This optional parameter is the coding System to
perform the lookup on. For RxNorm, "RXN" is the only valid value to send. If
not passed in, defaults to "RXN".
.RESULT Both
Pass by reference parameter that returns the
activation periods.

ARY(0)-Five piece "^" delimited string or -1^Message (no period or error)
1  # of Activation Periods Found
2  Not Used
3  Source Abbreviation ("RXN")
4  Nomenclature ("RXNORM")
5  Source Title ("RXNORM")

RESULT(<Activation Date>): Four-piece "^" string:
1.      Inactivation Date
2.      Not used
3. Variable Pointer to the RXNCONSO file - "<IEN>;ETSRXN(129.2"
4.      Not Used RESULT(<Activation Date>,0): STR
Where: Activation Date is the date the RXCUI and SAB was activated
$$PERIOD Output
This is the same output as returned on the 0 node of
the output array.

Five piece "^" delimited string or -1^Message (no period or error)
1  # of Activation Periods Found
2  Not Used
3  Source Abbreviation ("RXN")
4  Nomenclature ("RXNORM")
5  Source Title ("RXNORM")
$$RXN2OUT(RXCUI,SUB)
This API extracts a VA Unique ID and NDC if a valid
RXCUI is provided.

If the RXCUI is valid the VA Unique ID and NDC are returned as:

^TMP(SUB,$J,RXCUI,"VUID")=Count ^TMP(SUB,$J,RXCUI,"VUID",VUID
Count,0)=IEN^RXCUI^SAB^TTY^VUID^SUPPRESS ^TMP(SUB,$J,RXCUI,"VUID",VUID
Count,1)=STR

^TMP(SUB,$J,RXCUI,"NDC")=Count ^TMP(SUB,$J,RXCUI,"NDC",NDC
Count,0)=IEN^RXCUI^CODE^SAB^SUPPRESS ^TMP(SUB,$J,RXCUI,"NDC",NDC Count,1)=ATN
^TMP(SUB,$J,RXCUI,"NDC",NDC Count,2)=ATV

Example:

>W $$RXN2OUT^ETSRXN(1190692,"OUT") 2^2

^TMP("OUT",9511,1190692,"NDC")=2
^TMP("OUT",9511,1190692,"NDC",1,0)="872342^1190692^4000624^VANDF^O"
1)="NDC"
2)="000002100202"
^TMP("OUT",9511,1190692,"NDC",2,0)="872343^1190692^4000624^VANDF^O"
1)="NDC"
2)="060267074230"
^TMP("OUT",9511,1190692,"VUID")=2
^TMP("OUT",9511,1190692,"VUID",1,0)="434265^1190692^VANDF^CD^4000624^O"
1)="ATROPINE SO4 0.4MG TAB"
^TMP("OUT",9511,1190692,"VUID",2,0)="434269^1190692^VANDF^AB^4000624^O"
1)="ATROPINE SULFATE 0.4MG TAB"
VARIABLES TYPE VARIABLES DESCRIPTION
RXCUI Input
This parameter is the RxNorm Unique ID for every
concept in the RxNorm databases.
SUB Input
Optional parameter that indicates the subscript for
the Temporary Deprecated List Array.  If not passed in, defaults to "ETSOUT".
$$RXN2OUT Output
One of 2 possible values:
# VA Unique IDs found ^ # of NDC Codes found for the requested RXCUI
or
-1^<error message> - Error
$$TAX(VUID,SUB)
This API returns all VUIDs for the products in the
same value set as the valid VUID passed in. If valid values are found, the
results will be returned as described below:

^TMP(SUB,$J, User-Entered VUID ,"VUID")=Count ^TMP(SUB,$J, User-Entered VUID
,"VUID",VUID Count,0)=IEN^RXCUI^SAB^TTY^VUID^SUPPRESS ^TMP(SUB,$J,
User-Entered VUID ,"VUID",VUID Count,1)=STR ^TMP(SUB,$J, User-Entered VUID
,"VUID",VUID Count,2)=ACTIVATION DATE

Example: >W $$TAX^ETSRXN(4001147,"OUT") 1

^TMP("OUT",25599,4001147,"VUID")=1
^TMP("OUT",25599,4001147,"VUID",1,0)="137076^313725^VANDF^IN^4020804^N"
1)="VITAMIN E OIL"
2)="MAR 06, 2017"
VARIABLES TYPE VARIABLES DESCRIPTION
VUID Input
VA Unique ID
SUB Input
This parameter specifies the name of the first
subscript of the TMP global.  If this parameter is not passed in, the default
is "ETSTAX".
$$TAX Output
The number of RXNORM codes found or -1^error message.

$$VUI2RXN(CODE,TTY,SUB)
This API allows a user to extract the RxNorm Concept
number(s) if a valid VA Unique ID is provided.

If a valid VA Unique ID is found in the RxNorm Concept Names and Sources File
(#129.2), the entries will be returned as:

^TMP(SUB,$J,RXCUI Count,0)=IEN^RXCUI^SAB^TTY^CODE^SUPPRESS ^TMP(SUB,$J,RXCUI
Count,1)=STR


Example:

W $$VUI2RXN^ETSRXN(4026525,"CD","OUT") 1

>D ^%G Global ^TMP("OUT",$J
^TMP("OUT",4471,1,0)="273225^751139^VANDF^CD^4026525^N"
1)="LAMOTRIGINE 25MG TAB,35,KIT"
VARIABLES TYPE VARIABLES DESCRIPTION
CODE Input
VA Unique ID (in the Code field, #.04) field from the
RxNorm Concept Names and Sources File (#129.2).
TTY Input
TERM_TYPE TTY (#.03) field from the RxNorm Concept
Names and Sources File (#129.2).
SUB Input
Optional parameter that indicates the subscript for
the Temporary Deprecated List Array.  If not passed in, defaults to "ETSRXN".
$$VUI2RXN Output
Output value to the function.  Either:
1 - successful check
0 - does not exist
or
-1^<error message> - error occurred
$$VUICLASS(VUID,SUB)
This API retrieves the VUIDs for all products sharing
the same ATC drug class as the valid VUID passed in.

If the lookup was successful, the API will return the data in the format
below.

^TMP(SUB,$J, User-Entered VUID ,"VUID")=Count ^TMP(SUB,$J, User-Entered VUID
,"VUID",VUID Count,0)=IEN^RXCUI^SAB^TTY^VUID^SUPPRESS ^TMP(SUB,$J,
User-Entered VUID ,"VUID",VUID Count,1)=STR

Example

>W $$VUICLASS^ETSRXN(4025394,"OUT") 78

^TMP("OUT",25599,4025394,"VUID")=78
^TMP("OUT",25599,4025394,"VUID",1,0)="34736^198051^VANDF^CD^4025402^N"
1)="OMEPRAZOLE 20MG CAP,EC"
^TMP("OUT",25599,4025394,"VUID",2,0)="34737^198051^VANDF^CD^4025403^N"
1)="OMEPRAZOLE 20MG CAP,EC,UD"
^TMP("OUT",25599,4025394,"VUID",3,0)="34738^198051^VANDF^AB^4025402^N"
1)="OMEPRAZOLE 20MG EC CAP"
^TMP("OUT",25599,4025394,"VUID",4,0)="34739^198051^VANDF^AB^4025403^N"
1)="OMEPRAZOLE 20MG EC CAP UD"
^TMP("OUT",25599,4025394,"VUID",5,0)="39642^199119^VANDF^CD^4025400^N"
1)="OMEPRAZOLE 10MG CAP,EC"

<Partial listing displayed>
VARIABLES TYPE VARIABLES DESCRIPTION
VUID Input
VA Unique ID (in the Code field, #.04) field from the
RxNorm Concept Names and Sources File (#129.2).
SUB Input
This parameter specifies the name of the first
subscript of the TMP global.  If this parameter is not passed in, the default
is "ETSCLA".
$$VUICLASS Output
# of RXCUIs found
or -1^<error message> - Error
DATE ACTIVATED 2018/06/08