Print Page as PDF
VHA UNIQUE ID (VUID) API ICR (4631)

VHA UNIQUE ID (VUID) API    ICR (4631)

Name Value
NUMBER 4631
IA # 4631
DATE CREATED 2005/05/06
CUSTODIAL PACKAGE TOOLKIT
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE XTID
NAME VHA UNIQUE ID (VUID) API
GENERAL DESCRIPTION
API to handle the storage and retrieval of
VUID-assigned data for terms/concepts.

Please consult the VistA document library online to browse examples of its
use.
STATUS Active
KEYWORDS VUID
ID XTID
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
$$GETVUID(TFILE,TFIELD,TIREF)
This extrinsic function retrieves the VHA unique id
(VUID) for a given term/concept reference.

Example:

for terms defined in fields that are SET OF CODES

>S file=2,field=.02,iref="M"

>W $$GETVUID^XTID(file,field,iref)

123456


for terms defined in a single file

>S file=16000009,field=.01,iref="3,"

>W $$GETVUID^XTID(file,field,iref)

123457
VARIABLES TYPE VARIABLES DESCRIPTION
TFILE Input
(required) VistA file/subfile number where
term/concept is defined.
TFIELD Input
(optional) Field number, in TFILE, where term/concept
is defined.

- When not defined, TFIELD defaults to the .01 field number, and it represents
terms defined in the file TFILE.

- When defined, TFIELD must be of type SET OF CODES.
TIREF Input
(required) Internal reference for term/concept.

- For file entries this will be an IENS. For example,
TIREF="5,"

- For sets of codes this will be the internal value of the code.  For
example,
TIREF=3 or
TIREF="f" or
TIREF="M"
$$GETVUID Output
Returns:  Success of operation as

- The VHA unique id (VUID), when successful; or

- "0^<error message>", when unsuccessful
$$SETVUID(TFILE,TFIELD,TIREF,TVUID)
This extrinsic function populates the VHA unique id
(VUID) for a given term/concept reference.

Example:

for terms defined in fields that are SET OF CODES

>S file=2,field=.02,iref="M",vuid=123456

>W $$SETVUID^XTID(file,field,iref,vuid)

1

for terms defined in a single file

>S file=16000009,field=.01,iref="3,",vuid=123457

>W $$SETVUID^XTID(file,field,iref,vuid)

1
VARIABLES TYPE VARIABLES DESCRIPTION
TFILE Input
(required) VistA file/subfile number where
term/concept is defined.
TFIELD Input
(optional) Field number, in TFILE, where term/concept
is defined.
TIREF Input
(required) Internal reference for term/concept.

- For file entries this will be an IENS. For example,
TIREF="5,"

- For sets of codes this will be the internal value of the code.  For
example,
TIREF=3 or
TIREF="f" or
TIREF="M"
TVUID Input
(required) The VHA unique id (VUID) to assign the
given term/concept reference.
$$SETVUID Output
Returns: Success of operation as

- 1, when successful; or

- "0^<error message>", when unsuccessful
$$GETSTAT(TFILE,TFIELD,TIREF,TDATE)
This extrinsic function retrieves the status
information for a given term/concept reference and a specified date/time.

Example:

for terms defined in fields that are SET OF CODES

>S file=2,field=.02,iref="M",datetime=$$NOW^XLFDT

>W $$GETSTAT^XTID(file,field,iref,datetime)

1^3050121.154752^ACTIVE

for terms defined in a single file

>S file=16000009,field=.01,iref="3,",datetime=""

>W $$GETSTAT^XTID(file,field,iref,datetime)

0^3050122.154755^INACTIVE
VARIABLES TYPE VARIABLES DESCRIPTION
TFILE Input
(required) VistA file/subfile number where
term/concept is defined.
TFIELD Input
(optional) Field number, in TFILE, where term/concept
is defined.

- When not defined, TFIELD defaults to the .01 field number, and it represents
terms defined in the file TFILE.

- When defined, TFIELD must be of type SET OF CODES.
TIREF Input
(required) Internal reference for term/concept.

- For file entries this will be an IENS. For example,
TIREF="5,"

- For sets of codes this will be the internal value of the code.  For
example,
TIREF=3 or
TIREF="f" or
TIREF="M"
TDATE Input
(optional) FileMan date/time (defaults to NOW).
$$GETSTAT Output
Returns:  Success of operation as

- status information, when successful, as

"<internal value>^<FileMan effective date/time>^<external value>"

for example,

"0^3050220.115720^INACTIVE"

"1^3050225.115711^ACTIVE"

; or

- "^<error message>", when unsuccessful
$$SETSTAT(TFILE,TFIELD,TIREF,TSTAT,TDATE)
Extrinsic function to store the status and status
date/time for the given term.

Example:

for terms defined in fields that are SET OF CODES

>S file=2,field=.02,iref="M",status=1,datetime=$$NOW^XLFDT

>W $$SETSTAT^XTID(file,field,iref,status,datetime)

1

for terms defined in a single file

>S file=16000009,field=.01,iref="3,",status=1,datetime=$$NOW^XLFDT

>W $$SETSTAT^XTID(file,field,iref,status,datetime)

1
VARIABLES TYPE VARIABLES DESCRIPTION
TFILE Input
(required) VistA file/subfile number where
term/concept is defined.
TFIELD Input
(optional) Field number, in TFILE, where term/concept
is defined.

- When not defined, TFIELD defaults to the .01 field number, and it represents
terms defined in the file TFILE.

- When defined, TFIELD must be of type SET OF CODES.
TIREF Input
(required) Internal reference for term/concept.

- For file entries this will be an IENS. For example,
TIREF="5,"

- For sets of codes this will be the internal value of the code.  For
example,
TIREF=3 or
TIREF="f" or
TIREF="M"
TSTAT Input
(required) The status internal value as

- 0 for INACTIVE; or

- 1 for ACTIVE
TDATE Input
(optional) FileMan date/time (defaults to NOW).
$$SETSTAT Output
Returns: Success of operation as

- 1, when successful; or

- "0^<error message>", when unsuccessful
$$GETMASTR(TFILE,TFIELD,TIREF)
This extrinsic function retrieves the value of the
flag MASTER ENTRY FOR VUID for a given term/concept reference.

Example:

for terms defined in fields that are SET OF CODES

>S file=2,field=.02,iref="M"

>W $$GETMASTR^XTID(file,field,iref)

1

for terms defined in a single file

>S file=16000009,field=.01,iref="3,"

>W $$GETMASTR^XTID(file,field,iref)

0
VARIABLES TYPE VARIABLES DESCRIPTION
TFILE Input
(required) VistA file/subfile number where
term/concept is defined.
TFIELD Input
(optional) Field number, in TFILE, where term/concept
is defined.

- When not defined, TFIELD defaults to the .01 field number, and it represents
terms defined in the file TFILE.

- When defined, TFIELD must be of type SET OF CODES.
TIREF Input
(required) Internal reference for term/concept.

- For file entries this will be an IENS. For example,
TIREF="5,"

- For sets of codes this will be the internal value of the code.  For
example,
TIREF=3 or
TIREF="f" or
TIREF="M"
$$GETMASTR Output
Returns:  Success of operation as

- The internal value of the MASTER ENTRY FOR VUID field, when successful,
as

0 for NO
1 for YES

;or

- "^<error message>", when unsuccessful
$$SETMASTR(TFILE,TFIELD,TIREF,TMASTER)
This extrinsic function stores the value of the flag
MASTER ENTRY FOR VUID for a given term/concept reference.

Example:

for terms defined in fields that are SET OF CODES

>S file=2,field=.02,iref="M",mstrflag=0

>W $$SETMASTR^XTID(file,field,iref,mstrflag)

1

for terms defined in a single file

>S file=16000009,field=.01,iref="3,",mstrflag=1

>W $$SETMASTR^XTID(file,field,iref,mstrflag)

1
VARIABLES TYPE VARIABLES DESCRIPTION
TFILE Input
(required) VistA file/subfile number where
term/concept is defined.
TFIELD Input
(optional) Field number, in TFILE, where term/concept
is defined.

- When not defined, TFIELD defaults to the .01 field number, and it represents
terms defined in the file TFILE.

- When defined, TFIELD must be of type SET OF CODES.
TIREF Input
(required) Internal reference for term/concept.

- For file entries this will be an IENS. For example,
TIREF="5,"

- For sets of codes this will be the internal value of the code.  For
example,
TIREF=3 or
TIREF="f" or
TIREF="M"
TMASTER Input
(required) The internal value flag for the MASTER
ENTRY FOR VUID field, as

- 0 for NO; or

- 1 for YES
$$SETMASTR Output
Returns: Success of operation as

- 1, when successful; or

- "0^<error message>", when unsuccessful
$SCREEN(TFILE,TFIELD,TIREF,TDATE,TCACHE)
This Extrinsic function retrieves the screening
condition for a given term/concept reference and specified date/time.

Example 1 For terms defined in fields that are SET OF CODES:

>S file=2,field=.02,iref="M",datetime=$$NOW^XLFDT

>W $$SCREEN^XTID(file,field,iref,datetime) 0

Example 2 For terms defined in a single file:

>S file=16000009,field=.01,iref="3,",datetime=""

>W $$SCREEN^XTID(file,field,iref,datetime) 0

Example 3 When searching a large file:

>S file=120.52,field=.01,datetime="" >S SCREEN="I
'$$SCREEN^XTID(file,field,Y_"","",datetime,.cached)"
>. . .
>K cached >D LIST^DIC(file,,".01;99.99",,"*",,,,SCREEN,,"LIST","MSG") >K
cached
VARIABLES TYPE VARIABLES DESCRIPTION
TFILE Input
(required) VistA file/subfile number where
term/concept is defined.
TFIELD Input
(optional) Field number, in TFILE, where term/concept
is defined.

- When not defined, TFIELD defaults to the .01 field number, and it represents
terms defined in the file TFILE.

- When defined, TFIELD must be of type SET OF CODES.
TIREF Input
(required) Internal reference for term/concept.

- For file entries this will be an IENS. For example,
TIREF="5,"

- For sets of codes this will be the internal value of the code.  For
example,
TIREF=3 or
TIREF="f" or
TIREF="M"
TDATE Input
(optional) FileMan date/time (defaults to NOW) to
check screening against.
$$SCREEN Output
Returns: The screening condition as

- 0, when term/concept is selectable (i.e. don't screen it out); or

- 1, when term/concept is not selectable (i.e. screen it out)
TCACHE Both
(optional and by-reference) Flag to indicate caching.
Used mainly when defining the "screen" parameter [e.g., DIC("S")] while
searching large files. This will improve the speed of the search.

NOTE: It must be KILLed before initiating each search query (e.g., before
calling the ^DIC).
GETIREF(TFILE,TFIELD,TVUID,TARRAY,TMASTER)
This subroutine searches and returns a list of
terms/concepts for a given VUID (TVUID).  Filtering of the list is applied
when the remaining parameters are defined: TFILE, TFIELD, and TMASTER.

Example:

>N array S array="MYARRAY"

>S file=16000009,field=.01,vuid=12343,master=0

>D GETIREF^XTID(file,field,vuid,array,master)

>ZW MYARRAY

MYARRAY=2 MYARRAY(16000009,.01,"1,")=1^3050202.153242^ACTIVE^0
MYARRAY(16000009,.01,"3,")=0^3050215.07584^INACTIVE^1

When no entries are found, the named array is not populated

When an error occurs, the named array is populated as follows:

>ZW MYARRAY

MYARRAY("ERROR")="<error message>"
VARIABLES TYPE VARIABLES DESCRIPTION
TFILE Input
(optional) VistA file/subfile number where
term/concept is defined.

- When defined, the search is limited to those term/concepts that exist
in that file and have the VUID assigned to TVUID.

- When not defined, the search will include term/concepts that have the
VUID assigned to TVUID and may exist in both file terms and in SET OF
CODES terms.
TFIELD Input
(optional) Field number, in TFILE, where term/concept
is defined.

- When not defined, TFIELD defaults to the .01 field number, and it
represents terms defined in the file TFILE. The search is limited to
those term/concepts that exist in that file and have the VUID assigned
to TVUID

- When defined, TFIELD must be of type SET OF CODES.  The search is
limited to those term/concepts that exist in that file/field and have
the VUID assigned to TVUID.
TVUID Input
(required) The VHA unique id (VUID) value specified
to limit the search on.
TARRAY Both
(required) The name of the array (local or global)
where results of the search will be stored.

Returns: The given array populated as

- @TARRAY=<list count>
@TARRAY@(<file#>,<field#>,<internal reference>)=<status info>

where the <status info> is defined as

"<internal value>^<FileMan effective date/time>^
<external value>^<master entry?>"

; or

- when no entries are found, the array named by TARRAY is not populated

; or

- when an error occurs, the array named by TARRAY is populated as follows:

@TARRAY("ERROR")="<error message>"
TMASTER Input
(optional) Flag to limit the search of terms based on
the value of the MASTER ENTRY FOR VUID field.

- 0, to include all terms; or

- 1, to include only those terms designated as MASTER ENTRY FOR VUID
DATE ACTIVATED 2009/06/17