PXRMDIN ; SLC/PKR - Handle inpatient med findings. ;02/10/2010
;;2.0;CLINICAL REMINDERS;**4,12,17**;Feb 04, 2005;Build 102
;DBIA #5187 for PSSCLINR
;
;===============================================
GETDATA(DAS,FIEVT) ;Return data for an inpatient drug finding.
;DBIA #3836
D OEL^PSJPXRM1(DAS,.FIEVT)
S (FIEVT("STATUS"),FIEVT("VALUE"))=FIEVT("STAT") K FIEVT("STAT")
S FIEVT("START DATE")=FIEVT("START") K FIEVT("START")
S FIEVT("STOP DATE")=FIEVT("STOP") K FIEVT("STOP")
S FIEVT("DURATION")=$$DURATION^PXRMDATE(FIEVT("START DATE"),FIEVT("STOP DATE"))
Q
;
;===============================================
GETFNAME(DRUG,FIEVT) ;Return the name of the drug.
Q $S(+DRUG=0:DRUG,1:$$DRUG^PSSCLINR(DRUG))
;
;===============================================
EVALTERM(DFN,FINDPA,ENODE,TERMARR,TFIEVAL) ;Evaluate terms.
D EVALTERM^PXRMINDX(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL)
Q
;
;===============================================
MHVOUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the MHV output.
N DRUG,JND,NOUT,TEMP,TEXTOUT
S DRUG=IFIEVAL("DISPENSE DRUG")
S DRUG=$S(+DRUG=0:DRUG,1:$$DRUG^PSSCLINR(DRUG))
S TEMP="Inpatient Drug: "_DRUG_" = "
S TEMP=TEMP_"("_$$EDATE^PXRMDATE(IFIEVAL("START DATE"))
S TEMP=TEMP_" - "_$$EDATE^PXRMDATE(IFIEVAL("STOP DATE"))_")"
D FORMATS^PXRMTEXT(INDENT+1,PXRMRM,TEMP,.NOUT,.TEXTOUT)
F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
Q
;
;===============================================
OUTPUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the clinical
;maintenance output.
N DRUG,JND,NOUT,TEMP,TEXTOUT
S DRUG=IFIEVAL("DISPENSE DRUG")
S DRUG=$S(+DRUG=0:DRUG,1:$$DRUG^PSSCLINR(DRUG))
S NLINES=NLINES+1
S TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT," ")_"Inpatient Medication: "_DRUG
S TEMP=$$EDATE^PXRMDATE(IFIEVAL("DATE"))_" Status: "_IFIEVAL("STATUS")_"\\"
S TEMP=TEMP_"Start date: "_$$EDATE^PXRMDATE(IFIEVAL("START DATE"))
S TEMP=TEMP_" Stop date: "_$$EDATE^PXRMDATE(IFIEVAL("STOP DATE"))
I $D(IFIEVAL("DURATION")) S TEMP=TEMP_" Duration: "_IFIEVAL("DURATION")_" D"
D FORMATS^PXRMTEXT(INDENT+1,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[HPXRMDIN 2228 printed Oct 16, 2024@17:44:39 Page 2
PXRMDIN ; SLC/PKR - Handle inpatient med findings. ;02/10/2010
+1 ;;2.0;CLINICAL REMINDERS;**4,12,17**;Feb 04, 2005;Build 102
+2 ;DBIA #5187 for PSSCLINR
+3 ;
+4 ;===============================================
GETDATA(DAS,FIEVT) ;Return data for an inpatient drug finding.
+1 ;DBIA #3836
+2 DO OEL^PSJPXRM1(DAS,.FIEVT)
+3 SET (FIEVT("STATUS"),FIEVT("VALUE"))=FIEVT("STAT")
KILL FIEVT("STAT")
+4 SET FIEVT("START DATE")=FIEVT("START")
KILL FIEVT("START")
+5 SET FIEVT("STOP DATE")=FIEVT("STOP")
KILL FIEVT("STOP")
+6 SET FIEVT("DURATION")=$$DURATION^PXRMDATE(FIEVT("START DATE"),FIEVT("STOP DATE"))
+7 QUIT
+8 ;
+9 ;===============================================
GETFNAME(DRUG,FIEVT) ;Return the name of the drug.
+1 QUIT $SELECT(+DRUG=0:DRUG,1:$$DRUG^PSSCLINR(DRUG))
+2 ;
+3 ;===============================================
EVALTERM(DFN,FINDPA,ENODE,TERMARR,TFIEVAL) ;Evaluate terms.
+1 DO EVALTERM^PXRMINDX(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL)
+2 QUIT
+3 ;
+4 ;===============================================
MHVOUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the MHV output.
+1 NEW DRUG,JND,NOUT,TEMP,TEXTOUT
+2 SET DRUG=IFIEVAL("DISPENSE DRUG")
+3 SET DRUG=$SELECT(+DRUG=0:DRUG,1:$$DRUG^PSSCLINR(DRUG))
+4 SET TEMP="Inpatient Drug: "_DRUG_" = "
+5 SET TEMP=TEMP_"("_$$EDATE^PXRMDATE(IFIEVAL("START DATE"))
+6 SET TEMP=TEMP_" - "_$$EDATE^PXRMDATE(IFIEVAL("STOP DATE"))_")"
+7 DO FORMATS^PXRMTEXT(INDENT+1,PXRMRM,TEMP,.NOUT,.TEXTOUT)
+8 FOR JND=1:1:NOUT
SET NLINES=NLINES+1
SET TEXT(NLINES)=TEXTOUT(JND)
+9 QUIT
+10 ;
+11 ;===============================================
OUTPUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the clinical
+1 ;maintenance output.
+2 NEW DRUG,JND,NOUT,TEMP,TEXTOUT
+3 SET DRUG=IFIEVAL("DISPENSE DRUG")
+4 SET DRUG=$SELECT(+DRUG=0:DRUG,1:$$DRUG^PSSCLINR(DRUG))
+5 SET NLINES=NLINES+1
+6 SET TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT," ")_"Inpatient Medication: "_DRUG
+7 SET TEMP=$$EDATE^PXRMDATE(IFIEVAL("DATE"))_" Status: "_IFIEVAL("STATUS")_"\\"
+8 SET TEMP=TEMP_"Start date: "_$$EDATE^PXRMDATE(IFIEVAL("START DATE"))
+9 SET TEMP=TEMP_" Stop date: "_$$EDATE^PXRMDATE(IFIEVAL("STOP DATE"))
+10 IF $DATA(IFIEVAL("DURATION"))
SET TEMP=TEMP_" Duration: "_IFIEVAL("DURATION")_" D"
+11 DO FORMATS^PXRMTEXT(INDENT+1,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)=""
+14 QUIT
+15 ;