Print Page as PDF
LEX10CS ICR (5681)

LEX10CS    ICR (5681)

Name Value
NUMBER 5681
IA # 5681
DATE CREATED 2011/06/06
CUSTODIAL PACKAGE LEXICON UTILITY
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE LEX10CS
NAME LEX10CS
GENERAL DESCRIPTION
Supported APIs for the implementation of ICD-10. 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
  • ICDSRCH
  • DIAGSRCH
  • PCSDIG
  • CODELIST
  • ICD-10
  • ICD10
DURATION Till Otherwise Agreed
ID LEX10CS
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
$$ICDSRCH(TEXT,.ARRAY,DATE,LEN,FILTER)
This entry point searches for an ICD code and returns
active ICD codes found up to the number defined by the input parameter Length.
If the date is before the ICD-10 implementation date then the search will be
conducted for ICD-9 codes.  If the date passed is on or after the ICD-10
implementation date then the search will be conducted for ICD-10 codes.

VARIABLES TYPE VARIABLES DESCRIPTION
TEXT Input
Text or Code to search for.  (Required)

.ARRAY Input
This is a local output array passed by reference.
(Required)

DATE Input
The date against which the codes found by the search
will be compared in order to determine whether the code is active or inactive.
If not passed, TODAY's date will be used.  (Optional, but when used must be in
FileMan format)

LEN Input
This specifies the length of the list of codes.
Default value is 30.  (Optional)

FILTER Input
This is a filter to apply to the search to screen out
unwanted entries.  It is MUMPS code in the form of a valid IF statement.  It
is the same as Fileman's DIC("S").  (Optional)

$$ICDSRCH Output
2 Piece "^" delimited string the success/error
conditions

A Positive number for successful search not exceeding the Length of the list.

A Negative number for an unsuccessful search or a search condition

-1^No codes found

No codes found and local array not returned

-2^Too many items found, please refine search

The list exceeds the number indicated by LEN,
however, the first LEN of the Array is
returned and the list is marked as a pruned list

ARRAY Output
Output Array passed by reference containing the codes
found

ARRAY(0)=# found ^ Pruning Indicator
ARRAY(1)=CODE ^status effective date
ARRAY(1,"IDL )=ICD Dx long description (if code)
ARRAY(1,"IDL ,1)=ICD Dx IEN ^ effective date
ARRAY(1,"IDS )=ICD Dx short description (if code)
ARRAY(1,"IDS ,1)=ICD Dx IEN ^ effective date
ARRAY(1,"LEX )=Lexicon expression
ARRAY(1,"LEX ,1)=Lexicon IEN ^ effective date
ARRAY(1,"SYN ,1)=synonym #1
ARRAY(1,"SYN",m)=Synonym #m

Pruning Indicator:  If the second piece of ARY(0) is greater than 0, then the
list has been pruned, limiting the list to the length specified by the input
parameter <Len>.

$$DIAGSRCH(TEXT,.ARRAY,DATE,LEN,FILTER)
This entry point searches for an ICD code and returns
active ICD-10 codes found up to the number defined by the input parameter
Length.  This search is similar to $$ICDSRCH^LEX10CS except it only searches
ICD-10 codes.

VARIABLES TYPE VARIABLES DESCRIPTION
TEXT Input
Text or Code to search for.  (Required)

.ARRAY Input
This is a local output array passed by reference.
(Required)

DATE Input
The date against which the codes found by the search
will be compared in order to determine whether the code is active or inactive.
(Optional, but when used must be in FileMan format)

LEN Input
This specifies the length of the list of codes.
Default value is 30.  (Optional)

FILTER Input
This is a filter to apply to the search to screen out
unwanted entries.  It is MUMPS code in the form of a valid IF statement.  It
is the same as Fileman's DIC("S").  (Optional)

$$DIAGSRCH Output
2 Piece "^" delimited string the success/error
conditions

A Positive number for successful search not exceeding the Length of the list.

A Negative number for an unsuccessful search or a search condition

-1^No codes found

No codes found and local array not returned

-2^Too many items found, please refine search

The list exceeds the number indicated by LEN,
however, the first LEN of the Array is
returned and the list is marked as a pruned list

ARRAY Output
Output Array passed by reference containing the
ICD-10 codes found

ARRAY(0)=# found ^ Pruning Indicator
ARRAY(1)=CODE or Category ^ status effective date (code only)
ARRAY(1,"CAT")=Category Name
ARRAY(1,"IDL )=ICD Dx long description (if code)
ARRAY(1,"IDL ,1)=ICD Dx IEN ^ effective date
ARRAY(1,"IDS )=ICD Dx short description (if code)
ARRAY(1,"IDS ,1)=ICD Dx IEN ^ effective date
ARRAY(1,"LEX )=Lexicon expression
ARRAY(1,"LEX ,1)=Lexicon IEN ^ effective date
ARRAY(1,"SYN ,1)=synonym #1
ARRAY(1,"SYN",m)=Synonym #m
ARRAY(1,"MENU")=Menu Text
ARRAY(1,"MSG")=Message (unversioned only)

Notes:

Pruning Indicator:  If the second piece of
ARRAY(0) is greater than 0, then the list
has been pruned, limiting the list to the
length specified by the input parameter LEN.

If there is a message, it can be either:

Inactive mm/dd/yyyy
Pending mm/dd/yyyy

$$PCSDIG(FRAG,DATE)
This entry point takes an ICD-10-PCS code, full or a
partial (code fragment), and  returns a list of all possibilities for the next
character, with any definitions and examples available.  If a full code is
passed (7 characters) it will return the code's long description, and status.

VARIABLES TYPE VARIABLES DESCRIPTION
FRAG Input
This is an ICD-10-PCS Code (7 characters) or a
fragment of an ICD-10-PCS Code (less that 7 characters) (Required)

DATE Input
The date against which the codes found by the search
will be compared in order to determine whether the code is active or inactive.
(Optional, defaults to TODAY)

LEXPCDAT Output
This is both a variable and an array.  If the length
of the FRAG is less than 7, then the array will contain the next level of
choices and associated data.  If the length of the FRAG is equal to 7, then a
fully specified code has been passed and the array will contain the long
description, status and effective date of the code.

If the string FRAG is a valid code fragment or null, the return value Of
LEXPCDAT will be 1 and the following array will be returned.

LEXPCDAT("NEXLEV ,char1, DESC )=char1 description
LEXPCDAT("NEXLEV ,char2, DESC )=char2 description
LEXPCDAT("NEXLEV ,charn, DESC )=charn description

If the string FRAG is a valid code the return value Of LEXPCDAT will be 1 and
the following array will be returned.

LEXPCDAT("PCSDESC )=long description for code
LEXPCDAT("STATUS )=status_ ^ _effective date

If the string FRAG is a not valid code fragment or null and it is not a valid
code, the return value Of LEXPCDAT will be 0 and no array will be returned.

$$CODELIST(SYS,SPEC,SUB,DATE,LEN,FMT)
This entry point creates a list of active codes based
on an input code mask and date and places the list in a temporary global array
with a subscript specified by the calling application.

VARIABLES TYPE VARIABLES DESCRIPTION
SYS Input
Coding system the Coding Systems file 757.03.  This
can be a pointer, the .01 field or the abbreviated 3 character mnemonic (found
on the ASAB cross-reference (Required)

SPEC Input
This is a code from the coding system or a code mask.

Any character position can be occupied by a question mark "?  to allow any
value in that character position.  The trailing character may be an asterisk
indicating any characters that follow are allowable.  The following are all
valid; C71.0, C71.*, C7?.0 or 02V?0* (Required)

SUB Input
This is a string, preferably in the calling
applications namespace, that will be used as a subscript in a temporary global
array (optional, if not passed CODELIST will be used as a subscript).

^TMP(SUB,$J)

DATE Input
The date against which the codes found by the search
will be compared in order to determine whether the code is active or inactive.

(Optional, but when used, must be in FileMan format)

LEN Input
This specifies the length of the list of codes.
Default value is 30.  (Optional)

FMT Input
List Format (Optional)

0 - (zero) returns a brief listing in the
global array (codes only) (DEFAULT)

1 - returns a detailed listing in the
global  array, includes the code, a
variable pointer the code in a code
set file (i.e., ICD-9, CPT, etc), the
code's effective date, the expression
and the expression IEN from file
#757.01.

$$CODELIST Output
2 Piece "^" delimited string containing

Either:

Piece  Meaning
1    Positive value for success
2    Number of Codes Found

or:

Piece  Meaning
1    Negative number for error or condition
2    Error Message or Condition

Example errors/conditions

-1   Coding system not specified  (First
parameter is missing)
-2   Invalid coding system/source abbreviation
(First parameter not valid)
-3   No search specification (Second parameter
missing)
-4   Insufficient search specification"
(Second parameter too short)
-5   Invalid search specification (Second
parameter invalid)
-6   Number of matches exceeds specified
limit (More matches found, only the
number specified will be returned)

TMP(SUB,$J, Output
This is a global array subscripted as specified by
the calling application, input parameter SUB.  It contains a list of codes
found in either a brief or detailed output.

Brief output array (FMT = 0)

^TMP(SUB,$J,0)=Total n
^TMP(SUB,$J,1)=Code 1
^TMP(SUB,$J,2)=Code 2
^TMP(SUB,$J,n)=Code n


Detailed output array (FMT = 1)

^TMP(SUB,$J,0)=Total n
^TMP(SUB,$J,1)=Code 1
^TMP(SUB,$J,1,1)=Variable Pointer 1 ^ Code 1 ^ date
^TMP(SUB,$J,1,2)=Term 1 IEN ^ Term 1
^TMP(SUB,$J,1,"MSG")=Message (unversioned only)
^TMP(SUB,$J,2)=Code 2
^TMP(SUB,$J,2,1)=Variable Pointer 2 ^ Code 2 ^ date
^TMP(SUB,$J,2,2)=Term 2 IEN ^ Term 2
^TMP(SUB,$J,2,"MSG")=Message (unversioned only)
^TMP(SUB,$J,n)=Code n
^TMP(SUB,$J,n,1)=Variable Pointer n ^ Code n ^ date
^TMP(SUB,$J,n,2)=Term n IEN ^ Term n
^TMP(SUB,$J,n,"MSG")=Message (unversioned only)

Notes:

If the code is found in one of the
VistA Code Set files controlled by
a Standards Development Organization
(SDO) then a variable pointer will
be provided for that code in that
file.  Example of SDO controlled
files include:

ICD DIAGNOSIS file #80
ICD OPERATION/PROCEDURE file #80.1
CPT file #81
DSM file #627.7

If there is a message, it can be either:

Inactive mm/dd/yyyy
Pending mm/dd/yyyy

$$TAX(TEXT,SRC,CDT,SUB,VER)
This API returns codes that qualify for building a
taxonomy.  Originally designed for ICD-10, but modified to include any coding
system (DSM, ICD, SNOMED CT, CPT, etc.)

VARIABLES TYPE VARIABLES DESCRIPTION
TEXT Input
This is the text or code to search for.

SRC Input
This is a string of coding systems delimited by an
"^" up arrow to limit the search to the desired coding systems.  The string
can consist of pointers to the CODING SYSTEM file 757.03 or source
abbreviations.

Using source abbreviations
"ICD^ICP^10D^10P"

Using source pointers to file 757.03
"1^2^30^31"

CDT Input
This a date used processing versioned data.  Also,
when a versioned list is required (input parameter VER=1) it is used to
suppress inactive codes from the list.

SUB Input
This is the name of a subscript to use in the ^TMP
global (optional).  This allows for applications to put the data in their own
namespace.  It also allows for multiple search results to exist.

^TMP(LEXSUB,$J,
^TMP("LEXTAX",$J,    Default

VER Input
This is a boolean flag that indicates if the search
is to be versioned.  If set to 1, only active codes will be returned based on
the date in the CDT input parameter.  If no date, then TODAY is used.

VER = 0  Return active and inactive codes
VER = 1  Version, return active codes only

$$TAX Output
This the number of codes found by the search or -1 ^
with an error message.

TMP(SUB,$J) Output
This is the results of the search saved in the ^TMP
global with the specified subscript:

^TMP(SUB,$J,SRC,(CODE_" "),#)

5 piece "^" delimited string

1   Activation Date (can be a future date)
2   Inactivation Date (can be a future date)
3   Lexicon IEN to Expression File 757.01
4   Variable Pointer to a National file
5   Short Name from a National file

^TMP(SUB,$J,SRC,(CODE_" "),#,0)

2 piece "^" delimited string

1   Code (no spaces)
2   Lexicon Expression

Example:

Search for   "DIFFICULTY IN WALKING" For sources  "ICD^10D"  (ICD-9/10
Diagnosis)

^TMP("TAX",$J,0)=3 ^TMP("TAX",$J,1,"719.7 ",1)=2781001^2791001^
329945^4611;ICD9(^DIFFICULTY IN WALKING ^TMP("TAX",$J,1,"719.7
",1,0)=719.7^Difficulty
in Walking ^TMP("TAX",$J,1,"719.7 ",2)=3031001^3131001^
329945^4611;ICD9(^DIFFICULTY IN WALKING ^TMP("TAX",$J,1,"719.7
",2,0)=719.7^Difficulty
in Walking ^TMP("TAX",$J,1,"781.2 ",1)=2781001^3131001^
48820^5419;ICD9(^ABNORMALITY OF GAIT ^TMP("TAX",$J,1,"781.2
",1,0)=781.2^Abnormality
of Gait ^TMP("TAX",$J,30,"R26.2 ",1)=3131001^^5019306^
521502;ICD9(^Difficulty in walking, not
elsewhere classified ^TMP("TAX",$J,30,"R26.2 ",1,0)=R26.2^Difficulty
in Walking, not elsewhere classified

DATE ACTIVATED 2014/07/11