source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSOBA.m@ 836

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

initial load of WorldVistAEHR

File size: 6.6 KB
Line 
1GMTSOBA ; SLC/KER - HS Object - Ask ; 01/06/2003
2 ;;2.7;Health Summary;**58**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 10018 ^DIE (file #142.5)
6 ; DBIA 10026 ^DIR
7 ; DBIA 10103 $$FMTE^XLFDT
8 ; DBIA 10103 $$NOW^XLFDT
9 ;
10OBJ ; Create/Edit Object
11 N DA,X,Y,DIE,DR,GMTSED,GMTSCON,GMTSLBL,GMTSLBB,GMTSULB,GMTSHDR
12 N GMTSRDT,GMTSCON,GMTSRHD,GMTSNEW,GMTSNEWO,GMTSDES,GMTSCHD,GMTSLIM
13 N GMTSBLK,GMTSQ,GMTSDEC,GMTSNOD,GMTSOWN,GMTSDT,GMTSI,GMTSDA,GMTSUND
14 N GMTSTIM,GMTSTI,GMTSOI
15 S (GMTSHDR,GMTSRDT,GMTSCON,GMTSRHD,GMTSCHD,GMTSUND,GMTSLIM,GMTSULB,GMTSLBB,GMTSBLK,GMTSDEC,GMTSNOD)=0,GMTSOWN="",GMTSDES=1
16 S:'$L($G(GMTSNAM)) DA=$$LK^GMTSOBL Q:+($G(GMTSQ))>0
17 S:$L($G(GMTSNAM)) DA=$$HSO^GMTSOBL($G(GMTSNAM)) Q:+($G(GMTSQ))>0 Q:+($G(DA))'>0
18 S:$L($G(GMTSNAM)) GMTSNEW=+($P($G(DA),"^",3)),DA=+($P($G(DA),"^",1))
19 Q:+($G(DA))'>0 S (GMTSDA,GMTSOI)=+($G(DA)),GMTSTI=$P($G(^GMT(142.5,+GMTSOI,0)),"^",3) Q:+GMTSTI'>0
20 S GMTSLBL="" K GMTSOBJ S GMTSCON=1
21 I $L($G(GMTSNAM)),+GMTSNEW'>0,+DA>0 D Q:+($G(GMTSCON))'>0 Q:+($G(GMTSQ))>0
22 . N GMTSOWN S GMTSOWN=$P($G(^GMT(142.5,+DA,0)),"^",17)
23 . I +GMTSOWN>0,+($G(DUZ))>0,+GMTSOWN'=+($G(DUZ)) S GMTSCON=0 Q
24 . W !," Object '",GMTSNAM,"' already exist" S GMTSCON=$$CONT Q:+($G(GMTSCON))'>0
25 . N X,Y,DIR,DIE,DR,GMTSDEF,GMTSDICA,GMTSNAM,GMTSTYPE
26 . W ! S GMTSDEF=+($P($G(^GMT(142.5,+($G(DA)),0)),"^",3))
27 . S GMTSDEF=$S(+GMTSDEF>0:+GMTSDEF,1:"")
28 . S GMTSDICA=" Enter/Edit HEALTH SUMMARY TYPE: "
29 . K DTOUT,DUOUT,DIRUT,DIROUT
30 . S GMTSTYPE=$$TY^GMTSOBL(GMTSDEF)
31 . I $D(DTOUT)!($D(DUOUT))!($D(DIRUT))!($D(DIROUT)) S GMTSQ=1 Q
32 . S DR=".03////^S X=$G(GMTSTYPE)"
33 . S DIE="^GMT(142.5,",DA=+($G(DA)) S GMTSED=0
34 . F GMTSI=1:1:3 Q:GMTSI>3 L +^GMT(142.5,+($G(DA))):0 H:'$T 1 I $T D
35 . . D ^DIE S GMTSED=1 S $P(^GMT(142.5,+DA,0),U,19)=$$NOW^XLFDT,GMTSI=4
36 . . S:+($G(DUZ))>0 $P(^GMT(142.5,+DA,0),"^",17)=+($G(DUZ))
37 . I 'GMTSED S GMTSQ=1 K GMTSOBJ W !," Record Locked by another user" Q
38 . L -^GMT(142.5,+($G(DA))) S GMTST=+($P($G(^GMT(142.5,+DA,0)),U,3))
39 K:+($G(GMTSQ))>0 GMTSOBJ Q:+($G(GMTSQ))>0
40 D ALL K:+($G(GMTSQ))>0 GMTSOBJ S:+($G(GMTSQ))>0 GMTSDES=0 Q:+($G(GMTSQ))>0 N DIE,DR
41 S GMTSHDR=+($G(GMTSOBJ("HEADER")))
42 S GMTSLBL=$G(GMTSLBL) I GMTSHDR>0 D
43 . S GMTSRDT=$S($D(GMTSOBJ("DATE LINE")):1,1:0)
44 . S GMTSCON=$S($D(GMTSOBJ("CONFIDENTIAL")):1,1:0)
45 . S GMTSRHD=$S($D(GMTSOBJ("REPORT HEADER")):1,1:0)
46 . S GMTSCHD=$S($D(GMTSOBJ("COMPONENT HEADER")):1,1:0)
47 . S GMTSUND=$S($D(GMTSOBJ("UNDERLINE")):1,1:0)
48 . S GMTSLIM=$S($D(GMTSOBJ("LIMITS")):1,1:0)
49 . S GMTSBLK=$S($D(GMTSOBJ("BLANK LINE")):1,1:0)
50 . S GMTSDEC=$S($D(GMTSOBJ("DECEASED")):1,1:0)
51 . S GMTSULB=$S($D(GMTSOBJ("USE LABEL")):1,1:0)
52 . S GMTSLBB=$S($D(GMTSOBJ("LABEL BLANK LINE")):1,1:0)
53 I GMTSHDR'>0 S (GMTSRDT,GMTSCON,GMTSRHD,GMTSCHD,GMTSUND,GMTSLIM,GMTSBLK,GMTSDEC,GMTSULB,GMTSLBB)=0,GMTSLBL=""
54 S GMTSNOD=$S($D(GMTSOBJ("SUPPRESS COMPONENTS")):1,1:0)
55 S:+GMTSCHD'>0 (GMTSLIM,GMTSBLK)=0
56 S:'$L($G(GMTSLBL)) GMTSLBL="@",(GMTSULB,GMTSLBB)=0
57 N DR S DR=".02////^S X=$G(GMTSLBL);"
58 S:$L($G(GMTSTIM))&($G(GMTSTIM)'="@") DR=DR_".04////^S X=$G(GMTSTIM);"
59 S DR=DR_".05////^S X=$G(GMTSNOD);",DR=DR_".06////^S X=$G(GMTSHDR);"
60 S DR=DR_".07////^S X=$G(GMTSULB);",DR=DR_".08////^S X=$G(GMTSLBB);"
61 S DR=DR_".09////^S X=$G(GMTSRDT);",DR=DR_".1////^S X=$G(GMTSCON);"
62 S DR=DR_".11////^S X=$G(GMTSRHD);",DR=DR_".12////^S X=$G(GMTSCHD);"
63 S DR=DR_".13////^S X=$G(GMTSUND);",DR=DR_".14////^S X=$G(GMTSLIM);"
64 S DR=DR_".15////^S X=$G(GMTSBLK);",DR=DR_".16////^S X=$G(GMTSDEC);"
65 S:+($G(GMTSDES))>0 DR=DR_"1" S:$E(DR,1)=";" DR=$E(DR,2,$L(DR)) S:$E(DR,$L(DR))=";" DR=$E(DR,1,($L(DR)-1))
66 S DIE="^GMT(142.5,",DA=+($G(DA)) S GMTSED=0 W:+($G(GMTSDES))>0 !
67 F GMTSI=1:1:3 Q:GMTSI>3 L +^GMT(142.5,+($G(DA))):0 H:'$T 1 I $T D
68 . D ^DIE S GMTSED=1 S $P(^GMT(142.5,+DA,0),U,19)=$$NOW^XLFDT,GMTSI=4
69 . S:$G(GMTSTIM)="@" $P(^GMT(142.5,+DA,0),U,4)=""
70 I 'GMTSED S GMTSQ=1 K GMTSOBJ W !," Record Locked by another user" Q
71 L -^GMT(142.5,+($G(DA))) S GMTST=+($P($G(^GMT(142.5,+DA,0)),U,3))
72 K GMTSOBJ Q
73 ;
74ALL ; Print HS Header
75 N X,Y,DIR,DIROUT,DUOUT,DTOUT S GMTSOBJ="",GMTSQ=0 D RP Q:+($G(GMTSQ))>0
76 S DIR("A")=" Print standard Health Summary Header with the Object? "
77 S DIR("B")="N",DIR(0)="YAO",(DIR("?"),DIR("??"))="^D ALL^GMTSOBH"
78 W ! D ^DIR S:$D(DIROUT)!($D(DTOUT)) GMTSQ=1
79 S:Y["^"!(X["^") GMTSE=1,GMTSQ=1,GMTSDES=0
80 K:+($G(GMTSQ))>0!($D(DUOUT)) GMTSOBJ Q:+($G(GMTSQ))>0!($D(DUOUT))
81 S X=+($G(Y)) K:+X>0 GMTSOBJ S:+X'>0 GMTSOBJ=""
82 S GMTSOBJ("HEADER")=$S(+X'>0:1,1:0)
83 I +X'>0 D
84 . W ! D PART Q:+($G(GMTSQ))>1 W ! S GMTSLBL="" D LBL^GMTSOBA2
85 . S GMTSLBL=$S($L($G(GMTSOBJ("LABEL"))):$G(GMTSOBJ("LABEL")),1:"@")
86 . K:'$L($G(GMTSOBJ("LABEL"))) GMTSLBL,GMTSOBJ("LABEL BLANK LINE"),GMTSOBJ("USE LABEL")
87 W ! D SC^GMTSOBA2 K:+($G(GMTSQ))>0 GMTSOBJ
88 Q
89 ;
90RP ; Report Period
91 Q:+($G(GMTSQ))>0 N X,Y,DIR,DIROUT,DUOUT,DTOUT,GMTSDEF
92 S GMTSTIM=$$RP^GMTSOBT($G(GMTSTI),$G(GMTSOI)) S:+GMTSTIM<0 GMTSQ=1
93 Q
94 ;
95PART ; Print Partial Header
96 K:+($G(GMTSQ))>0 GMTSOBJ Q:+($G(GMTSQ))>0 W !," Partial Header:"
97 D:$D(GMTSOBJ) RD,RC,RH,CH^GMTSOBA2,DE^GMTSOBA2 Q
98RD ; Report Date
99 Q:+($G(GMTSQ))>0 N X,Y,DIR,DIROUT,DUOUT,DTOUT,GMTSDEF
100 S GMTSDEF=$P($G(^GMT(142.5,+($G(GMTSDA)),0)),U,9)
101 S GMTSDEF=$S(+GMTSDEF>0:"Y",1:"N")
102 S GMTSOBJ("DATE LINE")="",DIR("A")=" Print Report Date? "
103 S DIR("B")=GMTSDEF,DIR(0)="YAO",(DIR("?"),DIR("??"))="^D RD^GMTSOBH"
104 D ^DIR S:$D(DIROUT)!($D(DTOUT)) GMTSQ=1
105 S:Y["^"!(X["^") GMTSE=1,GMTSQ=1,GMTSDES=0
106 K:+($G(GMTSQ))>0 GMTSOBJ("DATE LINE") Q:+($G(GMTSQ))>0
107 S X=+($G(Y)) K:+X'>0 GMTSOBJ("DATE LINE") Q
108RC ; Confidentiality Banner
109 Q:+($G(GMTSQ))>0 N X,Y,DIR,DIROUT,DUOUT,DTOUT,GMTSDEF
110 S GMTSOBJ("CONFIDENTIAL")="",DIR("A")=" Print Confidentiality Banner? "
111 S GMTSDEF=$P($G(^GMT(142.5,+($G(GMTSDA)),0)),U,10)
112 S GMTSDEF=$S(+GMTSDEF>0:"Y",1:"N")
113 S DIR("B")=GMTSDEF,DIR(0)="YAO",(DIR("?"),DIR("??"))="^D RC^GMTSOBH"
114 D ^DIR S:$D(DIROUT)!($D(DTOUT)) GMTSQ=1
115 S:Y["^"!(X["^") GMTSE=1,GMTSQ=1,GMTSDES=0
116 K:+($G(GMTSQ))>0 GMTSOBJ("CONFIDENNTIAL") Q:+($G(GMTSQ))>0
117 S X=+($G(Y)) K:+X'>0 GMTSOBJ("CONFIDENTIAL") Q
118RH ; Report Header
119 Q:+($G(GMTSQ))>0 N X,Y,DIR,DIROUT,DUOUT,DTOUT,GMTSDEF
120 S GMTSOBJ("REPORT HEADER")="",DIR("A")=" Print Report Header? "
121 S GMTSDEF=$P($G(^GMT(142.5,+($G(GMTSDA)),0)),U,11)
122 S GMTSDEF=$S(+GMTSDEF>0:"Y",1:"N")
123 S DIR("B")=GMTSDEF,DIR(0)="YAO",(DIR("?"),DIR("??"))="^D RH^GMTSOBH"
124 D ^DIR S:$D(DIROUT)!($D(DTOUT)) GMTSQ=1
125 S:Y["^"!(X["^") GMTSE=1,GMTSQ=1,GMTSDES=0
126 K:+($G(GMTSQ))>0 GMTSOBJ("REPORT HEADER") Q:+($G(GMTSQ))>0
127 S X=+($G(Y)) K:+X'>0 GMTSOBJ("REPORT HEADER") Q
128 ;
129CONT(X) ; Continue with Edit
130 N DIR,DIROUT,DTOUT
131 S DIR(0)="YAO",DIR("B")="NO",DIR("A")=" Do you want to edit the object? Y/N "
132 D ^DIR S X=+($G(Y)) Q X
Note: See TracBrowser for help on using the repository browser.