Print Page as PDF
ETSLNC ICR (6731)

ETSLNC    ICR (6731)

Name Value
NUMBER 6731
IA # 6731
DATE CREATED 2017/01/30
CUSTODIAL PACKAGE ENTERPRISE TERMINOLOGY SERVICE
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE ETSLNC
NAME ETSLNC
GENERAL DESCRIPTION
These API(s) allow access to the LOINC data that is
contained in the LOINC files in the Enterprise Terminology Services (ETS)
package.
STATUS Active
KEYWORDS
  • CSDATA
  • CSYS
  • PERIOD
  • HIST
  • TAX
  • CHKCODE
  • GETCODE
  • GETNAME
  • GETSTAT
  • GETREC
  • VERSION
  • COMLST
  • DEPLIST
  • LOINC
ID ETSLNC
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
$$CHKCODE(ETSCODE)
This API checks to see if the LOINC code is in the
LOINC (#129.1) file.

Example:
W $$CHKCODE^ETSLNC(42012)
1
VARIABLES TYPE VARIABLES DESCRIPTION
ETSCODE Input
LOINC CODE (#.01) field from the LOINC (#129.1) file
$$CHKCODE Output
Output value to the function.  Either:
1 - successful check
0 - does not exist
or
-1^<error message> - error occurred
$$COMLST(ETSCOM,ETSSUB)
This API retrieves a list of LOINC codes for a
passed-in component.  It returns both the CODE (#.01) and FULLY SPECIFIED NAME
(#80) fields from the LOINC (#129.1) file.

If $$COMLST^ETSLNC returns a 1 (valid results found), the following global is
also returned, where <ETSSUB> is the value passed in as the second parameter
and the fourth subscript is equal to the CODE (#.01) field from the LOINC
(#129.1) file.

^TMP(<ETSSUB>,$J,"COMP",<CODE>)=FULLY SPECIFIED NAME (#80) field

Example:
>W $$COMLST^ETSLNC(3,"OUT")
1

>D ^%G
Global ^TMP("OUT",$J
^TMP("OUT",857,"COMP",2)="ALMECILLIN:SUSC:PT:ISOLATE:QN:MLC"
3)="ALMECILLIN:SUSC:PT:ISOLATE:ORDQN:MIC"
4)="ALMECILLIN:SUSC:PT:ISOLATE:ORDQN:AGAR DIFFUSION"
5)="ALMECILLIN:TITR:PT:ISOLATE+SER:QN:SBT"
18857)="ALMECILLIN:SUSC:PT:ISOLATE:ORDQN:"
VARIABLES TYPE VARIABLES DESCRIPTION
ETSCOM Input
IEN from the LOINC COMPONENT (#129.11) file.
ETSSUB Input
Optional parameter used to specify the subscript used
to store the data in.  If not passed in, the default is "ETSCOMP".
$$COMLST Output
One of the following three values:
0 - Component not used
1 - Success, results returned
or
-1^<error message> - Error
$$CSDATA(ETSCODE,ETSSYS,ETSCDT,ARY)
This API retrieves information for a specific code in
a database. 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^ETSLNC(1,"LNC",3160101,.ARY)
1

>ZW ARY
ARY("LEX",1)="1^ACYCLOVIR:SUSC:PT:ISOLATE:ORDQN:"
ARY("LEX",1,"N")="IEN ^ Fully Specified Name"
ARY("LEX",2)="1^3150629"
ARY("LEX",2,"N")="Status ^ Effective Date"
ARY("LEX",8)=""
ARY("LEX",8,"N")="Deactivated Concept"
ARY("SYS",1)=1
ARY("SYS",1,"N")="IEN"
ARY("SYS",2)="ACYCLOVIR [SUSCEPTIBILITY]"
ARY("SYS",2,"N")="Long Common Name"
VARIABLES TYPE VARIABLES DESCRIPTION
ETSCODE Input
CODE (#.01) field from the LOINC (#129.1) file
ETSSYS Input
This optional parameter is the coding System to
perform the lookup on. For LOINC, "LNC" is the only valid value to send. If
not passed in, defaults to "LNC".
ETSCDT Input
This optional parameter is the date in Fileman Format
used to evaluate the status. If not passed in, defaults to TODAY.
.ARY Both
This is a pass-by-reference parameter used to
indicate the array to return the output results.

The output is returned as:
ARY("LEX",1): Two pieces of data - IEN^FULLY SPECIFIED NAME (#80)
ARY("LEX",1,"N"): "IEN ^ Fully Specified Name"
ARY("LEX",2): Two pieces of data from the ACTIVATION STATUS subfile -
ACTIVATION STATUS (#1)^ACTIVATION EFFECTIVE DATE (#.01)
ARY("LEX",2,"N"): "Status ^ Effective Date"
ARY("LEX",8): Either Null (Active) or 1 (Inactive)
ARY("LEX",8,"N"): "Deactivated Concept"
ARY("SYS",1): IEN
ARY("SYS",1,"N"): "IEN"
ARY("SYS",2): LONG COMMON NAME (#83)
ARY("SYS",2,"N"): "Long Common Name"
*Note that the "N" values are the description of the output
$$CSDATA Output
One of three values:
1 - Successful (code exist in LOINC dictionary)
0 - Unsuccessful
or
-1^<message> - Error
$$CSYS(ETSYS)
This API returns coding system information for LOINC.
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^ETSLNC()
^LNC^LNC^LOINC^Logical Observation Identifier Names and Codes^ Duke
University Medical Center^^^^^^2.52^3150629^20000
VARIABLES TYPE VARIABLES DESCRIPTION
ETSSYS Input
This optional parameter has the coding system to
perform the Lookup on.  For LOINC, the only valid value is "LNC". If not
passed in, defaults to "LNC".
$$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
14. Lookup Threshold
$$DEPLST(ETSSUB)
This API retrieves the list of deprecated LOINC
codes.

The API returns the list of deprecated LOINC codes in a TMP global with the
first subscript of the TMP specified as a parameter to the function and the
fourth subscript equal to CODE (#.01) field from the LOINC (#129.1) file.

If there are deprecated codes, they are returned as:

^TMP(<ETSSUB>,$J,"DEPRECATED",<CODE>)=FULLY SPECIFIED NAME (#80) field

Example:
>W $$DEPLST^ETSLNC("SAB")
1

>D ^%G
Global ^TMP("SAB",$J
^TMP("SAB",127896,"DEPRECATED",1)="ACYCLOVIR:SUSC:PT:ISOLATE:ORDQN:"
VARIABLES TYPE VARIABLES DESCRIPTION
ETSSUB Input
Optional parameter that indicates the subscript for
the Temporary Deprecated List Array.  If not passed in, defaults to "ETSDEP".
$$DEPLST Output
One of three possible values:
0 - Component Not used
1 - Success, results returned
or
-1^<error message> - Error
$$GETCODE(ETSIEN)
This API retrieves the LOINC code for the IEN that is
passed in.

Example:
>W $$GETCODE^ETSLNC(38553)
38553
VARIABLES TYPE VARIABLES DESCRIPTION
ETSIEN Input
IEN from the LOINC (#129.1) file.
$$GETCODE Output
Return one of two possible values:
CODE (#.01) field from LOINC (#129.1) file
or
-1^<error message>
$$GETNAME(ETSINPT,ETSINTY,.NAME)
This API retrieves the LOINC Name Array, which
includes the FULLY SPECIFIED NAME (#80) and LONG COMMON NAME (#83) fields from
the LOINC (#129.1) file.


Example:
>W $$GETNAME^ETSLNC(3,"C",.NAME)
1

>ZW NAME
NAME("FULLNAME")="ALMECILLIN:SUSC:PT:ISOLATE:ORDQN:MIC"
NAME("LONGNAME")="ALMECILLIN - BY TEST [SUSCEPTIBILITY] BY MINIMUM INHIBITORY
CONCENTRATION (MIC)"
VARIABLES TYPE VARIABLES DESCRIPTION
ETSINPT Input
LOINC Code or IEN
ETSINTY Input
Input Type of the first parameter.  If not passed in,
it defaults to "C". Possible values are:
"C"=LOINC Code
"I"=LOINC IEN
.NAME Both
Pass by reference parameter that specifies the array
to return the LOINC name values.

The return array has two subscripts:
NAME("FULLNAME")=FULLY SPECIFIED NAME (#80) field
NAME("LONGNAME")=LONG COMMON NAME (#83) field
$$GETNAME Output
This is the return value of the function.  It can
have one of three values:
0 - Code or IEN not found
1 - Successfully retrieve Name information
or
-1^<error message> - Error
$$GETREC(ETSINPT,ETSINTY,ETSSUB)
This API retrieves all information about the LOINC
CODE or IEN.

If the lookup was successful, the API will return the data in a TMP global
with the first subscript value determined by the input of the ETSSUB
parameter.  The TMP global will have the following format with the data on
each node being the data for that respective field.

^TMP(<ETSSUB>,$J,"RECORD","ACTIVATION HISTORY",#,"ACTIVATION EFFECTIVE DATE")
"ACTIVATION
HISTORY",#,"ACTIVATION STATUS") ^TMP(<ETSSUB>,$J,"RECORD","ADJUSTMENT")
"CHALLENGE")
"CHANGE REASON")
"CHANGE TYPE")
"CHECK DIGIT")
"CLASS")
"CLASSTYPE")
"CODE")
"COMMENTS") or "COMMENTS",#)
"DATE LAST CHANGED")
"EXAMPLE UCUM UNITS")
"FULLY SPECIFIED NAME")
"IEN")
"LONG COMMON NAME")
"MASTER ENTRY FOR VUID")
"METHOD TYPE")
"NON-PATIENT SPECIMEN")
"PROPERTY")
"REPEAT OBSERVATION")
"SCALE TYPE")
"SHORTNAME")
"SNOMED CODE")
"SOURCE")
"SYSTEM")
"TIME ASPECT")
"TIME MODIFIER")
"UNITS")
"VA COMMON DISPLAY NAME")
"VERSION NUMBER") ^TMP(<ETSSUB>,$J,"RECORD","VUID")
"VUID EFFECTIVE DATE",#,"EFFECTIVE DATE/TIME")
"VUID EFFECTIVE DATE",#,"STATUS")

Example:
>W $$GETREC^ETSLNC(546,"C")
1

>D ^%G
Global ^TMP("ETSREC",$J
^TMP("ETSREC",139688,"RECORD","ACTIVATION HISTORY",1,"ACTIVATION EFFECTIVE
DATE")="3150629^JUN 29, 2015"
"ACTIVATION
STATUS")="1^ACTIVE"
^TMP("ETSREC",139688,"RECORD","ADJUSTMENT")=""
"CHALLENGE")=""
"CHANGE REASON")=""
"CHANGE TYPE")="MIN"
"CHECK DIGIT")=2
"CLASS")="MICRO"
"CLASSTYPE")="1^LABORATORY"
"CODE")="546-2"
"COMMENTS")=""
"DATE LAST CHANGED")="3150508^MAY 08, 2015"
"EXAMPLE UCUM UNITS")=""
"FULLY SPECIFIED
NAME")="STREPTOCOCCUS.BETA-HEMOLYTIC:ACNC:PT:THRT:ORD:ORGANISM SPECIFIC
CULTURE"
"IEN")=546
"LONG COMMON
NAME")="STREPTOCOCCUS.BETA-HEMOLYTIC [PRESENCE] IN THROAT BY ORGANISM SPECIFIC
CULTURE"
"MASTER ENTRY FOR VUID")="YES"
"METHOD TYPE")="ORGANISM SPECIFIC CULTURE"
"NON-PATIENT SPECIMEN")=""
"PROPERTY")="ARBITRARY CONCENTRATION"
"REPEAT OBSERVATION")=""
"SCALE TYPE")="Ordinal"
"SHORTNAME")="B-HEM STREP THROAT QL CULT"
"SNOMED CODE")=""
"SOURCE")="SH"
"SYSTEM")="Throat"
"TIME ASPECT")="POINT"
"TIME MODIFIER")=""
"UNITS")=""
"VA COMMON DISPLAY NAME")=""
"VERSION NUMBER")=""
"VUID")=4683779
^TMP("ETSREC",139688,"RECORD","VUID EFFECTIVE DATE",1,"EFFECTIVE
DATE/TIME")="3050501^MAY 01, 2005"
"STATUS")="1^
VARIABLES TYPE VARIABLES DESCRIPTION
ETSINPT Input
LOINC Code or IEN
ETSINTY Input
Input Type of the first parameter.  If not passed in,
it defaults to "C". Possible values are:
"C"=LOINC Code
"I"=LOINC IEN
ETSSUB Input
This parameter specifies the name of the first
subscript of the TMP global.  If this parameter is not passed in, the default
is "ETSREC".
$$GETREC Output
This is the return value of the function.  It can
have one of three values:
0 - Code or IEN not found
1 - Successfully retrieve LOINC record information
or
-1^<error message> - Error

If records are found, the LOINC record information is returned in a TMP global
as defined in the description of this component.
$$GETSTAT(ETSINPT,ETSINTY)
This API retrieves the current status for a LOINC
Code or IEN.

Example:
>W $$GETSTAT^ETSLNC(38340)
1^DEL
VARIABLES TYPE VARIABLES DESCRIPTION
ETSINPT Input
LOINC Code or IEN
ETSINTY Input
Input Type of the first parameter.  If not passed in,
it defaults to "C". Possible values are:
"C"=LOINC Code
"I"=LOINC IEN
$$GETSTAT Output
This is the return value of the function.  It can
have one of two values:
Internal Status^External Status
or
-1^<Error Message>
$$HIST(ETSCODE,ETSSYS,.ARY)
The API allows a user to extract the Activation
History for a specified LOINC CODE. 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 $$HIST^ETSLNC(2,"LNC",.ARY)
2

>ZW ARY
ARY(0)=1
ARY(0,0)="2^LNC^LOINC"
ARY(3150629,1)="Activated"
VARIABLES TYPE VARIABLES DESCRIPTION
ETSCODE Input
CODE (#.01) field from LOINC (#129.1) file
ETSSYS Input
This is the coding system.  The only valid value is
"LNC".  If not passed in, the default is "LNC".
.ARY Both
Pass by reference parameter that returns the
Activation History information.

ARY(0) = Number of Activation Histories ARY(0,0) = LOINC Code^Source
Abbreviation ("LNC")^Nomenclature ("LOINC") ARY(<Date>,<Status>) = Comment

Where:
Date is the effective date of the status change
Status is activation status ( 0=Inactive, 1=Active)
Comment provide more detail and can be "Activated", "Re-activated", or
"Inactivated". 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
$$PERIOD(ETSCODE,ETSSYS,ARY)
This API allows a user to view the activation periods
of a given code. 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 $$PERIOD^ETSLNC(6110,"LNC",.ARY)
1^^LNC^LOINC^Logical Observation Identifier Names and Codes

>ZW ARY
ARY(0)="1^^LNC^LOINC^Logical Observation Identifier Names and Codes"
ARY(3061026)="^^6110;^ETS(129.1,^ENGLISH PLANTAIN IGE AB [UNITS/VOLUME] IN
SERUM"
ARY(3061026,0)="PLANTAGO LANCEOLATA AB.IGE:ACNC:PT:SER:QN:"
VARIABLES TYPE VARIABLES DESCRIPTION
ETSCODE Input
CODE (#.01) field from LOINC (#129.1) file
ETSSYS Input
This is the coding system.  The only valid value is
"LNC".  If this is not passed in, the default is "LNC".
.ARY 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 ("LNC")
4  Nomenclature ("LOINC")
5  Source Title ("Logical Observation Identifier Names and Codes")

ARY(Activation Date)-Four piece "^" delimited string
1  Inactivation Date
2  NULL (not needed for LOINC)
3  Variable Pointer to the LOINC File (IEN;ETSLNC(129.1,)
4  LONG COMMON NAME (#83) field

ARY(Activation Date,0)=FULLY SPECIFIED NAME (#80) field
$$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 ("LNC")
4  Nomenclature ("LOINC")
5  Source Title ("Logical Observation Identifier Names and Codes")
$$TAX(ETSX,ETSSRC,ETSDT,ETSSUB,ETSVER)
This API allows a user to locate all of the valid
codes in the LOINC database for a given string. 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.

If valid values are found, the results will be returned in the TMP global with
the first subscript equal to the value passed into the ETSSUB parameter and
the fourth subscript equal to CODE (#.01) field from the LOINC (#129.1) file
and containing a trailing space.

^TMP(<ETSSUB>,$J,1,(CODE_" "),#) - Five piece "^" delimited string
1   Activation Date (can be a future date)
2   Inactivation Date (can be a future date)
3   Not Used
4   Variable Pointer to the LOINC file
5   LONG COMMON NAME (#83) field

^TMP(<ETSSUB>,$J,1,(CODE_" "),#,0) - Two piece "^" delimited string
1   LOINC Code - CODE (#.01) field
2   FULLY SPECIFIED NAME (#80) field

Example:
>W $$TAX^ETSLNC("WARFARIN","LNC")
16

>D ^%G
Global ^TMP("LEXTAX",$J
^TMP("LEXTAX",9239,0)=16
^TMP("LEXTAX",9239,1,"12282 ",3)="3150629^^^12282;ETSLNC(129.1,^WARFARIN
[PRESEN CE] IN URINE"
^TMP("LEXTAX",9239,1,"12282 ",3,0)="12282^WARFARIN:THRESHOLD:PT:URINE:ORD:"
^TMP("LEXTAX",9239,1,"29382 ",4)="3150629^^^29382;ETSLNC(129.1,^WARFARIN
[MASS/V OLUME] IN URINE"
^TMP("LEXTAX",9239,1,"29382 ",4,0)="29382^WARFARIN:MCNC:PT:URINE:QN:"
^TMP("LEXTAX",9239,1,"29383 ",5)="3150629^^^29383;ETSLNC(129.1,^WARFARIN
[MASS/V OLUME] IN GASTRIC FLUID"
^TMP("LEXTAX",9239,1,"29383 ",5,0)="29383^WARFARIN:MCNC:PT:GAST FLD:QN:"
^TMP("LEXTAX",9239,1,"39798 ",6)="3150629^^^39798;ETSLNC(129.1,^WARFARIN
[MOLES/ VOLUME] IN SERUM OR PLASMA"
^TMP("LEXTAX",9239,1,"39798 ",6,0)="39798^WARFARIN:SCNC:PT:SER/PLAS:QN:"
^TMP("LEXTAX",9239,1,"4098 ",1)="3150629^^^4098;ETSLNC(129.1,^WARFARIN
[MASS/VOL UME] IN SERUM OR PLASMA"
^TMP("LEXTAX",9239,1,"4098 ",1,0)="4098^WARFARIN:MCNC:PT:SER/PLAS:QN:"
<Partial Listing Displayed>
VARIABLES TYPE VARIABLES DESCRIPTION
ETSX Input
This is the partial Code or Text String to look up.
ETSSRC Input
This is the coding system.  The only valid value is
"LNC".  If this is not passed in, the default is "LNC".
ETSDT Input
Date in FileMan format to use to evaluate the status.
If not passed in, defaults to TODAY.
ETSSUB Input
This parameter will be used as the first subscript of
the TMP global that is returned when there are valid values. If not passed in,
the default will be "LEXTAX".
ETSVER Input
Search criteria - 0 for both Active and Inactive
codes, 1 for Active codes only. If not passed in, defaults to 0.
$$TAX Output
The number of LOINC codes found or -1^error message.
$$VERSION()
This API retrieves the LOINC version.

Example:
>W $$VERSION^ETSLNC()
2.52
VARIABLES TYPE VARIABLES DESCRIPTION
$$VERSION Output
LOINC Version.  The possible return values are:
The current LOINC version
or
Null - No version found/defined
or
-1^error message
DATE ACTIVATED 2018/06/08