source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMVITL.m@ 1671

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

initial load of FOIAVistA 6/30/08 version

File size: 3.4 KB
Line 
1PXRMVITL ; SLC/PKR - Handle vitals findings. ;09/20/2007
2 ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
3 ;
4 ;===========================================================
5EVALFI(DFN,DEFARR,ENODE,FIEVAL) ;Evaluate vital measurement findings.
6 D EVALFI^PXRMINDX(DFN,.DEFARR,ENODE,.FIEVAL)
7 Q
8 ;
9 ;===========================================================
10EVALPL(FINDPA,ENODE,TERMARR,PLIST) ;Evaluate vital measurement
11 ;term findings for patient lists.
12 D EVALPL^PXRMINDL(.FINDPA,ENODE,.TERMARR,PLIST)
13 Q
14 ;
15 ;===========================================================
16EVALTERM(DFN,FINDPA,ENODE,TERMARR,TFIEVAL) ;Evaluate vital measurement
17 ;terms.
18 D EVALTERM^PXRMINDX(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL)
19 Q
20 ;
21 ;===========================================================
22GETDATA(DAS,FIEVT) ;Return data for a GMRV Vital Measurement entry.
23 N EM,IND,GMRVDATA,STOP,TEMP,TYPE
24 ;DBIA #3647
25 D EN^GMVPXRM(.GMRVDATA,DAS,"I")
26 I $P(GMRVDATA(1),U,1)=-1 D Q
27 . S ^TMP("PXRMXMZ",$J,1,0)="Found GMRV entry "_DAS_" in the index, but it does not exist in ^GMR(120.5"
28 . D SEND^PXRMMSG("Bad entry in Vitals index.")
29 S FIEVT("TYPE")=$$EXTERNAL^DILFD(120.5,.03,"",GMRVDATA(3),.EM)
30 ;DBIA #10040
31 S TEMP=$S(+GMRVDATA(5)'=0:^SC(GMRVDATA(5),0),1:"")
32 S FIEVT("HOSPITAL LOCATION")=$P(TEMP,U,1)
33 S FIEVT("LOCATION TYPE")=$P(TEMP,U,3)
34 S STOP=$P(TEMP,U,7)
35 S FIEVT("ENTERED BY")=$P(^VA(200,GMRVDATA(6),0),U,1)
36 S (FIEVT("RATE"),FIEVT("VALUE"))=$P(GMRVDATA(7),U,1)
37 S IND=0
38 ;Load the external form of the qualifiers.
39 F S IND=$O(GMRVDATA(12,IND)) Q:IND="" D
40 . S TEMP=$P(GMRVDATA(12,IND),U,1)
41 .;DBIA #4504
42 . I TEMP'="" S FIEVT("QUALIFIER",IND)=$P($G(^GMRD(120.52,+TEMP,0)),U,1)
43 ;DBIA #557
44 I STOP'="" S FIEVT("STOP CODE")=$P(^DIC(40.7,STOP,0),U,1,2)
45 E S FIEVT("STOP CODE")=""
46 Q
47 ;
48 ;===========================================================
49MHVOUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the MHV output.
50 N DATE,EM,IND,JND,NAME,NOUT,RATE,TEMP,TEXTOUT,TYPE
51 S TYPE=$$EXTERNAL^DILFD(120.5,.03,"",IFIEVAL("TYPE"),.EM)
52 S NAME="Vital Measurement: "_TYPE_" = "
53 S IND=0
54 F S IND=+$O(IFIEVAL(IND)) Q:IND=0 D
55 . S RATE=$G(IFIEVAL(IND,"VALUE"))
56 . I RATE="" S RATE="MISSING"
57 . S DATE=IFIEVAL(IND,"DATE")
58 . S TEMP=NAME_RATE_" ("_$$EDATE^PXRMDATE(DATE)_")"
59 . D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
60 . F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
61 S NLINES=NLINES+1,TEXT(NLINES)=""
62 Q
63 ;
64 ;===========================================================
65OUTPUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the clinical
66 ;maintenance output.
67 N DATE,EM,IND,JND,NOUT,RATE,TEMP,TEXTOUT,TYPE
68 S NLINES=NLINES+1
69 S TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT," ")_"Vital Measurement: "_IFIEVAL("TYPE")
70 S IND=0
71 F S IND=+$O(IFIEVAL(IND)) Q:IND=0 D
72 . S DATE=IFIEVAL(IND,"DATE")
73 . S TEMP=$$EDATE^PXRMDATE(DATE)
74 . S RATE=$G(IFIEVAL(IND,"VALUE"))
75 . I RATE="" S RATE="MISSING"
76 . S TEMP=TEMP_"; rate - "_RATE
77 . D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
78 . F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
79 .;If there are qualifiers display them.
80 . I $D(IFIEVAL(IND,"QUALIFIER")) D
81 .. S TEMP="Qualifiers:"
82 .. N QIND S QIND=0
83 .. S QIND=$O(IFIEVAL(IND,"QUALIFIER",QIND)) S TEMP=TEMP_" "_IFIEVAL(IND,"QUALIFIER",QIND)
84 .. F S QIND=$O(IFIEVAL(IND,"QUALIFIER",QIND)) Q:QIND="" S TEMP=TEMP_", "_IFIEVAL(IND,"QUALIFIER",QIND)
85 .. D FORMATS^PXRMTEXT(INDENT+3,PXRMRM,TEMP,.NOUT,.TEXTOUT)
86 .. F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
87 S NLINES=NLINES+1,TEXT(NLINES)=""
88 Q
89 ;
Note: See TracBrowser for help on using the repository browser.