Print Page as PDF
DBIA4246 ICR (4246)

DBIA4246    ICR (4246)

Name Value
NUMBER 4246
IA # 4246
DATE CREATED 2003/11/06
CUSTODIAL PACKAGE LAB SERVICE
CUSTODIAL ISC Dallas
USAGE Controlled Subscription
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE LRPXAPIU
NAME DBIA4246
GENERAL DESCRIPTION
APIs for use with Lab data.

Arguments enclosed with brackets are optional. Arguments without brackets are
required. Arguments preceded by a period should be called by reference.

STATUS Active
ID LRPXAPIU
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION
$$LRDFN(d)


Obtains LRDFN (Lab Patient ID) from DFN (Patient ID). If no valid DFN exists,
0 is returned

argument

d     DFN
returns LRDFN

example

S LRDFN=$$LRDFN^LRPXAPIU(DFN)

$$DFN(l)


Obtains DFN (Patient ID) from LRDFN (Lab Patient ID). If no valid DFN exists,
0 is returned.

argument

l     LRDFN
returns DFN

example

S DFN=$$DFN^LRPXAPIU(LRDFN)

$$LRDFNM(l)


Obtains patient name from LRDFN. If no valid name exists, "" is returned.

argument

l     LRDFN
returns Patient name

example

Write patient's name using LRDFN.
W $$LRDFNM^LRPXAPIU(LRDFN)

$$DFNM(d)


Obtains patient name from DFN. If no valid name exists, "" is returned.

argument

d     DFN
returns Patient name

example

Write patient's name using DFN.
W $$DFNM^LRPXAPIU(DFN)

$$LRIDT(i)


Lab stores patient results by time with most recent values first. To do this
lab uses a convention of taking the date/time and subtracting 9999999. This
collates as most recent first. This function performs the conversion of
date/time to inverse date/time (or an inverse date/time to a date/time).

argument

i     date/time or inverse date/time
returns inverse of argument

examples

S LRIDT=$$LRIDT^LRPXAPIU(3020807.1104)
This would set LRIDT to 6979191.8896
Likewise
S COLTIME=$$LRIDT^LRPXAPI(6979191.8896)
This would set COLTIME to 3020807.1104

$$SPECNM(i)


Obtains specimen name from specimen number in file 61. If no valid name
exists, "" is returned.

argument

i     pointer to specimen in file 61
returns Specimen name

example

Write the specimen name using the variable LRBLOOD.
W $$SPECNM^LRPXAPIU(LRBLOOD)

$$LRDN(t)


Obtains lab data number (the subscript where results are stored in ^LR) from
the test number in file 60. The lab data number is the middle piece of the
data name (example: data name "CH;2;1" where 2 is the data number). If no
valid data number exists, 0 is returned.

argument

t     pointer to lab test in file 60
returns data number

example

Get the data number for glucose.
S LRDN=$$LRDN^LRPXAPIU(+$O(^LAB(60,"B","GLUCOSE",0))

$$TEST(d)


Obtains the test number in file 60 from lab data number (the subscript where
results are stored in ^LR). If no valid test number exists, 0 is returned.

argument

d     data number
returns pointer to lab test in file 60

example

Get the test number for glucose
(in this case the data number for glucose is 2).
S TEST=$$TEST^LRPXAPIU(2)

$$LRDNM(d)


Obtains lab test name from data number. If no valid name exists, "" is
returned.

argument

d     data number
returns Lab test name

example

Write the test name for glucose
(in this case the data  number for glucose is 2).
W $$LRDNM^LRPXAPIU(2)

$$TESTNM(t)


Obtains lab test name from test number in file 60. If no valid name exists, ""
is returned.

argument

t     pointer to lab test in file 60
returns Lab test name

example

Write the test name for glucose
(in this case the test number for glucose is 175).
W $$TESTNM^LRPXAPIU(175)

$$AB(d)


Obtains antimicrobial number in file 62.06 from antimicrobial data number. If
no valid test number exists, 0 is returned.

argument

d     data number for antimicrobial field in file 63
returns data number for antimicrobial

example

Get the antimicrobial number.
S ABN=$$AB^LRPXAPIU(ABDN)

$$ABDN(i)


Obtains antimicrobial data number from antimicrobial number in file 62.06.. If
no valid test number exists, 0 is returned.

argument

i     pointer to antimicrobial in file 62.06
returns data number for antimicrobial in file 63

example

Get the antimicrobial data number.
S ABDN=$$AB^LRPXAPIU(ABN)

$$ABNM(i)


Obtains antimicrobial name from antimicrobial number in file 62.06. If no
valid name exists, "" is returned.

argument

i     pointer to antimicrobial in file 62.06
returns antimicrobial name

example

WRITE the antimicrobial name from it's IEN.
W $$ABNM^LRPXAPIU(ABN)

$$TB(d)


Obtains mycobacteria field number in file 63 from the mycobacteria data
number. TB drugs are defined as fields in file 63. If no valid field number
exists, 0 is returned.

argument

d     TB data number
returns field number for TB drug

example

Get the TB field number from TBDN.
S TBN=$$TB^LRPXAPIU(TBDN)

$$TBDN(f)


Obtains the TB data number in file 63 from the TB field number. TB drugs are
defined as fields in file 63. If no valid field number exists, 0 is returned.

argument

f     field number for TB drug
returns TB data number

example

Get the TB data number from TBN.
S TBDN=$$TBDN^LRPXAPIU(TBN)

$$TBNM(f)


Obtains TB drug name from TB field number. TB drugs are defined as fields in
file 63. If no valid name exists, "" is returned.

argument

f     field number for TB drug
returns name of TB drug

example

Write the TB drug name from it's TB drug number.
W $$TBNM^LRPXAPIU(TBDN)

$$BUGNM(i)


Obtains organism name from organism number in file 61.2. If no valid name
exists, "" is returned.

argument

i     pointer to organism in file 61.2
returns organism name

example

Write the name of the organism from BUG.
W $$BUGNM^LRPXAPIU(BUG)

$$ORGNM(i)


Obtains  the organ/tissue name from organ/tissue number in file 61. If no
valid name exists, "" is returned.

argument

i     pointer to organ/tissue in file 61
returns organ/tissue name

example

Write the organ/tissue name for SPEC.
W $$ORGNM^LRPXAPIU(SPEC)

$$DISNM(i)


Obtains disease name from disease number in file 61.4. If no valid name
exists, "" is returned.

argument

i     pointer to disease in file 61.4
returns disease name

example

Write the disease name for DISEASE.
W $$DISNM^LRPXAPIU(DISEASE)

$$ETINM(i)


Obtains etiology name from etiology number in file 61.2. If no valid name
exists, "" is returned.

argument

i     pointer to etiology in file 61.2
returns etiology name

example

Write the etiology name for ETIOLOGY.
W $$ETINM^LRPXAPIU(ETIOLOGY)

$$MORPHNM(i)


Obtains morphology name from morphology number in file 61.1.  If no valid name
exists, "" is returned.

argument

i     pointer to morphology in file 61.1
returns morphology name

example

Write the morphology name for MORPH.
W $$MORPHNM^LRPXAPIU(MORPH)

$$FUNNM(i)


Obtains function name from function number in file 61.3. If no valid name
exists, "" is returned.

argument

i     pointer to function in file 61.3
returns function name

example

Write the function name for FUNC.
W $$FUNNM^LRPXAPIU(FUNC)

$$PROCNM(i)


Obtains procedure name from procedure number in file 61.5. If no valid name
exists, "" is returned.

argument

i     pointer to procedure in file 61.5
returns procedure name

example

Write the procedure name for PROC.
W $$PROCNM^LRPXAPIU(PROC)

$$DOD(d)


Obtains date of death from the appropriate field in the patient file -
^DPT(DFN,.35). If no valid date of death exists, 0 is returned.

argument

d     DFN
returns date of death

example

Write the date of death for a patient using DFN.
W $$DOD^LRPXAPIU(DFN)

$$ITEMNM(i)


Obtains item name from item of AP or Micro type. These items are composed of a
type [A M]; file (depends on type); file number. This function uses that
information to display the name of the file entry.

argument

i     item
returns item name

example

Write the item name for ITEM where ITEM="A;O;343".
W $$ITEMNM^LRPXAPIU(ITEM)

DATES(d1,d2)


Using two dates for comparison, this procedure returns the same dates but with
the first parameter being the oldest and the second parameter being the most
recent. This is used for a date range where it is not certain which dates are
the beginning and end. If no values are assigned to the dates or if they are
undefined, the first argument is returned as 0 and the second argument as
9999999. This would be a date range of all dates.

arguments

.d1     date (returns as the older of d1 and d2)
.d2     date (returns as the most recent of d1 and d2)

example

From the two dates, START and STOP, ensure that START is the
oldest date.
D DATES^LRPXAPIU(.START,.STOP)

NORMALS(.l,.h,t,s)


This returns the high and low reference range on a lab test. A specimen is
required.

arguments

.l    low reference range
.h    high reference range
t     pointer to laboratory test 60
s     pointer to specimen 61

example

Get low and high reference range on TEST and SPECIMEN.
D NORMALS^LRPXAPIU(.LOW,.HIGH,TEST,SPEC)

$$EXTVALUE(v,n)


Obtains external value of a value extracted using the reference node.

arguments

v     value in internal format
n     reference node
returns external format of value

example

Returns external format of value obtained from the reference node.
S VALUE=$$EXTVALUE^LRPXAPIU(VALUE,NODE)

$$CATEGORY(s,[t])
Obtains AP or Micro category from the subscript
number of Micro or AP data in file 63. Data are identified as bacteria,
parasite, fungus, mycobacteria, or virus. Different kinds of data are stored
on these subscripts depending on the type of organism or AP specimen. This
function determines the type of organism or AP specimen when knowing the
subscript.

arguments

s     Micro subscript number [3 6 9 12 17]
or AP subscript [AU CY EM SP]
[t]   type [A M]
default A
returns Micro category [B P F M V] or AP category [A C E S]

example

Get the category from the subscript.
S CAT=$$CATEGORY^LRPXAPIU(SUB)

$$CATSUB(c,[t])


Obtains AP or Micro subscript number from the category letter for AP or Micro
data in file 63. Data are identified as bacteria, parasite, fungus,
mycobacteria, or virus and stored on specific subscript numbers depending on
the type of organism. For AP this function determines the subscript when
knowing the type of AP specimen.. For Micro this function determines the
subscript number when knowing the type of organism.

arguments

c     Micro category [B P F M V]
or AP category [A C E S]
[t]   type [A M]
default A
returns Micro subscript number [3 6 9 12 17] or AP subscript
[AU CY EM SP]

example

Get the subscript number of Parasitology in Micro.
S SUB=$$CATSUB^LRPXAPIU("P","M")

$$CONDOK(c,[t])


Checks condition to determine if it is valid. If the condition is invalid 0 is
returned. If the condition is valid 1 is returned. The condition is used in
filtering lab results. This function may be used to check the syntax of the
condition before it is used. The condition is M code starting with an IF
statement. Specific variables are used for different types lab data. Operators
are specific to the variables used. An operator is followed by a value to form
a statement (example: E=283). Multiple statements can be used by separating
with the character: "~" for occurrence match or "|" for exact match.  For
Chemistry (type C)[F S V] where F is flag [H, L, H*, L*], S is specimen IEN,
and V is the value of lab test (free text or numeric). For Microbiology (type
M)[A C I M O R S T] where A is antimicrobial IEN, C is category [B F M P V], I
is interpretation (free text   usually [R S I]), M is mycobacteria
antimicrobial IEN (actually a # in the DD), O is organism IEN, R is result
(free text or numeric   usually [R S I], S is specimen IEN, and T is test IEN.
For Anatomic Pathology (type A)[C D E F I M O P S T] where C is category [A C
E S], D is disease IEN, E is etiology IEN, F is function IEN, I is ICD9 IEN, M
is morphology IEN, O is organ/tissue IEN, P is procedure IEN, S is specimen
(free text), and T is test IEN. Operators for variables: V: =, '=, >, '>, <,
'<, [, '[, [, '[ [I R F]: =, '=, [, '[, [, '[ S when type is A: =, '=, [, '[,
[,'[ All other variables: =, '=

arguments

c      condition condition is returned as 0 if invalid
a valid condition is returned as 1
[t]    type of data [C M A] Chem, Micro, or AP
default: C
returns 1 if condition syntax is ok, else 0

examples

Check syntax of COND.
I $L(COND),'$$CONDOK^LRPXAPIU(COND) Q

Evaluate a string as a valid condition.
W $$CONDOK^LRPXAPIU("V>100")
W $$CONDOK^LRPXAPIU("F[""*""","C")
W $$CONDOK^LRPXAPIU("M=204","A")
W $$CONDOK^LRPXAPIU("S[""TISSUE"""~C=""C""","A")
W $$CONDOK^LRPXAPIU("I[""R""|A=123","M")
W $$CONDOK^LRPXAPIU("C=""V""","M")
W $$CONDOK^LRPXAPIU("A=123|O=323|S=72|I[""R"""|T=334,"M")

SUBSCRIBING PACKAGE
SUBSCRIBING PACKAGE SUBSCRIBING DETAILS
CLINICAL REMINDERS
ORDER ENTRY/RESULTS REPORTING
SPINAL CORD DYSFUNCTION
MRSA INITIATIVE REPORTS
added 6/10/09
VIRTUAL PATIENT RECORD
VPR*1*2 needed a couple of the functions contained in
LRXAPIU, ICR #4246 to work with PXRM indices.
HEALTH MANAGEMENT PLATFORM
HMP's subscription to this ICR expired on 10/27/17 with
the shutdown of HMP.  HMP*2.0*12 released on 10/17/17 is an informational
patch outlining the steps for the sites to shut down the application. If HMP
is reactivated in the future, the HMP project team should review the access
provided by this ICR with the custodial application before reactivating HMP's
subscription to this ICR.
COMPREHENSIVE CARE COORDINATION
ADDED 5/16/2022, effective with DSSV*1.1 DSS Class 3
product using $$TESTNM Document Only