GMTSPXEP ; SLC/SBW,KER - PCE Patient Education comp ; 08/27/2002
;;2.7;Health Summary;**8,10,28,35,56**;Oct 20, 1995
;
; External References
; DBIA 3063 EDUC^PXRHS08
; DBIA 10011 ^DIWP
;
PTED ; Patient Education
N GMTSOVT K ^TMP("PXPE",$J) S GMTSOVT="AICTSORXHDE"
;
; GMTSOVT is a sting containing a set of Service
; Categories for:
;
; Ambulatory A
; Inpatient I
; Chart Review C
; Telecommunications T
; Day Surgery S
; Observation O
; Nursing Home R
; Ancillary X
; Hospitalization H
; Daily Hospitalization Ancillary D
; Event-Historical E
;
D EDUC^PXRHS08(DFN,GMTSEND,GMTSBEG,GMTSNDM,GMTSOVT)
Q:'$D(^TMP("PXPE",$J)) D CKP^GMTSUP Q:$D(GMTSQIT) D HDR,EDMAIN
Q
MRPTED ; Most recent patient education
N GMTSOVT,LATEST K ^TMP("PXPE",$J) S LATEST="R",GMTSOVT="AICTSORXHDE"
;
; Returns most recent Patient Education Topic Types
; for time period. GMTSOVT is a sting containing a
; set of Service Categories for:
;
; Ambulatory A
; Inpatient I
; Chart Review C
; Telecommunications T
; Day Surgery S
; Observation O
; Nursing Home R
; Ancillary X
; Hospitalization H
; Daily Hospitalization Ancillary D
; Event-Historical E
;
D EDUC^PXRHS08(DFN,GMTSEND,GMTSBEG,LATEST,GMTSOVT)
Q:'$D(^TMP("PXPE",$J))
D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HDR
D EDMAIN
Q
HDR ; Header
W ?2,"Date",?12,"Facility",?25,"Topic - Understanding Level",!!
Q
EDMAIN ; Main Education Display
N GMDT,GMED,GMIFN,GMN0,GMN1,X,GMTSDAT,ED,LEVEL,GMSITE,PSITE,PDT,LTXT
N COMMENT,GMICL,GMTSLN,GMTAB
S GMDT=0
F S GMDT=$O(^TMP("PXPE",$J,GMDT)) Q:GMDT'>0 D Q:$D(GMTSQIT)
. S GMED=""
. F S GMED=$O(^TMP("PXPE",$J,GMDT,GMED)) Q:GMED']"" D Q:$D(GMTSQIT)
. . S GMIFN=0
. . F S GMIFN=$O(^TMP("PXPE",$J,GMDT,GMED,GMIFN)) Q:GMIFN'>0 D Q:$D(GMTSQIT)
. . . S GMN0=$G(^TMP("PXPE",$J,GMDT,GMED,GMIFN,0))
. . . Q:GMN0']""
. . . S GMN1=$G(^TMP("PXPE",$J,GMDT,GMED,GMIFN,1))
. . . S GMSITE=$S($P(GMN1,U,3)]"":$E($P(GMN1,U,3),1,10),$P(GMN1,U,4)]"":$E($P(GMN1,U,4),1,10),1:"No Site")
. . . S X=$P(GMN0,U,2) D REGDT4^GMTSU S GMTSDAT=X
. . . S LTXT="",ED=$P(GMN0,U),LEVEL=$P(GMN0,U,3)
. . . I LEVEL]"" S LTXT=" - "_LEVEL
. . . I LEVEL="POOR"!(LEVEL="FAIR")!(LEVEL="GOOD") S LTXT=LTXT_" UNDERSTANDING"
. . . D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HDR
. . . I GMTSDAT'=$G(PDT)!GMTSNPG W GMTSDAT S PDT=GMTSDAT,PSITE=""
. . . I GMSITE'=$G(PSITE) W ?12,GMSITE S PSITE=GMSITE
. . . W ?25,ED,$G(LTXT),!
. . . S COMMENT="",COMMENT=$P(^TMP("PXPE",$J,GMDT,GMED,GMIFN,"COM"),U)
. . . I COMMENT]"" S GMICL=26,GMTAB=2 D FORMAT I $D(^UTILITY($J,"W")) D
. . . . F GMTSLN=1:1:^UTILITY($J,"W",DIWL) D LINE Q:$D(GMTSQIT)
K ^TMP("PXPE",$J)
Q
FORMAT ; Format Line
N DIWR,DIWF,X S DIWL=3,DIWR=80-(GMICL+GMTAB)
K ^UTILITY($J,"W") S X=COMMENT D ^DIWP
Q
LINE ; Write Line
D CKP^GMTSUP Q:$D(GMTSQIT) W ?26,^UTILITY($J,"W",DIWL,GMTSLN,0),!
Q
GMTSPXEP ; SLC/SBW,KER - PCE Patient Education comp ; 08/27/2002
+1 ;;2.7;Health Summary;**8,10,28,35,56**;Oct 20, 1995
+2 ;
+3 ; External References
+4 ; DBIA 3063 EDUC^PXRHS08
+5 ; DBIA 10011 ^DIWP
+6 ;
PTED ; Patient Education
+1 NEW GMTSOVT
KILL ^TMP("PXPE",$JOB)
SET GMTSOVT="AICTSORXHDE"
+2 ;
+3 ; GMTSOVT is a sting containing a set of Service
+4 ; Categories for:
+5 ;
+6 ; Ambulatory A
+7 ; Inpatient I
+8 ; Chart Review C
+9 ; Telecommunications T
+10 ; Day Surgery S
+11 ; Observation O
+12 ; Nursing Home R
+13 ; Ancillary X
+14 ; Hospitalization H
+15 ; Daily Hospitalization Ancillary D
+16 ; Event-Historical E
+17 ;
+18 DO EDUC^PXRHS08(DFN,GMTSEND,GMTSBEG,GMTSNDM,GMTSOVT)
+19 IF '$DATA(^TMP("PXPE",$JOB))
QUIT
DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
DO HDR
DO EDMAIN
+20 QUIT
MRPTED ; Most recent patient education
+1 NEW GMTSOVT,LATEST
KILL ^TMP("PXPE",$JOB)
SET LATEST="R"
SET GMTSOVT="AICTSORXHDE"
+2 ;
+3 ; Returns most recent Patient Education Topic Types
+4 ; for time period. GMTSOVT is a sting containing a
+5 ; set of Service Categories for:
+6 ;
+7 ; Ambulatory A
+8 ; Inpatient I
+9 ; Chart Review C
+10 ; Telecommunications T
+11 ; Day Surgery S
+12 ; Observation O
+13 ; Nursing Home R
+14 ; Ancillary X
+15 ; Hospitalization H
+16 ; Daily Hospitalization Ancillary D
+17 ; Event-Historical E
+18 ;
+19 DO EDUC^PXRHS08(DFN,GMTSEND,GMTSBEG,LATEST,GMTSOVT)
+20 IF '$DATA(^TMP("PXPE",$JOB))
QUIT
+21 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
IF GMTSNPG
DO HDR
+22 DO EDMAIN
+23 QUIT
HDR ; Header
+1 WRITE ?2,"Date",?12,"Facility",?25,"Topic - Understanding Level",!!
+2 QUIT
EDMAIN ; Main Education Display
+1 NEW GMDT,GMED,GMIFN,GMN0,GMN1,X,GMTSDAT,ED,LEVEL,GMSITE,PSITE,PDT,LTXT
+2 NEW COMMENT,GMICL,GMTSLN,GMTAB
+3 SET GMDT=0
+4 FOR
SET GMDT=$ORDER(^TMP("PXPE",$JOB,GMDT))
IF GMDT'>0
QUIT
Begin DoDot:1
+5 SET GMED=""
+6 FOR
SET GMED=$ORDER(^TMP("PXPE",$JOB,GMDT,GMED))
IF GMED']""
QUIT
Begin DoDot:2
+7 SET GMIFN=0
+8 FOR
SET GMIFN=$ORDER(^TMP("PXPE",$JOB,GMDT,GMED,GMIFN))
IF GMIFN'>0
QUIT
Begin DoDot:3
+9 SET GMN0=$GET(^TMP("PXPE",$JOB,GMDT,GMED,GMIFN,0))
+10 IF GMN0']""
QUIT
+11 SET GMN1=$GET(^TMP("PXPE",$JOB,GMDT,GMED,GMIFN,1))
+12 SET GMSITE=$SELECT($PIECE(GMN1,U,3)]"":$EXTRACT($PIECE(GMN1,U,3),1,10),$PIECE(GMN1,U,4)]"":$EXTRACT($PIECE(GMN1,U,4),1,10),1:"No Site")
+13 SET X=$PIECE(GMN0,U,2)
DO REGDT4^GMTSU
SET GMTSDAT=X
+14 SET LTXT=""
SET ED=$PIECE(GMN0,U)
SET LEVEL=$PIECE(GMN0,U,3)
+15 IF LEVEL]""
SET LTXT=" - "_LEVEL
+16 IF LEVEL="POOR"!(LEVEL="FAIR")!(LEVEL="GOOD")
SET LTXT=LTXT_" UNDERSTANDING"
+17 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
IF GMTSNPG
DO HDR
+18 IF GMTSDAT'=$GET(PDT)!GMTSNPG
WRITE GMTSDAT
SET PDT=GMTSDAT
SET PSITE=""
+19 IF GMSITE'=$GET(PSITE)
WRITE ?12,GMSITE
SET PSITE=GMSITE
+20 WRITE ?25,ED,$GET(LTXT),!
+21 SET COMMENT=""
SET COMMENT=$PIECE(^TMP("PXPE",$JOB,GMDT,GMED,GMIFN,"COM"),U)
+22 IF COMMENT]""
SET GMICL=26
SET GMTAB=2
DO FORMAT
IF $DATA(^UTILITY($JOB,"W"))
Begin DoDot:4
+23 FOR GMTSLN=1:1:^UTILITY($JOB,"W",DIWL)
DO LINE
IF $DATA(GMTSQIT)
QUIT
End DoDot:4
End DoDot:3
IF $DATA(GMTSQIT)
QUIT
End DoDot:2
IF $DATA(GMTSQIT)
QUIT
End DoDot:1
IF $DATA(GMTSQIT)
QUIT
+24 KILL ^TMP("PXPE",$JOB)
+25 QUIT
FORMAT ; Format Line
+1 NEW DIWR,DIWF,X
SET DIWL=3
SET DIWR=80-(GMICL+GMTAB)
+2 KILL ^UTILITY($JOB,"W")
SET X=COMMENT
DO ^DIWP
+3 QUIT
LINE ; Write Line
+1 DO CKP^GMTSUP
IF $DATA(GMTSQIT)
QUIT
WRITE ?26,^UTILITY($JOB,"W",DIWL,GMTSLN,0),!
+2 QUIT