PXRMLAB ; SLC/PKR - Handle laboratory test findings. ;03/02/2006
;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
;
;=============================================
EVALFI(DFN,DEFARR,ENODE,FIEVAL) ;Evaluate lab findings.
D EVALFI^PXRMINDX(DFN,.DEFARR,ENODE,.FIEVAL)
Q
;
;=============================================
EVALPL(FINDPA,ENODE,TERMARR,PLIST) ;Evaluate lab term findings
;for patient lists.
D EVALPL^PXRMINDL(.FINDPA,ENODE,.TERMARR,PLIST)
Q
;
;=============================================
EVALTERM(DFN,FINDPA,ENODE,TERMARR,TFIEVAL) ;Evaluate lab terms.
D EVALTERM^PXRMINDX(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL)
Q
;
;=============================================
GETDATA(DASP,FIEVT) ;Return Lab data. The first piece of DASP is the item.
N DAS,DATA,ITEM
;DBIA #4245
S ITEM=$P(DASP,"~",1)
S DAS=$P(DASP,"~",2)
D LRPXRM^LRPXAPI(.DATA,DAS,ITEM)
S FIEVT("DATA")=DATA
S FIEVT("TEST NAME")=$P(DATA,U,2)
I DAS["CH" S FIEVT("VALUE")=$P(DATA,U,3),FIEVT("FLAG")=$P(DATA,U,4)
E S (FIEVT("VALUE"),FIEVT("FLAG"))=""
I $D(DATA("SPECIMEN")) S FIEVT("SPECIMEN")=$P(DATA("SPECIMEN"),U,2)
Q
;
;=============================================
MHVOUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the MHV output.
N DATE,FLAG,IND,JND,NAME,NOUT,TEXTOUT,TEST,VALUE
S TEST=IFIEVAL("TEST NAME")
S NAME="Laboratory test: "_TEST_" = "
S IND=0
F S IND=+$O(IFIEVAL(IND)) Q:IND=0 D
. S VALUE=$G(IFIEVAL(IND,"VALUE"))
. S FLAG=$G(IFIEVAL(IND,"FLAG"))
. I FLAG'="" S VALUE=VALUE_FLAG
. S DATE=IFIEVAL(IND,"DATE")
. S TEMP=NAME_VALUE_" ("_$$EDATE^PXRMDATE(DATE)_")"
. D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
. F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
. S NLINES=NLINES+1,TEXT(NLINES)=""
Q
;
;=============================================
OUTPUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the clinical
;maintenance output.
N DATE,FLAG,IND,JND,NOUT,TEMP,TEXTOUT,TEST,VALUE
S TEST=IFIEVAL("TEST NAME")
S TEMP="Laboratory test: "_TEST
I $D(IFIEVAL("SPECIMEN")) S TEMP=TEMP_"; specimen: "_IFIEVAL("SPECIMEN")
S NLINES=NLINES+1
S TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT," ")_TEMP
S IND=0
F S IND=+$O(IFIEVAL(IND)) Q:IND=0 D
. S DATE=IFIEVAL(IND,"DATE")
. S TEMP=$$EDATE^PXRMDATE(DATE)
. S VALUE=$G(IFIEVAL(IND,"VALUE"))
. S FLAG=$G(IFIEVAL(IND,"FLAG"))
. I VALUE'="" S TEMP=TEMP_" value - "_VALUE
. I FLAG'="" S TEMP=TEMP_" "_FLAG
. D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
. F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
S NLINES=NLINES+1,TEXT(NLINES)=""
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXRMLAB 2616 printed Oct 16, 2024@17:47:10 Page 2
PXRMLAB ; SLC/PKR - Handle laboratory test findings. ;03/02/2006
+1 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
+2 ;
+3 ;=============================================
EVALFI(DFN,DEFARR,ENODE,FIEVAL) ;Evaluate lab findings.
+1 DO EVALFI^PXRMINDX(DFN,.DEFARR,ENODE,.FIEVAL)
+2 QUIT
+3 ;
+4 ;=============================================
EVALPL(FINDPA,ENODE,TERMARR,PLIST) ;Evaluate lab term findings
+1 ;for patient lists.
+2 DO EVALPL^PXRMINDL(.FINDPA,ENODE,.TERMARR,PLIST)
+3 QUIT
+4 ;
+5 ;=============================================
EVALTERM(DFN,FINDPA,ENODE,TERMARR,TFIEVAL) ;Evaluate lab terms.
+1 DO EVALTERM^PXRMINDX(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL)
+2 QUIT
+3 ;
+4 ;=============================================
GETDATA(DASP,FIEVT) ;Return Lab data. The first piece of DASP is the item.
+1 NEW DAS,DATA,ITEM
+2 ;DBIA #4245
+3 SET ITEM=$PIECE(DASP,"~",1)
+4 SET DAS=$PIECE(DASP,"~",2)
+5 DO LRPXRM^LRPXAPI(.DATA,DAS,ITEM)
+6 SET FIEVT("DATA")=DATA
+7 SET FIEVT("TEST NAME")=$PIECE(DATA,U,2)
+8 IF DAS["CH"
SET FIEVT("VALUE")=$PIECE(DATA,U,3)
SET FIEVT("FLAG")=$PIECE(DATA,U,4)
+9 IF '$TEST
SET (FIEVT("VALUE"),FIEVT("FLAG"))=""
+10 IF $DATA(DATA("SPECIMEN"))
SET FIEVT("SPECIMEN")=$PIECE(DATA("SPECIMEN"),U,2)
+11 QUIT
+12 ;
+13 ;=============================================
MHVOUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the MHV output.
+1 NEW DATE,FLAG,IND,JND,NAME,NOUT,TEXTOUT,TEST,VALUE
+2 SET TEST=IFIEVAL("TEST NAME")
+3 SET NAME="Laboratory test: "_TEST_" = "
+4 SET IND=0
+5 FOR
SET IND=+$ORDER(IFIEVAL(IND))
if IND=0
QUIT
Begin DoDot:1
+6 SET VALUE=$GET(IFIEVAL(IND,"VALUE"))
+7 SET FLAG=$GET(IFIEVAL(IND,"FLAG"))
+8 IF FLAG'=""
SET VALUE=VALUE_FLAG
+9 SET DATE=IFIEVAL(IND,"DATE")
+10 SET TEMP=NAME_VALUE_" ("_$$EDATE^PXRMDATE(DATE)_")"
+11 DO FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
+12 FOR JND=1:1:NOUT
SET NLINES=NLINES+1
SET TEXT(NLINES)=TEXTOUT(JND)
+13 SET NLINES=NLINES+1
SET TEXT(NLINES)=""
End DoDot:1
+14 QUIT
+15 ;
+16 ;=============================================
OUTPUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the clinical
+1 ;maintenance output.
+2 NEW DATE,FLAG,IND,JND,NOUT,TEMP,TEXTOUT,TEST,VALUE
+3 SET TEST=IFIEVAL("TEST NAME")
+4 SET TEMP="Laboratory test: "_TEST
+5 IF $DATA(IFIEVAL("SPECIMEN"))
SET TEMP=TEMP_"; specimen: "_IFIEVAL("SPECIMEN")
+6 SET NLINES=NLINES+1
+7 SET TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT," ")_TEMP
+8 SET IND=0
+9 FOR
SET IND=+$ORDER(IFIEVAL(IND))
if IND=0
QUIT
Begin DoDot:1
+10 SET DATE=IFIEVAL(IND,"DATE")
+11 SET TEMP=$$EDATE^PXRMDATE(DATE)
+12 SET VALUE=$GET(IFIEVAL(IND,"VALUE"))
+13 SET FLAG=$GET(IFIEVAL(IND,"FLAG"))
+14 IF VALUE'=""
SET TEMP=TEMP_" value - "_VALUE
+15 IF FLAG'=""
SET TEMP=TEMP_" "_FLAG
+16 DO FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
+17 FOR JND=1:1:NOUT
SET NLINES=NLINES+1
SET TEXT(NLINES)=TEXTOUT(JND)
End DoDot:1
+18 SET NLINES=NLINES+1
SET TEXT(NLINES)=""
+19 QUIT
+20 ;