source: FOIAVistA/trunk/r/HEALTH_SUMMARY-GMTS/GMTSPXEP.m@ 635

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

initial load of FOIAVistA 6/30/08 version

File size: 3.4 KB
Line 
1GMTSPXEP ; SLC/SBW,KER - PCE Patient Education comp ; 08/27/2002
2 ;;2.7;Health Summary;**8,10,28,35,56**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 3063 EDUC^PXRHS08
6 ; DBIA 10011 ^DIWP
7 ;
8PTED ; Patient Education
9 N GMTSOVT K ^TMP("PXPE",$J) S GMTSOVT="AICTSORXHDE"
10 ;
11 ; GMTSOVT is a sting containing a set of Service
12 ; Categories for:
13 ;
14 ; Ambulatory A
15 ; Inpatient I
16 ; Chart Review C
17 ; Telecommunications T
18 ; Day Surgery S
19 ; Observation O
20 ; Nursing Home R
21 ; Ancillary X
22 ; Hospitalization H
23 ; Daily Hospitalization Ancillary D
24 ; Event-Historical E
25 ;
26 D EDUC^PXRHS08(DFN,GMTSEND,GMTSBEG,GMTSNDM,GMTSOVT)
27 Q:'$D(^TMP("PXPE",$J)) D CKP^GMTSUP Q:$D(GMTSQIT) D HDR,EDMAIN
28 Q
29MRPTED ; Most recent patient education
30 N GMTSOVT,LATEST K ^TMP("PXPE",$J) S LATEST="R",GMTSOVT="AICTSORXHDE"
31 ;
32 ; Returns most recent Patient Education Topic Types
33 ; for time period. GMTSOVT is a sting containing a
34 ; set of Service Categories for:
35 ;
36 ; Ambulatory A
37 ; Inpatient I
38 ; Chart Review C
39 ; Telecommunications T
40 ; Day Surgery S
41 ; Observation O
42 ; Nursing Home R
43 ; Ancillary X
44 ; Hospitalization H
45 ; Daily Hospitalization Ancillary D
46 ; Event-Historical E
47 ;
48 D EDUC^PXRHS08(DFN,GMTSEND,GMTSBEG,LATEST,GMTSOVT)
49 Q:'$D(^TMP("PXPE",$J))
50 D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HDR
51 D EDMAIN
52 Q
53HDR ; Header
54 W ?2,"Date",?12,"Facility",?25,"Topic - Understanding Level",!!
55 Q
56EDMAIN ; Main Education Display
57 N GMDT,GMED,GMIFN,GMN0,GMN1,X,GMTSDAT,ED,LEVEL,GMSITE,PSITE,PDT,LTXT
58 N COMMENT,GMICL,GMTSLN,GMTAB
59 S GMDT=0
60 F S GMDT=$O(^TMP("PXPE",$J,GMDT)) Q:GMDT'>0 D Q:$D(GMTSQIT)
61 . S GMED=""
62 . F S GMED=$O(^TMP("PXPE",$J,GMDT,GMED)) Q:GMED']"" D Q:$D(GMTSQIT)
63 . . S GMIFN=0
64 . . F S GMIFN=$O(^TMP("PXPE",$J,GMDT,GMED,GMIFN)) Q:GMIFN'>0 D Q:$D(GMTSQIT)
65 . . . S GMN0=$G(^TMP("PXPE",$J,GMDT,GMED,GMIFN,0))
66 . . . Q:GMN0']""
67 . . . S GMN1=$G(^TMP("PXPE",$J,GMDT,GMED,GMIFN,1))
68 . . . 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")
69 . . . S X=$P(GMN0,U,2) D REGDT4^GMTSU S GMTSDAT=X
70 . . . S LTXT="",ED=$P(GMN0,U),LEVEL=$P(GMN0,U,3)
71 . . . I LEVEL]"" S LTXT=" - "_LEVEL
72 . . . I LEVEL="POOR"!(LEVEL="FAIR")!(LEVEL="GOOD") S LTXT=LTXT_" UNDERSTANDING"
73 . . . D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HDR
74 . . . I GMTSDAT'=$G(PDT)!GMTSNPG W GMTSDAT S PDT=GMTSDAT,PSITE=""
75 . . . I GMSITE'=$G(PSITE) W ?12,GMSITE S PSITE=GMSITE
76 . . . W ?25,ED,$G(LTXT),!
77 . . . S COMMENT="",COMMENT=$P(^TMP("PXPE",$J,GMDT,GMED,GMIFN,"COM"),U)
78 . . . I COMMENT]"" S GMICL=26,GMTAB=2 D FORMAT I $D(^UTILITY($J,"W")) D
79 . . . . F GMTSLN=1:1:^UTILITY($J,"W",DIWL) D LINE Q:$D(GMTSQIT)
80 K ^TMP("PXPE",$J)
81 Q
82FORMAT ; Format Line
83 N DIWR,DIWF,X S DIWL=3,DIWR=80-(GMICL+GMTAB)
84 K ^UTILITY($J,"W") S X=COMMENT D ^DIWP
85 Q
86LINE ; Write Line
87 D CKP^GMTSUP Q:$D(GMTSQIT) W ?26,^UTILITY($J,"W",DIWL,GMTSLN,0),!
88 Q
Note: See TracBrowser for help on using the repository browser.