PXRMEDU ;SLC/PKR - Handle education findings. ;04/15/2022
;;2.0;CLINICAL REMINDERS;**42,65**;Feb 04, 2005;Build 438
;
;=========================================================
EVALFI(DFN,DEFARR,ENODE,FIEVAL) ;Evaluate education findings.
D EVALFI^PXRMINDX(DFN,.DEFARR,ENODE,.FIEVAL)
Q
;
;=========================================================
EVALPL(FINDPA,ENODE,TERMARR,PLIST) ;Evaluate education term findings
;for patient lists.
D EVALPL^PXRMINDL(.FINDPA,ENODE,.TERMARR,PLIST)
Q
;
;=========================================================
EVALTERM(DFN,FINDPA,ENODE,TERMARR,TFIEVAL) ;Evaluate education terms.
D EVALTERM^PXRMINDX(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL)
Q
;
;=========================================================
GETDATA(DAS,FIEVT) ;Return data, for a specified V Patient ED entry.
;DBIA #4250
D VPEDU^PXPXRM(DAS,.FIEVT)
Q
;
;=========================================================
MHVOUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the MHV output.
N CAPTION,EDU220,EM,FIEN,IND,JND,MAGNITUDE,NAME,NOUT,PNAME,LOU,TEMP,TEXTOUT
N UCUMIEN,UCUMDISPLAY,UCUMFIELD,UNITS,VDATE
S FIEN=$P(IFIEVAL("FINDING"),";",1)
S TEMP=^AUTTEDT(FIEN,0)
S PNAME=$P(TEMP,U,4)
I PNAME="" S PNAME=$P(TEMP,U,1)
S NAME="Education Topic: "_PNAME_" = "
S EDU220=$G(^AUTTEDT(FIEN,220))
S UCUMIEN=$P(EDU220,U,4)
I UCUMIEN'="" D
. S UCUMDISPLAY=$P(EDU220,U,6)
. I UCUMDISPLAY="N" S UNITS="" Q
. S UCUMFIELD=$S(UCUMDISPLAY="C":"UCUM CODE",1:"DESCRIPTION")
. S UNITS=$$UCUMFIELDS^PXRMUCUM(UCUMIEN,UCUMFIELD)
E S UNITS=""
S IND=0
F S IND=+$O(IFIEVAL(IND)) Q:IND=0 D
. S LOU=$G(IFIEVAL(IND,"VALUE"))
. I LOU'="" S LOU=$$EXTERNAL^DILFD(9000010.16,.06,"",LOU,.EM)
. S VDATE=IFIEVAL(IND,"DATE")
. S TEMP=NAME_LOU_" ("_$$EDATE^PXRMDATE(VDATE)_")"
. D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
. F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
. I IFIEVAL(IND,"MEASUREMENT")'="" D
.. S MAGNITUDE=$P(IFIEVAL(IND,"MEASUREMENT"),U,1)
.. I MAGNITUDE="" Q
.. S NLINES=NLINES+1
.. S CAPTION=$S(UNITS="":"Magnitude: ",1:"Measurement: ")
.. S TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT+1," ")_CAPTION_MAGNITUDE
.. I UNITS'="" S TEXT(NLINES)=TEXT(NLINES)_" "_UNITS
S NLINES=NLINES+1,TEXT(NLINES)=""
Q
;
;=========================================================
OUTPUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the clinical
;maintenance output.
N CAPTION,EDU220,EM,FIEN,IND,JND,MAGNITUDE,NOUT,PNAME,LOU,TEMP,TEXTOUT
N UCUMIEN,UCUMDISPLAY,UCUMFIELD,UNITS,VDATE
S FIEN=$P(IFIEVAL("FINDING"),";",1)
S TEMP=^AUTTEDT(FIEN,0)
S PNAME=$P(TEMP,U,4)
I PNAME="" S PNAME=$P(TEMP,U,1)
S EDU220=$G(^AUTTEDT(FIEN,220))
S UCUMIEN=$P(EDU220,U,4)
I UCUMIEN'="" D
. S UCUMDISPLAY=$P(EDU220,U,6)
. I UCUMDISPLAY="N" S UNITS="" Q
. S UCUMFIELD=$S(UCUMDISPLAY="C":"UCUM CODE",1:"DESCRIPTION")
. S UNITS=$$UCUMFIELDS^PXRMUCUM(UCUMIEN,UCUMFIELD)
E S UNITS=""
I INDENT+17+$L(PNAME)<81 D
. S NLINES=NLINES+1
. S TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT," ")_"Education Topic: "_PNAME
E D
. N COL1W,COL2W,FMTSTR
. S TEMP="Education Topic:^"_PNAME
. S COL1W=INDENT+16,COL2W=80-COL1W
. S FMTSTR=COL1W_"R1^"_COL2W_"L"
. D COLFMT^PXRMTEXT(FMTSTR,TEMP," ",.NOUT,.TEXTOUT)
. F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
S IND=0
F S IND=+$O(IFIEVAL(IND)) Q:IND=0 D
. S VDATE=IFIEVAL(IND,"DATE")
. S TEMP=$$EDATE^PXRMDATE(VDATE)
. S LOU=$G(IFIEVAL(IND,"VALUE"))
. I LOU'="" D
.. S TEMP=TEMP_" level of understanding - "
.. S TEMP=TEMP_$$EXTERNAL^DILFD(9000010.16,.06,"",LOU,.EM)
. D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
. F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
. I IFIEVAL(IND,"MEASUREMENT")'="" D
.. S MAGNITUDE=$P(IFIEVAL(IND,"MEASUREMENT"),U,1)
.. I MAGNITUDE="" Q
.. S NLINES=NLINES+1
.. S CAPTION=$S(UNITS="":"Magnitude: ",1:"Measurement: ")
.. S TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT+1," ")_CAPTION_MAGNITUDE
.. I UNITS'="" S TEXT(NLINES)=TEXT(NLINES)_" "_UNITS
. I IFIEVAL(IND,"COMMENTS")'="" D
.. S TEMP="Comments: "_IFIEVAL(IND,"COMMENTS")
.. D FORMATS^PXRMTEXT(INDENT+3,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[HPXRMEDU 4323 printed Dec 13, 2024@01:44:25 Page 2
PXRMEDU ;SLC/PKR - Handle education findings. ;04/15/2022
+1 ;;2.0;CLINICAL REMINDERS;**42,65**;Feb 04, 2005;Build 438
+2 ;
+3 ;=========================================================
EVALFI(DFN,DEFARR,ENODE,FIEVAL) ;Evaluate education findings.
+1 DO EVALFI^PXRMINDX(DFN,.DEFARR,ENODE,.FIEVAL)
+2 QUIT
+3 ;
+4 ;=========================================================
EVALPL(FINDPA,ENODE,TERMARR,PLIST) ;Evaluate education 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 education terms.
+1 DO EVALTERM^PXRMINDX(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL)
+2 QUIT
+3 ;
+4 ;=========================================================
GETDATA(DAS,FIEVT) ;Return data, for a specified V Patient ED entry.
+1 ;DBIA #4250
+2 DO VPEDU^PXPXRM(DAS,.FIEVT)
+3 QUIT
+4 ;
+5 ;=========================================================
MHVOUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the MHV output.
+1 NEW CAPTION,EDU220,EM,FIEN,IND,JND,MAGNITUDE,NAME,NOUT,PNAME,LOU,TEMP,TEXTOUT
+2 NEW UCUMIEN,UCUMDISPLAY,UCUMFIELD,UNITS,VDATE
+3 SET FIEN=$PIECE(IFIEVAL("FINDING"),";",1)
+4 SET TEMP=^AUTTEDT(FIEN,0)
+5 SET PNAME=$PIECE(TEMP,U,4)
+6 IF PNAME=""
SET PNAME=$PIECE(TEMP,U,1)
+7 SET NAME="Education Topic: "_PNAME_" = "
+8 SET EDU220=$GET(^AUTTEDT(FIEN,220))
+9 SET UCUMIEN=$PIECE(EDU220,U,4)
+10 IF UCUMIEN'=""
Begin DoDot:1
+11 SET UCUMDISPLAY=$PIECE(EDU220,U,6)
+12 IF UCUMDISPLAY="N"
SET UNITS=""
QUIT
+13 SET UCUMFIELD=$SELECT(UCUMDISPLAY="C":"UCUM CODE",1:"DESCRIPTION")
+14 SET UNITS=$$UCUMFIELDS^PXRMUCUM(UCUMIEN,UCUMFIELD)
End DoDot:1
+15 IF '$TEST
SET UNITS=""
+16 SET IND=0
+17 FOR
SET IND=+$ORDER(IFIEVAL(IND))
if IND=0
QUIT
Begin DoDot:1
+18 SET LOU=$GET(IFIEVAL(IND,"VALUE"))
+19 IF LOU'=""
SET LOU=$$EXTERNAL^DILFD(9000010.16,.06,"",LOU,.EM)
+20 SET VDATE=IFIEVAL(IND,"DATE")
+21 SET TEMP=NAME_LOU_" ("_$$EDATE^PXRMDATE(VDATE)_")"
+22 DO FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
+23 FOR JND=1:1:NOUT
SET NLINES=NLINES+1
SET TEXT(NLINES)=TEXTOUT(JND)
+24 IF IFIEVAL(IND,"MEASUREMENT")'=""
Begin DoDot:2
+25 SET MAGNITUDE=$PIECE(IFIEVAL(IND,"MEASUREMENT"),U,1)
+26 IF MAGNITUDE=""
QUIT
+27 SET NLINES=NLINES+1
+28 SET CAPTION=$SELECT(UNITS="":"Magnitude: ",1:"Measurement: ")
+29 SET TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT+1," ")_CAPTION_MAGNITUDE
+30 IF UNITS'=""
SET TEXT(NLINES)=TEXT(NLINES)_" "_UNITS
End DoDot:2
End DoDot:1
+31 SET NLINES=NLINES+1
SET TEXT(NLINES)=""
+32 QUIT
+33 ;
+34 ;=========================================================
OUTPUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the clinical
+1 ;maintenance output.
+2 NEW CAPTION,EDU220,EM,FIEN,IND,JND,MAGNITUDE,NOUT,PNAME,LOU,TEMP,TEXTOUT
+3 NEW UCUMIEN,UCUMDISPLAY,UCUMFIELD,UNITS,VDATE
+4 SET FIEN=$PIECE(IFIEVAL("FINDING"),";",1)
+5 SET TEMP=^AUTTEDT(FIEN,0)
+6 SET PNAME=$PIECE(TEMP,U,4)
+7 IF PNAME=""
SET PNAME=$PIECE(TEMP,U,1)
+8 SET EDU220=$GET(^AUTTEDT(FIEN,220))
+9 SET UCUMIEN=$PIECE(EDU220,U,4)
+10 IF UCUMIEN'=""
Begin DoDot:1
+11 SET UCUMDISPLAY=$PIECE(EDU220,U,6)
+12 IF UCUMDISPLAY="N"
SET UNITS=""
QUIT
+13 SET UCUMFIELD=$SELECT(UCUMDISPLAY="C":"UCUM CODE",1:"DESCRIPTION")
+14 SET UNITS=$$UCUMFIELDS^PXRMUCUM(UCUMIEN,UCUMFIELD)
End DoDot:1
+15 IF '$TEST
SET UNITS=""
+16 IF INDENT+17+$LENGTH(PNAME)<81
Begin DoDot:1
+17 SET NLINES=NLINES+1
+18 SET TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT," ")_"Education Topic: "_PNAME
End DoDot:1
+19 IF '$TEST
Begin DoDot:1
+20 NEW COL1W,COL2W,FMTSTR
+21 SET TEMP="Education Topic:^"_PNAME
+22 SET COL1W=INDENT+16
SET COL2W=80-COL1W
+23 SET FMTSTR=COL1W_"R1^"_COL2W_"L"
+24 DO COLFMT^PXRMTEXT(FMTSTR,TEMP," ",.NOUT,.TEXTOUT)
+25 FOR JND=1:1:NOUT
SET NLINES=NLINES+1
SET TEXT(NLINES)=TEXTOUT(JND)
End DoDot:1
+26 SET IND=0
+27 FOR
SET IND=+$ORDER(IFIEVAL(IND))
if IND=0
QUIT
Begin DoDot:1
+28 SET VDATE=IFIEVAL(IND,"DATE")
+29 SET TEMP=$$EDATE^PXRMDATE(VDATE)
+30 SET LOU=$GET(IFIEVAL(IND,"VALUE"))
+31 IF LOU'=""
Begin DoDot:2
+32 SET TEMP=TEMP_" level of understanding - "
+33 SET TEMP=TEMP_$$EXTERNAL^DILFD(9000010.16,.06,"",LOU,.EM)
End DoDot:2
+34 DO FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
+35 FOR JND=1:1:NOUT
SET NLINES=NLINES+1
SET TEXT(NLINES)=TEXTOUT(JND)
+36 IF IFIEVAL(IND,"MEASUREMENT")'=""
Begin DoDot:2
+37 SET MAGNITUDE=$PIECE(IFIEVAL(IND,"MEASUREMENT"),U,1)
+38 IF MAGNITUDE=""
QUIT
+39 SET NLINES=NLINES+1
+40 SET CAPTION=$SELECT(UNITS="":"Magnitude: ",1:"Measurement: ")
+41 SET TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT+1," ")_CAPTION_MAGNITUDE
+42 IF UNITS'=""
SET TEXT(NLINES)=TEXT(NLINES)_" "_UNITS
End DoDot:2
+43 IF IFIEVAL(IND,"COMMENTS")'=""
Begin DoDot:2
+44 SET TEMP="Comments: "_IFIEVAL(IND,"COMMENTS")
+45 DO FORMATS^PXRMTEXT(INDENT+3,PXRMRM,TEMP,.NOUT,.TEXTOUT)
+46 FOR JND=1:1:NOUT
SET NLINES=NLINES+1
SET TEXT(NLINES)=TEXTOUT(JND)
End DoDot:2
End DoDot:1
+47 SET NLINES=NLINES+1
SET TEXT(NLINES)=""
+48 QUIT
+49 ;