source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSPXTP.m@ 619

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

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1GMTSPXTP ; SLC/SBW,KER - PCE Treatment Comp ; 08/27/2002
2 ;;2.7;Health Summary;**8,10,28,56**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 1242 TREAT^PXRHS06
6 ; DBIA 10011 ^DIWP
7 ;
8TRTMT ; Treatments within a Date Range and Service Category
9 N SERCAT S SERCAT="AICTSORXHDE"
10 ;
11 ; SERCAT is a sting containing service categories:
12 ; Ambulatory A
13 ; Inpatient I
14 ; Chart Review C
15 ; Telecommunications T
16 ; Day Surgery S
17 ; Observation O
18 ; Nursing Home R
19 ; Ancillary X
20 ; Hospitalization H
21 ; Daily Hospitalization Ancillary D
22 ; Historical event encounters E
23 ;
24 K ^TMP("PXT",$J)
25 D TREAT^PXRHS06(DFN,GMTSEND,GMTSBEG,GMTSNDM,SERCAT) Q:'$D(^TMP("PXT",$J))
26 N GMDT,GMIFN,GMSITE,GMN0,GMN1,X,GMTSDAT,TREAT,NUM,PDT
27 N GMTXT,GMTSICL,DIWL,GMTAB,GMTSX,GMCKP,PNARR,GMPSITE,GMTR,PSITE
28 N GMTSLN,GMICL,GMTAB,COMMENT S GMTSICL=24,DIWL=0,GMTAB=2,GMDT=0
29 D CKP^GMTSUP Q:$D(GMTSQIT) D HDR
30 F S GMDT=$O(^TMP("PXT",$J,GMDT)) Q:GMDT'>0 D Q:$D(GMTSQIT)
31 . S GMTR=""
32 . F S GMTR=$O(^TMP("PXT",$J,GMDT,GMTR)) Q:GMTR']"" D Q:$D(GMTSQIT)
33 . . S GMIFN=0
34 . . F S GMIFN=$O(^TMP("PXT",$J,GMDT,GMTR,GMIFN)) Q:GMIFN'>0 D TREATDSP Q:$D(GMTSQIT)
35 K ^TMP("PXT",$J)
36 Q
37HDR ; Display Header
38 W ?2,"Date",?10,"Facility",?22,"Treatment (Qty) ; Provider Narrative",!!
39 Q
40TREATDSP ; Display Treatment Data
41 S GMN0=$G(^TMP("PXT",$J,GMDT,GMTR,GMIFN,0)) Q:GMN0']""
42 S GMN1=$G(^TMP("PXT",$J,GMDT,GMTR,GMIFN,1))
43 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")
44 S X=$P(GMN0,U,2)
45 D REGDT4^GMTSU S GMTSDAT=X
46 S TREAT=$P(GMN0,U),NUM=$P(GMN0,U,3)
47 S PNARR=$G(^TMP("PXT",$J,GMDT,GMTR,GMIFN,"P")) S:PNARR=TREAT PNARR=""
48 S GMTXT=TREAT_$S(NUM]"":" ("_NUM_")",1:"")_$S(PNARR]"":"; "_PNARR,1:"")
49 D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HDR
50 I GMTSDAT'=$G(PDT)!GMTSNPG W GMTSDAT S PDT=GMTSDAT,PSITE=""
51 I GMSITE'=$G(PSITE) W ?12,GMSITE S PSITE=GMSITE
52 D TXTFMT^GMTSPXU1(GMTXT,"",GMTSICL,GMTAB,DIWL)
53 I '$D(^UTILITY($J,"W")) Q
54 S (GMTSX,GMCKP)=0
55 F S GMTSX=$O(^UTILITY($J,"W",DIWL,GMTSX)) Q:GMTSX'>0!$D(GMTSQIT) D
56 . I GMCKP>0 D CKP^GMTSUP Q:$D(GMTSQIT) D:GMTSNPG HDR W:GMTSNPG GMTSDAT,?10,GMSITE
57 . S GMCKP=1
58 . W ?GMTSICL+$S(GMTSX>1:GMTAB,1:0),$G(^UTILITY($J,"W",DIWL,GMTSX,0)),!
59 S COMMENT=$P($G(^TMP("PXT",$J,GMDT,GMTR,GMIFN,"COM")),U)
60 I COMMENT]"" S GMICL=26,GMTAB=2 D FORMAT I $D(^UTILITY($J,"W")) D
61 . F GMTSLN=1:1:^UTILITY($J,"W",DIWL) D LINE Q:$D(GMTSQIT)
62 Q
63FORMAT ; Format Line
64 N DIWR,DIWF,X S DIWL=3,DIWR=80-(GMICL+GMTAB) K ^UTILITY($J,"W")
65 S X=COMMENT D ^DIWP
66 Q
67LINE ; Write Line
68 D CKP^GMTSUP Q:$D(GMTSQIT) W ?26,^UTILITY($J,"W",DIWL,GMTSLN,0),!
69 Q
Note: See TracBrowser for help on using the repository browser.