source: FOIAVistA/trunk/r/HEALTH_SUMMARY-GMTS/GMTSPNB.m@ 1154

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

initial load of FOIAVistA 6/30/08 version

File size: 2.3 KB
Line 
1GMTSPNB ; SLC/JER/KER - TIU Brief Progress Notes ; 04/30/2002
2 ;;2.7;Health Summary;**12,28,33,49,55**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 10006 ^DIC (file #8925.1)
6 ; DBIA 10011 ^DIWP
7 ; DBIA 2902 VISIT^TIULAPIC
8 ; DBIA 2902 MAIN^TIULAPIC
9 ;
10MAIN ; Controls branching and execution
11 N PN,GMTSI,GMTSJ,TIUFPRIV,TIUSTAT,TIUTYPE,X,DIWF,DIWL,DIWR,MAX
12 K ^TMP("TIU",$J) S MAX=$S(+($G(GMTSNDM))>0:+($G(GMTSNDM)),1:99999)
13 S TIUSTAT="COMPLETED",TIUFPRIV=1
14 N X,Y S X="PROGRESS NOTES",DIC="^TIU(8925.1,",DIC(0)="X",DIC("S")="I $P($G(^(0)),U,4)=""CL""" D ^DIC S:Y>0 TIUTYPE=+Y
15 D EXTIU(DFN,TIUTYPE,GMTS1,GMTS2,MAX,0) Q:'$D(^TMP("TIU",$J))
16 D HEADER S GMTSI=0 F S GMTSI=$O(^TMP("TIU",$J,GMTSI)) Q:+GMTSI'>0!$D(GMTSQIT) D
17 . S GMTSJ=0 F S GMTSJ=$O(^TMP("TIU",$J,GMTSI,GMTSJ)) Q:+GMTSJ'>0!$D(GMTSQIT) D
18 . . D VARI(GMTSI,GMTSJ)
19 . . I $D(^TMP("TIU",$J,GMTSI,GMTSJ,"ZADD")) D ADDEND(GMTSI,GMTSJ)
20 . . D WRT
21 K ^TMP("TIU",$J)
22 Q
23 ;
24HEADER ; Prints header
25 D CKP^GMTSUP Q:$D(GMTSQIT) W "Prog Note DT",?16,"Title",?48,"Author",?64,"Last Corr DT",!!
26 Q
27 ;
28VARI(GMTSI,GMTSJ) ;Sets variables for display
29 S GMTSCNT=+$G(GMTSCNT)+1
30 S X=$G(^TMP("TIU",$J,GMTSI,GMTSJ,1301,"I")) D REGDT4^GMTSU S PN("DATE")=X
31 S PN("AUTHOR")=$G(^TMP("TIU",$J,GMTSI,GMTSJ,1202,"E"))
32 S PN("DOCTYPE")=$G(^TMP("TIU",$J,GMTSI,GMTSJ,.01,"E"))
33 I $L(PN("DOCTYPE"))>30 D FORMAT S PN("DOCTYPE")=^UTILITY($J,"W",1,1,0)
34 S PN("CORRDT")=""
35 Q
36 ;
37ADDEND(GMTSI,GMTSJ) ;Addenda date display
38 N GMTSAD
39 S GMTSAD=0
40 S GMTSAD=$O(^TMP("TIU",$J,GMTSI,GMTSJ,"ZADD",GMTSAD)) Q:+GMTSAD'>0
41 S X=^TMP("TIU",$J,GMTSI,GMTSJ,"ZADD",GMTSAD,1301,"I")
42 D REGDT4^GMTSU S PN("CORRDT")=X
43 Q
44 ;
45WRT ; Writes the component data
46 D CKP^GMTSUP Q:$D(GMTSQIT)
47 D:GMTSNPG HEADER W PN("DATE"),?16,PN("DOCTYPE"),?48,PN("AUTHOR"),?64,PN("CORRDT"),!
48 I $D(^UTILITY($J,"W",1,2,0)) D CKP^GMTSUP Q:$D(GMTSQIT) W ?16,^UTILITY($J,"W",1,2,0),!
49 K PN,^UTILITY($J)
50 Q
51 ;
52FORMAT ; Calls ^DIWP to format Title
53 N DIWF,DIWL,DIWR,X
54 S DIWF="C30",DIWL=1,DIWR=30,X=PN("DOCTYPE") D ^DIWP
55 Q
56EXTIU(DFN,GMTST,GMTS1,GMTS2,GMTSN,GMTSX) ; Extract Patient/Visit VIA TIU
57 N GMTSPV S GMTSPV=+($G(GMTSPXGO)) I GMTSPV,$L($T(VISIT^TIULAPIC)) D VISIT^TIULAPIC($G(DFN),$G(GMTST),$G(GMTS1),$G(GMTS2),$G(GMTSN),$G(GMTSX)) Q
58 D MAIN^TIULAPIC($G(DFN),$G(GMTST),$G(GMTS1),$G(GMTS2),$G(GMTSN),$G(GMTSX))
59 Q
Note: See TracBrowser for help on using the repository browser.