Print Page as PDF
LEXU (ICD-10 UPDATE) ICR (5679)

LEXU (ICD-10 UPDATE)    ICR (5679)

Name Value
NUMBER 5679
IA # 5679
DATE CREATED 2011/06/03
CUSTODIAL PACKAGE LEXICON UTILITY
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE LEXU
NAME LEXU (ICD-10 UPDATE)
GENERAL DESCRIPTION
This is an addendum to ICR 1573 and contains functions
added to LEXU during the implementation of ICD-10 Coding system. The APIs in
this ICR become effective on the date of release of patches ICD*18.0*57 and
LEX*2.0*80.

STATUS Active
KEYWORDS
  • ICD-10
  • LEXU
  • D10ONE
  • P10ONE
  • D10
  • ONE
  • ALL
  • IMPDATE
  • ICD10
  • DX
DURATION Till Otherwise Agreed
ID LEXU
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
$$D10ONE(IEN,DATE)
Returns either a single active ICD-10 Diagnosis code
linked to the Lexicon expression or Null if no ICD-10 Diagnosis code is found.

VARIABLES TYPE VARIABLES DESCRIPTION
IEN Input
Internal Entry Number in the Expression file
^LEX(757.01).

DATE Input
This is a date in Fileman format used to check if a
code is active or inactive on a specified date. If not supplied, it will
default to TODAY.

$$D10ONE Output
A single active ICD-10 Diagnosis code or Null if no
ICD-10 Diagnosis code is found.

$$D10(IEN,DATE)
Returns either a string of active ICD-10 Diagnosis
codes linked to an expression (separated by semicolon, i.e.,
ICD10;ICD10;ICD10) or Null If no ICD-10 Diagnosis codes are found.

VARIABLES TYPE VARIABLES DESCRIPTION
IEN Input
Internal Entry Number in the Expression file
^LEX(757.01).

DATE Input
This is a date in Fileman format used to check if a
code is active or inactive on a specified date. If not supplied, it will
default to TODAY.

$$D10 Output
A string of active ICD-10 Diagnosis codes linked to
an expression (separated by semicolon, i.e., ICD.10;ICD.10;ICD.10) or Null if
no ICD-10 Diagnosis codes are found.

$$P10ONE(IEN,DATE)
Returns either a single active ICD-10 Procedure code
linked to the Lexicon expression or Null if no icd-10 Procedure code is found.

VARIABLES TYPE VARIABLES DESCRIPTION
IEN Input
Internal Entry Number in the Expression file
^LEX(757.01).

DATE Input
This is a date in Fileman format used to check if a
code is active or inactive on a specified date. If not supplied, it will
default to TODAY.

$$P10ONE Output
A single active ICD-10 Procedure code or Null if no
ICD-10 Procedure code is found.

$$ONE(IEN,DATE,SAB)
Returns a single code for a given internal entry
number (IEN) for a specified date and source.

VARIABLES TYPE VARIABLES DESCRIPTION
IEN Input
Internal Entry Number in the Expression file
^LEX(757.01).

DATE Input
This is a date in Fileman format used to check if a
code is active or inactive on a specified date. If not supplied, it will
default to TODAY.

SAB Input
Source, this is an internal entry number in file
757.03 or the 3 character source mnemonic (found on the ASAB cross-reference
in file 757.03) or the SOURCE ABBREVIATION (.01 field in file 757.03)

$$ONE Output
Code - A single code belonging to the specified
coding identified by the input parameter
SAB and was active on the date provided
and linked to the expression (IEN).  or

Null   No code exist for the coding system on the
specified date and for the expression.

$$ALL(IEN,DATE,SAB)
Returns all classification codes for a given internal
entry number (IEN) for a specified date and source.

VARIABLES TYPE VARIABLES DESCRIPTION
IEN Input
Internal Entry Number in the Expression file
^LEX(757.01).

DATE Input
This is a date in Fileman format used to check if a
code is active or inactive on a specified date. If not supplied, it will
default to TODAY.

SAB Input
Source, this is an internal entry number in file
757.03 or the 3 character source mnemonic (found on the ASAB cross-reference
in file 757.03) or the SOURCE ABBREVIATION (.01 field in file 757.03)

$$ALL Output
A string of codes for the source provided (one or
more) delineated by a semi-colon or null if no codes are found for the source.

$$IMPDATE(SAB)
This entry point (extrinsic function) returns the
implementation date for a specified source.

VARIABLES TYPE VARIABLES DESCRIPTION
SAB Input
Source, this is an internal entry number in file
757.03 or the 3 character source mnemonic (found on the ASAB cross-reference
in file 757.03) or the SOURCE ABBREVIATION (.01 field in file 757.03)

$$IMPDATE Output
The date that a coding system was implemented in
VistA in Fileman format.

$$CSYS(SYS,VDT)
This entry point returns information about a coding
system on file in the Coding System file #757.03.

VARIABLES TYPE VARIABLES DESCRIPTION
SYS Input
Coding system identification system and can be in any
of the following formats:

A nickname if one exist, i.e.  HCPCS, DSM,
NANDA, BIRADS

First three characters of source abbreviation
from file 757.03, field .01

Source Abbreviation (file 757.03, field .01),
i.e., ICD9, CPT4, SNM2

Nomenclature (file 757.03, field 1), i.e.,
ICD-9-CM, ICD-10-PCS, NANDA

Type (only for ICD), i.e., "DIAG" or "PROC"
(requires date)

VDT Input
Versioning date in Fileman format used to determine
coding system if only the type is known (DIAG or PROC) and to determine the
correct SDO version if one exists.  If the date is not passed, then TODAY is
used.

$$CSYS Output
A 13 piece caret (^) delimited string

1    IEN
2    SAB (3 character source abbreviation)
3    Source Abbreviation (3-7 char)  (#.01)
4    Nomenclature (2-11 char) (#1)
5    Source Title (2-52 char) (#2)
6    Source (2-50 char) (#3)
7    Entries (numeric) (#4)
8    Unique Entries (numeric) (#5)
9    Inactive Version (1-20 char) (#6)
10    HL7 Coding System (2-40 char) (#7)
11    SDO Version Date (date) (757.08 #.01)
12    SDO Version Id (1-40 char) (757.08 #1)
13    Implementation Date (date) (#11)

$$HIST(CODE,SYS,.ARY)
This entry point returns a codes activation history
in an array passed by reference.

VARIABLES TYPE VARIABLES DESCRIPTION
CODE Input
This is a classification code found in the CODES file
757.02 (Required)

SYS Input
This is a coding system found in the CODING SYSTEMS
file 757.03.  It can be in the form of a pointer, a source abbreviation or the
name of a coding nomenclature (Required)

.ARY Both
This is an array of status effective dates and
activation status passed by reference (Required)

ARY(0) = Number of Activation History
ARY(0,0) = Code ^ Source ^ Source Name
ARY(<date>,<status>) = Comment

Status

0  = Inactive
1  = Active

Comments include:

Activated
Inactivated
Re-activated
Revised
Reused

If the date is in the future, the comment will be appended with "(Pending)"
indicating that the action activated, inactivated, etc., hasn't occurred yet.

$$HIST Output
This is the number of activation history entries
found

or

-1 ^ error message

$$PERIOD(CODE,SYS,ARY)
This entry point returns the activation periods
(active from and to) of a code in an array passed by reference.

VARIABLES TYPE VARIABLES DESCRIPTION
CODE Input
This is a classification code found in the CODES file
757.02 (Required)

SYS Input
This is a coding system found in the CODING SYSTEMS
file 757.03.  It can be in the form of a pointer, a source abbreviation or the
name of a coding nomenclature (Required)

.ARY Both
This is an array of activation periods (including
active on date and inactive on date when inactive) passed by reference
(Required)

ARY(0)   6 piece "^" delimited string

1  Number of Activation Periods found
2  Coding System (pointer to file 775.03)
3  Coding System Abbreviation
4  Coding System Nomenclature
5  Coding System Full Name
6  Coding System Source

or

-1 ^ Message (no period or error)

ARY(Activation Date) = 4 piece "^" delimited string

1  Inactivation Date
(conditional)

2  Pointer to Expression file 757.01
for the code in piece #2 above
(required)

3  Variable Pointer IEN;Root of a
national file (see below)  Include
when the code exist in an national
file (conditional)

CPT Procedure code    IEN;ICPT(
ICD Diagnosis code    IEN;ICD9(
ICD Procedure code    IEN;ICD0(

4  Short Description from the SDO file
(CPT or ICD)

ARY(Activation Date,0) = Lexicon Expression

$$PERIOD Output
This is the number of activation periods found:

Same as output variable ARY(0)

or

-1 ^ error message

$$DX(IEN,VDT)
This entry point is to be used as a screen Lexicon
searches. It will screen out all terms not linked to either an ICD-9 or ICD-10
code.  The code type (ICD-9 or ICD-10) is determined by date.  If the date
passed in is before the ICD-10 implementation date then it will screen on
ICD-9 codes.  If the date is on or after the ICD-10 implementation date then
it will screen on ICD-10 codes.

Assuming the variable VDT is a valid Fileman format date:

Screen on ICD Diagnosis

S DIC("S")="I $$DX^LEXU(+Y,VDT)"

VDT is before ICD-10 implementation = ICD-9
VDT is on or after ICD-10 implementation = ICD-10

If the date is not passed, then TODAY is used.

VARIABLES TYPE VARIABLES DESCRIPTION
IEN Input
This is an internal entry number in the expression
file 757.01.  When performing Fileman lookups, set it to the variable +Y.
(Required)

VDT Input
This is the versioning date against which the codes
found by the search will be compared in order to determine whether the code is
active or inactive.  Additionally if the date passed is earlier that the
ICD-10 implementation date then the screen will only condider ICD-9 codes.  If
the date is on or after the ICD-10 implementation date then the screen will
only consider ICD-10 codes.  If the date is not passed, then TODAY's date will
be used.  (Optional)

$$DX Output
This is a Boolean value:

$$DX = 1 (true) if the Lexicon entry is linked
to an active ICD code of the type specified by the
input parameter TYPE.

$$DX = 0 (false) if the Lexicon entry is not
linked to an active ICD code of the type specified
by the input parameter TYPE.

$$CSDATA(CODE,CSYS,VDT,.ARY)
This entry point returns information about a code
from a specified coding system.  It is intended to be similar to
ICDDATA^ICDXCODE except it is not limited to ICD coding systems.

VARIABLES TYPE VARIABLES DESCRIPTION
CODE Input
This is a code found in file 757.02 (CODES file).

CSYS Input
This is a pointer to the CODING SYSTEMS file 757.03
that identifies the coding system that CODE belongs to.  It is important to
specify the coding system because some codes overlap various coding systems.

VDT Input
This is the date that will be used to determine the
status of the code in the CODE input parameter.  The status will either be
Inactive or Active.

.ARY Both
This is the name of a local array passed by reference
that will contain the output.

ARY()

Lexicon Data

ARY("LEX",1)         IEN ^ Preferred Term
ARY("LEX",2)         Status ^ Effective Date
ARY("LEX",3)         IEN ^ Major Concept Term
ARY("LEX",4)         IEN ^ Fully Specified Name
ARY("LEX",5)         Hierarchy (if it exists)
ARY("LEX",6,0)       Synonyms/Other Forms
ARY("LEX",6,1)         Synonym #1
ARY("LEX",6,n)         #n
ARY("LEX",7,0)       Semantic Map
ARY("LEX",7,1,1)       Class ^ Type (internal)
ARY("LEX",7,1,2)       Class ^ Type (external)
ARY("LEX",7,1,n)       #n
ARY("LEX",7,1,n)       #n
ARY("LEX",8)         Deactivated Concept Flag

Coding System Data

ARY("SYS",1)         IEN
ARY("SYS",2)         Short Name
ARY("SYS",3)         Age High
ARY("SYS",4)         Age Low
ARY("SYS",5)         Sex
ARY("SYS",6,0)       MDC/DRG Pairing
ARY("SYS",6,1,1)       MDC
ARY("SYS",6,1,2)       DRGs
ARY("SYS",6,n,1)       #n
ARY("SYS",6,n,2)       #n
ARY("SYS",7)         Complication/Comorbidity
ARY("SYS",8)         MDC13
ARY("SYS",9)         MDC24
ARY("SYS",10)        MDC24
ARY("SYS",11)        Unacceptable as Principal Dx
ARY("SYS",12)        Major O.R. Procedure
ARY("SYS",13)        Procedure Category
ARY("SYS",14,0)      Description
ARY("SYS",14,1)        Text 1
ARY("SYS",14,n)        #n

Each data element will be in the following format:

ARY(ID,SUB) = DATA
ARY(ID,SUB,"N") = NAME

Where

ID      Identifier, may be:

"LEX" for Lexicon data
"SYS" for Coding System data

SUB     Numeric Subscript

DATA    This may be:

A value if it applies and is found
Null if it applies but not found
N/A if it does not apply

NAME    This is the common name given to the
data element

Example:

S X=$$CSDATA^LEXU("C18.6",30,3141010,.ARY)

X=1

ARY("LEX",1)="267081^Malignant neoplasm of descending colon"
ARY("LEX",1,"N")="IEN ^ Preferred Term" ARY("LEX",2)="1^3131001"
ARY("LEX",2,"N")="Status ^ Effective Date" ARY("LEX",3)="267081^Malignant
neoplasm of descending colon" ARY("LEX",3,"N")="IEN ^ Major Concept Term"
ARY("LEX",4)="" ARY("LEX",4,"N")="IEN ^ Fully Specified Name" ARY("LEX",5)=""
ARY("LEX",5,"N")="Hierarchy (if exists)" ARY("LEX",6,0)=0
ARY("LEX",6,0,"N")="Synonyms and Other Forms" ARY("LEX",7,0)=1
ARY("LEX",7,0,"N")="Semantic Map" ARY("LEX",7,1,1)="6^47"
ARY("LEX",7,1,1,"N")="Semantic Class ^ Semantic Type (internal)"
ARY("LEX",7,1,2)="Diseases/Pathologic Processes^Disease or Syndrome"
ARY("LEX",7,1,2,"N")="Semantic Class ^ Semantic Type (external)"
ARY("LEX",8)="" ARY("LEX",8,"N")="Deactivated Concept Flag"
ARY("SYS",1)=501148 ARY("SYS",1,"N")="IEN" ARY("SYS",2)="Malignant neoplasm of
descending colon" ARY("SYS",2,"N")="Short Name" ARY("SYS",3)=""
ARY("SYS",3,"N")="Age High" ARY("SYS",4)="" ARY("SYS",4,"N")="Age Low"
ARY("SYS",5)="" ARY("SYS",5,"N")="Sex" ARY("SYS",6,0)=0
ARY("SYS",6,0,"N")="MDC/DRG" ARY("SYS",7)=""
ARY("SYS",7,"N")="Complication/Comorbidity" ARY("SYS",8)=""
ARY("SYS",8,"N")="MDC13" ARY("SYS",9)="" ARY("SYS",9,"N")="MDC24"
ARY("SYS",10)="" ARY("SYS",10,"N")="MDC24" ARY("SYS",11)=""
ARY("SYS",11,"N")="Unacceptable as Principal Dx" ARY("SYS",12)="N/A"
ARY("SYS",13)="N/A" ARY("SYS",14,0)=1 ARY("SYS",14,0,"N")="Description"
ARY("SYS",14,1)="MALIGNANT NEOPLASM OF DESCENDING COLON"

$$CSDATA Output
This is a boolean value:

1 if the API is successful (fully or partial)
0 if the API is unsuccessful

or

-1 ^ Error Message

$$FREQ(TEXT)
This API checks the frequency of use of keywords
contained in a text string in the Lexicon.

VARIABLES TYPE VARIABLES DESCRIPTION
TEXT Input
This is a text string intended as the input for a
Lexicon search.

$$FREQ Output
This is the maximum number of records that must be
inspected during a Lexicon search to find matching entries for the input
search text.

If this number is too high, applications can prompt the user to either
continue with the search or to further refine the search.

$$MAX(SYS)
This API returns the SEARCH THRESHOLD field #12 of
the CODING SYSTEMS file #757.03.

VARIABLES TYPE VARIABLES DESCRIPTION
SYS Input
This is a pointer to the CODING SYSTEM file #757.03.

$$MAX Output
This is the value stored in the SEARCH THRESHOLD
field #12 of the CODING SYSTEMS file 757.03.  This value, along with the value
of $$FREQ^LEXU, can be used to evaluate if a search should continue or be
further refined.

$$FREQ  The maximum number or records to inspect
during a search based on the input text
string.

$$MAX   The maximum number of records to consider
for a coding system before refining the
search.

$$CAT(CODE)
This API returns the category (i.e., header) of an
ICD Diagnosis code.

VARIABLES TYPE VARIABLES DESCRIPTION
CODE Input
This is a valid ICD Diagnosis code.

$$CAT Output
This is the category (or header) to which the ICD
Diagnosis code belongs.

$$ISCAT(CODE)
This API determines if an ICD-10 string is an ICD
category.

VARIABLES TYPE VARIABLES DESCRIPTION
CODE Input
This is a string used to determine if it is an ICD-10
code or a category.

$$CODE Output
This is a 4 piece "^" delimited string containg the
following:

1  Category flag
1 CODE is a Category
0 CODE is not a Category

2  Number of Sub-Categories belonging
to the Category

3  Number of Codes belonging to the
Category

4  Parent Category
Parent Category
Null if no Parent Category

$$PFI(FRAG,CDT,.ARY)
This API returns a local array containing information
about an ICD-10 procedure code fragment.

VARIABLES TYPE VARIABLES DESCRIPTION
FRAG Input
This is a string representing a fragment of an ICD-10
procedure code.  An ICD-10 code is 7 characters long and a code fragment is a
portion of the code starting at character position #1 and not to exceed 6
characters in length.

CDT Input
This is the versioning date used to select an entry
that was appropriate on the date passed.  If no date is passed, TODAY is used.

Busines rules apply, if the date passed is before the implementation date for
ICD-10, then the implementation date is used.

.ARY Both
This is a local array passed by reference that will
contain information about a code fragment.

ARY(0)      5 piece "^" delimited strig
1  Unique Id
2  Code Fragment
3  Date Entered
4  Source
5  Details

ARY(1)      4 piece "^" delimited string
1  Effective Date
2  Status
3  Effective Date External
4  Status External

ARY(2)      Name/Title
ARY(3)      Description
ARY(4)      Explanation
ARY(5,0)    # of synonyms included
ARY(5,n)    Included synonyms

$$PFI Output
This is a success flag

1 on success
-1 ^ error message on error

$$NXSAB(SAB,REV)
This API returns the next Source Abbreviation found
in the CODING SYSTEMS file 757.03 using the ASAB cross-reference.  It is the
equivalent of $O(^LEX(757.03,"ASAB",SAB)).

VARIABLES TYPE VARIABLES DESCRIPTION
SAB Input
This is either a Source Abbreviation (SAB) from the
.01 field of file 757.03 or null value to find the first SAB.

REV Input
This is a reverse flag (optional).  If set to 1 the
API will find the next Source Abbreviation in the reverse order (aka, previous
SAB)

$$NXSAB Output
This is either the next Source Abbreviation (SAB)
previous SAB (when reverse flag set to 1) or null if the input parameter SAB
has no next SAB.

$$RECENT(SAB)
This API returns a boolean valued flag to indicate if
the coding system identified by the source abbreviation has been recently
updated with in a 90 day window (looking forward by 30 days and to the past by
60 days).  This is to evaluate if a coding system was updated by a quarterly
patch, and may be used to trigger an code set update protocol.

VARIABLES TYPE VARIABLES DESCRIPTION
SAB Input
This is either a 3 character source abbreviation
taken from the .01 field of the CODING SYSTEM file 757.03 or a pointer to the
CODING SYSTEM file 757.03.

$$RECENT Output
This is a Boolean valued flag.

1   indicates the Coding System has been recently
updated by a quarterly update by looking 30 days
into the future and 60 days for a change made
to the coding system.

0   indicate the Coding System has NOT been recently
updated by a quarterly update.

$$RUPD(SAB)
This API returns a date the coding system identified
by the source abbreviation has been updated based on a recent date (TODAY+3).
This is to evaluate if a coding system was updated by a quarterly patch, and
may be used to trigger an code set update protocol.

VARIABLES TYPE VARIABLES DESCRIPTION
SAB Input
This is either a 3 character source abbreviation
taken from the .01 field of the CODING SYSTEM file 757.03 or a pointer to the
CODING SYSTEM file 757.03.

$$RUPD Output
This is date found for the last update to a coding
system based on a recent date (TODAY+30)

$$LUPD(SAB,DATE)
This API returns the last date the coding system
identified by the source abbreviation has been updated based on the date
supplied (optional).  If no date is supplied, the last date will be returned.

VARIABLES TYPE VARIABLES DESCRIPTION
SAB Input
This is either a 3 character source abbreviation
taken from the .01 field of the CODING SYSTEM file 757.03 or a pointer to the
CODING SYSTEM file 757.03.

DATE Input
This is a date to use to retrieve the last update for
a coding system (optional)

$$LUPD Output
This is date found for the last update to a coding
system based on a recent passed or the last date updated if a date is not
passed.

$$PAR(TXT,.ARY)
This API takes a string of text and parses the string
into words using the parsing logic used by the Lexicon search engine.

VARIABLES TYPE VARIABLES DESCRIPTION
TXT Input
This is a text string intended as the input for a
Lexicon search and will be parsed into words and placed in a local array
(Required)

.ARY Input
Local array, passed by reference

$$PAR Output
This is the number of words parsed from the text

ARY Output
This is a local array containing the words parsed
from the input text.  The words are arranged in the order they are found in
the text; in alphabetical order; and in the order they are used in the Lexicon
search (frequency order)

Total words found

ARY(0)=#

Words listed in the order they appear in the input variable TXT

ARY(1)=WORD1
ARY(n)=WORDn

Words listed alphabetically with the frequency of occurrence in the Lexicon

ARY("B",WORDA)=# (Frequency of Use)
ARY("B",WORDB)=#

Words listed in the frequency order.  This is the order the words will be used
by the Lexicon search engine, starting with the least frequently used word and
ending with the most frequently used word.

ARY("L",1)=SEARCHWORD1
ARY("L",n)=SEARCHWORDn

$$SCT(IEN,DATE)
This entry point is a screen used during searches to
return terms with SNOMED CT codes that are not classified as Veterinary.

VARIABLES TYPE VARIABLES DESCRIPTION
IEN Input
Internal Entry Number in the Expression file
^LEX(757.01).

DATE Input
This is a date in Fileman format used to check if a
code is active or inactive on a specified date. If not supplied, it will
default to TODAY.

$$SCT Output
This is a Boolean value:

$$SCT = 1 (true) if the Lexicon entry is

Linked to an active SNOMED CT code
and the term is not a Veterinary term

$$SCT = 0 (false) if the Lexicon entry is

Not linked to an SNOMED CT code
or the SNOMED CT code is inactive
or the term is a Veterinary term

Excludes terms semantically typed as a Veterinary term.

DATE ACTIVATED 2014/07/11