source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMDIN.m@ 1713

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

initial load of FOIAVistA 6/30/08 version

File size: 2.2 KB
Line 
1PXRMDIN ; SLC/PKR - Handle inpatient med findings. ;09/21/2005
2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
3 ;
4 ;===============================================
5GETDATA(DAS,FIEVT) ;Return data for an inpatient drug finding.
6 ;DBIA #3836
7 D OEL^PSJPXRM1(DAS,.FIEVT)
8 S (FIEVT("STATUS"),FIEVT("VALUE"))=FIEVT("STAT") K FIEVT("STAT")
9 S FIEVT("START DATE")=FIEVT("START") K FIEVT("START")
10 S FIEVT("STOP DATE")=FIEVT("STOP") K FIEVT("STOP")
11 S FIEVT("DURATION")=$$DURATION^PXRMDATE(FIEVT("START DATE"),FIEVT("STOP DATE"))
12 Q
13 ;
14 ;===============================================
15GETFNAME(DRUG,FIEVT) ;Return the name of the drug.
16 ;DBIA #10043
17 Q $S(+DRUG=0:DRUG,1:$P(^PSDRUG(DRUG,0),U,1))
18 ;
19 ;===============================================
20EVALTERM(DFN,FINDPA,ENODE,TERMARR,TFIEVAL) ;Evaluate terms.
21 D EVALTERM^PXRMINDX(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL)
22 Q
23 ;
24 ;===============================================
25MHVOUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the MHV output.
26 N DRUG,JND,NOUT,TEMP,TEXTOUT
27 S DRUG=IFIEVAL("DISPENSE DRUG")
28 ;DBIA #10043
29 S DRUG=$S(+DRUG=0:DRUG,1:$P(^PSDRUG(DRUG,0),U,1))
30 S TEMP="Inpatient Drug: "_DRUG_" = "
31 S TEMP=TEMP_"("_$$EDATE^PXRMDATE(IFIEVAL("START DATE"))
32 S TEMP=TEMP_" - "_$$EDATE^PXRMDATE(IFIEVAL("STOP DATE"))_")"
33 D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
34 F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
35 Q
36 ;
37 ;===============================================
38OUTPUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the clinical
39 ;maintenance output.
40 N DRUG,JND,NOUT,TEMP,TEXTOUT
41 S DRUG=IFIEVAL("DISPENSE DRUG")
42 ;DBIA #10043
43 S DRUG=$S(+DRUG=0:DRUG,1:$P(^PSDRUG(DRUG,0),U,1))
44 S NLINES=NLINES+1
45 S TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT," ")_"Inpatient Medication: "_DRUG
46 S TEMP=$$EDATE^PXRMDATE(IFIEVAL("DATE"))
47 S TEMP=TEMP_" Status: "_IFIEVAL("STATUS")
48 S TEMP=TEMP_", Start date: "_$$EDATE^PXRMDATE(IFIEVAL("START DATE"))
49 S TEMP=TEMP_", Stop date: "_$$EDATE^PXRMDATE(IFIEVAL("STOP DATE"))
50 I $D(IFIEVAL("DURATION")) S TEMP=TEMP_" Duration: "_IFIEVAL("DURATION")_" D"
51 D FORMATS^PXRMTEXT(INDENT+1,PXRMRM,TEMP,.NOUT,.TEXTOUT)
52 F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
53 S NLINES=NLINES+1,TEXT(NLINES)=""
54 Q
55 ;
Note: See TracBrowser for help on using the repository browser.