LRPXAPI ;VA/SLC/STAFF - Lab Extract APIs ;2/26/04 13:34
;;5.2;LAB SERVICE;**1030,1031**;NOV 01, 1997
;
;;VA LR Patch(s): 295
;
;
; lab extract API routines
; dbia 4245
; no need to namespace local variables when calling these APIs
; the LRPXAPP routine shows examples of calling these APIs
; parameters: (.parameter is a call by reference)
; .TESTS array(ien)=ien^test name
; .VALUES array(seq of recent first)=col date/time^TEST^comment flag^RESULT
; .PATS array(dfn)=dfn^patient name
; .DATES array(-date)=date
; DFN is patient ien
; MAX is optional, # of tests,values,pts to return/call, default is 100
; .NEXT is optional, if NEXT'=0 then not finished
; COND is optional, condition for value (example I V>30), default is ""
; TYPE is [C M A] and is optional, default is C
; DATE1 is optional, earliest date, default is 0 (oldest)
; DATE2 is optional, latest date, default is 9999999 (most recent)
; .DATA is lab result or array(STYPE,#)= specimen, comments, datanumbers
; DATE is collection date/time
; ITEM is test number in file 60 for Chem data
; ITEM is "M;[S T O A M];[S T O A M] ien" for Micro data
; ITEM is "A;[S T O D M E F P I];[S T O D M E F P I] ien" for AP data
; SOURCE is optional, array reference used as alternate list of patients
; .RESULT is patient's test result (result^flag^...)
; NODE is data reference in ^PXRMINDX( indexes "lrdfn;CH;lridt;lrdn"
; LRDFN is lab patient ien
; LRIDT is lab collection time (inverted)
; LRDN is lab datanumbers for test values
; STYPE is "S" specimen node, "C" comments, "V" data nodes, "A" all
; .ERR is -1 when data cannot be found
;
; -- TESTS returns tests (items) on patient; dfn required --
;
TESTS(TESTS,DFN,TYPE,MAX,NEXT,COND,DATE1,DATE2) ; API
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used.
; Q
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") ; IHS/MSC/MKK - LR*5.2*1031
;
I $G(TESTS)?1U1UN1.14UNP,'$G(MAX) S MAX=1000000000 ; default for ^TMP is all, else 100 tests
E S MAX=+$G(MAX,100)
S TYPE=$G(TYPE,"C") ; default is CH data
I TYPE="C" D TESTS^LRPXAPI1(.TESTS,+$G(DFN),MAX,.NEXT,$G(COND),$G(DATE1),$G(DATE2)) Q
D TESTS^LRPXAPI3(.TESTS,+$G(DFN),TYPE,MAX,.NEXT,$G(COND),$G(DATE1),$G(DATE2)) Q
Q
;
; -- RESULTS returns results on patient; dfn required --
;
RESULTS(VALUES,DFN,ITEM,MAX,NEXT,COND,DATE1,DATE2) ; API
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used.
; Q
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") ; IHS/MSC/MKK - LR*5.2*1031
;
N TYPE
I $G(VALUES)?1U1UN1.14UNP,'$G(MAX) S MAX=1000000000 ; default for ^TMP is all, else 100 results
E S MAX=+$G(MAX,100)
S ITEM=$G(ITEM)
I ITEM'=+ITEM,$L(ITEM)<5 D Q ; results for all of type or partial item
. S MAX=+$G(MAX,10)
. S TYPE=$E(ITEM)
. I TYPE="C"!'$L(TYPE) D RESULTS^LRPXAPI1(.VALUES,+$G(DFN),MAX,.NEXT,$G(COND),$G(DATE1),$G(DATE2)) Q
. D RESULTS^LRPXAPI3(.VALUES,+$G(DFN),ITEM,MAX,.NEXT,$G(COND),$G(DATE1),$G(DATE2)) Q
I ITEM=+ITEM D TRESULTS^LRPXAPI1(.VALUES,+$G(DFN),ITEM,MAX,.NEXT,$G(COND),$G(DATE1),$G(DATE2)) Q
S TYPE=$E(ITEM)
D TRESULTS^LRPXAPI3(.VALUES,+$G(DFN),TYPE,ITEM,MAX,.NEXT,$G(COND),$G(DATE1),$G(DATE2)) Q
Q
;
; -- PATIENTS returns patients with a specific item; item required --
;
PATIENTS(PATS,ITEM,SOURCE,MAX,NEXT,COND,DATE1,DATE2) ; API
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used.
; Q
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") ; IHS/MSC/MKK - LR*5.2*1031
;
N TYPE
I $G(PATS)?1U1UN1.14UNP,'$G(MAX) S MAX=1000000000 ; default for ^TMP is all, else 100 patients
E S MAX=+$G(MAX,100)
S ITEM=$G(ITEM,0)
I ITEM=0!'$L($G(ITEM)) D ALLPATS^LRPXAPI3(.PATS,$G(SOURCE),MAX,.NEXT,$G(COND),$G(DATE1),$G(DATE2)) Q
I ITEM'=+ITEM,$L(ITEM)<5 D Q ; patients for all of type or partial item
. S TYPE=$E(ITEM)
. I TYPE="C" D PTS^LRPXAPI1(.PATS,$G(SOURCE),MAX,.NEXT,$G(COND),$G(DATE1),$G(DATE2)) Q
. D PTS^LRPXAPI3(.PATS,TYPE,ITEM,$G(SOURCE),MAX,.NEXT,$G(COND),$G(DATE1),$G(DATE2)) Q
I ITEM=+ITEM D PATIENTS^LRPXAPI1(.PATS,ITEM,$G(SOURCE),MAX,.NEXT,$G(COND),$G(DATE1),$G(DATE2)) Q
S TYPE=$E(ITEM)
D PATIENTS^LRPXAPI3(.PATS,TYPE,ITEM,$G(SOURCE),MAX,.NEXT,$G(COND),$G(DATE1),$G(DATE2)) Q
Q
;
; -- DATES returns col date/times as (date) or (type,date); dfn required --
;
DATES(DATES,DFN,TYPE,MAX,NEXT,DATE1,DATE2) ; API
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used.
; Q
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") ; IHS/MSC/MKK - LR*5.2*1031
;
I $G(DATES)?1U1UN1.14UNP,'$G(MAX) S MAX=1000000000 ; default for ^TMP is all, else 100 date/times
E S MAX=+$G(MAX,100)
S TYPE=$G(TYPE,"C") ; default is CH data
D DATES^LRPXAPI1(.DATES,+$G(DFN),TYPE,MAX,.NEXT,$G(DATE1),$G(DATE2))
Q
;
; ------------ other extract APIs --------------------
;
VALUE(RESULT,DFN,DATE,TEST,COND,ERR) ; API
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used.
; Q
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") ; IHS/MSC/MKK - LR*5.2*1031
;
; returns result node as RESULT; dfn, date, test required
D VALUE^LRPXAPI2(.RESULT,+$G(DFN),+$G(DATE),+$G(TEST),$G(COND),.ERR)
Q
;
LRVALUE(RESULT,LRDFN,LRIDT,LRDN,COND,ERR) ; API
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used.
; Q
; ----- END IHS/OIT/MKK - LR*5.2*130
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") ; IHS/MSC/MKK - LR*5.2*1031
;
; returns result node as RESULT; lrdfn, lridt, lrdn required
D LRVALUE^LRPXAPI2(.RESULT,+$G(LRDFN),+$G(LRIDT),+$G(LRDN),$G(COND),.ERR)
Q
;
LRPXRM(RESULT,NODE,ITEM,TYPES) ; API
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used.
; Q
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") ; IHS/MSC/MKK - LR*5.2*1031
;
; returns lab data using ^PXRMINDX indexes; node, item required
; types of data: V value, S specimen, C comments, or combinations
D LRPXRM^LRPXAPI2(.RESULT,$G(NODE),$G(ITEM),$G(TYPES,"VS"))
Q
;
SPEC(DATA,DFN,DATE,STYPE,ERR) ; API
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used.
; Q
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") ; IHS/MSC/MKK - LR*5.2*1031
;
; returns specimen node, comments, data nodes
; returned in array DATA; dfn, date required
D SPEC^LRPXAPI2(.DATA,+$G(DFN),+$G(DATE),$G(STYPE),.ERR)
Q
;
LRSPEC(DATA,LRDFN,LRIDT,STYPE,ERR) ; API
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used.
; Q
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") ; IHS/MSC/MKK - LR*5.2*1031
;
; returns specimen node, comments, data nodes
; returned in array DATA; lrdfn, lridt required
D LRSPEC^LRPXAPI2(.DATA,+$G(LRDFN),+$G(LRIDT),$G(STYPE),.ERR)
Q
;
VERIFIED(LRDFN,LRIDT) ; API $$(lrdfn,lridt) -> 1 if verified, else 0
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used. Return zero.
; Q 0
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") 0 ; IHS/MSC/MKK - LR*5.2*1031
;
Q $$VERIFIED^LRPXAPI2(+$G(LRDFN),+$G(LRIDT))
;
MIVERIFY(LRDFN,LRIDT,SUB) ; $$(lrdfn,lridt,sub) -> 1 if verified, else 0
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used. Return zero.
; Q 0
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") 0 ; IHS/MSC/MKK - LR*5.2*1031
;
Q $$MIVERIFY^LRPXAPI2(+$G(LRDFN),+$G(LRIDT),$G(SUB,"MI"))
;
APVERIFY(LRDFN,LRIDT,SUB) ; $$(lrdfn,lridt,sub) -> 1 if verified, else 0
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used. Return zero.
; Q 0
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") 0 ; IHS/MSC/MKK - LR*5.2*1031
;
Q $$APVERIFY^LRPXAPI2(+$G(LRDFN),+$G(LRIDT),$G(SUB))
;
VAL(LRDFN,LRIDT,LRDN) ; API $$(lrdfn,lridt,lrdn) -> result node
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used. Return zero.
; Q 0
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") 0 ; IHS/MSC/MKK - LR*5.2*1031
;
Q $$VAL^LRPXAPI2(+$G(LRDFN),+$G(LRIDT),+$G(LRDN))
;
REFVAL(NODE) ; API $$(reference node) -> data node
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used. Return zero.
; Q 0
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") 0 ; IHS/MSC/MKK - LR*5.2*1031
;
Q $$REFVAL^LRPXAPI2($G(NODE))
;
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used. Return zero.
; Q 0
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") 0 ; IHS/MSC/MKK - LR*5.2*1031
;
Q $$COMMENT^LRPXAPI2(+$G(LRDFN),+$G(LRIDT))
;
ACCY(TESTS,ACC,BDN) ; API
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used.
; Q
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") ; IHS/MSC/MKK - LR*5.2*1031
;
; returns TESTS from yearly accession, ACC, BDN required
; BDN is beginning date number
D ACCY^LRPXAPI2(.TESTS,ACC,BDN)
Q
;
CHNODE(ARRAY,NODE) ; API
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; RPMS Lab does not use Clinical Reminders.
; None of the following code will be used.
; Q
; ----- END IHS/OIT/MKK - LR*5.2*1030
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") ; IHS/MSC/MKK - LR*5.2*1031
;
; returns ARRAY of values on CH result node
D CHNODE^LRPXAPI2(.ARRAY,$G(NODE))
Q
;
HASITEM(DFN,ITEM) ; API $$(dfn,item) -> 1 if patient has item, else 0
;
Q:'$$PATCH^BLRUTIL4("PXRM*1.5*12") 0 ; IHS/MSC/MKK - LR*5.2*1031
;
I $D(^PXRMINDX(63,"PI",+$G(DFN),$G(ITEM,0))) Q 1
Q 0
;
LRPXAPI ;VA/SLC/STAFF - Lab Extract APIs ;2/26/04 13:34
+1 ;;5.2;LAB SERVICE;**1030,1031**;NOV 01, 1997
+2 ;
+3 ;;VA LR Patch(s): 295
+4 ;
+5 ;
+6 ; lab extract API routines
+7 ; dbia 4245
+8 ; no need to namespace local variables when calling these APIs
+9 ; the LRPXAPP routine shows examples of calling these APIs
+10 ; parameters: (.parameter is a call by reference)
+11 ; .TESTS array(ien)=ien^test name
+12 ; .VALUES array(seq of recent first)=col date/time^TEST^comment flag^RESULT
+13 ; .PATS array(dfn)=dfn^patient name
+14 ; .DATES array(-date)=date
+15 ; DFN is patient ien
+16 ; MAX is optional, # of tests,values,pts to return/call, default is 100
+17 ; .NEXT is optional, if NEXT'=0 then not finished
+18 ; COND is optional, condition for value (example I V>30), default is ""
+19 ; TYPE is [C M A] and is optional, default is C
+20 ; DATE1 is optional, earliest date, default is 0 (oldest)
+21 ; DATE2 is optional, latest date, default is 9999999 (most recent)
+22 ; .DATA is lab result or array(STYPE,#)= specimen, comments, datanumbers
+23 ; DATE is collection date/time
+24 ; ITEM is test number in file 60 for Chem data
+25 ; ITEM is "M;[S T O A M];[S T O A M] ien" for Micro data
+26 ; ITEM is "A;[S T O D M E F P I];[S T O D M E F P I] ien" for AP data
+27 ; SOURCE is optional, array reference used as alternate list of patients
+28 ; .RESULT is patient's test result (result^flag^...)
+29 ; NODE is data reference in ^PXRMINDX( indexes "lrdfn;CH;lridt;lrdn"
+30 ; LRDFN is lab patient ien
+31 ; LRIDT is lab collection time (inverted)
+32 ; LRDN is lab datanumbers for test values
+33 ; STYPE is "S" specimen node, "C" comments, "V" data nodes, "A" all
+34 ; .ERR is -1 when data cannot be found
+35 ;
+36 ; -- TESTS returns tests (items) on patient; dfn required --
+37 ;
TESTS(TESTS,DFN,TYPE,MAX,NEXT,COND,DATE1,DATE2) ; API
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used.
+4 ; Q
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT
+8 ;
+9 ; default for ^TMP is all, else 100 tests
IF $GET(TESTS)?1U1UN1.14UNP
IF '$GET(MAX)
SET MAX=1000000000
+10 IF '$TEST
SET MAX=+$GET(MAX,100)
+11 ; default is CH data
SET TYPE=$GET(TYPE,"C")
+12 IF TYPE="C"
DO TESTS^LRPXAPI1(.TESTS,+$GET(DFN),MAX,.NEXT,$GET(COND),$GET(DATE1),$GET(DATE2))
QUIT
+13 DO TESTS^LRPXAPI3(.TESTS,+$GET(DFN),TYPE,MAX,.NEXT,$GET(COND),$GET(DATE1),$GET(DATE2))
QUIT
+14 QUIT
+15 ;
+16 ; -- RESULTS returns results on patient; dfn required --
+17 ;
RESULTS(VALUES,DFN,ITEM,MAX,NEXT,COND,DATE1,DATE2) ; API
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used.
+4 ; Q
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT
+8 ;
+9 NEW TYPE
+10 ; default for ^TMP is all, else 100 results
IF $GET(VALUES)?1U1UN1.14UNP
IF '$GET(MAX)
SET MAX=1000000000
+11 IF '$TEST
SET MAX=+$GET(MAX,100)
+12 SET ITEM=$GET(ITEM)
+13 ; results for all of type or partial item
IF ITEM'=+ITEM
IF $LENGTH(ITEM)<5
Begin DoDot:1
+14 SET MAX=+$GET(MAX,10)
+15 SET TYPE=$EXTRACT(ITEM)
+16 IF TYPE="C"!'$LENGTH(TYPE)
DO RESULTS^LRPXAPI1(.VALUES,+$GET(DFN),MAX,.NEXT,$GET(COND),$GET(DATE1),$GET(DATE2))
QUIT
+17 DO RESULTS^LRPXAPI3(.VALUES,+$GET(DFN),ITEM,MAX,.NEXT,$GET(COND),$GET(DATE1),$GET(DATE2))
QUIT
End DoDot:1
QUIT
+18 IF ITEM=+ITEM
DO TRESULTS^LRPXAPI1(.VALUES,+$GET(DFN),ITEM,MAX,.NEXT,$GET(COND),$GET(DATE1),$GET(DATE2))
QUIT
+19 SET TYPE=$EXTRACT(ITEM)
+20 DO TRESULTS^LRPXAPI3(.VALUES,+$GET(DFN),TYPE,ITEM,MAX,.NEXT,$GET(COND),$GET(DATE1),$GET(DATE2))
QUIT
+21 QUIT
+22 ;
+23 ; -- PATIENTS returns patients with a specific item; item required --
+24 ;
PATIENTS(PATS,ITEM,SOURCE,MAX,NEXT,COND,DATE1,DATE2) ; API
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used.
+4 ; Q
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT
+8 ;
+9 NEW TYPE
+10 ; default for ^TMP is all, else 100 patients
IF $GET(PATS)?1U1UN1.14UNP
IF '$GET(MAX)
SET MAX=1000000000
+11 IF '$TEST
SET MAX=+$GET(MAX,100)
+12 SET ITEM=$GET(ITEM,0)
+13 IF ITEM=0!'$LENGTH($GET(ITEM))
DO ALLPATS^LRPXAPI3(.PATS,$GET(SOURCE),MAX,.NEXT,$GET(COND),$GET(DATE1),$GET(DATE2))
QUIT
+14 ; patients for all of type or partial item
IF ITEM'=+ITEM
IF $LENGTH(ITEM)<5
Begin DoDot:1
+15 SET TYPE=$EXTRACT(ITEM)
+16 IF TYPE="C"
DO PTS^LRPXAPI1(.PATS,$GET(SOURCE),MAX,.NEXT,$GET(COND),$GET(DATE1),$GET(DATE2))
QUIT
+17 DO PTS^LRPXAPI3(.PATS,TYPE,ITEM,$GET(SOURCE),MAX,.NEXT,$GET(COND),$GET(DATE1),$GET(DATE2))
QUIT
End DoDot:1
QUIT
+18 IF ITEM=+ITEM
DO PATIENTS^LRPXAPI1(.PATS,ITEM,$GET(SOURCE),MAX,.NEXT,$GET(COND),$GET(DATE1),$GET(DATE2))
QUIT
+19 SET TYPE=$EXTRACT(ITEM)
+20 DO PATIENTS^LRPXAPI3(.PATS,TYPE,ITEM,$GET(SOURCE),MAX,.NEXT,$GET(COND),$GET(DATE1),$GET(DATE2))
QUIT
+21 QUIT
+22 ;
+23 ; -- DATES returns col date/times as (date) or (type,date); dfn required --
+24 ;
DATES(DATES,DFN,TYPE,MAX,NEXT,DATE1,DATE2) ; API
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used.
+4 ; Q
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT
+8 ;
+9 ; default for ^TMP is all, else 100 date/times
IF $GET(DATES)?1U1UN1.14UNP
IF '$GET(MAX)
SET MAX=1000000000
+10 IF '$TEST
SET MAX=+$GET(MAX,100)
+11 ; default is CH data
SET TYPE=$GET(TYPE,"C")
+12 DO DATES^LRPXAPI1(.DATES,+$GET(DFN),TYPE,MAX,.NEXT,$GET(DATE1),$GET(DATE2))
+13 QUIT
+14 ;
+15 ; ------------ other extract APIs --------------------
+16 ;
VALUE(RESULT,DFN,DATE,TEST,COND,ERR) ; API
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used.
+4 ; Q
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT
+8 ;
+9 ; returns result node as RESULT; dfn, date, test required
+10 DO VALUE^LRPXAPI2(.RESULT,+$GET(DFN),+$GET(DATE),+$GET(TEST),$GET(COND),.ERR)
+11 QUIT
+12 ;
LRVALUE(RESULT,LRDFN,LRIDT,LRDN,COND,ERR) ; API
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used.
+4 ; Q
+5 ; ----- END IHS/OIT/MKK - LR*5.2*130
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT
+8 ;
+9 ; returns result node as RESULT; lrdfn, lridt, lrdn required
+10 DO LRVALUE^LRPXAPI2(.RESULT,+$GET(LRDFN),+$GET(LRIDT),+$GET(LRDN),$GET(COND),.ERR)
+11 QUIT
+12 ;
LRPXRM(RESULT,NODE,ITEM,TYPES) ; API
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used.
+4 ; Q
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT
+8 ;
+9 ; returns lab data using ^PXRMINDX indexes; node, item required
+10 ; types of data: V value, S specimen, C comments, or combinations
+11 DO LRPXRM^LRPXAPI2(.RESULT,$GET(NODE),$GET(ITEM),$GET(TYPES,"VS"))
+12 QUIT
+13 ;
SPEC(DATA,DFN,DATE,STYPE,ERR) ; API
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used.
+4 ; Q
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT
+8 ;
+9 ; returns specimen node, comments, data nodes
+10 ; returned in array DATA; dfn, date required
+11 DO SPEC^LRPXAPI2(.DATA,+$GET(DFN),+$GET(DATE),$GET(STYPE),.ERR)
+12 QUIT
+13 ;
LRSPEC(DATA,LRDFN,LRIDT,STYPE,ERR) ; API
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used.
+4 ; Q
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT
+8 ;
+9 ; returns specimen node, comments, data nodes
+10 ; returned in array DATA; lrdfn, lridt required
+11 DO LRSPEC^LRPXAPI2(.DATA,+$GET(LRDFN),+$GET(LRIDT),$GET(STYPE),.ERR)
+12 QUIT
+13 ;
VERIFIED(LRDFN,LRIDT) ; API $$(lrdfn,lridt) -> 1 if verified, else 0
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used. Return zero.
+4 ; Q 0
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT 0
+8 ;
+9 QUIT $$VERIFIED^LRPXAPI2(+$GET(LRDFN),+$GET(LRIDT))
+10 ;
MIVERIFY(LRDFN,LRIDT,SUB) ; $$(lrdfn,lridt,sub) -> 1 if verified, else 0
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used. Return zero.
+4 ; Q 0
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT 0
+8 ;
+9 QUIT $$MIVERIFY^LRPXAPI2(+$GET(LRDFN),+$GET(LRIDT),$GET(SUB,"MI"))
+10 ;
APVERIFY(LRDFN,LRIDT,SUB) ; $$(lrdfn,lridt,sub) -> 1 if verified, else 0
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used. Return zero.
+4 ; Q 0
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT 0
+8 ;
+9 QUIT $$APVERIFY^LRPXAPI2(+$GET(LRDFN),+$GET(LRIDT),$GET(SUB))
+10 ;
VAL(LRDFN,LRIDT,LRDN) ; API $$(lrdfn,lridt,lrdn) -> result node
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used. Return zero.
+4 ; Q 0
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT 0
+8 ;
+9 QUIT $$VAL^LRPXAPI2(+$GET(LRDFN),+$GET(LRIDT),+$GET(LRDN))
+10 ;
REFVAL(NODE) ; API $$(reference node) -> data node
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used. Return zero.
+4 ; Q 0
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT 0
+8 ;
+9 QUIT $$REFVAL^LRPXAPI2($GET(NODE))
+10 ;
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used. Return zero.
+4 ; Q 0
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT 0
+8 ;
+9 QUIT $$COMMENT^LRPXAPI2(+$GET(LRDFN),+$GET(LRIDT))
+10 ;
ACCY(TESTS,ACC,BDN) ; API
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used.
+4 ; Q
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT
+8 ;
+9 ; returns TESTS from yearly accession, ACC, BDN required
+10 ; BDN is beginning date number
+11 DO ACCY^LRPXAPI2(.TESTS,ACC,BDN)
+12 QUIT
+13 ;
CHNODE(ARRAY,NODE) ; API
+1 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+2 ; RPMS Lab does not use Clinical Reminders.
+3 ; None of the following code will be used.
+4 ; Q
+5 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+6 ;
+7 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT
+8 ;
+9 ; returns ARRAY of values on CH result node
+10 DO CHNODE^LRPXAPI2(.ARRAY,$GET(NODE))
+11 QUIT
+12 ;
HASITEM(DFN,ITEM) ; API $$(dfn,item) -> 1 if patient has item, else 0
+1 ;
+2 ; IHS/MSC/MKK - LR*5.2*1031
IF '$$PATCH^BLRUTIL4("PXRM*1.5*12")
QUIT 0
+3 ;
+4 IF $DATA(^PXRMINDX(63,"PI",+$GET(DFN),$GET(ITEM,0)))
QUIT 1
+5 QUIT 0
+6 ;