source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMLAB.m@ 1553

Last change on this file since 1553 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
1PXRMLAB ; SLC/PKR - Handle laboratory test findings. ;03/02/2006
2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
3 ;
4 ;=============================================
5EVALFI(DFN,DEFARR,ENODE,FIEVAL) ;Evaluate lab findings.
6 D EVALFI^PXRMINDX(DFN,.DEFARR,ENODE,.FIEVAL)
7 Q
8 ;
9 ;=============================================
10EVALPL(FINDPA,ENODE,TERMARR,PLIST) ;Evaluate lab term findings
11 ;for patient lists.
12 D EVALPL^PXRMINDL(.FINDPA,ENODE,.TERMARR,PLIST)
13 Q
14 ;
15 ;=============================================
16EVALTERM(DFN,FINDPA,ENODE,TERMARR,TFIEVAL) ;Evaluate lab terms.
17 D EVALTERM^PXRMINDX(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL)
18 Q
19 ;
20 ;=============================================
21GETDATA(DASP,FIEVT) ;Return Lab data. The first piece of DASP is the item.
22 N DAS,DATA,ITEM
23 ;DBIA #4245
24 S ITEM=$P(DASP,"~",1)
25 S DAS=$P(DASP,"~",2)
26 D LRPXRM^LRPXAPI(.DATA,DAS,ITEM)
27 S FIEVT("DATA")=DATA
28 S FIEVT("TEST NAME")=$P(DATA,U,2)
29 I DAS["CH" S FIEVT("VALUE")=$P(DATA,U,3),FIEVT("FLAG")=$P(DATA,U,4)
30 E S (FIEVT("VALUE"),FIEVT("FLAG"))=""
31 I $D(DATA("SPECIMEN")) S FIEVT("SPECIMEN")=$P(DATA("SPECIMEN"),U,2)
32 Q
33 ;
34 ;=============================================
35MHVOUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the MHV output.
36 N DATE,FLAG,IND,JND,NAME,NOUT,TEXTOUT,TEST,VALUE
37 S TEST=IFIEVAL("TEST NAME")
38 S NAME="Laboratory test: "_TEST_" = "
39 S IND=0
40 F S IND=+$O(IFIEVAL(IND)) Q:IND=0 D
41 . S VALUE=$G(IFIEVAL(IND,"VALUE"))
42 . S FLAG=$G(IFIEVAL(IND,"FLAG"))
43 . I FLAG'="" S VALUE=VALUE_FLAG
44 . S DATE=IFIEVAL(IND,"DATE")
45 . S TEMP=NAME_VALUE_" ("_$$EDATE^PXRMDATE(DATE)_")"
46 . D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
47 . F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
48 . S NLINES=NLINES+1,TEXT(NLINES)=""
49 Q
50 ;
51 ;=============================================
52OUTPUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the clinical
53 ;maintenance output.
54 N DATE,FLAG,IND,JND,NOUT,TEMP,TEXTOUT,TEST,VALUE
55 S TEST=IFIEVAL("TEST NAME")
56 S TEMP="Laboratory test: "_TEST
57 I $D(IFIEVAL("SPECIMEN")) S TEMP=TEMP_"; specimen: "_IFIEVAL("SPECIMEN")
58 S NLINES=NLINES+1
59 S TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT," ")_TEMP
60 S IND=0
61 F S IND=+$O(IFIEVAL(IND)) Q:IND=0 D
62 . S DATE=IFIEVAL(IND,"DATE")
63 . S TEMP=$$EDATE^PXRMDATE(DATE)
64 . S VALUE=$G(IFIEVAL(IND,"VALUE"))
65 . S FLAG=$G(IFIEVAL(IND,"FLAG"))
66 . I VALUE'="" S TEMP=TEMP_" value - "_VALUE
67 . I FLAG'="" S TEMP=TEMP_" "_FLAG
68 . D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
69 . F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
70 S NLINES=NLINES+1,TEXT(NLINES)=""
71 Q
72 ;
Note: See TracBrowser for help on using the repository browser.