GMTSOBA ; SLC/KER - HS Object - Ask ; 01/06/2003
;;2.7;Health Summary;**58**;Oct 20, 1995
;
; External References
; DBIA 10018 ^DIE (file #142.5)
; DBIA 10026 ^DIR
; DBIA 10103 $$FMTE^XLFDT
; DBIA 10103 $$NOW^XLFDT
;
OBJ ; Create/Edit Object
N DA,X,Y,DIE,DR,GMTSED,GMTSCON,GMTSLBL,GMTSLBB,GMTSULB,GMTSHDR
N GMTSRDT,GMTSCON,GMTSRHD,GMTSNEW,GMTSNEWO,GMTSDES,GMTSCHD,GMTSLIM
N GMTSBLK,GMTSQ,GMTSDEC,GMTSNOD,GMTSOWN,GMTSDT,GMTSI,GMTSDA,GMTSUND
N GMTSTIM,GMTSTI,GMTSOI
S (GMTSHDR,GMTSRDT,GMTSCON,GMTSRHD,GMTSCHD,GMTSUND,GMTSLIM,GMTSULB,GMTSLBB,GMTSBLK,GMTSDEC,GMTSNOD)=0,GMTSOWN="",GMTSDES=1
S:'$L($G(GMTSNAM)) DA=$$LK^GMTSOBL Q:+($G(GMTSQ))>0
S:$L($G(GMTSNAM)) DA=$$HSO^GMTSOBL($G(GMTSNAM)) Q:+($G(GMTSQ))>0 Q:+($G(DA))'>0
S:$L($G(GMTSNAM)) GMTSNEW=+($P($G(DA),"^",3)),DA=+($P($G(DA),"^",1))
Q:+($G(DA))'>0 S (GMTSDA,GMTSOI)=+($G(DA)),GMTSTI=$P($G(^GMT(142.5,+GMTSOI,0)),"^",3) Q:+GMTSTI'>0
S GMTSLBL="" K GMTSOBJ S GMTSCON=1
I $L($G(GMTSNAM)),+GMTSNEW'>0,+DA>0 D Q:+($G(GMTSCON))'>0 Q:+($G(GMTSQ))>0
. N GMTSOWN S GMTSOWN=$P($G(^GMT(142.5,+DA,0)),"^",17)
. I +GMTSOWN>0,+($G(DUZ))>0,+GMTSOWN'=+($G(DUZ)) S GMTSCON=0 Q
. W !," Object '",GMTSNAM,"' already exist" S GMTSCON=$$CONT Q:+($G(GMTSCON))'>0
. N X,Y,DIR,DIE,DR,GMTSDEF,GMTSDICA,GMTSNAM,GMTSTYPE
. W ! S GMTSDEF=+($P($G(^GMT(142.5,+($G(DA)),0)),"^",3))
. S GMTSDEF=$S(+GMTSDEF>0:+GMTSDEF,1:"")
. S GMTSDICA=" Enter/Edit HEALTH SUMMARY TYPE: "
. K DTOUT,DUOUT,DIRUT,DIROUT
. S GMTSTYPE=$$TY^GMTSOBL(GMTSDEF)
. I $D(DTOUT)!($D(DUOUT))!($D(DIRUT))!($D(DIROUT)) S GMTSQ=1 Q
. S DR=".03////^S X=$G(GMTSTYPE)"
. S DIE="^GMT(142.5,",DA=+($G(DA)) S GMTSED=0
. F GMTSI=1:1:3 Q:GMTSI>3 L +^GMT(142.5,+($G(DA))):0 H:'$T 1 I $T D
. . D ^DIE S GMTSED=1 S $P(^GMT(142.5,+DA,0),U,19)=$$NOW^XLFDT,GMTSI=4
. . S:+($G(DUZ))>0 $P(^GMT(142.5,+DA,0),"^",17)=+($G(DUZ))
. I 'GMTSED S GMTSQ=1 K GMTSOBJ W !," Record Locked by another user" Q
. L -^GMT(142.5,+($G(DA))) S GMTST=+($P($G(^GMT(142.5,+DA,0)),U,3))
K:+($G(GMTSQ))>0 GMTSOBJ Q:+($G(GMTSQ))>0
D ALL K:+($G(GMTSQ))>0 GMTSOBJ S:+($G(GMTSQ))>0 GMTSDES=0 Q:+($G(GMTSQ))>0 N DIE,DR
S GMTSHDR=+($G(GMTSOBJ("HEADER")))
S GMTSLBL=$G(GMTSLBL) I GMTSHDR>0 D
. S GMTSRDT=$S($D(GMTSOBJ("DATE LINE")):1,1:0)
. S GMTSCON=$S($D(GMTSOBJ("CONFIDENTIAL")):1,1:0)
. S GMTSRHD=$S($D(GMTSOBJ("REPORT HEADER")):1,1:0)
. S GMTSCHD=$S($D(GMTSOBJ("COMPONENT HEADER")):1,1:0)
. S GMTSUND=$S($D(GMTSOBJ("UNDERLINE")):1,1:0)
. S GMTSLIM=$S($D(GMTSOBJ("LIMITS")):1,1:0)
. S GMTSBLK=$S($D(GMTSOBJ("BLANK LINE")):1,1:0)
. S GMTSDEC=$S($D(GMTSOBJ("DECEASED")):1,1:0)
. S GMTSULB=$S($D(GMTSOBJ("USE LABEL")):1,1:0)
. S GMTSLBB=$S($D(GMTSOBJ("LABEL BLANK LINE")):1,1:0)
I GMTSHDR'>0 S (GMTSRDT,GMTSCON,GMTSRHD,GMTSCHD,GMTSUND,GMTSLIM,GMTSBLK,GMTSDEC,GMTSULB,GMTSLBB)=0,GMTSLBL=""
S GMTSNOD=$S($D(GMTSOBJ("SUPPRESS COMPONENTS")):1,1:0)
S:+GMTSCHD'>0 (GMTSLIM,GMTSBLK)=0
S:'$L($G(GMTSLBL)) GMTSLBL="@",(GMTSULB,GMTSLBB)=0
N DR S DR=".02////^S X=$G(GMTSLBL);"
S:$L($G(GMTSTIM))&($G(GMTSTIM)'="@") DR=DR_".04////^S X=$G(GMTSTIM);"
S DR=DR_".05////^S X=$G(GMTSNOD);",DR=DR_".06////^S X=$G(GMTSHDR);"
S DR=DR_".07////^S X=$G(GMTSULB);",DR=DR_".08////^S X=$G(GMTSLBB);"
S DR=DR_".09////^S X=$G(GMTSRDT);",DR=DR_".1////^S X=$G(GMTSCON);"
S DR=DR_".11////^S X=$G(GMTSRHD);",DR=DR_".12////^S X=$G(GMTSCHD);"
S DR=DR_".13////^S X=$G(GMTSUND);",DR=DR_".14////^S X=$G(GMTSLIM);"
S DR=DR_".15////^S X=$G(GMTSBLK);",DR=DR_".16////^S X=$G(GMTSDEC);"
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))
S DIE="^GMT(142.5,",DA=+($G(DA)) S GMTSED=0 W:+($G(GMTSDES))>0 !
F GMTSI=1:1:3 Q:GMTSI>3 L +^GMT(142.5,+($G(DA))):0 H:'$T 1 I $T D
. D ^DIE S GMTSED=1 S $P(^GMT(142.5,+DA,0),U,19)=$$NOW^XLFDT,GMTSI=4
. S:$G(GMTSTIM)="@" $P(^GMT(142.5,+DA,0),U,4)=""
I 'GMTSED S GMTSQ=1 K GMTSOBJ W !," Record Locked by another user" Q
L -^GMT(142.5,+($G(DA))) S GMTST=+($P($G(^GMT(142.5,+DA,0)),U,3))
K GMTSOBJ Q
;
ALL ; Print HS Header
N X,Y,DIR,DIROUT,DUOUT,DTOUT S GMTSOBJ="",GMTSQ=0 D RP Q:+($G(GMTSQ))>0
S DIR("A")=" Print standard Health Summary Header with the Object? "
S DIR("B")="N",DIR(0)="YAO",(DIR("?"),DIR("??"))="^D ALL^GMTSOBH"
W ! D ^DIR S:$D(DIROUT)!($D(DTOUT)) GMTSQ=1
S:Y["^"!(X["^") GMTSE=1,GMTSQ=1,GMTSDES=0
K:+($G(GMTSQ))>0!($D(DUOUT)) GMTSOBJ Q:+($G(GMTSQ))>0!($D(DUOUT))
S X=+($G(Y)) K:+X>0 GMTSOBJ S:+X'>0 GMTSOBJ=""
S GMTSOBJ("HEADER")=$S(+X'>0:1,1:0)
I +X'>0 D
. W ! D PART Q:+($G(GMTSQ))>1 W ! S GMTSLBL="" D LBL^GMTSOBA2
. S GMTSLBL=$S($L($G(GMTSOBJ("LABEL"))):$G(GMTSOBJ("LABEL")),1:"@")
. K:'$L($G(GMTSOBJ("LABEL"))) GMTSLBL,GMTSOBJ("LABEL BLANK LINE"),GMTSOBJ("USE LABEL")
W ! D SC^GMTSOBA2 K:+($G(GMTSQ))>0 GMTSOBJ
Q
;
RP ; Report Period
Q:+($G(GMTSQ))>0 N X,Y,DIR,DIROUT,DUOUT,DTOUT,GMTSDEF
S GMTSTIM=$$RP^GMTSOBT($G(GMTSTI),$G(GMTSOI)) S:+GMTSTIM<0 GMTSQ=1
Q
;
PART ; Print Partial Header
K:+($G(GMTSQ))>0 GMTSOBJ Q:+($G(GMTSQ))>0 W !," Partial Header:"
D:$D(GMTSOBJ) RD,RC,RH,CH^GMTSOBA2,DE^GMTSOBA2 Q
RD ; Report Date
Q:+($G(GMTSQ))>0 N X,Y,DIR,DIROUT,DUOUT,DTOUT,GMTSDEF
S GMTSDEF=$P($G(^GMT(142.5,+($G(GMTSDA)),0)),U,9)
S GMTSDEF=$S(+GMTSDEF>0:"Y",1:"N")
S GMTSOBJ("DATE LINE")="",DIR("A")=" Print Report Date? "
S DIR("B")=GMTSDEF,DIR(0)="YAO",(DIR("?"),DIR("??"))="^D RD^GMTSOBH"
D ^DIR S:$D(DIROUT)!($D(DTOUT)) GMTSQ=1
S:Y["^"!(X["^") GMTSE=1,GMTSQ=1,GMTSDES=0
K:+($G(GMTSQ))>0 GMTSOBJ("DATE LINE") Q:+($G(GMTSQ))>0
S X=+($G(Y)) K:+X'>0 GMTSOBJ("DATE LINE") Q
RC ; Confidentiality Banner
Q:+($G(GMTSQ))>0 N X,Y,DIR,DIROUT,DUOUT,DTOUT,GMTSDEF
S GMTSOBJ("CONFIDENTIAL")="",DIR("A")=" Print Confidentiality Banner? "
S GMTSDEF=$P($G(^GMT(142.5,+($G(GMTSDA)),0)),U,10)
S GMTSDEF=$S(+GMTSDEF>0:"Y",1:"N")
S DIR("B")=GMTSDEF,DIR(0)="YAO",(DIR("?"),DIR("??"))="^D RC^GMTSOBH"
D ^DIR S:$D(DIROUT)!($D(DTOUT)) GMTSQ=1
S:Y["^"!(X["^") GMTSE=1,GMTSQ=1,GMTSDES=0
K:+($G(GMTSQ))>0 GMTSOBJ("CONFIDENNTIAL") Q:+($G(GMTSQ))>0
S X=+($G(Y)) K:+X'>0 GMTSOBJ("CONFIDENTIAL") Q
RH ; Report Header
Q:+($G(GMTSQ))>0 N X,Y,DIR,DIROUT,DUOUT,DTOUT,GMTSDEF
S GMTSOBJ("REPORT HEADER")="",DIR("A")=" Print Report Header? "
S GMTSDEF=$P($G(^GMT(142.5,+($G(GMTSDA)),0)),U,11)
S GMTSDEF=$S(+GMTSDEF>0:"Y",1:"N")
S DIR("B")=GMTSDEF,DIR(0)="YAO",(DIR("?"),DIR("??"))="^D RH^GMTSOBH"
D ^DIR S:$D(DIROUT)!($D(DTOUT)) GMTSQ=1
S:Y["^"!(X["^") GMTSE=1,GMTSQ=1,GMTSDES=0
K:+($G(GMTSQ))>0 GMTSOBJ("REPORT HEADER") Q:+($G(GMTSQ))>0
S X=+($G(Y)) K:+X'>0 GMTSOBJ("REPORT HEADER") Q
;
CONT(X) ; Continue with Edit
N DIR,DIROUT,DTOUT
S DIR(0)="YAO",DIR("B")="NO",DIR("A")=" Do you want to edit the object? Y/N "
D ^DIR S X=+($G(Y)) Q X
GMTSOBA ; SLC/KER - HS Object - Ask ; 01/06/2003
+1 ;;2.7;Health Summary;**58**;Oct 20, 1995
+2 ;
+3 ; External References
+4 ; DBIA 10018 ^DIE (file #142.5)
+5 ; DBIA 10026 ^DIR
+6 ; DBIA 10103 $$FMTE^XLFDT
+7 ; DBIA 10103 $$NOW^XLFDT
+8 ;
OBJ ; Create/Edit Object
+1 NEW DA,X,Y,DIE,DR,GMTSED,GMTSCON,GMTSLBL,GMTSLBB,GMTSULB,GMTSHDR
+2 NEW GMTSRDT,GMTSCON,GMTSRHD,GMTSNEW,GMTSNEWO,GMTSDES,GMTSCHD,GMTSLIM
+3 NEW GMTSBLK,GMTSQ,GMTSDEC,GMTSNOD,GMTSOWN,GMTSDT,GMTSI,GMTSDA,GMTSUND
+4 NEW GMTSTIM,GMTSTI,GMTSOI
+5 SET (GMTSHDR,GMTSRDT,GMTSCON,GMTSRHD,GMTSCHD,GMTSUND,GMTSLIM,GMTSULB,GMTSLBB,GMTSBLK,GMTSDEC,GMTSNOD)=0
SET GMTSOWN=""
SET GMTSDES=1
+6 IF '$LENGTH($GET(GMTSNAM))
SET DA=$$LK^GMTSOBL
IF +($GET(GMTSQ))>0
QUIT
+7 IF $LENGTH($GET(GMTSNAM))
SET DA=$$HSO^GMTSOBL($GET(GMTSNAM))
IF +($GET(GMTSQ))>0
QUIT
IF +($GET(DA))'>0
QUIT
+8 IF $LENGTH($GET(GMTSNAM))
SET GMTSNEW=+($PIECE($GET(DA),"^",3))
SET DA=+($PIECE($GET(DA),"^",1))
+9 IF +($GET(DA))'>0
QUIT
SET (GMTSDA,GMTSOI)=+($GET(DA))
SET GMTSTI=$PIECE($GET(^GMT(142.5,+GMTSOI,0)),"^",3)
IF +GMTSTI'>0
QUIT
+10 SET GMTSLBL=""
KILL GMTSOBJ
SET GMTSCON=1
+11 IF $LENGTH($GET(GMTSNAM))
IF +GMTSNEW'>0
IF +DA>0
Begin DoDot:1
+12 NEW GMTSOWN
SET GMTSOWN=$PIECE($GET(^GMT(142.5,+DA,0)),"^",17)
+13 IF +GMTSOWN>0
IF +($GET(DUZ))>0
IF +GMTSOWN'=+($GET(DUZ))
SET GMTSCON=0
QUIT
+14 WRITE !," Object '",GMTSNAM,"' already exist"
SET GMTSCON=$$CONT
IF +($GET(GMTSCON))'>0
QUIT
+15 NEW X,Y,DIR,DIE,DR,GMTSDEF,GMTSDICA,GMTSNAM,GMTSTYPE
+16 WRITE !
SET GMTSDEF=+($PIECE($GET(^GMT(142.5,+($GET(DA)),0)),"^",3))
+17 SET GMTSDEF=$SELECT(+GMTSDEF>0:+GMTSDEF,1:"")
+18 SET GMTSDICA=" Enter/Edit HEALTH SUMMARY TYPE: "
+19 KILL DTOUT,DUOUT,DIRUT,DIROUT
+20 SET GMTSTYPE=$$TY^GMTSOBL(GMTSDEF)
+21 IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))!($DATA(DIROUT))
SET GMTSQ=1
QUIT
+22 SET DR=".03////^S X=$G(GMTSTYPE)"
+23 SET DIE="^GMT(142.5,"
SET DA=+($GET(DA))
SET GMTSED=0
+24 FOR GMTSI=1:1:3
IF GMTSI>3
QUIT
LOCK +^GMT(142.5,+($GET(DA))):0
IF '$TEST
HANG 1
IF $TEST
Begin DoDot:2
+25 DO ^DIE
SET GMTSED=1
SET $PIECE(^GMT(142.5,+DA,0),U,19)=$$NOW^XLFDT
SET GMTSI=4
+26 IF +($GET(DUZ))>0
SET $PIECE(^GMT(142.5,+DA,0),"^",17)=+($GET(DUZ))
End DoDot:2
+27 IF 'GMTSED
SET GMTSQ=1
KILL GMTSOBJ
WRITE !," Record Locked by another user"
QUIT
+28 LOCK -^GMT(142.5,+($GET(DA)))
SET GMTST=+($PIECE($GET(^GMT(142.5,+DA,0)),U,3))
End DoDot:1
IF +($GET(GMTSCON))'>0
QUIT
IF +($GET(GMTSQ))>0
QUIT
+29 IF +($GET(GMTSQ))>0
KILL GMTSOBJ
IF +($GET(GMTSQ))>0
QUIT
+30 DO ALL
IF +($GET(GMTSQ))>0
KILL GMTSOBJ
IF +($GET(GMTSQ))>0
SET GMTSDES=0
IF +($GET(GMTSQ))>0
QUIT
NEW DIE,DR
+31 SET GMTSHDR=+($GET(GMTSOBJ("HEADER")))
+32 SET GMTSLBL=$GET(GMTSLBL)
IF GMTSHDR>0
Begin DoDot:1
+33 SET GMTSRDT=$SELECT($DATA(GMTSOBJ("DATE LINE")):1,1:0)
+34 SET GMTSCON=$SELECT($DATA(GMTSOBJ("CONFIDENTIAL")):1,1:0)
+35 SET GMTSRHD=$SELECT($DATA(GMTSOBJ("REPORT HEADER")):1,1:0)
+36 SET GMTSCHD=$SELECT($DATA(GMTSOBJ("COMPONENT HEADER")):1,1:0)
+37 SET GMTSUND=$SELECT($DATA(GMTSOBJ("UNDERLINE")):1,1:0)
+38 SET GMTSLIM=$SELECT($DATA(GMTSOBJ("LIMITS")):1,1:0)
+39 SET GMTSBLK=$SELECT($DATA(GMTSOBJ("BLANK LINE")):1,1:0)
+40 SET GMTSDEC=$SELECT($DATA(GMTSOBJ("DECEASED")):1,1:0)
+41 SET GMTSULB=$SELECT($DATA(GMTSOBJ("USE LABEL")):1,1:0)
+42 SET GMTSLBB=$SELECT($DATA(GMTSOBJ("LABEL BLANK LINE")):1,1:0)
End DoDot:1
+43 IF GMTSHDR'>0
SET (GMTSRDT,GMTSCON,GMTSRHD,GMTSCHD,GMTSUND,GMTSLIM,GMTSBLK,GMTSDEC,GMTSULB,GMTSLBB)=0
SET GMTSLBL=""
+44 SET GMTSNOD=$SELECT($DATA(GMTSOBJ("SUPPRESS COMPONENTS")):1,1:0)
+45 IF +GMTSCHD'>0
SET (GMTSLIM,GMTSBLK)=0
+46 IF '$LENGTH($GET(GMTSLBL))
SET GMTSLBL="@"
SET (GMTSULB,GMTSLBB)=0
+47 NEW DR
SET DR=".02////^S X=$G(GMTSLBL);"
+48 IF $LENGTH($GET(GMTSTIM))&($GET(GMTSTIM)'="@")
SET DR=DR_".04////^S X=$G(GMTSTIM);"
+49 SET DR=DR_".05////^S X=$G(GMTSNOD);"
SET DR=DR_".06////^S X=$G(GMTSHDR);"
+50 SET DR=DR_".07////^S X=$G(GMTSULB);"
SET DR=DR_".08////^S X=$G(GMTSLBB);"
+51 SET DR=DR_".09////^S X=$G(GMTSRDT);"
SET DR=DR_".1////^S X=$G(GMTSCON);"
+52 SET DR=DR_".11////^S X=$G(GMTSRHD);"
SET DR=DR_".12////^S X=$G(GMTSCHD);"
+53 SET DR=DR_".13////^S X=$G(GMTSUND);"
SET DR=DR_".14////^S X=$G(GMTSLIM);"
+54 SET DR=DR_".15////^S X=$G(GMTSBLK);"
SET DR=DR_".16////^S X=$G(GMTSDEC);"
+55 IF +($GET(GMTSDES))>0
SET DR=DR_"1"
IF $EXTRACT(DR,1)=";"
SET DR=$EXTRACT(DR,2,$LENGTH(DR))
IF $EXTRACT(DR,$LENGTH(DR))=";"
SET DR=$EXTRACT(DR,1,($LENGTH(DR)-1))
+56 SET DIE="^GMT(142.5,"
SET DA=+($GET(DA))
SET GMTSED=0
IF +($GET(GMTSDES))>0
WRITE !
+57 FOR GMTSI=1:1:3
IF GMTSI>3
QUIT
LOCK +^GMT(142.5,+($GET(DA))):0
IF '$TEST
HANG 1
IF $TEST
Begin DoDot:1
+58 DO ^DIE
SET GMTSED=1
SET $PIECE(^GMT(142.5,+DA,0),U,19)=$$NOW^XLFDT
SET GMTSI=4
+59 IF $GET(GMTSTIM)="@"
SET $PIECE(^GMT(142.5,+DA,0),U,4)=""
End DoDot:1
+60 IF 'GMTSED
SET GMTSQ=1
KILL GMTSOBJ
WRITE !," Record Locked by another user"
QUIT
+61 LOCK -^GMT(142.5,+($GET(DA)))
SET GMTST=+($PIECE($GET(^GMT(142.5,+DA,0)),U,3))
+62 KILL GMTSOBJ
QUIT
+63 ;
ALL ; Print HS Header
+1 NEW X,Y,DIR,DIROUT,DUOUT,DTOUT
SET GMTSOBJ=""
SET GMTSQ=0
DO RP
IF +($GET(GMTSQ))>0
QUIT
+2 SET DIR("A")=" Print standard Health Summary Header with the Object? "
+3 SET DIR("B")="N"
SET DIR(0)="YAO"
SET (DIR("?"),DIR("??"))="^D ALL^GMTSOBH"
+4 WRITE !
DO ^DIR
IF $DATA(DIROUT)!($DATA(DTOUT))
SET GMTSQ=1
+5 IF Y["^"!(X["^")
SET GMTSE=1
SET GMTSQ=1
SET GMTSDES=0
+6 IF +($GET(GMTSQ))>0!($DATA(DUOUT))
KILL GMTSOBJ
IF +($GET(GMTSQ))>0!($DATA(DUOUT))
QUIT
+7 SET X=+($GET(Y))
IF +X>0
KILL GMTSOBJ
IF +X'>0
SET GMTSOBJ=""
+8 SET GMTSOBJ("HEADER")=$SELECT(+X'>0:1,1:0)
+9 IF +X'>0
Begin DoDot:1
+10 WRITE !
DO PART
IF +($GET(GMTSQ))>1
QUIT
WRITE !
SET GMTSLBL=""
DO LBL^GMTSOBA2
+11 SET GMTSLBL=$SELECT($LENGTH($GET(GMTSOBJ("LABEL"))):$GET(GMTSOBJ("LABEL")),1:"@")
+12 IF '$LENGTH($GET(GMTSOBJ("LABEL")))
KILL GMTSLBL,GMTSOBJ("LABEL BLANK LINE"),GMTSOBJ("USE LABEL")
End DoDot:1
+13 WRITE !
DO SC^GMTSOBA2
IF +($GET(GMTSQ))>0
KILL GMTSOBJ
+14 QUIT
+15 ;
RP ; Report Period
+1 IF +($GET(GMTSQ))>0
QUIT
NEW X,Y,DIR,DIROUT,DUOUT,DTOUT,GMTSDEF
+2 SET GMTSTIM=$$RP^GMTSOBT($GET(GMTSTI),$GET(GMTSOI))
IF +GMTSTIM<0
SET GMTSQ=1
+3 QUIT
+4 ;
PART ; Print Partial Header
+1 IF +($GET(GMTSQ))>0
KILL GMTSOBJ
IF +($GET(GMTSQ))>0
QUIT
WRITE !," Partial Header:"
+2 IF $DATA(GMTSOBJ)
DO RD
DO RC
DO RH
DO CH^GMTSOBA2
DO DE^GMTSOBA2
QUIT
RD ; Report Date
+1 IF +($GET(GMTSQ))>0
QUIT
NEW X,Y,DIR,DIROUT,DUOUT,DTOUT,GMTSDEF
+2 SET GMTSDEF=$PIECE($GET(^GMT(142.5,+($GET(GMTSDA)),0)),U,9)
+3 SET GMTSDEF=$SELECT(+GMTSDEF>0:"Y",1:"N")
+4 SET GMTSOBJ("DATE LINE")=""
SET DIR("A")=" Print Report Date? "
+5 SET DIR("B")=GMTSDEF
SET DIR(0)="YAO"
SET (DIR("?"),DIR("??"))="^D RD^GMTSOBH"
+6 DO ^DIR
IF $DATA(DIROUT)!($DATA(DTOUT))
SET GMTSQ=1
+7 IF Y["^"!(X["^")
SET GMTSE=1
SET GMTSQ=1
SET GMTSDES=0
+8 IF +($GET(GMTSQ))>0
KILL GMTSOBJ("DATE LINE")
IF +($GET(GMTSQ))>0
QUIT
+9 SET X=+($GET(Y))
IF +X'>0
KILL GMTSOBJ("DATE LINE")
QUIT
RC ; Confidentiality Banner
+1 IF +($GET(GMTSQ))>0
QUIT
NEW X,Y,DIR,DIROUT,DUOUT,DTOUT,GMTSDEF
+2 SET GMTSOBJ("CONFIDENTIAL")=""
SET DIR("A")=" Print Confidentiality Banner? "
+3 SET GMTSDEF=$PIECE($GET(^GMT(142.5,+($GET(GMTSDA)),0)),U,10)
+4 SET GMTSDEF=$SELECT(+GMTSDEF>0:"Y",1:"N")
+5 SET DIR("B")=GMTSDEF
SET DIR(0)="YAO"
SET (DIR("?"),DIR("??"))="^D RC^GMTSOBH"
+6 DO ^DIR
IF $DATA(DIROUT)!($DATA(DTOUT))
SET GMTSQ=1
+7 IF Y["^"!(X["^")
SET GMTSE=1
SET GMTSQ=1
SET GMTSDES=0
+8 IF +($GET(GMTSQ))>0
KILL GMTSOBJ("CONFIDENNTIAL")
IF +($GET(GMTSQ))>0
QUIT
+9 SET X=+($GET(Y))
IF +X'>0
KILL GMTSOBJ("CONFIDENTIAL")
QUIT
RH ; Report Header
+1 IF +($GET(GMTSQ))>0
QUIT
NEW X,Y,DIR,DIROUT,DUOUT,DTOUT,GMTSDEF
+2 SET GMTSOBJ("REPORT HEADER")=""
SET DIR("A")=" Print Report Header? "
+3 SET GMTSDEF=$PIECE($GET(^GMT(142.5,+($GET(GMTSDA)),0)),U,11)
+4 SET GMTSDEF=$SELECT(+GMTSDEF>0:"Y",1:"N")
+5 SET DIR("B")=GMTSDEF
SET DIR(0)="YAO"
SET (DIR("?"),DIR("??"))="^D RH^GMTSOBH"
+6 DO ^DIR
IF $DATA(DIROUT)!($DATA(DTOUT))
SET GMTSQ=1
+7 IF Y["^"!(X["^")
SET GMTSE=1
SET GMTSQ=1
SET GMTSDES=0
+8 IF +($GET(GMTSQ))>0
KILL GMTSOBJ("REPORT HEADER")
IF +($GET(GMTSQ))>0
QUIT
+9 SET X=+($GET(Y))
IF +X'>0
KILL GMTSOBJ("REPORT HEADER")
QUIT
+10 ;
CONT(X) ; Continue with Edit
+1 NEW DIR,DIROUT,DTOUT
+2 SET DIR(0)="YAO"
SET DIR("B")="NO"
SET DIR("A")=" Do you want to edit the object? Y/N "
+3 DO ^DIR
SET X=+($GET(Y))
QUIT X